/* Landesmark Achter'n Diek – globales Stylesheet (alle Seiten)
   Farben aus der Landesmarkfahne: Blau, Gold, Weiß.

   Aufbau
   - css/style.css    alle Seiten: Grundlagen, Layout, gemeinsame Bausteine, Hilfsklassen
   - css/start.css    nur Startseite: Video-Hero, Gau-Kacheln, Bildband, Galerie
   - css/gruppen.css  nur Gruppenseite: Filter, Gruppenliste, Karte

   Ebenen (Cascade Layers) – spätere Ebenen gewinnen unabhängig von der Spezifität:
   basis < bausteine < seiten < hilfen

   Umbrüche: 960px (Tablet), 720px (Handy), 460px (kleines Handy) – direkt am Baustein notiert.
   Keine style-Attribute: Die Content-Security-Policy blockiert sie (siehe docs/SECURITY.md). */

@layer basis, bausteine, seiten, hilfen;

@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans";
  src: url("../fonts/source-sans-3.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

/* ================= Grundlagen ================= */
@layer basis {
  :root {
    --navy: #0c2847;
    --navy-2: #133a63;
    --blue: #1663ad;
    --gold: #f2b51c;
    --gold-soft: #fbe7b0;
    --sand: #f6f2ea;
    --sand-2: #ece5d6;
    --paper: #fffdf9;
    --ink: #14213a;
    --muted: #56627a;
    --line: #ddd5c4;
    --radius: 14px;
    --wrap: 72rem;
    --font-head: "Bricolage", "Avenir Next", "Segoe UI", sans-serif;
    --font-body: "Source Sans", "Segoe UI", system-ui, sans-serif;

    /* Rollen-Farben: im hellen Modus aus der Grundpalette, im Dunkelmodus angepasst */
    --navy-text: var(--navy);           /* Marine als Schriftfarbe (Logo, Chronik, Ghost-Button) */
    --btn-bg: var(--navy);              /* Standard-Button */
    --blue-surface: var(--blue);        /* blaue Fläche mit weißer Schrift */
    --tag-bg: #e5eef8;                  /* Etikett „Stamm“ usw. */
    --scroll-thumb: rgb(12 40 71 / .43);
    --filter-bg: rgb(246 242 234 / .94);
    --map-sea: #dfe9f2;
    --map-land: #eee8dc;
    --map-ours: var(--paper);
    --map-stroke: #fff;
    --map-ours-stroke: #c9bfa9;
    --map-sea-text: #7d9bb8;

    color-scheme: light;
  }

  /* Dunkelmodus: eigene Palette auf Basis des Marineblaus der Fahne. Ohne sie dunkeln
     Browser (Samsung Internet, Chrome) die Seite selbst ab – mit hellen Deichlinien und Braun-Grau.
     js/farbschema.js setzt data-farbschema (System-Vorgabe oder eigene Wahl über den Umschalter). */
  :root[data-farbschema="dunkel"] {
    color-scheme: dark;

    --sand: #0d1626;
    --sand-2: #1a2740;
    --paper: #142036;
    --ink: #e8edf5;
    --muted: #a4b0c3;
    --line: #2a3a55;
    --blue: #8bbcf0;
    --navy-2: #1d4a7a;

    --navy-text: #e8edf5;
    --btn-bg: #1f5590;
    --blue-surface: #2a64a8;
    --tag-bg: #1b3354;
    --scroll-thumb: rgb(232 237 245 / .35);
    --filter-bg: rgb(13 22 38 / .94);
    --map-sea: #0f2236;
    --map-land: #1c2a40;
    --map-ours: #2a3c58;
    --map-stroke: #0d1626;
    --map-ours-stroke: #4a6080;
    --map-sea-text: #4f6f8f;
  }

  *, *::before, *::after { box-sizing: border-box; }
  [hidden] { display: none !important; }
  html {
    -webkit-text-size-adjust: 100%; scroll-behavior: smooth;
    /* Dezente Scrollbar: transparente Spur, halbtransparenter Griff (Firefox, Chrome/Edge ≥ 121) */
    scrollbar-color: var(--scroll-thumb) transparent;
    @media (prefers-reduced-motion: reduce) { scroll-behavior: auto; }
  }
  body {
    margin: 0;
    font: 400 1.125rem/1.6 var(--font-body);
    color: var(--ink);
    background: var(--sand);
    @media (max-width: 720px) { font-size: 1.0625rem; }
  }
  img { max-width: 100%; height: auto; display: block; }
  a { color: var(--blue); text-underline-offset: .18em; text-decoration-thickness: 1px; }
  a:hover { text-decoration-thickness: 2px; }
  /* Fokusrahmen braucht ≥ 3:1 zum Hintergrund: auf hellem Grund Blau, auf Navy-Flächen Gold */
  :focus-visible { outline: 3px solid var(--fokus, var(--blue)); outline-offset: 3px; border-radius: 4px; }
  .section--navy, .hero--video, .site-footer, .card--dark { --fokus: var(--gold); }

  h1, h2, h3 {
    font-family: var(--font-head);
    line-height: 1.08;
    letter-spacing: -.02em;
    margin: 0 0 .5em;
    font-weight: 700;
    text-wrap: balance;
  }
  h1 { font-size: clamp(2.6rem, 7vw, 5.2rem); font-weight: 800; letter-spacing: -.035em; }
  h2 { font-size: clamp(1.8rem, 4vw, 2.75rem); }
  h3 { font-size: 1.3rem; letter-spacing: -.01em; }
  p { margin: 0 0 1em; text-wrap: pretty; }

  @media print { body { background: #fff; } }
}

/* ================= Bausteine ================= */
@layer bausteine {
  .wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
  .narrow { max-width: 44rem; }
  .skip { position: absolute; left: -999px; }
  .skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--paper); padding: .5rem 1rem; }

  .kicker {
    font: 600 .8rem/1.2 var(--font-head);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 1rem;
  }
  .lead { font-size: clamp(1.2rem, 2.2vw, 1.4rem); color: var(--muted); max-width: 40rem; }

  /* ---------- Header ---------- */
  .site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
  .site-header .wrap {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: .5rem 2rem; padding-block: .9rem;
  }
  .site-header nav {
    order: 1; margin-left: auto;
    @media (max-width: 720px) { order: 2; flex: 1 1 100%; min-width: 0; }
    @media print { display: none !important; }
  }
  .brand {
    display: flex; align-items: center; gap: .7rem;
    text-decoration: none; color: var(--navy-text);
    font: 800 1.3rem/1 var(--font-head); letter-spacing: -.02em;
  }
  .brand img { width: 40px; height: 44px; }
  .brand small {
    display: block; font: 500 .72rem/1.3 var(--font-body);
    letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  }
  .nav {
    display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; list-style: none;
    @media (max-width: 720px) {
      flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; justify-content: space-between;
      margin-inline: -.45rem; width: calc(100% + .9rem);
      &::-webkit-scrollbar { display: none; }
    }
  }
  .nav a {
    display: block; padding: .45rem .8rem; border-radius: 999px;
    font: 600 1rem/1.2 var(--font-head); color: var(--ink); text-decoration: none;
    @media (max-width: 720px) { padding: .45rem .28rem; font-size: clamp(.74rem, 3.25vw, .92rem); white-space: nowrap; }
  }
  .nav a:hover { background: var(--sand); }

  /* Umschalter Hell/Dunkel: Desktop rechts neben dem Menü, Handy rechts neben dem Logo */
  .farbschema {
    order: 2; display: grid; place-items: center; flex: none;
    width: 2.4rem; height: 2.4rem; margin-left: -1.25rem; border-radius: 50%; cursor: pointer;
    border: 1px solid var(--line); background: transparent; color: var(--ink);
    @media (max-width: 720px) { order: 1; margin-left: 0; }
    @media print { display: none !important; }
  }
  .farbschema:hover { background: var(--sand); }
  .farbschema svg { width: 1.15rem; height: 1.15rem; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .farbschema .i-mond { stroke: none; }
  .farbschema .i-sonne, .farbschema[aria-pressed="true"] .i-mond { display: none; }
  .farbschema[aria-pressed="true"] .i-sonne { display: block; }
  .nav a[aria-current="page"] {
    background: var(--btn-bg); color: #fff;
    @media (max-width: 720px) { padding-inline: .5rem; }
  }

  /* ---------- Buttons ---------- */
  .actions {
    display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem;
    @media print { display: none !important; }
  }
  .btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .85rem 1.4rem; border-radius: 999px;
    font: 700 1rem/1 var(--font-head); text-decoration: none;
    background: var(--btn-bg); color: #fff; border: 2px solid var(--btn-bg);
    transition: transform .15s ease, background .15s ease;
  }
  .btn:hover { transform: translateY(-2px); background: var(--navy-2); }
  .btn--ghost { background: transparent; color: var(--navy-text); }
  .btn--ghost:hover { background: var(--sand); }
  .btn--gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
  .btn--gold:hover { background: #ffc93d; }
  .btn--light { background: transparent; color: #fff; border-color: #fff; }
  .btn--light:hover { background: rgb(255 255 255 / .1); }
  .section--navy a.btn { text-decoration: none; }
  .section--navy a.btn--gold { color: var(--navy); }
  .section--navy a.btn--light { color: #fff; }

  /* ---------- Seitenkopf Unterseiten, Unternavigation, Deichlinie ---------- */
  .page-head { background: var(--paper); position: relative; }
  .page-head .wrap { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(4rem, 8vw, 6rem); }
  .page-head h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
  .page-head .dike { position: absolute; bottom: -1px; left: 0; }

  .subnav { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.75rem; }
  .subnav a {
    padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--line);
    font: 600 .95rem/1 var(--font-head); color: var(--ink); text-decoration: none; background: var(--paper);
  }
  .subnav a[aria-current="page"] { background: var(--blue-surface); border-color: var(--blue-surface); color: #fff; }

  /* Wellen links, Deich, Kothe und Jurte rechts – Farbe = Hintergrund der folgenden Sektion.
     Höhe folgt dem viewBox-Verhältnis (1440:110), damit nichts verzerrt; auf schmalen
     Schirmen schneidet „xMaxYMax slice“ links Wasser ab, Deich und Zelte bleiben sichtbar. */
  .dike {
    display: block; width: 100%; height: clamp(56px, 7.64vw, 150px);
    @media print { display: none !important; }
  }
  .dike path { fill: var(--sand); }
  .dike .dike-welle { opacity: .45; }
  .dike--navy path { fill: var(--navy); }

  /* ---------- Sektionen und Raster ---------- */
  .section { padding-block: clamp(3.5rem, 8vw, 6rem); }
  .section--navy { background: var(--navy); color: #e6edf6; }
  .section--navy h2, .section--navy h3 { color: #fff; }
  .section--navy .kicker { color: var(--gold); }
  .section--navy a { color: var(--gold-soft); }
  .section--paper { background: var(--paper); }
  .section-head { max-width: 44rem; margin-bottom: 2.5rem; }

  .grid { display: grid; gap: 1.25rem; }
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
    @media (max-width: 720px) { grid-template-columns: 1fr; }
  }
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
    @media (max-width: 960px) { grid-template-columns: 1fr 1fr; }
    @media (max-width: 720px) { grid-template-columns: 1fr; }
  }
  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
    @media (max-width: 960px) { grid-template-columns: repeat(2, 1fr); }
    @media (max-width: 460px) { grid-template-columns: 1fr; }
  }
  .split {
    display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center;
    @media (max-width: 720px) { grid-template-columns: 1fr; }
  }
  .split img { border-radius: var(--radius); }

  /* ---------- Karten ---------- */
  .card {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.5rem;
  }
  .card p:last-child { margin-bottom: 0; }
  .card .num {
    font: 800 .85rem/1 var(--font-head); color: var(--blue);
    display: inline-block; margin-bottom: 1rem; letter-spacing: .1em;
  }
  /* Karte mit Foto oben */
  .card--img { overflow: hidden; }
  .card--img > img {
    margin: -1.5rem -1.5rem 1.2rem; width: calc(100% + 3rem); max-width: none;
    aspect-ratio: 3 / 2; object-fit: cover;
  }

  /* Klischee-Karten (Pfadfinden heute) */
  .myth { display: flex; flex-direction: column; }
  .myth-label {
    font: 700 .72rem/1 var(--font-head); letter-spacing: .12em; text-transform: uppercase;
    color: var(--muted); margin-bottom: .6rem;
  }
  .myth-claim {
    font-size: 1.25rem; color: var(--muted);
    /* dünner Strich, damit der Satz trotzdem gut lesbar bleibt */
    text-decoration: line-through; text-decoration-color: rgb(242 181 28 / .8); text-decoration-thickness: .055em;
    margin-bottom: 1.1rem;
  }
  .myth-label--real { color: var(--blue); margin-top: auto; padding-top: 1rem; border-top: 1px dashed var(--line); }

  /* ---------- Text-Bausteine ---------- */
  .figure { margin: 0; }
  .figure img { border-radius: var(--radius); width: 100%; }
  .figure figcaption { font-size: .92rem; color: var(--muted); margin-top: .6rem; }
  .section--navy .figure figcaption { color: #b9c6d8; }

  .facts { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
  .facts li { padding-left: 1.6rem; position: relative; }
  .facts li::before { content: ""; position: absolute; left: 0; top: .55em; width: .7rem; height: .7rem; border-radius: 2px; background: var(--gold); transform: rotate(45deg); }

  .quote {
    font: 700 clamp(1.5rem, 3vw, 2.1rem)/1.2 var(--font-head); letter-spacing: -.02em;
    border-left: 4px solid var(--gold); padding-left: 1.25rem; margin: 0 0 1.5rem;
  }
  .prose { max-width: 44rem; }
  .prose h2 { font-size: 1.6rem; margin-top: 2.2rem; }
  .prose h3 { margin-top: 1.6rem; }

  /* ---------- Mitmachen: Stufen, FAQ ---------- */
  .stage { border-top: 6px solid var(--blue); }
  .stage--wolf { border-top-color: #3f8a4f; }
  .stage--old { border-top-color: var(--gold); }
  .stage .age { font: 700 1rem/1 var(--font-head); color: var(--muted); margin-bottom: .75rem; display: block; }

  .faq { border-top: 1px solid var(--line); }
  .faq details { border-bottom: 1px solid var(--line); padding: 1.1rem 0; }
  .faq summary {
    cursor: pointer; font: 700 1.15rem/1.3 var(--font-head); list-style: none;
    display: flex; justify-content: space-between; gap: 1rem;
  }
  .faq summary::-webkit-details-marker { display: none; }
  .faq summary::after { content: "+"; color: var(--blue); font-size: 1.5rem; line-height: 1; transition: transform .2s; }
  .faq details[open] summary::after { transform: rotate(45deg); }
  .faq details p { margin: .8rem 0 0; color: var(--muted); }

  /* ---------- Über uns: Chronik, Lied ---------- */
  .timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
  .timeline li { position: relative; padding: 0 0 1.6rem 1.75rem; }
  .timeline li::before {
    content: ""; position: absolute; left: -7px; top: .45rem; width: 12px; height: 12px;
    border-radius: 50%; background: var(--gold); border: 2px solid var(--sand);
  }
  .timeline b { font: 800 1.1rem/1 var(--font-head); color: var(--navy-text); display: block; margin-bottom: .3rem; }

  .song-wrap {
    display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(2rem, 5vw, 4rem); align-items: start;
    @media (max-width: 720px) { grid-template-columns: 1fr; }
  }
  .song { display: grid; gap: 1.4rem; font-size: 1.12rem; line-height: 1.55; }
  .song p { margin: 0; }
  .song-ref { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 1.3rem 1.5rem; font-weight: 600; }
  .song-ref .song-label { color: var(--gold); }
  .song-label { display: block; font: 700 .78rem/1 var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--blue); margin-bottom: .5rem; }
  .song-chords { font-size: 1rem; }
  .song-chords b { font-family: var(--font-head); color: var(--blue); letter-spacing: .04em; }
  .song-note, .song-credit { font-size: .95rem; color: var(--muted); }
  .song-credit { border-top: 1px solid var(--line); padding-top: .8rem; }

  /* ---------- Kontakt ---------- */
  .contact-card h3 { margin-bottom: .3rem; }
  .contact-card p { color: var(--muted); font-size: 1rem; }
  .contact-card a { font-weight: 600; overflow-wrap: anywhere; }

  /* ---------- Footer ---------- */
  .site-footer { background: #071a30; color: #b9c6d8; font-size: 1rem; border-top: 4px solid var(--gold); }
  .footer-grid {
    display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem;
    padding-block: 2.5rem 2rem;
    @media (max-width: 960px) {
      grid-template-columns: 1fr 1fr;
      & > :first-child { grid-column: 1 / -1; }
    }
    @media (max-width: 460px) { grid-template-columns: 1fr; }
  }
  .site-footer h2 { font-size: 1rem; letter-spacing: .1em; text-transform: uppercase; color: #fff; margin-bottom: .8rem; }
  .site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
  .site-footer a { color: #e6edf6; text-decoration: none; }
  .site-footer a:hover { color: var(--gold); text-decoration: underline; }
  .site-footer p a { text-decoration: underline; }
  .footer-cpd { display: flex; gap: 1rem; align-items: center; }
  .footer-cpd img { width: 84px; border-radius: 4px; }
  .footer-bottom {
    border-top: 1px solid rgb(255 255 255 / .12); padding-block: 1.2rem;
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; font-size: .92rem;
  }
  .footer-bottom ul { display: flex; gap: 1.25rem; }
}

/* ================= Hilfsklassen (statt style-Attributen) ================= */
@layer hilfen {
  .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  .items-start { align-items: start; }
  .gap-wide { gap: clamp(2rem, 5vw, 4rem); }
  .card--dark { background: var(--navy-2); border-color: transparent; }
  .card--center { text-align: center; padding: 2.5rem 1.5rem; }
  .quote--plain { border: 0; padding: 0; margin: 0 0 .5rem; }
  .text-soft { color: #b9c6d8; }
  .muted-flush { color: var(--muted); margin: 0; }
  .muted-foot { padding-block: 1rem 3rem; color: var(--muted); }
  .muted-note { margin-top: 2.5rem; color: var(--muted); }
  .mt-2 { margin-top: 2rem; }
  .mb-15 { margin-bottom: 1.5rem; }
  .mb-25 { margin-bottom: 2.5rem; }
  .h1--small { font-size: clamp(2.2rem, 5vw, 3.2rem); }
  .page-head--tall { min-height: 70vh; }
  .logo-lg { max-width: 300px; justify-self: center; }
}
