/* ==========================================================================
   legasthenie.eu - Basis-Stylesheet
   Nachschlagewerk, Leseseite. EOEDL-Designwelt: #1874cd, Nunito.
   Aufbau: Tokens, Grundlagen, Kopf, Layout, Inhalt, Bausteine, Fuss, Print.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  --blue:        #1874cd;
  --blue-dark:   #12559a;
  --blue-tint:   #eaf3fc;
  --blue-line:   #bcd8f4;

  --amber:       #a2610f;
  --amber-tint:  #fdf4e6;
  --amber-line:  #f0d9b0;

  --ink:         #1b232e;
  --ink-soft:    #4c5766;
  --ink-faint:   #79838f;

  --line:        #e3e8ee;
  --bg:          #ffffff;
  --bg-soft:     #f6f8fb;

  --measure:     68ch;
  --radius:      8px;
  --shadow:      0 1px 3px rgba(20,35,55,.06), 0 8px 24px rgba(20,35,55,.05);

  --step--1: clamp(.86rem, .84rem + .1vw, .92rem);
  --step-0:  clamp(1.06rem, 1.02rem + .18vw, 1.19rem);
  --step-1:  clamp(1.22rem, 1.14rem + .34vw, 1.42rem);
  --step-2:  clamp(1.42rem, 1.28rem + .6vw, 1.78rem);
  --step-3:  clamp(1.72rem, 1.44rem + 1.2vw, 2.5rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--step-0);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-weight: 800; line-height: 1.2; letter-spacing: -.011em; color: var(--ink); }
h1 { font-size: var(--step-3); margin: 0 0 .5rem; letter-spacing: -.021em; }
h2 { font-size: var(--step-2); margin: 3rem 0 .85rem; scroll-margin-top: 1.5rem; }
h3 { font-size: var(--step-1); margin: 2rem 0 .6rem; font-weight: 700; }
p  { margin: 0 0 1.15rem; }

a { color: var(--blue-dark); text-decoration: underline; text-underline-offset: .16em; text-decoration-thickness: .07em; }
a:hover { color: var(--blue); text-decoration-thickness: .13em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 3px; }

strong, b { font-weight: 700; }
ul, ol { margin: 0 0 1.15rem; padding-left: 1.35rem; }
li { margin-bottom: .42rem; }
li::marker { color: var(--blue); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--blue); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 var(--radius) 0;
  font-weight: 700; text-decoration: none;
}
.skip:focus { left: 0; }

.wrap { width: min(100% - 2.4rem, 1180px); margin-inline: auto; }

/* --- Kopf --------------------------------------------------------------- */
.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(1.6) blur(6px);
  background: rgba(255,255,255,.92);
}
.site-head__in { display: flex; align-items: baseline; gap: .8rem; padding: .85rem 0; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.14rem; color: var(--blue); text-decoration: none; letter-spacing: -.02em; }
.brand:hover { color: var(--blue-dark); }
.brand__claim { color: var(--ink-faint); font-size: var(--step--1); font-weight: 600; }

/* --- Layout ------------------------------------------------------------- */
.page { padding: 2.6rem 0 4rem; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.8rem; }
/* Lesereihenfolge auf schmalen Schirmen: Titel, dann Inhaltsverzeichnis, dann Text. */
.lead  { order: 1; }
.layout__aside { order: 2; }
.prose { order: 3; }
@media (min-width: 62rem) {
  .layout { grid-template-columns: minmax(0, 1fr) 16.5rem; gap: 1.8rem 3.4rem; align-items: start; }
  .lead   { grid-column: 1; grid-row: 1; }
  .prose  { grid-column: 1; grid-row: 2; }
  .layout__aside { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 5.2rem; align-self: start; }
}
.lead, .prose { max-width: var(--measure); min-width: 0; }

/* --- Titelbereich ------------------------------------------------------- */
.eyebrow {
  display: inline-block; font-size: var(--step--1); font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; color: var(--blue); margin-bottom: .7rem;
}
.lede { font-size: var(--step-1); line-height: 1.55; color: var(--ink-soft); max-width: 60ch; margin-bottom: 1.8rem; }
.meta-line { font-size: var(--step--1); color: var(--ink-faint); margin: 0 0 2.2rem; }

/* --- Bausteine ---------------------------------------------------------- */

/* Antwortkasten: die zitierfaehige Kurzantwort */
.answer {
  background: var(--blue-tint);
  border: 1px solid var(--blue-line);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin: 0 0 2rem;
}
.answer__label {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: var(--step--1); font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--blue-dark); margin-bottom: .6rem;
}
.answer__label::before {
  content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: var(--blue);
}
.answer p { margin: 0; font-size: var(--step-1); line-height: 1.55; }
.answer p + p { margin-top: .8rem; font-size: var(--step-0); color: var(--ink-soft); }

/* Faktenkasten */
.facts { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.5rem; margin: 0 0 2.4rem; background: var(--bg-soft); }
.facts h2 { font-size: var(--step-0); margin: 0 0 .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); font-weight: 800; }
.facts ul { list-style: none; padding: 0; margin: 0; }
.facts li { position: relative; padding-left: 1.2rem; margin-bottom: .55rem; }
.facts li::before { content: ""; position: absolute; left: 0; top: .62rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--blue); }
.facts li:last-child { margin-bottom: 0; }

/* Definition, der visuelle Anker der Seite */
.definition {
  margin: 2rem 0 2.4rem; padding: 1.6rem 1.7rem;
  background: #fff; border: 1px solid var(--blue-line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.definition blockquote { margin: 0; font-size: var(--step-1); line-height: 1.55; color: var(--ink); }
.definition blockquote p:last-child { margin-bottom: 0; }
.definition cite { display: block; margin-top: .9rem; font-style: normal; font-size: var(--step--1); color: var(--ink-faint); font-weight: 600; }

/* Hervorgehobener Praxisblock */
.callout {
  background: var(--amber-tint); border: 1px solid var(--amber-line);
  border-radius: var(--radius); padding: 1.3rem 1.5rem; margin: 1.8rem 0 2rem;
}
.callout h3 { margin-top: 0; color: var(--amber); }
.callout :last-child { margin-bottom: 0; }

/* Tabellen */
.table-scroll { overflow-x: auto; margin: 1.5rem 0 2rem; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .96rem; background: #fff; }
caption { caption-side: bottom; text-align: left; padding: .7rem .9rem 0; font-size: var(--step--1); color: var(--ink-faint); }
th, td { padding: .72rem .95rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--bg-soft); font-weight: 800; font-size: .9rem; letter-spacing: .01em; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Inhaltsverzeichnis */
.toc { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; background: var(--bg-soft); }
.toc__title {
  font-size: var(--step--1); font-weight: 800; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-soft); margin: 0 0 .7rem; list-style: none; cursor: pointer; position: relative;
}
.toc__title::-webkit-details-marker { display: none; }
.toc__title::after {
  content: "+"; position: absolute; right: 0; top: -.24rem; font-size: 1.3rem; font-weight: 400;
  color: var(--blue); line-height: 1;
}
.toc[open] .toc__title::after { content: "\2212"; }
.toc[open] .toc__title { margin-bottom: .7rem; }
.toc:not([open]) .toc__title { margin-bottom: 0; }
@media (min-width: 62rem) {
  .toc__title { cursor: default; pointer-events: none; }
  .toc__title::after { display: none; }
}
.toc__list { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc__list li { margin-bottom: .42rem; line-height: 1.4; }
.toc__list a { color: var(--ink-soft); text-decoration: none; font-size: .93rem; font-weight: 600; display: block; padding-left: .8rem; border-left: 2px solid var(--line); }
.toc__list a:hover { color: var(--blue-dark); border-left-color: var(--blue); }
.toc__list a[aria-current="true"] { color: var(--blue-dark); border-left-color: var(--blue); }
@media (max-width: 61.99rem) {
  .toc { background: #fff; }
}

/* FAQ */
.faq { margin: 1.4rem 0 2rem; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; padding: .95rem 2rem .95rem 0; font-weight: 700; list-style: none;
  position: relative; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: .3rem; top: .78rem;
  font-size: 1.45rem; font-weight: 400; color: var(--blue); line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { color: var(--blue-dark); }
.faq .faq__a { padding: 0 0 1.1rem; color: var(--ink-soft); }
.faq .faq__a :last-child { margin-bottom: 0; }

/* Autorinnen */
.authors { margin: 3rem 0 0; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); }
.authors h2 { margin-top: 0; font-size: var(--step-1); }
.authors dl { margin: 0; }
.authors dt { font-weight: 800; margin-top: .9rem; }
.authors dd { margin: .1rem 0 0; color: var(--ink-soft); font-size: .97rem; }

/* Quellen */
.sources { margin-top: 2.5rem; font-size: .95rem; }
.sources ol { padding-left: 1.3rem; }
.sources li { color: var(--ink-soft); margin-bottom: .6rem; }

/* Weiterfuehrende Links */
.next-steps { display: grid; gap: .9rem; margin: 1.4rem 0 0; padding: 0; list-style: none; }
@media (min-width: 40rem) { .next-steps { grid-template-columns: 1fr 1fr; } }
.next-steps a {
  display: block; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); background: #fff; height: 100%;
}
.next-steps a:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.next-steps b { display: block; color: var(--blue-dark); margin-bottom: .15rem; }
.next-steps span { font-size: .93rem; color: var(--ink-soft); }

/* --- Fuss --------------------------------------------------------------- */
.site-foot { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 2.2rem 0; margin-top: 3rem; font-size: .93rem; color: var(--ink-soft); }
.site-foot__grid { display: grid; gap: 1.4rem; }
@media (min-width: 46rem) { .site-foot__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-foot h2 { font-size: .88rem; text-transform: uppercase; letter-spacing: .07em; margin: 0 0 .55rem; color: var(--ink); }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin-bottom: .35rem; }
.site-foot__legal { margin-top: 1.8rem; padding-top: 1.1rem; border-top: 1px solid var(--line); font-size: .86rem; color: var(--ink-faint); }

/* --- Druck -------------------------------------------------------------- */
@media print {
  .site-head, .layout__aside, .next-steps, .skip { display: none !important; }
  body { font-size: 11pt; line-height: 1.5; color: #000; }
  .layout { display: block; }
  .prose { max-width: none; }
  a { color: #000; text-decoration: underline; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #444; word-break: break-all; }
  .answer, .definition, .callout, .facts { border: 1pt solid #999; background: none; }
  .faq details { display: block; }
  .faq .faq__a { display: block !important; }
  h2, h3 { break-after: avoid; }
  table { break-inside: avoid; }
}
