/* Gemeinsamer Kern der Demo-Seiten.
   Nutzt nur die Stil-Variablen, die jede stile.css setzt:
   --bg --bg-alt --flaeche --text --text-leise --akzent --akzent-text --linie
   --schrift-titel --schrift-text --radius-bild --radius-knopf
   Das Anpassen-Feld und die Attrappen-Dialoge haben bewusst eigene,
   neutrale Farben: Sie gehören zu OctiByte, nicht zum Laden. */

[hidden] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }

:root {
  --leiste-hoehe: 72px;
  --kern-ink: #1d2a24;
  --kern-papier: #ffffff;
  --kern-leise: #4d5a53;
  --kern-linie: #d5dbd7;
  --kern-akzent: #2a6e56;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--schrift-text);
  font-size: 1.0625rem;
  line-height: 1.6;
}
.kern-bereit body { transition: background-color .4s, color .4s; }
@media (max-width: 899px) { body { padding-bottom: calc(var(--leiste-hoehe) + env(safe-area-inset-bottom)); } }

img { max-width: 100%; display: block; height: auto; }
h1, h2, h3 { font-family: var(--schrift-titel); line-height: 1.15; margin: 0 0 .5em; font-weight: 400; }
p { margin: 0 0 1em; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 3px; }

/* ── Abschnitte ── */
main > section { padding: 64px 20px; background: var(--bg); }
.no-js main > section:nth-of-type(even),
.js main > section[data-ton="alt"] { background: var(--bg-alt); }
.inhalt { max-width: 1080px; margin: 0 auto; }
.ueberschrift-klein {
  font-family: var(--schrift-text); font-size: .8125rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-leise); margin-bottom: .75em;
}
.leise { color: var(--text-leise); }
@media (min-width: 900px) { main > section { padding: 96px 32px; } }

/* ── Knöpfe ── */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 48px; padding: 0 1.4em; border-radius: var(--radius-knopf);
  background: var(--akzent); color: var(--akzent-text);
  font: 600 1rem/1 var(--schrift-text); text-decoration: none; border: 2px solid var(--akzent);
  cursor: pointer;
}
.knopf-zweit { background: transparent; color: var(--text); border-color: currentColor; }
.knopf:disabled { cursor: default; }

/* ── Kopfleiste ── */
.kopf {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px; background: var(--bg); border-bottom: 1px solid var(--linie);
}
.kopf-name { font-family: var(--schrift-titel); font-size: 1.25rem; text-decoration: none; }
.kopf-nav { display: none; gap: 24px; align-items: center; }
.kopf-nav a { text-decoration: none; font-size: .9375rem; }
.kopf-nav a:hover { text-decoration: underline; }
@media (min-width: 900px) { .kopf { padding: 16px 32px; } .kopf-nav { display: flex; } }

/* ── Daumenleiste (unter 900 px) ── */
.daumenleiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--linie);
}
.daumenleiste > * {
  flex: 1; min-height: 48px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-knopf); font: 600 1rem/1 var(--schrift-text); text-decoration: none;
  border: 2px solid var(--akzent); cursor: pointer;
}
.daumenleiste > :first-child, .daumenleiste > .knopf-ersatz { background: var(--akzent); color: var(--akzent-text); }
.daumenleiste > :last-child { background: var(--bg); color: var(--text); border-color: var(--text); }
@media (min-width: 900px) { .daumenleiste { display: none; } }

/* ── Zeiten ── */
.zeiten { width: 100%; border-collapse: collapse; }
.zeiten th, .zeiten td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--linie); font-weight: 400; }
.zeiten td { text-align: right; }

/* ── Attrappen-Weg ── */
[data-attrappe-weg] fieldset { border: 0; margin: 0 0 24px; padding: 0; }
[data-attrappe-weg] legend { font-family: var(--schrift-titel); font-size: 1.375rem; margin-bottom: 12px; padding: 0; }
.no-js [data-attrappe-weg] fieldset { opacity: .85; }
.weg-optionen { display: grid; gap: 10px; }
@media (min-width: 600px) { .weg-optionen { grid-template-columns: repeat(2, 1fr); } }
.weg-option {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius-knopf);
}
.weg-option:has(input:checked) { border-color: var(--akzent); box-shadow: inset 0 0 0 1px var(--akzent); }
.weg-option input { accent-color: var(--akzent); width: 18px; height: 18px; margin: 0; }
.weg-feld { display: grid; gap: 6px; }
.weg-feld input, .weg-feld select, .weg-feld textarea {
  font: inherit; color: var(--text); background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: 8px; padding: 12px 14px; width: 100%;
}
.weg-leiste { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }
.weg-weiter, .weg-zurueck {
  min-height: 48px; padding: 0 1.4em; border-radius: var(--radius-knopf);
  font: 600 1rem/1 var(--schrift-text); cursor: pointer;
}
.weg-weiter { background: var(--akzent); color: var(--akzent-text); border: 2px solid var(--akzent); }
.weg-zurueck { background: transparent; color: var(--text); border: 2px solid var(--linie); }

/* ── OctiByte-Band am Seitenende ── */
.demo-band {
  background: var(--kern-ink); color: #f3f1ea; padding: 32px 20px;
  display: flex; flex-direction: column; gap: 16px; align-items: flex-start;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: .9375rem; line-height: 1.55;
}
.demo-band p { margin: 0; max-width: 720px; }
.demo-band a, .kern-hinweis a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.2em; border-radius: 999px;
  background: #f3f1ea; color: var(--kern-ink); font-weight: 600; text-decoration: none;
}
@media (min-width: 900px) {
  .demo-band { flex-direction: row; align-items: center; justify-content: center; gap: 32px; padding: 28px 32px; }
}

/* ── Fuß ── */
.fuss { padding: 32px 20px; text-align: center; font-size: .875rem; color: var(--text-leise); background: var(--bg); }
.fuss a { color: var(--text-leise); }

/* ── Anpassen-Knopf ── */
.anpassen-knopf {
  position: fixed; z-index: 40; right: 16px;
  bottom: calc(var(--leiste-hoehe) + env(safe-area-inset-bottom) + 12px);
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--kern-ink); color: #ffffff;
  font: 600 .875rem/1 system-ui, -apple-system, 'Segoe UI', sans-serif;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}
.no-js .anpassen-knopf { display: none; }
@media (max-width: 899px) {
  .anpassen-knopf { transition: opacity .2s, transform .2s, visibility 0s; }
  .anpassen-knopf.kern-zur-seite {
    opacity: 0; transform: translateY(12px); visibility: hidden;
    transition: opacity .2s, transform .2s, visibility 0s .2s;
  }
}
@media (min-width: 900px) { .anpassen-knopf { bottom: 24px; right: 24px; } }

/* ── Dialoge (Anpassen, Attrappe) ── */
.kern-dialog {
  border: 0; padding: 28px 22px 24px; color: var(--kern-ink); background: var(--kern-papier);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 1rem; line-height: 1.5;
  width: min(420px, 100vw - 32px); max-height: calc(100dvh - 32px); overflow: auto;
  border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.kern-dialog::backdrop { background: rgba(20, 26, 23, .35); }
/* Beim Anpassen soll man sehen, wie sich die Seite dahinter ändert. */
.kern-dialog.anpassen::backdrop { background: rgba(20, 26, 23, .12); }
.kern-titel { font-weight: 700; font-size: 1.125rem; margin: 0 32px 6px 0; }
.kern-leise { color: var(--kern-leise); margin: 0 0 16px; font-size: .9375rem; }
.kern-schliessen {
  position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: #eef1ef; color: var(--kern-ink); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.kern-dialog fieldset { border: 0; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.kern-dialog legend {
  font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--kern-leise);
  margin-bottom: 8px; padding: 0; font-weight: 600;
}
.kern-dialog fieldset:first-of-type { grid-template-columns: 1fr 1fr; }
.kern-wahl, .kern-schalter {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--kern-linie); border-radius: 12px; cursor: pointer;
}
.kern-wahl:has(input:checked) { border-color: var(--kern-akzent); box-shadow: inset 0 0 0 1px var(--kern-akzent); }
.kern-wahl input, .kern-schalter input { accent-color: var(--kern-akzent); width: 18px; height: 18px; margin: 0; }
.kern-hinweis {
  margin-top: 8px; padding: 16px; border-radius: 14px; background: var(--kern-ink); color: #f3f1ea; font-size: .9375rem;
}
.kern-hinweis p { margin: 0 0 12px; }

@media (max-width: 599px) {
  .kern-dialog.anpassen {
    margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 20px 20px 0 0;
    max-height: 58dvh;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}
@media (min-width: 600px) {
  .kern-dialog.anpassen { margin: auto 24px 24px auto; }
}

@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
}
