/* ==================================================================
   S’Wolferl – Basis-Styles (Platzhalter, bis Marens Styling vorliegt)
   Alle Farben, Schriften und Abstände stehen als Design-Tokens in
   :root – Marens Vorlage ändert nur diese Werte, keine Struktur.
   ================================================================== */

/* Eigene Schriften (liegen in src/fonts, werden mit ausgespielt) */
@font-face {
  font-family: "CoreCircus";
  src: url("/fonts/CoreCircus.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "ACaslonPro";
  src: url("/fonts/ACaslonPro-Regular.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Farben */
  --farbe-hintergrund: #ffffff;
  --farbe-text: #2e2a25;
  --farbe-akzent: #063FB8;   /* Wolferl-Blau */
  --farbe-dezent: #7a736a;
  --farbe-linie: #e5ded3;
  --farbe-karte: #F1E8DC;   /* zweite Farbe: helles Holz */

  /* Schriften: Überschriften in CoreCircus, Fließtext serifenlos */
  --font-kopf: "CoreCircus", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-text: "ACaslonPro", Georgia, "Times New Roman", serif;

  /* Layout */
  --breite-inhalt: 60rem;
  --abstand: 1.5rem;
  --radius: 6px;

  /* Schriftgrößen (gemessen vom Notion-Original) */
  --schriftgroesse: 1.5rem;      /* Basisschrift 18pt (= 24px) */
  --schrift-h1: 2.5rem;        /* Titel       40px/700 */
  --schrift-h2: 1.875rem;      /* Heading 1   30px/600 */
  --schrift-h3: 1.25rem;       /* Unterüberschriften (ehem. H4) 20px */
  --schrift-h4: 1.25rem;       /* Heading 3   20px/600 */
  --schrift-caption: 1rem;      /* Bildtext    16px     */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--farbe-hintergrund);
  color: var(--farbe-text);
  font-family: var(--font-text);
  font-size: var(--schriftgroesse);
  line-height: 1.5;
  padding-top: 5.5rem; /* fixierter Kopfbalken */
}

html { scroll-behavior: smooth; }

/* ---------- Fixierter Kopfbalken (Marke links, Logo + Hamburger rechts) ---------- */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 5.5rem;
  padding: 0 1.5rem;
  background: var(--farbe-hintergrund);
  border-bottom: 1px solid var(--farbe-linie);
}
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.site-brand {
  margin: 0;
  font-family: var(--font-kopf);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--farbe-text);
  letter-spacing: 0.01em;
  text-decoration: none;
}
.logo-link {
  display: inline-flex;
  line-height: 0;
}
.site-logo {
  height: 4.0625rem; /* 25% groesser als 3.25rem */
  width: auto;
  border-radius: 4px;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  background: none;
  border: 1px solid var(--farbe-linie);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: var(--farbe-text);
}

/* ---------- Kopf ---------- */
.site-header {
  max-width: var(--breite-inhalt);
  margin: 3rem auto 2rem;
  padding: 0 1.25rem;
}
.site-title {
  margin: 0;
  line-height: 1.2;
}

/* ---------- Inhalt ---------- */
.content {
  max-width: var(--breite-inhalt);
  margin: 0 auto 4rem;
  padding: 0 1.25rem;
}

h1, h2, h3, h4 {
  font-family: var(--font-kopf);
  margin-top: 2.5rem;
}
h1 { font-size: var(--schrift-h1); font-weight: 400; line-height: 1.2; }
h2 { font-size: var(--schrift-h2); font-weight: 400; line-height: 1.3; }
h3 { font-size: var(--schrift-h3); font-weight: 400; line-height: 1.3; }
h4 { font-size: var(--schrift-h4); font-weight: 400; line-height: 1.3; }

p { margin: 1rem 0; }

a { color: var(--farbe-akzent); }

/* ---------- Cover (Seitenkopf-Grafik, volle Breite) ---------- */
.cover {
  display: block;
  width: 100vw;
  max-width: none;
  margin: 0 0 1.5rem;
}

/* ---------- Abbildungen ---------- */
.figure { margin: 2rem 0; }
.figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}
.figure figcaption {
  margin-top: 0.5rem;
  font-size: var(--schrift-caption);
  color: var(--farbe-text); /* #2e2a25 */
}

/* ---------- Zitate ---------- */
blockquote {
  margin: 2rem 0 2rem 2rem; /* ganzer Zitatblock etwas nach rechts eingerückt */
  padding: 0.25rem 0 0.25rem 1.5rem;
  font-family: var(--font-text);
  font-style: italic;
  color: #8a6f55;
}
blockquote p { margin: 0.25rem 0; }
blockquote cite {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-kopf); /* Zitatquelle in CoreCircus */
  font-style: normal;
  font-size: 0.95rem;
  color: #8a6f55;
}

/* ---------- Spalten (aus Notion-Spaltenblöcken) ---------- */
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--abstand);
  margin: 2rem 0;
}
@media (max-width: 40rem) {
  .columns { grid-template-columns: 1fr; }
}

/* ---------- Kapitel-Kicker (kleine Kapitelmarkierung über der Überschrift) ---------- */
.chapter-kicker {
  margin: 0 0 1rem; /* gleicher Abstand zur H2 wie H2 zum Folgeabsatz */
  padding-top: 7rem; /* großer Abstand nach oben (zum vorherigen Kapitel) */
  font-family: var(--font-kopf); /* CoreCircus */
  font-size: var(--schrift-h3); /* so groß wie die H3 (20px) */
  font-weight: 400; /* CoreCircus hat kein Bold – kein Synthetik-Fett */
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8a6f55; /* Kicker in warmem Holzton */
}

/* ---------- Fakten-Karten (Projektdaten im Überblick) ---------- */
.fakten {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.fakt {
  margin: 0;
  padding: 1rem 1.1rem;
  background: var(--farbe-karte);
  font-family: var(--font-kopf); /* CoreCircus */
  font-size: 1rem; /* 16px */
}
.fakt dt {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--farbe-dezent);
}
.fakt dd {
  margin: 0.35rem 0 0;
  line-height: 1.4;
}
.fakt-text {
  font-family: var(--font-text); /* ACaslonPro – Werte im neuen Format */
  font-size: 1.125rem; /* 18px */
  font-weight: normal;
}

/* ---------- Kapitelnavigation (Desktop: unter dem Logo rechts; Mobil: Hamburger-Dropdown) ---------- */
.chapter-nav {
  counter-reset: kapitel;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 14rem;
}
.chapter-nav a {
  padding: 0.25rem 0.75rem 0.25rem 0;
  border-right: 2px solid var(--farbe-linie);
  color: var(--farbe-dezent);
  font-size: 0.9rem;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.chapter-nav a:hover { color: var(--farbe-text); }
.chapter-nav a::before {
  counter-increment: kapitel;
  content: counter(kapitel, decimal-leading-zero);
  margin-right: 0.4rem;
  font-size: 0.8em;
  color: var(--farbe-linie);
  transition: color 0.2s ease;
}
.chapter-nav a:hover::before { color: var(--farbe-dezent); }
.chapter-nav a.active {
  color: var(--farbe-text);
  border-right-color: var(--farbe-akzent);
}
.chapter-nav a.active::before { color: var(--farbe-akzent); }

/* Desktop: vertikal, fixiert unter dem fixierten Kopfbalken */
@media (min-width: 80rem) {
  .chapter-nav {
    position: fixed;
    top: 6.75rem; /* unter dem Kopfbalken (5.5rem + Abstand) */
    right: 1.5rem;
    text-align: right;
    z-index: 10;
  }
  body { padding-right: 18rem; }
}

/* Mobil: Hamburger im fixierten Kopfbalken, Kapitelliste als Dropdown darunter */
@media (max-width: 80rem) {
  .nav-toggle { display: flex; }
  .chapter-nav {
    display: none;
    position: fixed;
    top: 5.5rem; /* direkt unter dem Kopfbalken */
    left: 0;
    right: 0;
    z-index: 19;
    flex-direction: column;
    gap: 0;
    max-width: none;
    background: var(--farbe-hintergrund);
    border-bottom: 1px solid var(--farbe-linie);
    padding: 0.5rem 1rem 1rem;
  }
  .chapter-nav.open { display: flex; }
  .chapter-nav a {
    white-space: normal;
    padding: 0.75rem 0.5rem;
    border-right: none;
    border-bottom: 1px solid var(--farbe-linie);
  }
  .chapter-nav a:last-child { border-bottom: none; }
  .chapter-nav a.active {
    border-bottom-color: var(--farbe-akzent);
  }
}

/* ---------- Kapitel (One-Pager, sanftes Einblenden) ---------- */
.chapter {
  scroll-margin-top: 6rem; /* Sprungziel unter dem fixierten Kopfbalken */
}
.chapter h2 {
  margin-top: 0;
  margin-bottom: 0; /* Abstand zum Text steuert allein der Paragraph (1rem) */
  padding-top: 0; /* Abstand nach oben liegt beim Chapter-Kicker */
  color: var(--farbe-akzent); /* Highlight-Aussagen farblich abgesetzt */
}
.chapter h3 { padding-top: 3rem; } /* Unterabschnitte innerhalb der Kapitel */
html.js .chapter {
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
html.js .chapter.visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html.js .chapter { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Trenner ---------- */
hr {
  border: none;
  border-top: 1px solid var(--farbe-linie);
  max-width: 6rem;
  margin: 3rem auto;
}

/* ---------- Fuß ---------- */
.site-footer {
  max-width: var(--breite-inhalt);
  margin: 0 auto 3rem;
  padding: 1rem 1.25rem 0;
  border-top: 1px solid var(--farbe-linie);
  color: var(--farbe-dezent);
  font-size: 0.9rem;
}
