/* ===========================================================
   Wolfgang Siegel · Psychologische Praxis · Stylesheet
   Designziele:
   - Warme Identität & Charakter der Original-Praxis bewahren
   - Pro Hauptbereich eigene Akzentfarbe (Tabs + Hervorhebungen)
   - Hohe Lesbarkeit (WCAG-AA), keine externen Webfonts (DSGVO)
   - Sticky-Sidebar, saubere Anker-Sprünge, echte Klickbarkeit
   =========================================================== */

:root {
  /* Header-Höhe als Variable (für Sticky-Offsets & Anker)
     wird per JS dynamisch aktualisiert; Fallback hier */
  --header-h: 168px;       /* Top-Bar + Tab-Leiste, mit Puffer */
  --header-h-sm: 120px;    /* Mobile */

  /* Neutralpalette */
  --c-bg:           #fbf3dc;   /* warmes Cremegelb */
  --c-bg-deeper:    #f4e3b4;
  --c-bg-grain:     url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.42  0 0 0 0 0.18  0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  --c-surface:      #ffffff;
  --c-surface-alt:  #fffaeb;
  --c-ink:          #1c160f;
  --c-ink-soft:     #443a2c;
  --c-muted:        #7a6b54;
  --c-rule:         #e6d6a6;

  /* Marke (Logo) */
  --c-ochre:        #b87a1e;
  --c-ochre-deep:   #8a5710;
  --c-ochre-soft:   #f1d8a3;

  /* Default-Akzent = Ocker (für Startseite & Service-Seiten) */
  --c-accent:        var(--c-ochre);
  --c-accent-deep:   var(--c-ochre-deep);
  --c-accent-soft:   var(--c-ochre-soft);
  --c-accent-bg:     #fff4d6;
  --c-link:          var(--c-ochre-deep);
  --c-link-hover:    #5b3a08;
  --c-focus:         #c87a00;

  /* Bereichsspezifische Farben (für Tabs) */
  --t-zur-person:    #e8c763;   /* helles Senfgelb */
  --t-publikationen: #d9a13b;   /* dunkles Senfgelb */
  --t-psychotherapie:#e57c2a;   /* Orange */
  --t-themen:        #b8431d;   /* Rotbraun */
  --t-gutachten:     #2c7570;   /* Teal */
  --t-arbeitsleben:  #6c843a;   /* Olivgrün */

  --radius:    14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(80,55,10,.08), 0 2px 6px rgba(80,55,10,.06);
  --shadow:    0 6px 18px rgba(80,55,10,.10), 0 18px 40px rgba(80,55,10,.08);
  --shadow-warm: 0 4px 14px rgba(184,122,30,.18), 0 16px 32px rgba(184,122,30,.12);

  --container: 1240px;
  --content-max: 70ch;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Palatino", Georgia, "Times New Roman", serif;
  --fs-base: 1.0625rem;
  --lh-base: 1.65;
}

/* ===== Pro Bereich: Akzentfarbe + Hintergrundton überschreiben ===== */
body[data-section="zur-person"] {
  --c-accent: #c69a25; --c-accent-deep:#8a6a10; --c-accent-soft:#f4dc92; --c-accent-bg:#fff6d4; --c-link:#7a5208;
  --c-bg: #fbf2cf; --c-bg-deeper:#f4dfa3;
}
body[data-section="publikationen"] {
  --c-accent: #b78127; --c-accent-deep:#7e570f; --c-accent-soft:#ecc880; --c-accent-bg:#fcecc0; --c-link:#6b4708;
  --c-bg: #fbecbe; --c-bg-deeper:#efd58d;
}
body[data-section="psychotherapie"] {
  --c-accent: #d96b1d; --c-accent-deep:#8e3e07; --c-accent-soft:#fac79f; --c-accent-bg:#fde3cb; --c-link:#7e3a06;
  --c-bg: #fde0c4; --c-bg-deeper:#f7c190;
}
body[data-section="themen"] {
  --c-accent: #b8431d; --c-accent-deep:#7a2a0e; --c-accent-soft:#f3b89c; --c-accent-bg:#fcd9c5; --c-link:#7a2a0e;
  --c-bg: #f7c8a8; --c-bg-deeper:#ee9e76;
}
body[data-section="gutachten"] {
  --c-accent: #2c7570; --c-accent-deep:#194a47; --c-accent-soft:#a8d3cf; --c-accent-bg:#d4ebe8; --c-link:#194a47;
  --c-bg: #c9e1de; --c-bg-deeper:#9bc4be;
}
body[data-section="arbeitsleben"] {
  --c-accent: #6c843a; --c-accent-deep:#3f5520; --c-accent-soft:#c4d49a; --c-accent-bg:#e1ebc3; --c-link:#3f5520;
  --c-bg: #d8e1b8; --c-bg-deeper:#bccc8b;
}
body[data-section="service"] {
  --c-bg: #f5ead0; --c-bg-deeper:#e8d6a2;
}

/* ===== Reset & Basis ===== */
*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* Scroll-Anchoring deaktivieren. Sonst korrigiert der Browser scrollY,
   wenn der sticky Header beim Scroll-Toggle schrumpft (~40 px), und das
   führt zu Oszillation/Flackern direkt um die is-scrolled-Schwelle. */
html, body { overflow-anchor: none; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--c-ink);
  background-color: var(--c-bg);
  background-image:
    radial-gradient(1200px 600px at 50% -200px, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(800px 400px at 100% 0%, rgba(184,122,30,.08), transparent 70%),
    var(--c-bg-grain);
  background-attachment: fixed, fixed, fixed;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

img,svg,video,audio { max-width: 100%; height: auto; display: block; }

a {
  color: var(--c-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(0,0,0,.18);
}
a:hover { color: var(--c-link-hover); text-decoration-color: var(--c-accent); text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; border-radius: 2px; }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }

/* ===== Typografie ===== */
h1,h2,h3,h4,h5 {
  font-family: var(--font-serif);
  color: var(--c-ink);
  line-height: 1.22;
  margin: 0 0 .5em;
  letter-spacing: -.005em;
}
h1 { font-size: clamp(1.95rem, 2.4vw + 1rem, 2.8rem); font-weight: 700; }
h2 { font-size: clamp(1.45rem, 1.4vw + 1rem, 1.95rem); font-weight: 700; color: var(--c-accent-deep); }
h3 { font-size: 1.27rem; font-weight: 600; color: var(--c-accent-deep); }
h4 { font-size: 1.1rem; font-weight: 700; color: var(--c-ink); }

p { margin: 0 0 1em; max-width: var(--content-max); }
ul, ol { padding-left: 1.25em; max-width: var(--content-max); }
li + li { margin-top: .25em; }

::selection { background: var(--c-accent-soft); color: var(--c-ink); }

/* Skip-Link */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--c-ink); color: #fff;
  padding: .75rem 1rem; font-weight: 600;
  z-index: 9999; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1rem, 3vw, 2rem); }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background:
    linear-gradient(180deg, #fbf0c8 0%, var(--c-bg) 100%);
  border-bottom: 1px solid rgba(184,122,30,.22);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 6px 18px rgba(80,55,10,.06);
}
.site-header__inner {
  display: flex; align-items: center; gap: 1.25rem;
  padding-block: .85rem;
}

/* ----- Marke / Logo ----- */
.brand {
  display: inline-flex; align-items: center;
  text-decoration: none;
  filter: drop-shadow(0 1px 1px rgba(80,55,10,.12));
  transition: transform .15s, filter .15s;
}
.brand:hover { text-decoration: none; transform: translateY(-1px); filter: drop-shadow(0 2px 4px rgba(80,55,10,.18)); }
.brand__logo {
  display: block;
  height: 64px;
  width: auto;
  max-width: 100%;
  image-rendering: -webkit-optimize-contrast;
  transition: height .22s cubic-bezier(.4, 0, .2, 1);
}
@media (max-width: 860px) { .brand__logo { height: 52px; } }
@media (max-width: 480px) { .brand__logo { height: 44px; } }

/* Logo-Farbvariante pro Seitenbereich. CSS content auf einem <img>
   tauscht die gerenderte Bildquelle aus, ohne den DOM oder das alt-
   Attribut anzufassen — funktioniert in Chrome/Edge/Safari/Firefox. */
body[data-section="psychotherapie"] .brand__logo,
body[data-section="themen"]         .brand__logo { content: url(img/logo-orange.gif); }
body[data-section="gutachten"]      .brand__logo,
body[data-section="arbeitsleben"]   .brand__logo { content: url(img/logo-gruen.gif); }

.header-spacer { flex: 1; }

/* Utility-Nav */
.utility-nav { display: flex; gap: .85rem; align-items: center; font-size: .88rem; }
.utility-nav a { color: var(--c-muted); text-decoration: none; }
.utility-nav a:hover, .utility-nav a[aria-current="page"] { color: var(--c-link); text-decoration: underline; }
.utility-nav .sep { color: rgba(184,122,30,.4); }

/* Search */
.search { position: relative; display: inline-flex; align-items: center; }
.search input {
  width: 220px;
  border: 1px solid rgba(184,122,30,.3);
  background: rgba(255,255,255,.85);
  border-radius: 999px;
  padding: .55rem .9rem .55rem 2.1rem;
  font: inherit; color: var(--c-ink);
  transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--c-muted); }
.search input:focus { border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); outline: none; }
.search__icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--c-muted); pointer-events: none; }
.search__results {
  position: absolute; top: calc(100% + .35rem); left: 0; right: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  max-height: 65vh; overflow: auto; padding: .25rem;
  display: none; z-index: 200;
}
.search__results.open { display: block; }
.search__results a { display: block; padding: .55rem .7rem; border-radius: 6px; text-decoration: none; color: var(--c-ink); font-size: .95rem; }
.search__results a:hover, .search__results a:focus { background: var(--c-accent-bg); color: var(--c-accent-deep); }
.search__results .sr-section { font-size: .72rem; color: var(--c-muted); text-transform: uppercase; letter-spacing: .1em; padding: .5rem .7rem .25rem; }

/* ===== Primärnav: gefärbte Tabs ===== */
.primary-nav {
  background: linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,0));
  border-top: 1px solid rgba(184,122,30,.18);
}
/* Menü-Leiste: Tile-Grid links, Schnellkontakt rechts.
   Aggressive Resets gegen UA-ul/li-Defaults, damit das Grid füllt. */
.primary-nav__bar {
  display: flex;
  justify-content: center;
  padding: .6rem 0;
}
.primary-nav__list {
  list-style: none !important;
  margin: 0 auto !important;
  padding: 0 !important;
  padding-inline-start: 0 !important;
  padding-inline-end: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  grid-auto-rows: 1fr !important;
  gap: 10px;
  width: 100%;
  max-width: 900px;
  min-width: 0;
  box-sizing: border-box;
}
.primary-nav__item {
  display: block !important;
  list-style: none !important;
  position: relative;
  margin: 0 !important;
  padding: 0 !important;
  min-width: 0;
  width: 100%;
  height: 100%;
}
.primary-nav__link {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  text-align: center;
  min-height: 60px;
  padding: .8rem 1rem;
  font-weight: 600;
  font-size: .95rem;
  color: var(--c-ink);
  text-decoration: none;
  border-radius: 8px;
  background: var(--tab-color, var(--c-bg-deeper));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.35),
    0 2px 4px rgba(80,55,10,.08);
  transition:
    filter .15s, transform .05s, box-shadow .15s,
    min-height .22s cubic-bezier(.4, 0, .2, 1),
    padding .22s cubic-bezier(.4, 0, .2, 1),
    font-size .22s cubic-bezier(.4, 0, .2, 1);
  position: relative;
  line-height: 1.3;
  box-sizing: border-box;
}
.primary-nav__label--short { display: none; }
/* Scroll-Kurzversion: einreihig, 6 kompakte Tabs mit Kurz-Labels.
   NUR auf Desktop (>= 861px). Auf Mobile bleibt die vertikale Burger-
   Menu-Geometrie unangetastet, sonst zwingen die hier definierten
   Layout-Regeln (höhere Spezifität via .site-header.is-scrolled) das
   geöffnete Mobile-Menü in den Desktop-Modus — buggt sichtbar als
   6-Tab-Leiste oben + verrutschtes Submenu am Seitenende. */
@media (min-width: 861px) {
  .site-header.is-scrolled .primary-nav__list {
    grid-template-columns: repeat(6, 1fr) !important;
    max-width: 1100px;
    gap: 6px;
  }
  .site-header.is-scrolled .primary-nav__link {
    min-height: 38px;
    padding: .35rem .55rem;
    font-size: .82rem;
  }
  .site-header.is-scrolled .primary-nav__label--full { display: none; }
  .site-header.is-scrolled .primary-nav__label--short { display: inline; }
  .site-header.is-scrolled .primary-nav__bar { padding: .35rem 0; }
}
/* Logo + Header-Innenpadding-Shrink dürfen auch auf Mobile schrumpfen. */
.site-header.is-scrolled .site-header__inner { padding-block: .45rem; }
.site-header.is-scrolled .brand__logo { height: 44px; }

/* Transitions auf die schrumpfenden Properties — damit der Header
   seine Höhe smooth interpoliert. Da body padding-top via --header-h
   und ResizeObserver an die Header-Höhe gekoppelt ist, folgt der
   Inhalt synchron ohne Sprung. */
.brand__logo { transition: height .22s cubic-bezier(.4, 0, .2, 1); }
.site-header__inner { transition: padding-block .22s cubic-bezier(.4, 0, .2, 1); }
.primary-nav__bar { transition: padding .22s cubic-bezier(.4, 0, .2, 1); }
.primary-nav__link:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  text-decoration: none;
}
.primary-nav__link:active { transform: translateY(1px); }
.primary-nav__item.is-active .primary-nav__link,
.primary-nav__link[aria-current="page"] {
  filter: brightness(1.1) saturate(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.6),
    inset 0 -4px 0 var(--c-accent-deep),
    0 -2px 0 var(--c-accent-deep);
  color: var(--c-ink);
}
.primary-nav__item--zur-person    .primary-nav__link { --tab-color: var(--t-zur-person); }
.primary-nav__item--publikationen .primary-nav__link { --tab-color: var(--t-publikationen); }
.primary-nav__item--psychotherapie .primary-nav__link { --tab-color: var(--t-psychotherapie); color: #fff; }
.primary-nav__item--themen        .primary-nav__link { --tab-color: var(--t-themen); color: #fff; }
.primary-nav__item--gutachten     .primary-nav__link { --tab-color: var(--t-gutachten); color: #fff; }
.primary-nav__item--arbeitsleben  .primary-nav__link { --tab-color: var(--t-arbeitsleben); color: #fff; }

/* Submenu-Farben sollen an die Sektion des PARENT-Tabs gekoppelt sein,
   nicht an die Section der aktuellen Seite. Wir setzen daher die
   Accent-Variablen pro Menü-Item; das Submenu darin erbt sie. Der Rest
   der Seite behält die body[data-section]-Werte. */
.primary-nav__item--zur-person     { --c-accent:#c69a25; --c-accent-deep:#8a6a10; --c-accent-soft:#f4dc92; --c-accent-bg:#fff6d4; --c-bg-deeper:#f4dfa3; --c-link:#7a5208; }
.primary-nav__item--publikationen  { --c-accent:#b78127; --c-accent-deep:#7e570f; --c-accent-soft:#ecc880; --c-accent-bg:#fcecc0; --c-bg-deeper:#efd58d; --c-link:#6b4708; }
.primary-nav__item--psychotherapie { --c-accent:#d96b1d; --c-accent-deep:#8e3e07; --c-accent-soft:#fac79f; --c-accent-bg:#fde3cb; --c-bg-deeper:#f7c190; --c-link:#7e3a06; }
.primary-nav__item--themen         { --c-accent:#b8431d; --c-accent-deep:#7a2a0e; --c-accent-soft:#f3b89c; --c-accent-bg:#fcd9c5; --c-bg-deeper:#ee9e76; --c-link:#7a2a0e; }
.primary-nav__item--gutachten      { --c-accent:#2c7570; --c-accent-deep:#194a47; --c-accent-soft:#a8d3cf; --c-accent-bg:#d4ebe8; --c-bg-deeper:#9bc4be; --c-link:#194a47; }
.primary-nav__item--arbeitsleben   { --c-accent:#6c843a; --c-accent-deep:#3f5520; --c-accent-soft:#c4d49a; --c-accent-bg:#e1ebc3; --c-bg-deeper:#bccc8b; --c-link:#3f5520; }

/* Schnellkontakt rechts neben den Menü-Tabs: flache Inline-Leiste mit
   ·-Separator. Telefon/Adresse klickbar, Sprechzeiten reine Info. */
.quickaccess {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .55rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.quickaccess__card {
  display: inline-flex;
  align-items: center;
  padding: .3rem .45rem;
  background: transparent;
  border: 0;
  border-radius: 6px;
  text-decoration: none;
  color: var(--c-ink);
  position: relative;
  transition: background .15s, color .15s;
}
.quickaccess__card + .quickaccess__card::before {
  content: "·";
  position: absolute;
  left: -.4rem;
  color: var(--c-muted);
  opacity: .55;
  pointer-events: none;
  font-weight: 700;
}
a.quickaccess__card:hover {
  background: var(--c-accent-bg);
  color: var(--c-accent-deep);
  text-decoration: none;
}
.quickaccess__card--hours {
  cursor: default;
}
.quickaccess__label {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
}
.quickaccess__value {
  font-weight: 600;
  font-size: .82rem;
  line-height: 1.25;
  color: inherit;
}
.quickaccess__card--phone .quickaccess__value {
  font-size: .88rem;
  letter-spacing: .01em;
}
.quickaccess__card--phone .quickaccess__value::before {
  content: "☎ ";
  margin-right: .15rem;
  opacity: .8;
}

/* Chevron für Submenu */
.primary-nav__chevron {
  display: inline-block;
  margin-left: .35rem;
  width: 0; height: 0;
  border: 4px solid transparent;
  border-top-color: currentColor;
  opacity: .7;
  transform: translateY(2px);
}

/* Submenu — unsichtbare Brücke (padding-top) statt margin-top,
   damit der Cursor zwischen Tab und Karte nicht ins Leere fällt. */
.submenu {
  position: absolute; left: 0; top: 100%;
  padding-top: 10px;            /* unsichtbare Brücke */
  display: none; z-index: 120;
  background: transparent;
  border: 0;
}
.submenu.open { display: block; }
.submenu > ul {
  list-style: none; margin: 0; padding: .4rem;
  min-width: 260px; max-width: 340px;
  background: var(--c-surface);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}
.submenu > ul::before {
  content: "";
  position: absolute; top: -7px; left: 1.5rem;
  width: 12px; height: 12px;
  background: var(--c-surface);
  border-left: 1px solid var(--c-rule);
  border-top: 1px solid var(--c-rule);
  transform: rotate(45deg);
}
.submenu a {
  display: block; padding: .35rem .65rem;
  color: var(--c-ink); text-decoration: none;
  border-radius: 6px; font-weight: 500;
  font-size: .9rem;
  line-height: 1.3;
}
.submenu a:hover, .submenu a:focus { background: var(--c-accent-bg); color: var(--c-accent-deep); }
.submenu a.submenu__home {
  font-weight: 700;
  background: var(--c-bg-deeper);
  border-bottom: 1px solid var(--c-rule);
  border-radius: 6px 6px 0 0;
  margin-bottom: 4px;
}
.submenu__group {
  margin-top: .3rem;
  padding: .3rem .65rem 0;
  border-top: 1px solid var(--c-rule);
}
.submenu__group-label {
  font-size: .72rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--c-accent-deep);
  display: block;
}
.submenu a.submenu__sub {
  padding-left: 1.3rem;
  font-size: .88rem;
  position: relative;
}
.submenu a.submenu__sub::before {
  content: "›";
  position: absolute; left: .7rem; top: .35rem;
  color: var(--c-accent);
  font-weight: 700;
}

/* Lange Listen (z. B. Psychotherapie mit 16 Einträgen) zweispaltig
   ausgeben, damit das Dropdown auch auf 21"-Monitoren komplett sichtbar
   bleibt. Der ::before-Pfeil und das Übersichts-Link spannen über beide
   Spalten. */
.submenu--wide > ul {
  min-width: 520px; max-width: 560px;
  column-count: 2;
  column-gap: .5rem;
  column-rule: 1px solid var(--c-rule);
}
.submenu--wide > ul > li {
  break-inside: avoid;
}
.submenu--wide > ul > li:first-child,
.submenu--wide > ul > li.submenu__group {
  column-span: all;
}
/* Pfeil zur Tab-Brücke links positionieren */
.submenu--wide > ul::before {
  left: 1.5rem;
}

/* Chevron-Toggle: per JS in jeden Hauptmenü-Item eingefügt.
   Auf Desktop versteckt (Hover öffnet Submenu).
   Auf Mobile sichtbar — Tap toggelt Submenu auf/zu, ohne die Navigation
   des Hauptlinks zu blockieren. */
.primary-nav__expand {
  display: none;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.menu-toggle {
  display: none;
  background: var(--c-surface);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-sm);
  padding: .55rem .9rem;
  font: inherit; font-weight: 600;
  color: var(--c-ink);
  cursor: pointer;
}

/* ===== Page Layout ===== */
.page {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 2.5rem;
  padding-block: 2.5rem 4rem;
  align-items: start;
}
.page--no-aside { grid-template-columns: 1fr; }
main { min-width: 0; }

/* Sticky Sidebar – Heading bleibt fix, nur TOC scrollt bei Bedarf */
.aside {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 2rem);
  display: flex;
  flex-direction: column;
}
.aside__inner {
  background: var(--c-surface);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.aside__inner::before {
  content: "";
  display: block;
  width: 36px; height: 4px;
  background: var(--c-accent);
  border-radius: 4px;
  margin-bottom: .9rem;
  flex: 0 0 auto;
}
.aside__title {
  font-family: var(--font-serif);
  font-size: .8rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--c-muted);
  margin: 0 0 .75rem;
  font-weight: 600;
  flex: 0 0 auto;
}
.toc {
  list-style: none; margin: 0; padding: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  /* dezenter Scroll-Indikator wenn Inhalt überläuft */
  scrollbar-width: thin;
  scrollbar-color: var(--c-accent-soft) transparent;
}
.toc::-webkit-scrollbar { width: 6px; }
.toc::-webkit-scrollbar-thumb { background: var(--c-accent-soft); border-radius: 4px; }
.toc::-webkit-scrollbar-track { background: transparent; }
.toc > li { margin: 0; }
.toc a {
  display: block;
  padding: .5rem .8rem;
  color: var(--c-ink-soft);
  text-decoration: none;
  font-size: .94rem;
  line-height: 1.4;
  border-radius: 6px;
  border-left: 3px solid transparent;
  margin-left: -3px;
}
.toc a:hover { background: var(--c-accent-bg); color: var(--c-accent-deep); }
.toc a.is-active {
  color: var(--c-accent-deep);
  border-left-color: var(--c-accent);
  background: var(--c-accent-bg);
  font-weight: 600;
}
.toc--sub { padding-left: .9rem; font-size: .88rem; margin-top: .15rem; }
.toc--sub a { padding: .3rem .65rem; color: var(--c-muted); }

/* Body-Scroll-Lock, sobald ein Mobile-Overlay (Hauptmenü oder TOC-Sheet)
   offen ist. overflow: hidden + position: fixed wegen iOS-Safari, das
   overflow allein dort nicht respektiert. Scroll-Position bleibt durch
   den fixen Body erhalten (Inhalt scrollt visuell nicht). */
body.no-scroll {
  overflow: hidden;
  touch-action: none;
}
body.no-scroll .mobile-fab { display: none !important; }
.primary-nav.is-open,
.mobile-toc-sheet__panel {
  overscroll-behavior: contain;
}

/* ===== Mobile FAB: Sektion-Sprung + Scroll-to-top ===== */
.mobile-fab {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 80;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .22s ease, transform .22s ease;
}
.mobile-fab.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.mobile-fab__btn {
  width: 52px; height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--c-accent);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(80,55,10,.35), 0 1px 2px rgba(0,0,0,.15);
  transition: transform .1s, filter .15s;
}
.mobile-fab__btn:active { transform: scale(.94); }
.mobile-fab__btn:hover, .mobile-fab__btn:focus-visible { filter: brightness(1.08); }
.mobile-fab__btn--toc { background: var(--c-accent-deep); }
@media (min-width: 861px) { .mobile-fab, .mobile-toc-sheet { display: none !important; } }

/* Bottom-Sheet mit den Sektion-Ankern */
.mobile-toc-sheet {
  position: fixed; inset: 0;
  z-index: 200;
  visibility: hidden;
  pointer-events: none;
}
.mobile-toc-sheet.is-open { visibility: visible; pointer-events: auto; }
.mobile-toc-sheet__backdrop {
  position: absolute; inset: 0;
  background: rgba(40,25,5,.45);
  opacity: 0;
  transition: opacity .25s ease;
}
.mobile-toc-sheet.is-open .mobile-toc-sheet__backdrop { opacity: 1; }
.mobile-toc-sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 78vh;
  background: var(--c-surface);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  padding: .5rem 1rem 1rem;
  box-shadow: 0 -8px 24px rgba(0,0,0,.22);
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-toc-sheet.is-open .mobile-toc-sheet__panel { transform: translateY(0); }
.mobile-toc-sheet__grip {
  width: 40px; height: 4px;
  background: var(--c-rule);
  border-radius: 2px;
  margin: 6px auto 12px;
}
.mobile-toc-sheet__heading {
  margin: 0 0 .75rem;
  font-size: 1rem;
  color: var(--c-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.mobile-toc-sheet__list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.mobile-toc-sheet__item { margin: 0; }
.mobile-toc-sheet__item a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .55rem .65rem;
  border-radius: 8px;
  color: var(--c-ink);
  text-decoration: none;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.mobile-toc-sheet__item a:hover,
.mobile-toc-sheet__item a:active {
  background: var(--c-accent-bg);
  color: var(--c-accent-deep);
  border-left-color: var(--c-accent);
}
.mobile-toc-sheet__item--h3 a {
  padding-left: 1.5rem;
  font-size: .92rem;
  color: var(--c-muted);
  min-height: 40px;
}
.mobile-toc-sheet__close {
  width: 100%;
  min-height: 44px;
  padding: .65rem 1rem;
  border: 1px solid var(--c-rule);
  border-radius: 10px;
  background: transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.mobile-toc-sheet__close:active { background: var(--c-bg-deeper); }

/* ===== 404-Seite ===== */
.error-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  padding-block: clamp(2rem, 6vw, 5rem);
}
.error-page__figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 426 / 286;
}
.error-page__figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.error-page__text { min-width: 0; }
.error-page__code {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  line-height: 1;
  color: var(--c-accent-deep);
  letter-spacing: -.02em;
  margin: 0 0 .5rem;
  opacity: .8;
}
.error-page h1 {
  margin-top: 0;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
}
.error-page__links {
  list-style: none;
  padding: 0;
  margin: .5rem 0 1rem;
}
.error-page__links li {
  margin: 0;
  padding: .35rem 0;
  border-top: 1px solid var(--c-rule);
}
.error-page__links li:last-child { border-bottom: 1px solid var(--c-rule); }
.error-page__links a {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  padding: .25rem 0;
}
.error-page__links a::after {
  content: " ›";
  margin-left: .3rem;
  color: var(--c-accent);
}
@media (max-width: 700px) {
  .error-page { grid-template-columns: 1fr; }
  .error-page__figure { max-width: 100%; }
}

/* ===== Content Card ===== */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(1.5rem, 3vw, 2.75rem);
  position: relative;
}
.card + .card { margin-top: 1.5rem; }
.card::before {
  content: "";
  position: absolute; left: 0; top: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--c-accent) 0%, var(--c-accent-soft) 60%, transparent 100%);
  border-radius: var(--radius) var(--radius) 0 0;
}

.lede {
  font-size: 1.18rem;
  color: var(--c-ink-soft);
  font-family: var(--font-serif);
  font-style: italic;
  max-width: var(--content-max);
  line-height: 1.55;
}

/* Sections: scroll-margin-top federt den Sticky-Header beim Anker-Sprung ab.
   Großzügig 1.5rem Puffer, damit die vorherige Zeile nicht in das Ziel hineinragt. */
section[id], article[id], [id].card, [id].book-card,
h2[id], h3[id], h4[id] {
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}
:target { scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.section { padding-block: 1rem; }
.section + .section {
  border-top: 1px solid var(--c-rule);
  margin-top: 2.5rem;
  padding-top: 2.5rem;
}
.section__eyebrow {
  display: inline-block;
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--c-accent); font-weight: 700;
  margin-bottom: .4rem;
  padding: .2rem .55rem;
  background: var(--c-accent-bg);
  border-radius: 3px;
}

/* Kicker */
.kicker {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--c-accent-bg);
  color: var(--c-accent-deep);
  font-weight: 700; font-size: .78rem; letter-spacing: .12em;
  text-transform: uppercase; padding: .35rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--c-accent-soft);
}
.kicker::before {
  content: "";
  display: inline-block; width: 8px; height: 8px;
  background: var(--c-accent);
  border-radius: 50%;
}

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; max-width: none; }
.timeline li {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: .7rem 0;
  border-bottom: 1px dashed var(--c-rule);
  max-width: none;
  position: relative;
}
.timeline li:last-child { border-bottom: none; }
.timeline .year {
  font-weight: 700; color: var(--c-accent-deep);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-serif);
}
@media (max-width: 600px) {
  .timeline li { grid-template-columns: 1fr; gap: .2rem; padding-left: 0; }
}

/* Figures */
figure { margin: 1.25rem 0; }
figure img { border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
figcaption { font-size: .87rem; color: var(--c-muted); margin-top: .4rem; font-style: italic; }

/* Eingebettetes Foto: nimmt seine natürliche Größe an, wird nie
   hochskaliert (die Originale sind teilweise nur 120-350 px breit;
   das Hochziehen auf eine fixe max-width macht sie unscharf).
   Auf schmalen Screens schrumpft das Bild proportional. */
.figure-inline {
  margin: 1.5rem auto;
  width: fit-content;
  max-width: 100%;
}
.figure-inline > img {
  display: block;
  max-width: 100%;
  height: auto;
}
.figure-inline > figcaption {
  text-align: center;
  max-width: 32rem;
  margin-left: auto; margin-right: auto;
}

/* Float-Variante: kleines Bild rechts vom Text — perfekt für
   Porträtformat-Originale (kreuzung, isovaleraldehyd …) damit der
   Text rundherum nicht künstlich kurz wird. Clear bei Section-Wechsel. */
.figure-inline--right {
  float: right;
  margin: .25rem 0 1rem 1.5rem;
}
.figure-inline--left {
  float: left;
  margin: .25rem 1.5rem 1rem 0;
}
.section::after { content: ""; display: block; clear: both; }
@media (max-width: 600px) {
  .figure-inline--right, .figure-inline--left {
    float: none; margin: 1.5rem auto;
  }
}

/* Bilderpaar (Lebenslauf): zwei kleine Porträts nebeneinander, floaten
   rechts neben den Anfang der Timeline. Natürliche Größe, kein
   aspect-ratio-Crop. Auf Mobil wandern sie über die Timeline. */
.figure-pair {
  float: right;
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  margin: .25rem 0 1.25rem 1.5rem;
  width: fit-content;
  max-width: 50%;
}
.figure-pair figure {
  margin: 0;
  width: fit-content;
}
.figure-pair img {
  display: block;
  max-width: 100%;
  height: auto;
}
.figure-pair figcaption {
  text-align: center;
  font-size: .82rem;
}
@media (max-width: 600px) {
  .figure-pair {
    float: none;
    margin: 1.5rem auto;
    justify-content: center;
    max-width: 100%;
  }
}

/* Porträt rechts neben einleitendem Text (Zur Person).
   Bild wird auf seine natürliche Breite (200 px) begrenzt — nicht aufgeblasen.
   ACHTUNG: Float-Variante nicht in Kombination mit dl-rows/Grid-Tabellen
   verwenden — dafür gibt es .legal-hero (Flex/Grid-Layout). */
.figure-portrait {
  float: right;
  margin: 0 0 1rem 1.5rem;
  width: fit-content;
  max-width: 40%;
}
.figure-portrait img {
  display: block;
  max-width: 200px;
  width: 100%;
  height: auto;
}
@media (max-width: 540px) {
  .figure-portrait {
    float: none; margin: 0 auto 1.25rem;
    max-width: 200px;
  }
}

/* ============================================================
   Rechts-Seiten (Impressum, Datenschutz): klarer Hero-Block mit
   Portrait links, Adress-/Kontaktblock rechts. Statt einem floaten-
   den Portrait, das mit nachfolgenden Grid-Tabellen (dl-rows) kolli-
   diert, liegt das Portrait hier in einem eigenen Grid-Container.
   ============================================================ */
.legal-hero {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.25rem 2rem;
  align-items: start;
  margin: 1.5rem 0 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--c-rule);
}
.legal-hero__portrait {
  margin: 0;
  width: 200px;
}
.legal-hero__portrait img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.legal-hero__body > :first-child { margin-top: 0; }
.legal-hero__body h2 { margin-top: 0; }
.legal-address {
  font-style: normal;
  margin: 0 0 1rem;
}
.legal-contact { margin: 0 0 .3rem; }
.legal-contact strong { display: inline-block; min-width: 4.5rem; }
.small { font-size: .85rem; }

@media (max-width: 600px) {
  .legal-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .legal-hero__body { text-align: left; max-width: 32rem; }
  .legal-contact strong { min-width: 0; margin-right: .25rem; }
}

/* dl-rows: für deutsche Begriffe brauchen wir etwas mehr Breite
   in der Definitions-Spalte. Bei längeren Begriffen (z. B. „Approbations-
   behörde", „Berufsrechtliche Regelungen") darf die Spalte mitwachsen. */
.legal dl.dl-rows {
  grid-template-columns: minmax(11rem, max-content) 1fr;
  gap: .75rem 1.25rem;
  margin: 0 0 2rem;
}
.legal dl.dl-rows dt {
  font-weight: 700;
  color: var(--c-accent-deep);
  line-height: 1.35;
}
.legal dl.dl-rows dd {
  line-height: 1.55;
}
.legal dl.dl-rows dd p { margin: 0; }
.legal dl.dl-rows dd ul { margin: 0; padding-left: 1.1em; max-width: none; }
/* Nur direkte H2-Kinder bekommen Trennlinien — auf Datenschutz sind die
   H2 in <section class="section">, dort macht .section selbst die Trennung. */
.legal > h2 {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--c-rule);
}
.legal > h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
@media (max-width: 600px) {
  .legal dl.dl-rows { grid-template-columns: 1fr; gap: .15rem .5rem; }
  .legal dl.dl-rows dt { margin-top: .85rem; }
}

/* Pull-quote */
.pullquote {
  font-family: var(--font-serif);
  font-size: 1.3rem; line-height: 1.5;
  color: var(--c-accent-deep);
  border-left: 4px solid var(--c-accent);
  padding: 1rem 1.5rem;
  margin: 1.75rem 0;
  background: linear-gradient(90deg, var(--c-accent-bg) 0%, transparent 80%);
  font-style: italic;
  border-radius: 0 6px 6px 0;
  position: relative;
}
.pullquote::before {
  content: "“";
  position: absolute;
  left: -.1rem; top: -1.3rem;
  font-size: 5rem;
  color: var(--c-accent);
  opacity: .25;
  font-family: var(--font-serif);
  line-height: 1;
}
.pullquote small { display: block; font-size: .82rem; color: var(--c-muted); margin-top: .65rem; font-style: normal; }

/* Notice */
.notice {
  display: flex; gap: .85rem;
  background: var(--c-accent-bg);
  border: 1px solid var(--c-accent-soft);
  border-left: 4px solid var(--c-accent);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem; margin: 1rem 0 1.5rem;
}
.notice strong { color: var(--c-accent-deep); }
.notice p { margin-bottom: .5rem; }
.notice p:last-child { margin-bottom: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--c-accent);
  color: #fff;
  padding: .7rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, transform .05s, box-shadow .15s;
  box-shadow: 0 2px 6px rgba(80,55,10,.18);
  font: inherit;
  font-weight: 600;
}
.btn:hover { background: var(--c-accent-deep); color: #fff; text-decoration: none; box-shadow: 0 4px 12px rgba(80,55,10,.25); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 3px rgba(80,55,10,.2); }
.btn--ghost {
  background: transparent;
  color: var(--c-accent-deep);
  border-color: var(--c-accent);
  box-shadow: none;
}
.btn--ghost:hover { background: var(--c-accent-bg); color: var(--c-accent-deep); }
/* Abstand zwischen direkt aufeinander folgenden Buttons */
.btn + .btn { margin-left: .6rem; }
/* Gruppen-Wrapper: erlaubt Umbruch bei wenig Platz */
.btn-row {
  display: flex; flex-wrap: wrap; gap: .6rem;
  margin: .75rem 0;
}
.btn-row .btn + .btn { margin-left: 0; }

/* Tile Grid */
.grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.tile {
  display: flex; flex-direction: column; gap: .55rem;
  background: var(--c-surface);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--c-ink);
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tile::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--c-accent);
  opacity: .9;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-warm);
  border-color: var(--c-accent-soft);
  color: var(--c-ink); text-decoration: none;
}
.tile h3 { margin: 0; color: var(--c-accent-deep); }
.tile p { margin: 0; color: var(--c-ink-soft); }
.tile .arrow { margin-top: auto; font-weight: 700; color: var(--c-accent); padding-top: .25rem; }

/* Hero (Startseite) */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: center;
  background:
    linear-gradient(135deg, #fff7df 0%, var(--c-surface) 60%, #fff7df 100%);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3.5vw, 3rem);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -80px; top: -80px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, var(--c-ochre-soft) 0%, transparent 70%);
  opacity: .5; z-index: 0; pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { margin-top: 0; }
.hero__role {
  color: var(--c-muted); font-size: .85rem; letter-spacing: .14em;
  text-transform: uppercase; font-weight: 600; margin-bottom: 1rem;
}
.hero__cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.hero__media figure { margin: 0; text-align: center; }
.hero__media img {
  display: block;
  margin: 0 auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 360px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero__media figcaption {
  text-align: center;
  margin-top: .6rem;
}
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }

/* Schlanker Seitenkopf (Startseite ohne Hero-Bild) */
.page-header {
  margin: .25rem 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--c-rule);
}
.page-header h1 { margin: .35rem 0 0; }
.page-header .kicker { margin: 0; }

/* Definition lists */
dl.dl-rows { display: grid; grid-template-columns: 9rem 1fr; gap: .5rem 1rem; margin: 0; }
dl.dl-rows dt { font-weight: 700; color: var(--c-accent-deep); font-variant-numeric: tabular-nums; }
dl.dl-rows dd { margin: 0; }
@media (max-width: 600px) { dl.dl-rows { grid-template-columns: 1fr; } dl.dl-rows dt { margin-top: .5rem; } }

/* File-Listen */
.file-list { list-style: none; padding: 0; margin: 0; max-width: none; }
.file-list li {
  padding: .65rem .35rem;
  border-bottom: 1px solid var(--c-rule);
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline;
  max-width: none;
}
.file-list li:last-child { border-bottom: none; }
.file-list .meta { color: var(--c-muted); font-size: .85rem; }
.file-list a { font-weight: 600; }
.file-list a::before {
  content: "📄";
  margin-right: .35rem;
  filter: grayscale(.4);
  font-size: .95em;
}

/* Audio Player */
.audio-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--c-accent-bg);
  border: 1px solid var(--c-accent-soft);
  border-left: 4px solid var(--c-accent);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.audio-card audio {
  flex: 1 1 280px;
  min-width: 260px;
  height: 40px;
  width: 100%;
  max-width: 100%;
}
.audio-card__meta { font-size: .9rem; color: var(--c-muted); margin: .25rem 0 0; }
.audio-card__download { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 540px) {
  .audio-card { flex-direction: column; align-items: stretch; }
  .audio-card audio { width: 100%; min-width: 0; }
  .audio-card__download { align-self: flex-start; }
}

/* DSGVO Zwei-Klick YouTube-Embed
   Markup:
   <div class="video-embed" data-yt="https://www.youtube.com/embed/ID"
                            data-title="Titel des Videos">
     <div class="video-consent">
       <div class="video-consent__inner">
         <h3>YouTube-Video laden?</h3>
         <p>Es werden personenbezogene Daten an YouTube/Google übertragen. Details in der
           <a href="datenschutz.html">Datenschutzerklärung</a>.</p>
         <button type="button" class="btn">Video laden</button>
       </div>
     </div>
   </div>
*/
.video-embed {
  position: relative;
  aspect-ratio: 16/9;
  width: 100%;
  background: #111;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1rem 0;
  box-shadow: var(--shadow-sm);
}
.video-embed iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.video-consent {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 1.25rem;
  cursor: pointer;
  background:
    linear-gradient(rgba(20,12,4,.78), rgba(20,12,4,.78)),
    linear-gradient(135deg, #2a1a08 0%, #5c3c10 60%, var(--c-ochre, #c98a1c) 100%);
  color: #fff;
  text-align: center;
}
.video-consent:hover, .video-consent:focus {
  background:
    linear-gradient(rgba(20,12,4,.65), rgba(20,12,4,.65)),
    linear-gradient(135deg, #2a1a08 0%, #5c3c10 60%, var(--c-ochre, #c98a1c) 100%);
}
.video-consent__inner {
  max-width: 480px;
}
.video-consent h3 {
  color: #fff;
  margin: 0 0 .5rem;
  font-size: 1.15rem;
}
.video-consent p {
  margin: 0 0 1rem;
  color: rgba(255,255,255,.92);
  font-size: .92rem;
  line-height: 1.45;
}
.video-consent a {
  color: #ffd585;
  text-decoration: underline;
}
.video-consent .btn {
  background: var(--c-accent, #c98a1c);
  color: #fff;
  border: 0;
}
.video-consent .btn:hover { filter: brightness(1.08); }

/* YouTube Karte (Fallback, falls keine Video-ID vorhanden) */
.yt-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  background: var(--c-surface);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  align-items: center;
  margin: 1rem 0;
  text-decoration: none;
  color: var(--c-ink);
  transition: transform .15s, box-shadow .15s;
}
.yt-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-warm); text-decoration: none; color: var(--c-ink); }
.yt-card__thumb {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(135deg, #2a1a08 0%, #5c3c10 60%, var(--c-ochre) 100%);
  display: grid; place-items: center;
}
.yt-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.yt-card__play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(0,0,0,.2);
}
.yt-card__play::after {
  content: "";
  width: 64px; height: 44px;
  background: rgba(255,0,0,.85);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.yt-card__play::before {
  content: "";
  position: absolute;
  width: 0; height: 0;
  border-left: 18px solid #fff;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  z-index: 2;
}
.yt-card__info h3 { margin: 0 0 .3rem; color: var(--c-accent-deep); }
.yt-card__info p { margin: 0; color: var(--c-muted); font-size: .92rem; }
.yt-card__info .meta { display: inline-block; margin-top: .65rem; font-size: .85rem; color: var(--c-accent); font-weight: 600; }
@media (max-width: 640px) {
  .yt-card { grid-template-columns: 1fr; }
}

/* Footer */
.site-footer {
  margin-top: 4rem;
  background:
    linear-gradient(180deg, var(--c-bg) 0%, var(--c-bg-deeper) 60%, #e9d28a 100%);
  border-top: 1px solid rgba(184,122,30,.25);
  padding-block: 2.5rem 2.5rem;
  font-size: .92rem;
  color: var(--c-ink-soft);
  position: relative;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg,
    var(--t-zur-person) 0% 16.66%,
    var(--t-publikationen) 16.66% 33.33%,
    var(--t-psychotherapie) 33.33% 50%,
    var(--t-themen) 50% 66.66%,
    var(--t-gutachten) 66.66% 83.33%,
    var(--t-arbeitsleben) 83.33% 100%);
}
.site-footer .container { display: grid; gap: 1.5rem 2rem; grid-template-columns: 1.4fr 1fr 1fr; }
.site-footer h4 { font-size: .85rem; color: var(--c-ochre-deep); text-transform: uppercase; letter-spacing: .12em; margin-bottom: .6rem; font-family: var(--font-sans); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .25rem; }
.site-footer a { color: var(--c-ink); }
.site-footer .copy {
  grid-column: 1 / -1; color: var(--c-muted); font-size: .82rem;
  border-top: 1px solid rgba(184,122,30,.25);
  padding-top: 1.25rem; margin-top: .5rem;
}
@media (max-width: 720px) { .site-footer .container { grid-template-columns: 1fr; } }

/* Consent Bar */
/* Pull-image / Book card */
.book-card {
  display: grid; grid-template-columns: 220px 1fr; gap: 1.75rem;
  align-items: start;
  background: linear-gradient(180deg, var(--c-surface) 0%, var(--c-accent-bg) 100%);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.book-card img {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transform: rotate(-1.5deg);
  transition: transform .25s;
}
.book-card img:hover { transform: rotate(0); }
@media (max-width: 640px) {
  .book-card { grid-template-columns: 1fr; }
  .book-card img { max-width: 220px; margin-inline: auto; }
}

/* Two-column */
.two-col {
  display: grid; gap: 1.75rem;
  grid-template-columns: 1fr 1fr;
}
.two-col > * { min-width: 0; }
.two-col p, .two-col ul { max-width: none; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

/* Utility */
.sr-only { position: absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--c-muted); }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 2rem; }
.divider { border: none; border-top: 1px solid var(--c-rule); margin: 1.75rem 0; }

/* Print */
@media print {
  .site-header, .aside, .site-footer, .menu-toggle, .search { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border: none; box-shadow: none; padding: 0; }
  .card::before { display: none; }
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; color: #555; }
}

/* Responsive */
/* Hauptmenü ist bereits als 3×2-Raster konzipiert — kein eigener
   Zwischen-Breakpoint mehr nötig, erst Mobile-Hamburger bei 860. */
@media (max-width: 980px) {
  :root { --header-h: var(--header-h-sm); }
  .page { grid-template-columns: 1fr; }
  .aside {
    position: relative; top: 0;
  }
  .aside__inner { max-height: none; overflow: visible; }
}
@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; min-height: 44px; }
  .primary-nav { display: none; }
  .primary-nav.is-open {
    display: block;
    position: absolute; left: 0; right: 0; top: 100%;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--c-surface);
    padding: 1rem;
    max-height: calc(100vh - var(--header-h-sm));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .primary-nav__bar { flex-direction: column; gap: 12px; }
  .primary-nav__list { grid-template-columns: 1fr !important; gap: 6px; padding: 0 !important; }
  .quickaccess { flex: 1 1 auto; }

  /* Hauptmenü-Item: Link + Chevron in einer Zeile, Submenu darunter */
  .primary-nav__item {
    flex: 1 1 auto;
    max-width: none;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
  }
  .primary-nav__link {
    min-height: 52px;
    border-radius: 10px;
    flex: 1 1 auto;
  }
  .primary-nav__expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    min-height: 52px;
    margin-left: 4px;
    border-radius: 10px;
    background: rgba(0,0,0,.05);
    transition: background .15s;
  }
  .primary-nav__expand:hover,
  .primary-nav__expand:focus-visible { background: rgba(0,0,0,.12); }
  .primary-nav__chevron-icon {
    display: inline-block;
    font-size: 1.1rem;
    transition: transform .2s ease-out;
  }
  .primary-nav__expand[aria-expanded="true"] .primary-nav__chevron-icon {
    transform: rotate(180deg);
  }

  /* Submenüs auf Mobile standardmäßig geschlossen — Akkordeon */
  .submenu {
    flex: 1 1 100%;
    position: static;
    box-shadow: none;
    border: none;
    padding: 0;
    min-width: 0;
    display: none;
  }
  .submenu.open { display: block; }
  .submenu::before { display: none; }
  .submenu > ul, .submenu--wide > ul {
    min-width: 0; max-width: none;
    column-count: 1; column-rule: none;
    border: none; box-shadow: none; background: transparent;
    padding: .5rem 0 .5rem 1rem;
    border-left: 3px solid var(--c-accent-soft);
    margin-left: .5rem;
  }
  .submenu > ul::before { display: none; }
  .submenu a { padding: .65rem .75rem; min-height: 44px; }

  .utility-nav { display: none; }
  .search input { width: 160px; }
  .search { order: 2; }
  .brand__name { font-size: 1.2rem; }
  .brand__eyebrow { font-size: .65rem; }
}
@media (max-width: 640px) {
  .site-header__inner { gap: .75rem; flex-wrap: wrap; }
  .search { width: 100%; order: 99; }
  .search input { width: 100%; }
  /* Touch-Targets in Inhalts-Listen vergrößern */
  .toc a { padding: .65rem .8rem; min-height: 44px; display: flex; align-items: center; }
  .file-list a { display: inline-block; min-height: 44px; padding: .35rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration: .001ms !important; transition: none !important; }
}
