/* ==========================================================================
   Andreas-Schule Bestwig – Stylesheet des Relaunch-Prototyps
   Ein einziges Stylesheet, keine externen Abhängigkeiten, keine Webfonts.
   Aufbau: 1 Design-Tokens · 2 Basis · 3 Layout · 4 Kopf & Navigation
           5 Komponenten · 6 Fuß · 7 Utilities · 8 Barrierefreiheit & Druck
   ========================================================================== */

/* ---------------------------------------------------- 1 Design-Tokens ---- */
:root {
  /* Farben – abgeleitet aus dem Schullogo (#143886) */
  --blau-900: #0d2454;
  --blau-800: #143886;
  --blau-700: #1c4bab;
  --blau-100: #e8eefb;
  --blau-050: #f4f7fd;

  --gruen-700: #2f6d42;
  --gruen-100: #e4f1e7;

  /* Akzentfarbe: dunkel genug für weiße Schrift (Kontrast 5,8:1) */
  --orange-900: #8a3b09;
  --orange-700: #a8480d;
  --orange-500: #d9670f;   /* nur als Rand-/Flächenakzent, nie mit weißer Schrift */
  --orange-100: #fdefe2;

  --grau-900: #17191d;
  --grau-700: #454b55;
  --grau-500: #6b727d;
  --grau-300: #ccd1d9;
  --grau-200: #e3e6eb;
  --grau-100: #f2f4f7;
  --weiss: #ffffff;

  --fokus: #b4530a;

  /* Typografie – Systemschriften, kein externer Ladevorgang */
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
             Arial, "Noto Sans", sans-serif;
  --schrift-titel: "Segoe UI Semibold", system-ui, -apple-system, "Segoe UI",
                   Roboto, Arial, sans-serif;

  /* Maße */
  --breite: 1180px;
  --breite-text: 68ch;
  --radius: 12px;
  --radius-gross: 20px;
  --abstand: clamp(1rem, 0.6rem + 1.6vw, 2rem);

  --schatten-1: 0 1px 2px rgba(13, 36, 84, .06), 0 2px 8px rgba(13, 36, 84, .06);
  --schatten-2: 0 2px 6px rgba(13, 36, 84, .08), 0 12px 28px rgba(13, 36, 84, .10);
}

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

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

body {
  margin: 0;
  font-family: var(--schrift);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  color: var(--grau-900);
  background: var(--weiss);
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  font-family: var(--schrift-titel);
  line-height: 1.2;
  color: var(--blau-900);
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(1.9rem, 1.4rem + 2.2vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.45rem, 1.2rem + 1.1vw, 2rem); letter-spacing: -.01em; }
h3 { font-size: clamp(1.15rem, 1.05rem + .5vw, 1.375rem); }
h4 { font-size: 1.0625rem; }

p, ul, ol, dl, table { margin: 0 0 1.1em; }
p, li { max-width: var(--breite-text); }

a { color: var(--blau-700); text-underline-offset: .18em; }
a:hover { color: var(--blau-900); }

img { max-width: 100%; height: auto; display: block; }

hr { border: 0; border-top: 1px solid var(--grau-200); margin: 2.5rem 0; }

[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--fokus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ----------------------------------------------------------- 3 Layout ---- */
.wrap {
  width: min(100% - 2 * var(--abstand), var(--breite));
  margin-inline: auto;
}
.wrap--schmal { width: min(100% - 2 * var(--abstand), 860px); }

main { display: block; }

.abschnitt { padding-block: clamp(2.5rem, 1.5rem + 3vw, 4.5rem); }
.abschnitt--getoent { background: var(--blau-050); }
.abschnitt--grau { background: var(--grau-100); }

.raster {
  display: grid;
  gap: clamp(1rem, .6rem + 1.4vw, 1.75rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.raster--zwei { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }

.zweispalter {
  display: grid;
  gap: clamp(1.5rem, 1rem + 2vw, 3rem);
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 860px) { .zweispalter { grid-template-columns: 1fr; } }

/* --------------------------------------------- 4 Kopfbereich & Menü ------ */
.skiplink {
  position: absolute;
  left: 1rem; top: -5rem;
  z-index: 999;
  background: var(--blau-900);
  color: var(--weiss);
  padding: .75rem 1.25rem;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 600;
  transition: top .15s ease-in;
}
.skiplink:focus { top: 0; }

.servicebalken {
  background: var(--blau-900);
  color: var(--weiss);
  font-size: .875rem;
}
.servicebalken .wrap {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  align-items: center; justify-content: space-between;
  padding-block: .5rem;
}
.servicebalken a { color: var(--weiss); text-decoration-color: rgba(255,255,255,.45); }
.servicebalken a:hover { color: var(--weiss); text-decoration-color: var(--weiss); }
.servicebalken ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.servicebalken li { max-width: none; }

.kopf {
  position: sticky; top: 0; z-index: 100;
  background: var(--weiss);
  border-bottom: 1px solid var(--grau-200);
}
.kopf__innen {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .75rem;
}
.marke { display: flex; align-items: center; gap: .875rem; text-decoration: none; color: inherit; }
.marke img { width: 54px; height: auto; border-radius: 8px; }
.marke__name { font-family: var(--schrift-titel); font-weight: 700; font-size: 1.15rem; color: var(--blau-900); line-height: 1.15; }
.marke__zusatz { display: block; font-size: .8125rem; font-weight: 400; color: var(--grau-500); }

.menu-schalter {
  display: none;
  align-items: center; gap: .5rem;
  background: var(--blau-800); color: var(--weiss);
  border: 0; border-radius: var(--radius);
  padding: .7rem 1rem;
  font: inherit; font-weight: 600; font-size: .9375rem;
  cursor: pointer;
  min-height: 46px;
}
.menu-schalter__balken { display: inline-block; width: 20px; height: 2px; background: currentColor; position: relative; }
.menu-schalter__balken::before,
.menu-schalter__balken::after { content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: currentColor; }
.menu-schalter__balken::before { top: -6px; }
.menu-schalter__balken::after  { top: 6px; }
.menu-schalter[aria-expanded="true"] .menu-schalter__balken { background: transparent; }
.menu-schalter[aria-expanded="true"] .menu-schalter__balken::before { top: 0; transform: rotate(45deg); }
.menu-schalter[aria-expanded="true"] .menu-schalter__balken::after  { top: 0; transform: rotate(-45deg); }

.hauptmenu ul { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.hauptmenu li { max-width: none; }
.hauptmenu a {
  display: block;
  padding: .6rem .85rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  color: var(--grau-700);
  min-height: 44px;
  display: flex; align-items: center;
}
.hauptmenu a:hover { background: var(--blau-100); color: var(--blau-900); }
.hauptmenu a[aria-current="page"] {
  background: var(--blau-800); color: var(--weiss);
}

@media (max-width: 940px) {
  .kopf__innen { position: relative; flex-wrap: wrap; }
  .hauptmenu ul { flex-direction: column; gap: .125rem; }
  .hauptmenu a { padding: .85rem 1rem; font-size: 1.0625rem; }

  /* Ohne JavaScript bleibt das Menü als aufgeklappte Liste vollständig
     bedienbar. Erst wenn JavaScript aktiv ist (Klasse .js am html-Element),
     wird daraus ein einklappbares Menü mit Schaltfläche. */
  .hauptmenu { width: 100%; padding-bottom: .5rem; }

  .menu-schalter:not([hidden]) { display: inline-flex; }

  .js .hauptmenu {
    display: none;
    width: auto;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--weiss);
    border-bottom: 1px solid var(--grau-200);
    box-shadow: var(--schatten-2);
    padding: .75rem var(--abstand) 1.25rem;
  }
  .js .hauptmenu.offen { display: block; }
}

/* ------------------------------------------------------ 5 Komponenten ---- */

/* Bühne */
.buehne { position: relative; background: var(--blau-900); color: var(--weiss); overflow: hidden; }
.buehne__bild { position: absolute; inset: 0; }
.buehne__bild img { width: 100%; height: 100%; object-fit: cover; opacity: .3; }
.buehne__inhalt {
  position: relative;
  padding-block: clamp(3rem, 2rem + 5vw, 6rem);
}
.buehne h1 { color: var(--weiss); max-width: 18ch; }
.buehne__text { font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); max-width: 52ch; color: #e6ecf8; }
.buehne__marken { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.marker {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.3);
  color: var(--weiss);
  border-radius: 999px;
  padding: .3rem .85rem;
  font-size: .875rem; font-weight: 600;
}

/* Schaltflächen */
.knopf {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 700; text-decoration: none;
  border: 2px solid transparent;
  min-height: 48px;
  transition: background .15s, color .15s, border-color .15s;
}
.knopf--haupt { background: var(--orange-700); color: var(--weiss); }
.knopf--haupt:hover { background: var(--orange-900); color: var(--weiss); }
.knopf--zweit { background: var(--weiss); color: var(--blau-900); border-color: var(--weiss); }
.knopf--zweit:hover { background: transparent; color: var(--weiss); }
.knopf--linie { border-color: var(--blau-800); color: var(--blau-800); background: transparent; }
.knopf--linie:hover { background: var(--blau-800); color: var(--weiss); }
.knopf-reihe { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Schnellzugriff-Kacheln */
.schnellzugriff { margin-top: -2.25rem; position: relative; z-index: 2; }
.kachel {
  display: block;
  background: var(--weiss);
  border: 1px solid var(--grau-200);
  border-radius: var(--radius-gross);
  padding: 1.35rem 1.35rem 1.15rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--schatten-1);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  height: 100%;
}
.kachel:hover { transform: translateY(-3px); box-shadow: var(--schatten-2); border-color: var(--blau-700); color: inherit; }
.kachel__symbol {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--blau-100); color: var(--blau-800);
  display: grid; place-items: center; margin-bottom: .8rem;
}
.kachel__symbol svg { width: 24px; height: 24px; }
.kachel h3 { margin-bottom: .25rem; font-size: 1.0625rem; }
.kachel p { font-size: .9375rem; color: var(--grau-700); margin: 0; }

/* Karten */
.karte {
  background: var(--weiss);
  border: 1px solid var(--grau-200);
  border-radius: var(--radius-gross);
  padding: clamp(1.25rem, 1rem + 1vw, 2rem);
  box-shadow: var(--schatten-1);
}
.karte--getoent { background: var(--blau-050); border-color: var(--blau-100); box-shadow: none; }
.karte--hinweis { background: var(--orange-100); border-color: #f3d3b4; box-shadow: none; }
.karte > :last-child { margin-bottom: 0; }

/* Meldungen / Aktuelles */
.meldung {
  border-left: 4px solid var(--blau-700);
  padding: .25rem 0 .25rem 1.25rem;
  margin-bottom: 2rem;
}
.meldung:last-child { margin-bottom: 0; }
.meldung__datum {
  display: inline-block;
  font-size: .8125rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--grau-500);
  margin-bottom: .2rem;
}
.meldung h3 { margin-bottom: .4rem; }
.meldung p:last-child { margin-bottom: 0; }
.meldung--wichtig { border-left-color: var(--orange-500); }

/* Beschreibungslisten für Fakten */
.fakten { display: grid; gap: .1rem; margin: 0 0 1.25rem; }
.fakten div {
  display: grid; grid-template-columns: minmax(9rem, 13rem) 1fr; gap: .5rem 1rem;
  padding: .6rem 0; border-bottom: 1px solid var(--grau-200);
}
.fakten div:last-child { border-bottom: 0; }
.fakten dt { font-weight: 700; color: var(--blau-900); }
.fakten dd { margin: 0; }
@media (max-width: 560px) { .fakten div { grid-template-columns: 1fr; gap: .1rem; } }

/* Tabellen */
.tabellen-huelle { overflow-x: auto; margin-bottom: 1.25rem; }
table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: .9375rem; }
caption { text-align: left; font-weight: 700; color: var(--blau-900); padding-bottom: .6rem; }
th, td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--grau-200); vertical-align: top; }
thead th { background: var(--blau-800); color: var(--weiss); border-bottom: 0; }
thead th:first-child { border-top-left-radius: 8px; }
thead th:last-child { border-top-right-radius: 8px; }
tbody th { background: var(--blau-050); font-weight: 700; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }

/* Bilder */
figure { margin: 0 0 1.25rem; }
figure img { border-radius: var(--radius); }
figcaption { font-size: .875rem; color: var(--grau-500); padding-top: .5rem; }
.bild-rund { border-radius: var(--radius-gross); overflow: hidden; }

/* Kontaktkarte */
.kontaktkarte { background: var(--blau-900); color: var(--weiss); border-radius: var(--radius-gross); padding: clamp(1.5rem, 1rem + 1.5vw, 2.25rem); }
.kontaktkarte h2, .kontaktkarte h3 { color: var(--weiss); }
.kontaktkarte a { color: #cfe0ff; }
.kontaktkarte a:hover { color: var(--weiss); }
.kontaktkarte .fakten div { border-bottom-color: rgba(255,255,255,.18); }
.kontaktkarte .fakten dt { color: #cfe0ff; }

/* Aufzählungen mit Haken */
.liste-haken { list-style: none; padding: 0; }
.liste-haken li { position: relative; padding-left: 1.9rem; margin-bottom: .55rem; }
.liste-haken li::before {
  content: ""; position: absolute; left: 0; top: .45em;
  width: 1.1rem; height: .6rem;
  border-left: 3px solid var(--gruen-700); border-bottom: 3px solid var(--gruen-700);
  transform: rotate(-45deg);
}

/* Aufklappbare Bereiche */
details {
  border: 1px solid var(--grau-200);
  border-radius: var(--radius);
  margin-bottom: .6rem;
  background: var(--weiss);
}
details[open] { border-color: var(--blau-700); }
summary {
  cursor: pointer;
  padding: .95rem 1.1rem;
  font-weight: 700;
  color: var(--blau-900);
  min-height: 48px;
  display: flex; align-items: center;
  border-radius: var(--radius);
}
summary:hover { background: var(--blau-050); }
details > :not(summary) { padding-inline: 1.1rem; }
details > :last-child { padding-bottom: 1.1rem; }

/* Zielgruppen-Einstiege */
.einstieg {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--weiss); border: 1px solid var(--grau-200);
  border-left: 5px solid var(--orange-500);
  border-radius: var(--radius); padding: 1.15rem 1.25rem;
  text-decoration: none; color: inherit; height: 100%;
}
.einstieg:hover { background: var(--orange-100); color: inherit; }
.einstieg h3 { margin-bottom: .15rem; font-size: 1.0625rem; }
.einstieg p { margin: 0; font-size: .9375rem; color: var(--grau-700); }

/* Brotkrumen */
.brotkrumen { font-size: .875rem; padding-block: .9rem; color: var(--grau-500); }
.brotkrumen ol { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.brotkrumen li { max-width: none; }
.brotkrumen li + li::before { content: "›"; padding-right: .35rem; color: var(--grau-300); }

/* Downloads */
.download {
  display: flex; align-items: center; gap: .85rem;
  padding: .9rem 1.1rem;
  border: 1px solid var(--grau-200); border-radius: var(--radius);
  text-decoration: none; color: inherit; background: var(--weiss);
  margin-bottom: .6rem;
}
.download:hover { border-color: var(--blau-700); background: var(--blau-050); color: inherit; }
.download__typ {
  flex: none; font-size: .75rem; font-weight: 700; letter-spacing: .04em;
  background: var(--blau-800); color: var(--weiss);
  padding: .2rem .5rem; border-radius: 5px;
}
.download__name { font-weight: 600; }
.download__zusatz { display: block; font-size: .8125rem; color: var(--grau-500); font-weight: 400; }

/* ------------------------------------------------------------- 6 Fuß ---- */
.fuss { background: var(--grau-900); color: #d5d9e0; padding-block: 3rem 1.5rem; margin-top: 4rem; font-size: .9375rem; }
.fuss h2, .fuss h3 { color: var(--weiss); font-size: 1rem; margin-bottom: .7rem; }
.fuss a { color: #cfe0ff; }
.fuss a:hover { color: var(--weiss); }
.fuss ul { list-style: none; padding: 0; margin: 0; }
.fuss li { margin-bottom: .4rem; max-width: none; }
.fuss__unten {
  margin-top: 2.5rem; padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,.14);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
  font-size: .875rem; color: #9aa2ae;
}
.fuss__unten ul { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }

/* -------------------------------------------------------- 7 Utilities ---- */
.nur-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.vorspann { font-size: clamp(1.0625rem, 1rem + .4vw, 1.1875rem); color: var(--grau-700); max-width: 58ch; }
.zentriert { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 2rem; }
.stand { font-size: .8125rem; color: var(--grau-500); }

/* --------------------------- 8 Barrierefreiheit, Motion & Druck ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .kachel:hover { transform: none; }
}

@media (prefers-contrast: more) {
  .kachel, .karte, .download, details { border-color: var(--grau-700); }
  .buehne__bild img { opacity: .18; }
}

@media print {
  .servicebalken, .kopf, .schnellzugriff, .fuss, .skiplink, .knopf-reihe { display: none !important; }
  body { font-size: 11pt; color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
  .buehne { background: none; color: #000; }
  .buehne h1 { color: #000; }
  .buehne__bild { display: none; }
}
