/* Coach Miller — Basis: Reset, Kopf, Fuß, Knöpfe, Cookie-Dialog, mitlaufender
   Knopf. Gilt für alle Seiten. Sektions-Layout: seite.css. */
@import url("../fonts/fonts.css");
@import url("tokens.css");

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-weight: var(--fw-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; }
h1, h2, h3 {
  margin: 0; font-family: var(--font-titel); font-weight: var(--fw-titel);
  letter-spacing: var(--ls-titel); line-height: var(--lh-titel);
  text-transform: uppercase;
}
p { margin: 0; }

.nur-vorlesen {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--kreide); outline-offset: 2px; }

/* ---- Layout-Hilfen -------------------------------------------------------*/
.rahmen { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s-3); }
@media (min-width: 720px) { .rahmen { padding: 0 var(--s-5); } }
/* WebKit-Grid-Blowout-Schutz: ein Grid-Kind mit min-width:auto (Default) zieht
   sich sonst auf die Intrinsic-Breite eines enthaltenen Bilds hoch, selbst
   wenn der Track minmax(0,1fr) rechnet. */
.rahmen > * { min-width: 0; }

/* ---- Kopf ------------------------------------------------------------- */
.cm-kopf {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  background: var(--bg);
  border-bottom: var(--hairline);
}
@media (min-width: 720px) { .cm-kopf { padding: var(--s-2) var(--s-5); } }
.cm-kopf a.marke { display: flex; align-items: center; padding: 8px; margin: -8px; min-height: 44px; flex: none; }
.cm-logo { height: 20px; width: auto; }
@media (min-width: 480px) { .cm-logo { height: 26px; } }
.cm-kopf .kopf-link {
  font-family: var(--font-titel); font-weight: var(--fw-titel); letter-spacing: var(--ls-titel);
  text-transform: uppercase; white-space: nowrap;
  font-size: 14px; text-decoration: none; padding: 12px 4px; min-height: 44px; display: flex; align-items: center;
  border-bottom: 1px solid transparent;
}
@media (min-width: 480px) { .cm-kopf .kopf-link { font-size: 15px; } }
/* Kopf-Knopf als echter Knopf (Nikita 20.10.): immer sichtbar, Kreide auf Asphalt.
   Über hellen Abschnitten dreht sich der ganze Kopf um (Klasse auf-hell, seite.js). */
.cm-kopf { transition: background-color .2s ease, border-color .2s ease; }
.cm-kopf .kopf-link {
  background: var(--btn-bg); color: var(--btn-text);
  padding: 0 var(--s-2); border: 0; border-radius: var(--radius);
  transition: background-color .2s ease, color .2s ease;
}
@media (min-width: 720px) { .cm-kopf .kopf-link { padding: 0 var(--s-3); font-size: 17px; } }
.cm-kopf .kopf-link:hover { background: var(--btn-bg-hover); }
.cm-logo--auf-hell { display: none; }
.cm-kopf.auf-hell { background: var(--bg-hell); border-bottom-color: var(--line-hell); }
.cm-kopf.auf-hell .cm-logo { display: none; }
.cm-kopf.auf-hell .cm-logo--auf-hell { display: block; }
.cm-kopf.auf-hell .kopf-link { background: var(--btn-bg-auf-hell); color: var(--btn-text-auf-hell); }
.cm-kopf.auf-hell .kopf-link:hover { background: var(--btn-bg-auf-hell-hover); }
@media (prefers-reduced-motion: reduce) { .cm-kopf, .cm-kopf .kopf-link { transition: none; } }

/* ---- Knöpfe ------------------------------------------------------------*/
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-1);
  min-height: 48px; padding: 14px var(--s-4);
  background: var(--btn-bg); color: var(--btn-text);
  font-family: var(--font-titel); font-weight: var(--fw-titel); letter-spacing: var(--ls-titel);
  text-transform: uppercase;
  font-size: 18px; border: 0; border-radius: var(--radius); cursor: pointer;
  text-decoration: none; line-height: 1;
  transition: background .15s ease;
}
.btn:hover { background: var(--btn-bg-hover); }
.btn:disabled { opacity: .55; cursor: default; }
/* Auf hellen (Kreide-)Flächen dreht sich der Knopf um: Asphalt-Fläche, Kreide-Schrift */
[data-flaeche="hell"] .btn { background: var(--btn-bg-auf-hell); color: var(--btn-text-auf-hell); }
[data-flaeche="hell"] .btn:hover { background: var(--btn-bg-auf-hell-hover); }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 13px calc(var(--s-4) - 1px);
  background: transparent; color: var(--text);
  border: 1px solid var(--kreide); border-radius: var(--radius);
  font-family: var(--font-titel); font-weight: var(--fw-titel); letter-spacing: var(--ls-titel);
  text-transform: uppercase; font-size: 18px;
  text-decoration: none; cursor: pointer;
}
.btn-ghost:hover { background: var(--kreide); color: var(--asphalt); }

/* ---- Fuß -----------------------------------------------------------------*/
.cm-fuss {
  border-top: var(--hairline);
  padding: var(--s-5) var(--s-3) var(--s-6);
  margin-top: auto;
}
.cm-fuss .rahmen {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-3);
  text-align: center;
}
.cm-fuss .fuss-logo { height: 18px; width: auto; opacity: .82; }
.cm-fuss .fuss-marke {
  font-family: var(--font-text); font-size: var(--fs-small); color: var(--text-dim); text-transform: none;
}
.cm-fuss nav { display: flex; gap: var(--s-3); flex-wrap: wrap; justify-content: center; }
.cm-fuss nav a {
  font-size: var(--fs-small); color: var(--text-dim); text-decoration: none;
  min-height: 44px; display: inline-flex; align-items: center;
  border-bottom: 1px solid transparent;
}
.cm-fuss nav a:hover { color: var(--text); border-bottom-color: var(--text); }

/* ---- Mitlaufender Knopf (nur Handy) ---------------------------------------
   Erscheint erst, wenn der Hero verlassen wurde, verschwindet wieder, sobald
   der Fuß erreicht ist — gesteuert per JS (Klasse "an"), s. seite.js. */
.cm-sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: var(--s-2) var(--s-3) calc(var(--s-2) + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  border-top: var(--hairline);
  transform: translateY(100%);
  transition: transform .28s ease;
}
.cm-sticky.an { transform: translateY(0); }
.cm-sticky .btn { width: 100%; }
@media (min-width: 860px) { .cm-sticky { display: none; } }

/* ---- Cookie-Dialog: Verdunklung, zwei identische Knöpfe, dunkler Stil ----*/
.cm-schleier {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0, 0, 0, .68);
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease;
}
.cm-schleier.an { opacity: 1; pointer-events: auto; }
.cm-cookie {
  position: fixed; inset: 0; z-index: 901;
  display: flex; align-items: flex-end; justify-content: center;
  padding: var(--s-3); pointer-events: none;
}
.cm-cookie .karte {
  pointer-events: auto; width: 100%; max-width: 520px;
  background: var(--eisen); color: var(--text);
  border-top: 3px solid var(--kreide);
  padding: var(--s-4) var(--s-4) var(--s-3);
  transform: translateY(16px); opacity: 0;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), opacity .35s ease;
}
.cm-cookie.an .karte { transform: none; opacity: 1; }
.cm-cookie h2 { font-size: 24px; margin: 0 0 var(--s-2); text-transform: none; }
.cm-cookie p { font-family: var(--font-text); font-size: var(--fs-small); line-height: var(--lh-body); color: var(--text-dim-auf-karte); margin: 0 0 var(--s-3); max-width: var(--maxw-text); }
.cm-cookie p a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.cm-cookie .antworten { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.cm-cookie .antworten button {
  min-height: 48px; padding: 12px; border-radius: var(--radius);
  font-family: var(--font-titel); font-weight: var(--fw-titel); letter-spacing: var(--ls-titel);
  text-transform: uppercase; font-size: var(--fs-small);
  cursor: pointer;
  background: var(--kreide); color: var(--asphalt); border: 1px solid var(--kreide);
}
.cm-cookie .antworten button:hover { background: var(--btn-bg-hover); }
.cm-cookie .karte:focus { outline: none; }
@media (max-width: 480px) { .cm-cookie { padding: 0; } .cm-cookie .karte { max-width: none; } }
@media (prefers-reduced-motion: reduce) {
  .cm-schleier, .cm-cookie .karte, .cm-sticky { transition: none; }
}

body.consent-offen .cm-sticky { display: none; }
