/* PagePurr – Leseheft. Farben und Schriften aus der App (Assets.xcassets, AppFonts.swift).
   Schriften liegen lokal: keine Anfrage an fremde Server.
   Proportionen nach Figma-Review 01.11.2026 (figma-review.md): eine Achse für Kopf, Inhalt und Fuß;
   ab 52rem eine Randspalte links (Variante A), ab 64rem breiter (Variante B). Raster: halbe Zeile. */

@font-face { font-family: "Newsreader"; src: url("fonts/Newsreader-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/Newsreader-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/Manrope-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/Manrope-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root {
  color-scheme: light dark;
  --bg: #F7F8F2;
  --surface: #FFFFFF;
  --text: #20352B;
  --text-2: #617064;
  --border: #D9E1D5;
  --accent: #244B3B;
  --on-accent: #F7F8F2;
  --ribbon: #244B3B;

  --serif: "Newsreader", "New York", Georgia, serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --measure: 36rem;     /* Textspalte */
  --margin-col: 6rem;   /* Randspalte (ab 52rem) */
  --col-gap: 2rem;
  --page: 36rem;        /* Achse für Kopf, Inhalt und Fuß; ab 52rem = Randspalte + Abstand + Text */
  --gutter: 1.25rem;
  --radius: 0.75rem;
}
@media (min-width: 52rem) { :root { --page: 44rem; --gutter: 1.5rem; } }
@media (min-width: 64rem) { :root { --page: 60rem; --margin-col: 13rem; --col-gap: 3rem; --measure: 44rem; } }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151E19;
    --surface: #1E2B23;
    --text: #F4F3EB;
    --text-2: #A9B8AE;
    --border: #435247;
    --accent: #B2CBB3;
    --on-accent: #151E19;
    --ribbon: #6F9A7E;
  }
}
:root[data-theme="dark"] {
  --bg: #151E19; --surface: #1E2B23; --text: #F4F3EB; --text-2: #A9B8AE;
  --border: #435247; --accent: #B2CBB3; --on-accent: #151E19; --ribbon: #6F9A7E;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.75rem;
  overflow-wrap: break-word;
  hyphens: auto;
}
@media (min-width: 64rem) { body { font-size: 1.125rem; line-height: 1.875rem; } }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: var(--gutter); top: -4rem;
  background: var(--accent); color: var(--on-accent);
  padding: 0.6rem 1rem; border-radius: 0.5rem; z-index: 10;
}
.skip:focus { top: 0.75rem; }

/* Kopf: Marke links, Navigation rechts, „English“ am Ende. Das Lesezeichenband hängt von der Oberkante. */
.site-header { border-bottom: 1px solid var(--border); }
.site-header .inner {
  max-width: calc(var(--page) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0 1.5rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.625rem;
  padding: 1.3125rem 0 0.8125rem;
  font-family: var(--serif); font-size: 1.25rem; font-weight: 500; line-height: 1;
  color: var(--text); text-decoration: none;
}
.brand img { width: 1.75rem; height: 1.75rem; border-radius: 0.4375rem; }

.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; }
.lang {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 0.25rem;
  color: var(--text-2); font-size: 0.9375rem; font-weight: 600; text-decoration: none;
}
.lang:hover { color: var(--text); }
@media (max-width: 40rem) { .brand-row { width: 100%; } }
@media (min-width: 40.01rem) {
  .site-header .inner { gap: 0; }
  .brand-row { display: contents; }
  .site-header nav { order: 2; margin-left: auto; }
  .lang {
    order: 3; align-self: flex-end; min-height: 0;
    margin: 0 0 1rem 0.5rem; padding: 0 0 0 0.75rem;
    border-left: 1px solid var(--border);
    font-weight: 400; line-height: 1.125rem;
  }
}

.nav { display: flex; flex-wrap: wrap; gap: 0 0.25rem; margin: 0; padding: 0; list-style: none; }
.nav li { margin: 0; }
.nav a {
  position: relative; display: block;
  min-height: 2.75rem; padding: 1.625rem 0.625rem 1rem;
  color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 0.9375rem; line-height: 1.2;
}
.nav a:hover { color: var(--text); }
@media (max-width: 40rem) {
  .site-header nav, .nav { width: 100%; }
  .nav { justify-content: space-between; flex-wrap: nowrap; margin: 0 -0.45rem; width: calc(100% + 0.9rem); }
  .nav a { padding: 1.375rem 0.45rem 0.875rem; }
  .brand { padding-bottom: 0.375rem; }
}
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 50%;
  width: 0.625rem; height: 1.125rem; margin-left: -0.3125rem;
  background: var(--ribbon);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
}
@media (min-width: 64rem) {
  .brand { font-size: 1.375rem; padding: 1.375rem 0 0.875rem; }
  .brand img { width: 2rem; height: 2rem; border-radius: 0.5rem; }
  .nav a { font-size: 1rem; padding: 1.75rem 0.75rem 1.0625rem; }
  .nav a[aria-current="page"]::before { width: 0.6875rem; height: 1.25rem; margin-left: -0.34375rem; }
  .lang { font-size: 1rem; margin-bottom: 1.0625rem; }
}

/* Die Buchseite: ab 52rem Randspalte links, Text rechts */
main {
  position: relative;
  max-width: calc(var(--page) + 2 * var(--gutter)); margin: 0 auto;
  padding: 2.625rem var(--gutter) 4.375rem;
  counter-reset: kapitel;
}
@media (min-width: 52rem) {
  main { padding: 5.25rem var(--gutter) 7rem calc(var(--gutter) + var(--margin-col) + var(--col-gap)); }
}
@media (min-width: 64rem) { main { padding-top: 5.625rem; padding-bottom: 7.5rem; } }

h1 {
  margin: 0 0 0.875rem;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.25rem, 1.2rem + 3.6vw, 3.25rem); line-height: calc(1em + 0.25rem);
  letter-spacing: -0.01em; hyphens: manual;
}
.lead {
  margin: 0 0 0.875rem; color: var(--text);
  font-family: var(--serif); font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.3125rem); line-height: 1.75rem;
}
@media (min-width: 52rem) { .lead { line-height: 2rem; } }
.meta { margin: 0 0 3.5rem; color: var(--text-2); font-size: 0.875rem; line-height: 1.25rem; }

h2 {
  position: relative; margin: 3.5rem 0 0.875rem;
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 1.75rem); line-height: calc(1em + 0.375rem); hyphens: manual;
}
.kapitel h2 { counter-increment: kapitel; }
.kapitel h2::before {
  content: counter(kapitel);
  display: inline-block; min-width: 1.25em;
  font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--text-2);
}
@media (min-width: 52rem) {
  .kapitel h2::before {
    position: absolute; right: 100%; width: var(--margin-col); min-width: 0;
    margin-right: var(--col-gap); text-align: right;
  }
}
h3 { margin: 1.75rem 0 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.75rem; }

p, ul, ol { margin: 0 0 0.875rem; }
ul, ol { padding-left: 1.25rem; }
li { margin-bottom: 0.4375rem; }
li::marker { color: var(--text-2); }
strong { font-weight: 600; }

@media (min-width: 64rem) {
  h1 { font-size: 3.75rem; line-height: 4rem; margin-bottom: 0.9375rem; }
  .lead { font-size: 1.4375rem; line-height: 2.125rem; margin-bottom: 0.9375rem; }
  .meta { margin-bottom: 3.75rem; }
  h2 { font-size: 1.875rem; line-height: 2.25rem; margin: 3.75rem 0 0.9375rem; }
  h3 { font-size: 1.125rem; line-height: 1.875rem; margin-top: 1.875rem; }
  p, ul, ol { margin-bottom: 0.9375rem; }
  li { margin-bottom: 0.46875rem; }
}

.note {
  margin: 1.5rem 0; padding: 1rem 1.15rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.note p:last-child { margin-bottom: 0; }

address { font-style: normal; }

/* Inhalt der Datenschutzseite: keine Karte, nur Haarlinien; ab 64rem mitlaufend in der Randspalte */
.note.contents {
  position: relative; margin: 0 0 3.5rem; padding: 0.875rem 0;
  background: none; border: 0; border-block: 1px solid var(--border); border-radius: 0;
  font-size: 0.9375rem; line-height: 1.5rem;
}
.contents .contents-label {
  margin: 0 0 0.375rem; color: var(--text-2);
  font-family: var(--serif); font-style: italic; font-size: 1.0625rem;
}
.contents ol { margin: 0; padding-left: 1.5rem; columns: 2 14rem; column-gap: 2rem; }
.contents li { break-inside: avoid; margin-bottom: 0; }
.contents li::marker { font-family: var(--serif); font-style: italic; }
h2[id] { scroll-margin-top: 1.5rem; }
@media (min-width: 52rem) {
  .contents .contents-label {
    position: absolute; right: 100%; top: 0.875rem; width: var(--margin-col);
    margin: 0 var(--col-gap) 0 0; text-align: right;
  }
}
@media (min-width: 64rem) {
  main.kapitel {
    display: grid; grid-template-columns: var(--margin-col) var(--measure); column-gap: var(--col-gap);
    align-items: start; padding-left: var(--gutter);
  }
  main.kapitel > * { grid-column: 2; }
  /* Im Raster fallen Abstände nicht zusammen: die Abstände nach oben sind um den Absatzabstand kleiner. */
  main.kapitel > .meta { margin-bottom: 0.9375rem; }
  main.kapitel > h2 { margin-top: 2.8125rem; }
  main.kapitel > h3 { margin-top: 0.9375rem; }
  main.kapitel > .contents {
    grid-column: 1; grid-row: 4 / span 100;
    position: sticky; top: 1.5rem; width: 9.375rem;
    margin: 3.1875rem 0 0; padding: 0; border: 0;
    font-size: 0.875rem; line-height: 1.25rem;
  }
  main.kapitel > .contents .contents-label { position: static; width: auto; margin: 0 0 0.5rem; text-align: left; }
  main.kapitel > .contents ol { columns: auto; padding-left: 1.375rem; }
  main.kapitel > .contents li { margin-bottom: 0.125rem; }
  main.kapitel > .contents { hyphens: manual; }
  main.kapitel > .contents a { color: var(--text-2); text-decoration: none; }
  main.kapitel > .contents a:hover { color: var(--text); text-decoration: underline; }
}

/* Inhaltsverzeichnis der Startseite */
.toc { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.toc li { position: relative; margin: 0; border-bottom: 1px solid var(--border); }
.toc a {
  display: flex; align-items: baseline; gap: 0.75rem;
  min-height: 3.5rem; padding: 0.875rem 0;
  color: var(--text); text-decoration: none;
}
.toc .num { font-family: var(--serif); font-style: italic; color: var(--text-2); min-width: 1.25rem; }
.toc .title { font-family: var(--serif); font-size: 1.375rem; line-height: 1.75rem; }
.toc .leader { flex: 1; border-bottom: 1px dotted var(--text-2); transform: translateY(-0.3em); opacity: 0.6; min-width: 1rem; }
.toc .hint { color: var(--text-2); font-size: 0.9375rem; white-space: nowrap; }
.toc a:hover .title { text-decoration: underline; text-underline-offset: 0.18em; }
@media (max-width: 30rem) { .toc .hint { display: none; } }
@media (min-width: 52rem) {
  .toc .num {
    position: absolute; right: 100%; top: 0.875rem; width: var(--margin-col); min-width: 0;
    margin-right: var(--col-gap); text-align: right; font-size: 1.375rem; line-height: 1.75rem;
  }
}
@media (min-width: 64rem) {
  .toc a { min-height: 3.75rem; padding: 0.9375rem 0; }
  .toc .title, .toc .num { font-size: 1.5rem; line-height: 1.875rem; }
  .toc .num { top: 0.9375rem; }
}

/* Startseiten-Icon: auf dem Handy über der H1, ab 52rem in der Randspalte */
.hero-icon { width: 3.5rem; height: 3.5rem; border-radius: 0.8rem; margin: 0 0 1.75rem; display: block;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 8px 24px -12px rgb(0 0 0 / 0.25); }
@media (min-width: 52rem) {
  .hero-icon { position: absolute; left: calc(var(--gutter) + var(--margin-col) - 4.5rem); top: 5.25rem;
    width: 4.5rem; height: 4.5rem; border-radius: 1rem; margin: 0; }
}
@media (min-width: 64rem) {
  .hero-icon { left: calc(var(--gutter) + var(--margin-col) - 6rem); top: 5.625rem;
    width: 6rem; height: 6rem; border-radius: 1.3rem; }
}

/* Fragen auf der Support-Seite */
details { border-bottom: 1px solid var(--border); }
details:first-of-type { border-top: 1px solid var(--border); }
summary {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  min-height: 3.5rem; padding: 0.875rem 0; cursor: pointer; list-style: none;
  font-weight: 600;
}
@media (min-width: 64rem) { summary { min-height: 3.75rem; padding: 0.9375rem 0; } }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--serif); font-size: 1.5rem; line-height: 1; color: var(--text-2); }
details[open] summary::after { content: "–"; }
details > :not(summary) { margin-top: 0; }
details > :last-child { padding-bottom: 0.875rem; }

.button {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.5rem 1.125rem;
  background: var(--accent); color: var(--on-accent); border-radius: 0.5rem;
  font-weight: 600; text-decoration: none;
}
.button:hover { filter: brightness(1.08); }

.site-footer { border-top: 1px solid var(--border); color: var(--text-2); font-size: 0.875rem; line-height: 1.25rem; }
.site-footer .inner {
  max-width: calc(var(--page) + 2 * var(--gutter)); margin: 0 auto; padding: 1.75rem var(--gutter) 2.625rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem;
}
@media (min-width: 64rem) { .site-footer .inner { padding: 1.875rem var(--gutter) 2.8125rem; } }
.site-footer a { color: var(--text-2); }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0 1rem; margin: 0; padding: 0; list-style: none; }

@media print {
  .site-header .nav, .skip, .site-footer ul { display: none; }
  body { background: #fff; color: #000; }
}
