/* =====================================================================
   Vielfalt-Atlas NRW – Oberfläche

   Der Atlas ist ein Teil von vielfalt-begleiten.nrw und übernimmt deren
   Gestaltung seit dem LVR-Redesign: Weiß als Grund, Flächen in #f2f6fc,
   Blau #00309c als Handlungsfarbe, Orange und Limette nur als Akzent,
   Schrift Inter (selbst gehostet). Karten ohne Schatten, 1px Linie,
   Radius 8px; Knöpfe als Pillen.

   Regeln: keine Inline-Styles, keine externen Ressourcen, kein Build.
   Ohne JavaScript voll bedienbar. Kontraste nach WCAG 2.1 AA, nachgerechnet
   (Werte in den Kommentaren).
   ===================================================================== */

/* ---------------------------------------------------------------
   0. Schrift (Inter, variabel, SIL Open Font License)
   --------------------------------------------------------------- */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------- */
:root {
    /* Marke (Preset-Namen der Hauptseite) */
    --brand:        #00309c;   /* Blau: 11,0:1 auf Weiß, 10,2:1 auf Fläche */
    --brand-dark:   #001f66;   /* Navigationsband */
    --brand-light:  #e3ebfb;   /* hellblaue Fläche */
    --base:         #ffffff;
    --surface:      #f2f6fc;   /* Fläche */
    --contrast:     #0b1b33;   /* Text: 17,2:1 auf Weiß */
    --text-soft:    #46546e;   /* gedämpft: 7,6:1 auf Weiß, 7,0:1 auf Fläche */
    --border:       #d5deec;
    --orange:       #fca818;   /* nur als Fläche oder auf Dunkelblau (7,8:1) */
    --lime:         #9ccc0c;   /* nur als Fläche */

    /* Orange, das gelesen werden muss: #fca818 trägt auf Weiß 1,95:1 und
       fällt für Text und für Zustandsmerkmale durch. Dieser tiefe Ton
       trägt 5,6:1 auf Weiß und 5,2:1 auf der Fläche. */
    --accent-deep:  #9a5700;
    --lime-light:   #eef7d2;   /* Fläche für Entfernungen; Text #2b3d00 darauf 10,7:1 */
    --lime-text:    #3a6a00;   /* 5,8:1 auf --lime-light */
    --wip-fill:     #fff1d6;   /* Gebiet in Arbeit, wie .badge--deadline */

    /* Abgeleitet */
    --bg:            var(--base);
    --card:          #ffffff;
    --surface-2:     #e9eef8;
    /* Ränder von Bedienelementen: 4,3:1 auf Weiß, 4,0:1 auf Fläche (WCAG 1.4.11 will 3:1). */
    --border-strong: #6b7a94;
    --text:          var(--contrast);
    --text-muted:    var(--text-soft);
    --link:          var(--brand);
    --link-hover:    var(--brand-dark);
    --ring:          var(--brand);
    --rule:          var(--brand);

    --cta:        var(--brand);
    --cta-hover:  var(--brand-dark);
    --on-cta:     #ffffff;           /* 11,0:1 auf Blau */

    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem;
    --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4rem;

    --radius:    8px;
    --radius-sm: 6px;
    --radius-pill: 999px;
    --container: 1120px;
    --measure:   68ch;

    --t-fast: 140ms;
    --ease:   cubic-bezier(.2, .7, .2, 1);

    color-scheme: light;
}

/* Dunkelmodus: Nachtblau statt Weiß, hellere Blautöne für Bedienelemente.
   Nachgerechnet: Text 15,0:1, gedämpft 9,4:1, Link 9,0:1, Ring 11,5:1,
   Weiß auf CTA 6,4:1, Ränder 5,4:1. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg:            #0d1830;
        --card:          #14213f;
        --surface:       #14213f;
        --surface-2:     #1b2a4d;
        --border:        #2a3a5e;
        --border-strong: #7f8fb0;
        --text:          #e8edf7;
        --text-muted:    #b3bdd4;
        --brand:         #9db8ff;
        --brand-dark:    #c7d6ff;
        --brand-light:   #1c2c55;
        --link:          #9db8ff;
        --link-hover:    #c7d6ff;
        --ring:          #ffc857;
        --rule:          #4f6cc0;
        --accent-deep:   #ffb547;
        --lime-light:    #24361a;
        --lime-text:     #cde58a;
        --wip-fill:      #4a2e00;
        --cta:           #2f56c9;
        --cta-hover:     #3d63d6;
        --on-cta:        #ffffff;
        --mark-edge:     #9db8ff; /* Rand von Legendenpunkten und Gebietsmarken, 8:1 auf --bg */
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg:            #0d1830;
    --card:          #14213f;
    --surface:       #14213f;
    --surface-2:     #1b2a4d;
    --border:        #2a3a5e;
    --border-strong: #7f8fb0;
    --text:          #e8edf7;
    --text-muted:    #b3bdd4;
    --brand:         #9db8ff;
    --brand-dark:    #c7d6ff;
    --brand-light:   #1c2c55;
    --link:          #9db8ff;
    --link-hover:    #c7d6ff;
    --ring:          #ffc857;
    --rule:          #4f6cc0;
    --accent-deep:   #ffb547;
    --lime-light:    #24361a;
    --lime-text:     #cde58a;
    --wip-fill:      #4a2e00;
    --cta:           #2f56c9;
    --cta-hover:     #3d63d6;
    --on-cta:        #ffffff;
    --mark-edge:     #9db8ff;
    color-scheme: dark;
}

/* ---------------------------------------------------------------
   2. Grundlagen
   --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1.0625rem;              /* 17px */
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }

a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); }

h1, h2, h3, h4 {
    font-family: var(--font-sans);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
    color: var(--text);
    overflow-wrap: break-word;
}
h3, h4 { font-weight: 700; line-height: 1.25; }

p { overflow-wrap: break-word; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s7) 0; }
[hidden] { display: none !important; }
main:focus { outline: none; }
main { padding-bottom: var(--s7); }

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--s5);
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.muted { color: var(--text-muted); }

/* Gesperrte Versalzeile in Blau, wie die kleinen Überzeilen der Hauptseite. */
.eyebrow {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .75rem;
    font-weight: 700;
    color: var(--brand);
    margin: 0 0 var(--s2);
}

.section-title {
    font-size: 1.5rem;
    margin: 0 0 var(--s4);
}
.section-head { margin: 0 0 var(--s4); }
.section-head .section-title { margin-bottom: var(--s1); }
.section-lede { margin: 0; color: var(--text-muted); }

.list-plain { padding-left: 1.15rem; display: grid; gap: var(--s2); }
.print-only { display: none; }

/* ---------------------------------------------------------------
   3. Fokus und Sprungmarken
   --------------------------------------------------------------- */
:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.skip-link {
    position: absolute; left: var(--s4); top: -5rem; z-index: 100;
    background: var(--cta); color: var(--on-cta);
    padding: var(--s3) var(--s4);
    font-weight: 700; text-decoration: none;
    border-radius: var(--radius-pill);
    transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: var(--s4); color: var(--on-cta); }
.skip-link:focus-visible { outline: 3px solid var(--accent-deep); outline-offset: 3px; }

/* Sprunglink vor der Karte: rechts oben über der Karte (links liegt der
   Zoomregler), nur sichtbar bei Fokus. */
.skip-link--inline { position: absolute; left: auto; right: var(--s3); top: var(--s3); z-index: 1001; transition: none; }
.skip-link--inline:not(:focus) { width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* ---------------------------------------------------------------
   4. Schaltflächen (Pillen wie auf der Hauptseite)
   --------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: var(--s2);
    padding: .6rem 1.2rem;
    min-height: 46px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--card);
    color: var(--text);
    font: inherit;
    font-size: .975rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--t-fast) var(--ease),
                border-color var(--t-fast) var(--ease),
                color var(--t-fast) var(--ease);
}
.btn:hover { background: var(--brand-light); border-color: var(--brand); color: var(--text); }
.btn:disabled { opacity: .6; cursor: progress; }

.btn--primary {
    background: var(--cta);
    border-color: var(--cta);
    color: var(--on-cta);
}
.btn--primary:hover { background: var(--cta-hover); border-color: var(--cta-hover); color: var(--on-cta); }

.btn--ghost { background: transparent; border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--brand-light); }

.btn--lg { padding: .8rem 1.5rem; font-size: 1.05rem; min-height: 52px; }
.btn--small { padding: .4rem .9rem; min-height: 44px; font-size: .9rem; }
.btn--icon { width: 46px; padding: 0; flex: none; }

.ext { font-size: .85em; }

/* ---------------------------------------------------------------
   5. Kopfbereich: schmales Band der Hauptseite, dann weiße Markenzeile
   --------------------------------------------------------------- */
.site-band {
    background: var(--brand-dark);
    color: #ffffff;                    /* 15,1:1 */
    font-size: .82rem;
}
.site-band__inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--s3); min-height: 34px; flex-wrap: wrap;
}
.site-band__text { opacity: .92; }
.site-band__link { color: #ffffff; font-weight: 600; text-decoration-color: var(--orange); }
.site-band__link:hover { color: var(--orange); }
.site-band__link:focus-visible { outline-color: var(--orange); }

.site-header {
    position: sticky; top: 0; z-index: 30;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}
.site-header__inner {
    display: flex; align-items: center; gap: var(--s4);
    min-height: 68px; flex-wrap: wrap;
}

.brand {
    display: inline-flex; align-items: center; gap: var(--s2);
    font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em;
    color: var(--text); text-decoration: none;
}
.brand__mark { color: var(--brand); flex: none; }
.brand__nrw { color: var(--brand); }

.site-nav { display: flex; gap: var(--s1); margin-left: auto; flex-wrap: wrap; }
.site-nav a {
    padding: .45rem .7rem;
    border-radius: var(--radius-sm);
    color: var(--text); text-decoration: none;
    font-size: .95rem; font-weight: 600;
    border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: var(--text); background: var(--brand-light); }
/* Die aktuelle Seite zeigt nur diese Linie: als Zustandsmerkmal braucht sie
   3:1 gegen die Kopffläche, das tiefe Orange trägt 5,6:1. */
.site-nav a[aria-current="page"] {
    border-bottom-color: var(--accent-deep);
    border-radius: 0;
    background: transparent;
    font-weight: 700;
}

.theme-toggle {
    flex: none; width: 46px; height: 46px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
    background: var(--card); color: var(--text);
    cursor: pointer; font-size: 1.15rem; line-height: 1;
}
.theme-toggle:hover { background: var(--brand-light); }

/* ---------------------------------------------------------------
   6. "Was gibt es in meiner Nähe?"
   Der erste Schritt: eine blaue Fläche mit Ort, Umkreis, Suchen und dem
   Standortknopf. Kompakt wiederholt über gefilterten Treffern.
   --------------------------------------------------------------- */
.near { margin: var(--s6) 0 var(--s7); }
.near__form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--s6);
    position: relative;
    overflow: hidden;
}
/* Ein orange-limetter Farbstreifen oben: der Akzent der Hauptseite. */
.near__form::before {
    content: "";
    position: absolute; left: 0; top: 0; right: 0; height: 5px;
    background: linear-gradient(90deg, var(--orange) 0 60%, var(--lime) 60% 100%);
}
.near__head { max-width: 46rem; margin-bottom: var(--s5); }
.near__title { font-size: clamp(1.9rem, 1.2rem + 3vw, 3rem); margin: 0 0 var(--s3); }
.near__lede { font-size: 1.1rem; line-height: 1.55; margin: 0; max-width: 60ch; }

.near__fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px auto;
    gap: var(--s3);
    align-items: end;
}
.near__field { display: grid; gap: var(--s1); min-width: 0; }
.near__field > label,
.filters__row > label {
    font-size: .8rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em;
    color: var(--text);
}
.near input[type="text"],
.near select,
.filters input[type="search"],
.filters input[type="text"],
.filters select {
    width: 100%;
    padding: .6rem .8rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    font: inherit; font-size: 1rem;
    min-height: 48px;
}
.near input::placeholder,
.filters input::placeholder { color: var(--text-muted); opacity: 1; }
.near__submit { min-height: 48px; }

.near__locate {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4);
    margin-top: var(--s4);
}
.near__locate-btn { background: var(--card); }
.near__hint { margin: 0; font-size: .875rem; line-height: 1.5; color: var(--text-muted); max-width: 52ch; }
.near__status { margin: var(--s3) 0 0; font-size: .95rem; line-height: 1.5; min-height: 1.5em; }
.near__status:empty { margin: 0; min-height: 0; }
.near__status a { margin-left: .35em; font-weight: 600; }

.near--compact { margin: var(--s4) 0 var(--s6); }
.near--compact .near__form { padding: var(--s4) var(--s5); }
.near--compact .near__form::before { display: none; }
.near--compact .near__head { margin-bottom: var(--s3); }
.near--compact .near__title { font-size: 1rem; font-weight: 700; letter-spacing: 0; margin: 0; }

/* Kopf der gefilterten Ansicht */
.results-intro { max-width: var(--measure); padding: var(--s6) 0 0; margin: 0; }
.results-intro__title { font-size: clamp(1.6rem, 1rem + 2vw, 2.4rem); margin: 0 0 var(--s2); }
.results-intro__note { margin: 0; color: var(--text-muted); }

/* ---------------------------------------------------------------
   7. Sammlungen
   --------------------------------------------------------------- */
.collections { margin: var(--s7) 0; }
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: var(--s4);
    list-style: none; padding: 0; margin: 0;
}
.tiles > li { display: flex; }
.tile {
    flex: 1;
    display: flex; flex-direction: column; gap: var(--s2);
    padding: var(--s5);
    text-decoration: none; color: var(--text);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-top: 4px solid var(--lime);
    transition: border-color var(--t-fast) var(--ease);
}
.tile:hover { border-color: var(--brand); border-top-color: var(--lime); }
.tile__title { font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; line-height: 1.25; }
.tile:hover .tile__title { text-decoration: underline; text-underline-offset: .18em; }
.tile__desc { color: var(--text); font-size: .95rem; max-width: 46ch; }
.tile__cta { margin-top: auto; padding-top: var(--s2); color: var(--brand); font-weight: 600; font-size: .95rem; }

/* ---------------------------------------------------------------
   8. Neu im Atlas
   --------------------------------------------------------------- */
.feed { margin: var(--s7) 0; }
.feed__list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--border); }
.feed__list > li {
    padding: var(--s3) 0;
    border-bottom: 1px solid var(--border);
    display: flex; flex-wrap: wrap; gap: var(--s3); align-items: baseline;
}
.feed__list a { font-weight: 600; text-decoration: none; }
.feed__list a:hover { text-decoration: underline; }
.feed__list .muted { font-size: .92rem; }

/* ---------------------------------------------------------------
   9. Ergebnisbereich
   --------------------------------------------------------------- */
.results-section { margin: var(--s6) 0 var(--s8); scroll-margin-top: 5rem; }

.results-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: var(--s4); flex-wrap: wrap;
    padding-bottom: var(--s3);
    border-bottom: 2px solid var(--rule);
}
.results-head .section-title { margin: 0; }
.results-count { color: var(--text-muted); margin: 0; font-size: .95rem; }
.results-count__number { color: var(--text); font-size: 1.35rem; font-weight: 800; margin-right: .1em; }

.results-layout {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    gap: var(--s6);
    margin-top: var(--s5);
    align-items: start;
}
.results-main { min-width: 0; transition: opacity var(--t-fast) var(--ease); }
.results-main[aria-busy="true"] { opacity: .55; }
.results-loading {
    margin: 0 0 var(--s3); padding: var(--s3) var(--s4);
    background: var(--brand-light); border-radius: var(--radius-sm);
    font-weight: 600; font-size: .95rem;
}
.results-note { margin: 0 0 var(--s4); font-size: .95rem; color: var(--text-muted); }

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: var(--s4);
    list-style: none; padding: 0; margin: 0;
}
.results-grid:focus { outline: none; }
.results-grid > li { display: flex; min-width: 0; }
.results-grid > li > .card { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------
   10. Aktive Filter
   --------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; padding: 0; margin: var(--s4) 0 0; }
.chips--center { justify-content: center; margin-top: var(--s3); }
.chip {
    display: inline-flex; align-items: center; gap: var(--s2);
    min-height: 38px; padding: .3rem .8rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--card);
    color: var(--text); text-decoration: none;
    font-size: .875rem; font-weight: 600;
    max-width: 100%;
}
.chip > span:first-child { overflow-wrap: anywhere; }
.chip:hover { background: var(--brand-light); border-color: var(--brand); color: var(--text); }
.chip__x { color: var(--text); font-size: 1.15rem; line-height: 1; flex: none; }
.chip--reset { border-style: dashed; color: var(--link); }

/* ---------------------------------------------------------------
   11. Ergebniskarte
   Von oben nach unten: Angebotsart und Entfernung, Name, Träger, Ort,
   Kurzbeschreibung, Themen.
   --------------------------------------------------------------- */
.card {
    display: flex; flex-direction: column; justify-content: space-between;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 0;
    transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.card:hover { border-color: var(--border-strong); }
.card:focus { outline: none; }
.card:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
/* Von der Karte aus gewählt: blauer Rahmen, doppelt gezogen. */
.card--active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }

.card__body { padding: var(--s4) var(--s4) var(--s2); min-width: 0; }

.card__topline {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: var(--s2); margin-bottom: var(--s2);
}
.card__offers, .entry__badges {
    display: flex; flex-wrap: wrap; align-items: baseline;
    gap: var(--s1) var(--s3);
    margin: 0; padding: 0; list-style: none;
}
.card__distance {
    flex: none; margin: 0;
    padding: .15rem .6rem;
    border-radius: var(--radius-pill);
    background: var(--lime-light); color: var(--lime-text);
    font-size: .82rem; font-weight: 700; line-height: 1.5;
    font-variant-numeric: tabular-nums;
}

.card__head { display: flex; gap: var(--s3); align-items: flex-start; margin-bottom: var(--s1); }
.card__headtext { min-width: 0; flex: 1; }
.card__title {
    font-size: 1.15rem; line-height: 1.25;
    margin: 0 0 var(--s1);
    hyphens: auto; overflow-wrap: break-word;
}
.card__title a { color: var(--text); text-decoration: none; }
.card__title a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: .16em; }
/* Die ganze Karte ist klickbar über den Titel, ohne verschachtelte Links. */
.card__title a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.card__actions, .card__actions a { position: relative; z-index: 1; }

.card__org { color: var(--text-muted); font-size: .875rem; font-weight: 600; line-height: 1.45; margin: 0; hyphens: auto; overflow-wrap: break-word; }

/* Der Ort: Nähe ist das, wonach hier gesucht wird. */
.card__location {
    display: flex; align-items: center; gap: .4rem;
    margin: var(--s2) 0;
    font-size: .95rem; font-weight: 600; line-height: 1.35;
    color: var(--brand);
    overflow-wrap: anywhere;
}
.card__pin { flex: none; }

.card__desc {
    margin: 0 0 var(--s3);
    font-size: .95rem; line-height: 1.5;
    color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card__meta { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s1); align-items: center; padding: 0; margin: 0; }

.card__actions {
    display: flex; gap: var(--s2); flex-wrap: wrap;
    padding: var(--s2) var(--s4) var(--s3);
    border-top: 1px solid var(--border);
}

/* ---------------------------------------------------------------
   12. Signet
   --------------------------------------------------------------- */
.avatar { width: 46px; height: 46px; flex: none; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.avatar--lg { width: 68px; height: 68px; }
.avatar--logo { background: #fff; border: 1px solid var(--border); padding: 5px; }
.avatar--logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.entry__titlerow { display: flex; gap: var(--s4); align-items: flex-start; }

/* ---------------------------------------------------------------
   13. Plaketten
   --------------------------------------------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: .25rem;
    padding: .18rem .6rem;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    background: var(--surface-2);
    color: var(--text);
    font-size: .78rem; font-weight: 600; line-height: 1.5;
}
/* Die Angebotsart ist keine Plakette, sondern die gesperrte Versalzeile. */
.badge--offer {
    padding: 0; background: transparent; border: 0;
    color: var(--brand);
    font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; line-height: 1.4;
}
.badge--offer + .badge--offer::before {
    content: ""; display: inline-block; width: 4px; height: 4px; margin-right: .7rem;
    border-radius: 50%; background: var(--accent-deep); vertical-align: .15em;
}
.badge--deadline { background: #fff1d6; color: #6b3d00; border-color: var(--accent-deep); }
.badge--deadline-soft { background: var(--surface-2); color: var(--text); }
.badge--group { background: var(--brand-light); color: var(--text); }
.badge--topic { background: var(--surface-2); color: var(--text); }
:root[data-theme="dark"] .badge--deadline { background: #4a2e00; color: #ffe1b0; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .badge--deadline { background: #4a2e00; color: #ffe1b0; }
}

/* ---------------------------------------------------------------
   14. Filter
   Ein details-Element, serverseitig offen; das Skript klappt es am Handy
   beim Laden einmal zu.
   --------------------------------------------------------------- */
.results-aside { min-width: 0; }
.filters-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 var(--s4);
    position: sticky; top: 5.25rem;
    max-height: calc(100vh - 6rem);
    overflow: auto;
}
.filters-wrap__summary {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
    min-height: 48px; padding: var(--s3) 0;
    cursor: pointer; list-style: none;
    font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
    color: var(--text);
}
.filters-wrap__summary::-webkit-details-marker { display: none; }
.filters-wrap__summary::after { content: "\2212"; font-size: 1.2rem; line-height: 1; font-weight: 400; color: var(--text); }
.filters-wrap:not([open]) > .filters-wrap__summary::after { content: "+"; }
.filters-wrap__summary:hover { color: var(--link-hover); }

.filters { display: grid; gap: var(--s3); padding: 0 0 var(--s4); }
.filters__search { display: flex; gap: var(--s2); }
.filters__search input { flex: 1; min-width: 0; }
.filters__row { display: grid; gap: var(--s1); align-items: start; }
.filters__hint { font-size: .875rem; line-height: 1.5; margin: 0; color: var(--text-muted); }

.facet { border-top: 1px solid var(--border); }
.facet > summary {
    cursor: pointer; font-weight: 700; font-size: .95rem;
    padding: var(--s3) 0; list-style: none; min-height: 44px;
    display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
}
.facet > summary::-webkit-details-marker { display: none; }
.facet > summary::after { content: "+"; color: var(--text); font-size: 1.1rem; line-height: 1; margin-left: auto; }
.facet[open] > summary::after { content: "\2212"; }
.facet > summary:hover { color: var(--link-hover); }
.facet__selected {
    font-size: .75rem; font-weight: 700; color: var(--on-cta);
    background: var(--cta); border-radius: var(--radius-pill); padding: .05rem .55rem;
}
.facet__group { border: 0; margin: 0; padding: 0 0 var(--s3); display: grid; gap: 0; }

.facet__item {
    display: flex; align-items: center; gap: var(--s2);
    padding: .3rem .35rem; margin-inline: -.35rem;
    border-radius: var(--radius-sm);
    cursor: pointer; font-size: .95rem; min-height: 40px;
}
.facet__item:hover { background: var(--brand-light); }
.facet__item input { width: 20px; height: 20px; flex: none; accent-color: var(--brand); margin: 0; }
.facet__label { flex: 1; min-width: 0; }
.facet__count {
    flex: none; min-width: 2ch; text-align: right;
    font-size: .8rem; font-weight: 600; color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.facet__count--zero { opacity: .7; }

.filters__actions { display: flex; gap: var(--s2); flex-wrap: wrap; padding-top: var(--s2); }
.filters__actions .btn { flex: 1 1 auto; }

/* ---------------------------------------------------------------
   15. Seitennummerierung
   --------------------------------------------------------------- */
.pagination {
    display: flex; align-items: center; gap: var(--s4); justify-content: space-between;
    margin: var(--s6) 0 0; padding-top: var(--s4);
    border-top: 1px solid var(--border);
}
.pagination__status { color: var(--text); font-size: .95rem; }

/* ---------------------------------------------------------------
   16. Leerer Zustand
   --------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: var(--s7) var(--s5);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.empty-state:focus { outline: none; }
.empty-state__title { font-weight: 800; font-size: 1.4rem; letter-spacing: -.02em; margin: 0 0 var(--s2); }
.empty-state > p { max-width: 52ch; margin-inline: auto; }
.empty-state .muted { font-size: .95rem; margin-top: var(--s5); }
.empty-state__actions { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: center; margin: var(--s5) 0 0; }

/* ---------------------------------------------------------------
   17. Karte
   Leaflet kommt aus assets/vendor und lädt erst auf Klick. Unsere Regeln
   stehen unter .mapbox, damit sie die später geladene leaflet.css schlagen.
   Vorsicht: Leaflet-Regeln wie .leaflet-touch .leaflet-bar a haben dieselbe
   Spezifität wie .mapbox .x a und gewinnen dann; dort eine Klasse mehr nehmen.
   --------------------------------------------------------------- */
.mapbox { margin: 0 0 var(--s4); position: relative; }
.mapbox__teaser {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s4); align-items: center;
    padding: var(--s4) var(--s5); margin: 0 0 var(--s3);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.mapbox__glyph { color: var(--brand); }
.mapbox__teaser-title { margin: 0 0 var(--s1); font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; line-height: 1.25; }
.mapbox__teaser-note, .mapbox__scope { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--text-muted); max-width: 60ch; }
.mapbox__scope { margin-top: var(--s2); }
.mapbox__toggle { margin: 0; white-space: nowrap; }
.mapbox[data-open] .mapbox__teaser { padding: var(--s3) var(--s4); }
.mapbox[data-open] .mapbox__teaser-note { display: none; }
/* Eigener Stapelkontext: der Sprunglink (z-index 1001) liegt über der Karte, aber unter dem mitlaufenden Kopf. */
.mapbox__frame { position: relative; isolation: isolate; }
.mapbox__canvas {
    height: 440px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    /* Eigener Stapelkontext: Leaflets Ebenen (z-index bis 1000) bleiben unter dem mitlaufenden Kopf. */
    isolation: isolate;
}
.mapbox__canvas:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.mapbox__loading { margin: 0; font-weight: 600; color: var(--text-muted); }
.mapbox__note { margin: var(--s2) 0 0; font-size: .8rem; line-height: 1.5; color: var(--text-muted); }
.mapbox__hint { display: none; margin: 0 0 var(--s2); font-size: .85rem; color: var(--text-muted); }
@media (pointer: coarse) {
    /* Auch im Querformat bleibt ein Rand außerhalb der Karte zum Weiterwischen. */
    .mapbox__canvas { height: min(440px, 50vh); height: min(440px, 50svh); min-height: 200px; }
    .mapbox__hint { display: block; }
}
/* Niedrige Schirme (Handy quer): Kopf läuft nicht mit, sonst bleibt neben der Karte kein Platz zum Wischen. */
@media (max-height: 500px) {
    .site-header { position: static; }
    html { scroll-padding-top: var(--s4); }
}
.mapbox__legend {
    display: flex; flex-wrap: wrap; gap: .35rem 1.25rem;
    list-style: none; margin: var(--s2) 0 0; padding: 0;
    font-size: .85rem; color: var(--text);
}
.mapbox__legend li { display: inline-flex; align-items: center; gap: .45rem; }
.entry__layout > .mapbox .mapbox__canvas { height: 340px; }
@media (pointer: coarse) and (max-height: 500px) {
    /* Querformat auch auf der Detailseite: Rand zum Weiterwischen wie auf / und /karte. */
    .entry__layout > .mapbox .mapbox__canvas { height: min(340px, 50vh); height: min(340px, 50svh); min-height: 160px; }
    /* Freier Streifen zwischen Karte und Hinweis bzw. Legende liegt außerhalb der Randzone. */
    .mapbox__hint { margin-bottom: var(--s4); }
    .mapbox__legend { margin-top: var(--s4); }
}

/* Legendenpunkte, auch in der Statuszeile und der Gebietstabelle (nicht unter .mapbox). */
.atlas-key { display: inline-block; width: 14px; height: 14px; border-radius: 50%; flex: none; border: 2px solid var(--mark-edge, var(--cta)); background: var(--cta); }
.atlas-key--area { background: var(--card); border-width: 3px; }
.atlas-key--erschlossen { width: 18px; height: 18px; background: var(--card); border-width: 3px; }
.atlas-key--group { box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--mark-edge, var(--cta)); }
.atlas-key--in_arbeit { width: 18px; height: 18px; background: var(--wip-fill); border-color: var(--accent-deep); border-style: dashed; }
.atlas-key--offen { background: transparent; border-color: var(--border-strong); }

.mapbox .leaflet-container { font-family: var(--font-sans); font-size: .875rem; background: var(--surface-2); }
.mapbox .leaflet-control-zoom.leaflet-bar a { width: 40px; height: 40px; line-height: 40px; font-size: 1.3rem; background: var(--card); color: var(--text); }
.mapbox .leaflet-control-zoom.leaflet-bar a:focus { background: var(--card); color: var(--text); }
.mapbox .leaflet-control-zoom.leaflet-bar a:hover { background: var(--brand-light); }
.mapbox .leaflet-control-zoom.leaflet-bar a.leaflet-disabled { background: var(--surface-2); color: var(--text-muted); opacity: .6; cursor: default; }
@media (pointer: coarse) {
    .mapbox .leaflet-control-zoom.leaflet-bar a { width: 44px; height: 44px; line-height: 44px; }
}
.mapbox .leaflet-control-zoom a:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; position: relative; z-index: 1; }
.mapbox .leaflet-bar { border: 1px solid var(--border-strong); box-shadow: none; }
/* Die Attribution liegt auf den Kacheln und bleibt in beiden Modi weiß. */
.mapbox .leaflet-control-attribution { font-size: .72rem; background: rgba(255, 255, 255, .92); color: #0b1b33; }
.mapbox .leaflet-control-attribution a { color: #00309c; }
.mapbox .leaflet-container a.leaflet-popup-close-button { width: 44px; height: 44px; font-size: 24px; line-height: 44px; color: var(--text-muted); }

/* Marker als CSS-Tropfen in der Handlungsfarbe, hervorgehoben im tiefen Orange. */
/* Leaflet positioniert Marker absolut; kein eigenes position hier, sonst stapeln sie sich. */
.mapbox .atlas-pin { width: 30px; height: 40px; cursor: pointer; }
.mapbox .atlas-pin::before {
    content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px;
    background: var(--cta); border: 2px solid #fff; border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: none;
    transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.mapbox .atlas-pin::after {
    content: ""; position: absolute; left: 11px; top: 11px; width: 8px; height: 8px;
    background: #fff; border-radius: 50%;
}
.mapbox .atlas-pin--active::before { background: var(--accent-deep); transform: rotate(-45deg) scale(1.2); }
.mapbox .atlas-pin:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 50%; }
/* Stadtweites Angebot: Ring statt Tropfenfüllung, am Sitz des Trägers. */
.mapbox .atlas-pin--area::before { background: var(--card); border: 3px solid var(--cta); }
.mapbox .atlas-pin--area::after { background: var(--cta); }
.mapbox .atlas-pin--area.atlas-pin--active::before { border-color: var(--accent-deep); background: var(--card); }

.mapbox .atlas-center {
    width: 18px; height: 18px; border-radius: 50%;
    background: #fca818; border: 3px solid #fff;
    box-shadow: 0 0 0 2px #9a5700;
}

.mapbox .atlas-cluster {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--cta); color: var(--on-cta);
    border: 3px solid #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--cta) 22%, transparent);
    font-weight: 700; font-size: .95rem;
    font-variant-numeric: tabular-nums;
}
.mapbox .atlas-cluster--many { width: 48px; height: 48px; font-size: 1.05rem; }
.mapbox .atlas-cluster--lots { width: 56px; height: 56px; font-size: 1.15rem; }
.mapbox .atlas-cluster:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
/* Mehrere Gebiete auf /karte: gestapelter Ring wie die Gebietsmarke, keine volle Scheibe wie eine Angebotsgruppe. */
.mapbox .atlas-cluster--areas { background: var(--card); color: var(--text); border: 3px solid var(--mark-edge, var(--cta)); box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--mark-edge, var(--cta)); }

/* Gebietsmarken auf /karte: Kreis mit Zahl, Name darunter. */
.mapbox .atlas-area__dot {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; margin: 4px; box-sizing: border-box; border-radius: 50%;
    background: var(--card); color: var(--text); border: 3px solid var(--mark-edge, var(--cta));
    font-weight: 800; font-size: .85rem; font-variant-numeric: tabular-nums;
}
.mapbox .atlas-area--in_arbeit .atlas-area__dot { width: 24px; height: 24px; margin: 10px; background: var(--wip-fill); border: 2px dashed var(--accent-deep); }
.mapbox .atlas-area__name {
    position: absolute; top: calc(100% - 2px); left: 50%; transform: translateX(-50%);
    white-space: nowrap; padding: 0 .35rem; border-radius: var(--radius-sm);
    background: var(--card); color: var(--text); font-size: .75rem; font-weight: 700; line-height: 1.5;
}
.mapbox[data-zoom-low] .atlas-area__name { display: none; }
.mapbox .atlas-area--erschlossen { cursor: pointer; }
.mapbox .atlas-area:focus-visible { outline: none; }
.mapbox .atlas-area:focus-visible .atlas-area__dot { outline: 3px solid var(--ring); outline-offset: 2px; }

.mapbox .leaflet-popup-content-wrapper { border-radius: var(--radius); box-shadow: none; border: 1px solid var(--border-strong); background: var(--card); color: var(--text); }
.mapbox .leaflet-popup-tip { box-shadow: none; border: 1px solid var(--border-strong); background: var(--card); }
.mapbox .leaflet-popup-content { margin: 12px 40px 12px 16px; min-width: 0; line-height: 1.45; }
.atlas-popup p { margin: 0 0 .35rem; }
.atlas-popup__title { font-weight: 700; font-size: 1rem; }
/* .mapbox davor, sonst gewinnt .leaflet-container a (#0078A8, im Dunkelmodus 3,2:1). */
.mapbox .atlas-popup a { color: var(--link); }
.mapbox .atlas-popup a:hover { color: var(--link-hover); }
.atlas-popup__offer { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.atlas-popup__place { color: var(--text-muted); }
.atlas-popup__km { font-weight: 700; color: var(--lime-text); }
.atlas-popup__list { margin-top: .5rem; font-size: .875rem; }

/* Dunkelmodus: nur die Kachelebene wird umgekehrt; Marker, Popups und der
   Umkreis liegen in anderen Ebenen und behalten ihre Token-Farben. */
:root[data-theme="dark"] .mapbox .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .mapbox .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); }
}

/* Statuszeile „Stand der Erschließung“ auf der Startseite. */
.coverage { display: flex; flex-wrap: wrap; gap: .35rem 1.5rem; align-items: baseline; margin: var(--s5) 0 0; font-size: .9rem; color: var(--text); }
.coverage__title { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.coverage__date { margin-left: .5rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
.coverage__list { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.coverage__list li { display: inline-flex; align-items: baseline; gap: .45rem; }
.coverage__more { margin: 0; flex-basis: 100%; font-weight: 600; }

/* Gebietstabelle auf /karte. */
.gebiete { width: 100%; border-collapse: collapse; margin: var(--s3) 0 var(--s4); font-size: .95rem; }
.gebiete th, .gebiete td { text-align: left; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--border); vertical-align: baseline; overflow-wrap: break-word; hyphens: auto; }
.gebiete thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.gebiete td .atlas-key { vertical-align: -2px; margin-right: .45rem; }
.gebiete__sub { color: var(--text-muted); font-size: .85rem; }
.gebiete__legend { display: none; }
/* Bei 320 px (400 % Zoom) scrollt nur die Tabelle waagerecht, nicht die Seite. */
.gebiete-wrap { overflow-x: auto; }
.gebiete-wrap:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.gebiete__open { display: flex; gap: .45rem; align-items: baseline; color: var(--text); }

@media (max-width: 560px) {
    .mapbox__teaser { grid-template-columns: 1fr; padding: var(--s4); }
    .mapbox__glyph { display: none; }
    .mapbox__toggle { width: 100%; }
    .mapbox__canvas { height: clamp(300px, 50vh, 420px); min-height: 0; }
    .gebiete th, .gebiete td { padding: var(--s2) .4rem; }
    .gebiete thead th { letter-spacing: .04em; }
    /* Status nur als Symbol, der Text bleibt für Screenreader: so passen vier Spalten ungebrochen. */
    .gebiete__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .gebiete td .atlas-key { margin-right: 0; }
    .gebiete__legend { display: flex; gap: var(--s4); margin: calc(-1 * var(--s2)) 0 var(--s3); font-size: .85rem; color: var(--text-muted); }
    .gebiete__legend > span { display: inline-flex; align-items: center; gap: .45rem; }
    .gebiete__sub { display: block; }
}
@media (max-width: 400px) {
    /* 360 px: vier Spalten in 328 px ohne Abschneiden. */
    .gebiete { font-size: .875rem; }
    .gebiete th, .gebiete td { padding: var(--s2) .25rem; }
    .gebiete thead th { letter-spacing: 0; }
}
/* ---------------------------------------------------------------
   18. Detailseite
   --------------------------------------------------------------- */
.breadcrumb { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; color: var(--text); font-size: .9rem; margin: var(--s5) 0 var(--s4); }
.breadcrumb [aria-current="page"] { overflow-wrap: anywhere; }
.backlink { margin: 0 0 var(--s5); font-weight: 600; font-size: .95rem; }

.entry__header { padding-bottom: var(--s5); margin-bottom: var(--s6); border-bottom: 2px solid var(--rule); }
.entry__title { font-size: clamp(1.8rem, 1.2rem + 2.5vw, 2.7rem); margin: 0 0 var(--s2); }
.entry__subtitle { font-size: 1.15rem; line-height: 1.5; color: var(--text); max-width: 52ch; margin: 0 0 var(--s3); }
.entry__org { font-weight: 600; font-size: .95rem; margin: 0; overflow-wrap: anywhere; color: var(--text-muted); }

/* Der Kontaktblock steht im Markup VOR dem Fliesstext (Handy zuerst) und
   wird auf breiten Schirmen per Rasterposition nach rechts gesetzt. */
.entry__layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s7); align-items: start; }
.entry__layout > .entry__main  { grid-column: 1; grid-row: 1; }
.entry__layout > .entry__aside { grid-column: 2; grid-row: 1; }
/* Mit Standort: Karte breit direkt unter dem Kopfstrich, darunter Haupttext und Seitenspalte. */
.entry__layout > .mapbox { grid-column: 1 / -1; grid-row: 1; margin: 0; }
.entry__layout--karte > .entry__main,
.entry__layout--karte > .entry__aside { grid-row: 2; }
.entry__main { min-width: 0; max-width: var(--measure); }
.entry__main > .section-title { margin-top: 0; }
.entry__lede { font-size: 1.2rem; line-height: 1.55; font-weight: 500; margin: 0 0 var(--s5); }
.entry__body p { margin: 0 0 var(--s4); }
.entry__body p:last-child { margin-bottom: 0; }
.entry__tags-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin: var(--s6) 0 var(--s3); padding-top: var(--s4); border-top: 1px solid var(--border); }
.entry__tags { display: flex; flex-wrap: wrap; gap: var(--s1); margin: 0; padding: 0; list-style: none; }

.entry__aside {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--s5);
    position: sticky; top: 5.25rem;
    min-width: 0;
}
.entry__aside .section-title { font-size: 1.2rem; margin-top: 0; }

.facts { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0 0 var(--s4); }
.facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); font-weight: 700; margin-top: var(--s3); }
.facts dt:first-of-type { margin-top: 0; }
.facts dd { margin: 0; overflow-wrap: anywhere; font-size: .95rem; }
.facts__maplink { font-size: .9rem; font-weight: 600; }

.entry__actions { display: grid; gap: var(--s2); margin-bottom: var(--s5); }
.entry__actions .btn { background: var(--card); }
.entry__actions .btn--primary { background: var(--cta); }
.btn--call { min-height: 56px; flex-direction: column; gap: 0; padding: .5rem 1rem; line-height: 1.25; }
.btn--call .btn__label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.btn--call .btn__number { font-size: 1.15rem; font-weight: 700; letter-spacing: .01em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.action-status { margin: 0; font-size: .85rem; color: var(--text); min-height: 1.2em; }
.action-status:empty { display: none; }
.entry__disclaimer { font-size: .82rem; line-height: 1.5; margin: var(--s4) 0 0; padding-top: var(--s4); border-top: 1px solid var(--border); }

/* ---------------------------------------------------------------
   19. Fliesstextseiten
   --------------------------------------------------------------- */
.prose { max-width: var(--measure); margin: var(--s7) auto var(--s8); }
.prose--center { text-align: center; }
.prose--center .list-plain { display: inline-grid; text-align: left; }
.prose h1 { font-size: clamp(1.8rem, 1.2rem + 2.5vw, 2.6rem); margin: 0 0 var(--s4); }
.prose h2 { font-size: 1.35rem; margin: var(--s7) 0 var(--s3); }
.prose p { margin: 0 0 var(--s4); }
.prose .lede { font-size: 1.15rem; line-height: 1.55; color: var(--text); }

.collection-head { max-width: var(--measure); padding: var(--s4) 0 0; margin: 0 0 var(--s6); }
.collection-head__title { font-size: clamp(1.8rem, 1.2rem + 2.5vw, 2.7rem); margin: 0 0 var(--s3); }
.collection-head__intro { font-size: 1.1rem; line-height: 1.6; color: var(--text); margin: 0 0 var(--s3); }
.collection-head__count { margin: 0; font-weight: 700; color: var(--brand); }
.collection-head__more { margin: var(--s2) 0 0; font-size: .95rem; font-weight: 600; }
.entry__more { margin: var(--s6) 0 0; font-weight: 600; }
.page-collection .results-main { margin-top: var(--s5); }

/* ---------------------------------------------------------------
   20. Hinweise und Formular
   --------------------------------------------------------------- */
.notice { padding: var(--s4) var(--s5); border-radius: var(--radius); margin: var(--s5) 0; border-left: 4px solid var(--border-strong); background: var(--surface); }
.notice p { margin: 0; }
.notice ul { margin: var(--s1) 0 0; padding-left: 1.2rem; }
.notice--error { background: #fbeeea; border-color: #8c2f16; color: #6f2410; }
.notice--warn  { background: #fff1d6; border-color: #9a5700; color: #5c3400; }
.notice--ok    { background: var(--brand-light); border-color: var(--brand); color: var(--text); }

.placeholder { display: inline-block; padding: .05rem .4rem; border: 1px dashed #9a5700; border-radius: var(--radius-sm); background: #fff1d6; color: #5c3400; font-weight: 600; }

.suggest { display: grid; gap: var(--s5); max-width: 44rem; margin-top: var(--s6); }
.suggest .field { display: flex; flex-direction: column; gap: var(--s1); border: 0; padding: 0; margin: 0; }
.suggest .field > span,
.suggest legend { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text); padding: 0; }
.suggest input, .suggest textarea, .suggest select {
    font: inherit; font-size: 1rem; padding: .65rem .8rem;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--card); color: var(--text); width: 100%; min-height: 48px;
}
.suggest textarea { min-height: 6rem; line-height: 1.55; resize: vertical; }
.suggest input:hover, .suggest textarea:hover { border-color: var(--brand); }
.suggest .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.suggest .checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0; margin-top: var(--s2); }
.suggest .check-item, .suggest .consent { display: flex; align-items: flex-start; gap: var(--s2); }
.suggest .check-item { padding: .3rem .35rem; margin-inline: -.35rem; border-radius: var(--radius-sm); min-height: 40px; align-items: center; }
.suggest .check-item:hover { background: var(--brand-light); }
.suggest .check-item input, .suggest .consent input { width: 20px; height: 20px; min-height: 0; margin-top: .3rem; accent-color: var(--brand); flex: none; }
.suggest .check-item input { margin-top: 0; }
.suggest .consent { margin: 0; padding: var(--s4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: .95rem; line-height: 1.55; }
.suggest .form-actions { margin-top: 0; }
.suggest > .muted { font-size: .88rem; margin: 0; }

.hp { position: absolute !important; left: -9999px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------------------------------------------------------------
   21. Fussbereich
   --------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: var(--s8); padding: var(--s7) 0 var(--s7); }
.site-footer__grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--s7); }
.site-footer__brand { font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; margin: 0 0 var(--s2); }
.site-footer p { margin: 0 0 var(--s2); max-width: 46ch; font-size: .95rem; }
.site-footer__heading { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text); margin: 0 0 var(--s2); }
.site-footer__links { list-style: none; padding: 0; margin: 0; }
.site-footer nav a { display: inline-block; padding: .3rem 0; color: var(--text); font-size: .95rem; }
.disclaimer { margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--border); color: var(--text); font-size: .85rem; line-height: 1.6; max-width: 78ch; }

/* ---------------------------------------------------------------
   22. Mobil
   --------------------------------------------------------------- */
@media (max-width: 900px) {
    /* Hier bricht die Navigation in eine zweite Zeile; ein mitlaufender Kopf wäre dann zu hoch. */
    .site-header { position: static; }
    html { scroll-padding-top: var(--s4); }
    .results-layout, .entry__layout { grid-template-columns: 1fr; gap: var(--s5); }
    .filters-wrap { position: static; max-height: none; overflow: visible; }
    .entry__layout > .entry__main,
    .entry__layout > .entry__aside,
    .entry__layout > .mapbox { grid-column: auto; grid-row: auto; }
    .entry__aside { position: static; }
    .entry__main { max-width: none; }
    .near__fields { grid-template-columns: minmax(0, 1fr) 130px; }
    .near__submit { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
    body { line-height: 1.55; }
    .container { padding-inline: var(--s4); }
    html { scroll-padding-top: var(--s4); }

    /* Vier Navigationspunkte brauchen zwei Zeilen; ein mitlaufender Kopf
       fräße ein Viertel des Bildschirms, deshalb steht er hier fest. */
    .site-header { position: static; }
    .site-header__inner { min-height: 0; padding-block: var(--s3); gap: var(--s2); }
    .brand { font-size: 1.05rem; }
    .site-nav { width: 100%; margin-left: 0; gap: 0 var(--s1); order: 3; }
    .site-nav a { padding: .4rem .5rem; font-size: .9rem; min-height: 44px; display: inline-flex; align-items: center; }
    .theme-toggle { margin-left: auto; }
    .site-band__inner { min-height: 30px; }

    .near { margin: var(--s4) 0 var(--s6); }
    .near__form { padding: var(--s5) var(--s4); }
    .near__head { margin-bottom: var(--s4); }
    .near__lede { font-size: 1rem; }
    .near__fields { grid-template-columns: 1fr; }
    .near__locate .btn { width: 100%; }
    .near--compact .near__form { padding: var(--s4); }

    .collections, .feed { margin-block: var(--s6); }
    .results-section { margin-block: var(--s5) var(--s7); }
    .results-head { flex-direction: column; align-items: flex-start; gap: var(--s1); }
    .card__actions .btn { flex: 1 1 auto; }
    .empty-state { padding: var(--s6) var(--s4); }
    .empty-state__actions .btn, .filters__actions .btn { flex: 1 1 100%; }

    .entry__titlerow { gap: var(--s3); }
    .avatar--lg { width: 52px; height: 52px; }
    .entry__aside { padding: var(--s4); }
    .entry__lede { font-size: 1.1rem; }

    .site-footer__grid { grid-template-columns: 1fr; gap: var(--s5); }
    .pagination { flex-wrap: wrap; gap: var(--s3); justify-content: center; }
    .suggest .field-row { grid-template-columns: 1fr; gap: var(--s4); }
    .prose h2 { margin-top: var(--s6); }
}

/* ---------------------------------------------------------------
   23. Bewegung reduzieren
   --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------------------------------------------------------------
   24. Druck
   --------------------------------------------------------------- */
@media print {
    :root, :root[data-theme="dark"] {
        --bg: #fff; --card: #fff; --surface: #fff; --surface-2: #fff;
        --text: #000; --text-muted: #333;
        --border: #999; --border-strong: #999;
        --link: #000; --link-hover: #000;
        --brand: #000; --accent-deep: #000; --rule: #000;
        color-scheme: light;
    }
    body { background: #fff; color: #000; font-size: 11pt; }
    .site-band, .site-header, .site-footer, .skip-link, .breadcrumb, .backlink, .chips,
    .results-aside, .pagination, .theme-toggle, .action-status, .mapbox, .near,
    .entry__actions button, .entry__disclaimer { display: none !important; }
    .print-only { display: block !important; }
    .container { max-width: none; padding: 0; }
    .entry__layout { display: block; }
    .entry__header { border-bottom: 1px solid #999; }
    .entry__aside { border: 1px solid #999; margin-top: var(--s5); padding: var(--s4); page-break-inside: avoid; }
    .card, .tile { border-color: #999; }
    .badge { border: 1px solid #999; background: #fff !important; color: #000 !important; }
    .badge--offer { border: 0; }
    .card__distance { background: #fff; color: #000; border: 1px solid #999; }
    a { color: #000; text-decoration: underline; }
    .entry__main a[href^="http"]::after,
    .entry__actions a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; word-break: break-all; font-weight: 400; }
    h1, h2, h3 { page-break-after: avoid; }
    .print-source { margin-top: var(--s5); padding-top: var(--s2); border-top: 1px solid #999; font-size: .8rem; word-break: break-all; }
}
