/*
 * Netzwerk Finanzkompetenz Nordrhein-Westfalen
 * Zentrales Stylesheet des oeffentlichen Auftritts.
 *
 * Farben und Schrift nach der Vorlage NeuesDesign.pdf.
 * Ersetzt das frühere WordPress-Theme (template/style.css) und Bootstrap 3.
 */

/* ------------------------------------------------------------------ *
 * 1. Gestaltungsvariablen
 * ------------------------------------------------------------------ */

:root {
    /* Hausfarben */
    --purpurrot: #882345;
    --nachtblau: #003064;
    --grasgruen: #175E54;
    --grau: #7F7F7F;

    /* Abstufungen */
    --nachtblau-dunkel: #00223f;
    --nachtblau-hell: #0b4a8a;
    --purpurrot-dunkel: #6b1b37;
    --grasgruen-hell: #1e7a6d;

    /* Flaechen */
    --grund: #ffffff;
    --grund-gedaempft: #f4f6f8;
    --grund-akzent: #eef1f5;
    --linie: #dde3ea;
    --linie-kraeftig: #c3ccd7;

    /* Text */
    --text: #1c2530;
    --text-gedaempft: #55606d;
    --text-invers: #ffffff;

    /* Typografie */
    --schrift: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --zeilenhoehe: 1.65;

    /* Raster. Die Breite waechst auf grossen Bildschirmen mit – bei 1200px
     * fest blieb auf einem hochaufloesenden Monitor mehr als die halbe
     * Flaeche leer, und die Seite wurde unnoetig lang. Die Stufen greifen
     * erst oberhalb der ueblichen Laptopbreiten, darunter aendert sich
     * nichts. */
    --breite: 1200px;
    --breite-text: 46rem;
    --abstand: 1rem;
    --abstand-gross: clamp(2.5rem, 6vw, 5rem);

    /* Formen */
    --radius: 6px;
    --radius-gross: 10px;
    --schatten: 0 1px 2px rgba(0, 34, 63, .06), 0 4px 12px rgba(0, 34, 63, .06);
    --schatten-hoch: 0 2px 4px rgba(0, 34, 63, .08), 0 12px 28px rgba(0, 34, 63, .12);

    --uebergang: 160ms ease;
}

/* ------------------------------------------------------------------ *
 * 2. Grundlagen
 * ------------------------------------------------------------------ */

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

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

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

body {
    margin: 0;
    font-family: var(--schrift);
    font-size: 1.0625rem;
    line-height: var(--zeilenhoehe);
    color: var(--text);
    background: var(--grund);
    -webkit-font-smoothing: antialiased;
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--nachtblau);
    text-decoration-thickness: 1px;
    text-underline-offset: .18em;
}

a:hover,
a:focus-visible {
    color: var(--purpurrot);
}

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

hr {
    border: 0;
    border-top: 1px solid var(--linie);
    margin: var(--abstand-gross) 0;
}

/* ------------------------------------------------------------------ *
 * 3. Typografie
 * ------------------------------------------------------------------ */

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--nachtblau);
    margin: 0 0 .6em;
    text-wrap: balance;
}

h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem); }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.5vw, 2rem); }
h3 { font-size: clamp(1.15rem, 1rem + .7vw, 1.4rem); }
h4 { font-size: 1.0625rem; }

p, ul, ol, dl, table, figure {
    margin: 0 0 1.15em;
}

p, li {
    text-wrap: pretty;
}

.vorspann {
    font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem);
    color: var(--text-gedaempft);
    max-width: var(--breite-text);
}

.klein {
    font-size: .9rem;
    color: var(--text-gedaempft);
}

/* Abschnittsueberschrift mit dem Diagonalen-Motiv der Marke */
.abschnitt-titel {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.6rem;
}

.abschnitt-titel::before {
    content: "";
    flex: none;
    width: 1.15rem;
    height: 1.6rem;
    background:
        linear-gradient(to bottom right, var(--purpurrot) 0 50%, transparent 50% 100%),
        linear-gradient(to top left, var(--grasgruen) 0 50%, var(--nachtblau) 50% 100%);
}

.abschnitt-fuss {
    margin: 1.8rem 0 0;
    text-align: center;
}

.abschnitt-titel h2,
.abschnitt-titel h1 {
    margin: 0;
}

/* ------------------------------------------------------------------ *
 * 4. Raster und Abschnitte
 * ------------------------------------------------------------------ */

.huelle {
    width: min(100% - 2.5rem, var(--breite));
    margin-inline: auto;
}

@media (min-width: 1440px) {
    :root { --breite: 1340px; }
}

@media (min-width: 1700px) {
    :root { --breite: 1560px; }
}

@media (min-width: 2000px) {
    :root { --breite: 1800px; }
}

.abschnitt {
    padding-block: var(--abstand-gross);
}

.abschnitt--gedaempft {
    background: var(--grund-gedaempft);
}

.abschnitt--dunkel {
    background: var(--nachtblau);
    color: var(--text-invers);
}

.abschnitt--dunkel h1,
.abschnitt--dunkel h2,
.abschnitt--dunkel h3 {
    color: var(--text-invers);
}

.abschnitt--dunkel a {
    color: #cfe0f2;
}

.raster {
    display: grid;
    gap: 1.75rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.raster--zwei {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

.raster--breit {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
}

.fliess {
    max-width: var(--breite-text);
}

/* ------------------------------------------------------------------ *
 * 5. Wort-Bild-Marke
 * ------------------------------------------------------------------ */

.marke {
    display: block;
    width: 100%;
    height: auto;
}

/* ------------------------------------------------------------------ *
 * 6. Kopfbereich und Navigation
 * ------------------------------------------------------------------ */

.sprungmarke {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: .75rem 1.25rem;
    background: var(--nachtblau);
    color: var(--text-invers);
    font-weight: 600;
}

.sprungmarke:focus {
    left: 1rem;
    top: 1rem;
    color: var(--text-invers);
}

.kopf {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--grund);
    border-bottom: 1px solid var(--linie);
}

.kopf__leiste {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding-block: .9rem;
}

.kopf__marke {
    display: block;
    flex: none;
    width: min(19rem, 58vw);
    line-height: 0;
}

.kopf__marke:focus-visible {
    outline-offset: 4px;
}

.kopf__schalter {
    display: none;
    align-items: center;
    gap: .5rem;
    padding: .55rem .9rem;
    font: inherit;
    font-weight: 600;
    color: var(--nachtblau);
    background: var(--grund-gedaempft);
    border: 1px solid var(--linie-kraeftig);
    border-radius: var(--radius);
    cursor: pointer;
}

.kopf__schalter-strich,
.kopf__schalter-strich::before,
.kopf__schalter-strich::after {
    display: block;
    width: 1.15rem;
    height: 2px;
    background: currentColor;
    content: "";
}

.kopf__schalter-strich {
    position: relative;
}

.kopf__schalter-strich::before { position: absolute; top: -6px; }
.kopf__schalter-strich::after { position: absolute; top: 6px; }

.navigation ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .15rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Zugang zum internen Bereich: eigener Menuepunkt, sichtbar abgesetzt */
.navigation__zugang {
    margin-left: .5rem;
    padding-left: .75rem;
    border-left: 1px solid var(--linie);
}

.navigation__zugang a {
    color: var(--purpurrot);
}

.navigation__zugang a::before {
    content: "";
    display: inline-block;
    width: .55rem;
    height: .8rem;
    margin-right: .4rem;
    vertical-align: -1px;
    background: currentColor;
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.navigation__zugang a:hover,
.navigation__zugang a:focus-visible {
    color: var(--text-invers);
    background: var(--purpurrot);
}

.navigation a {
    display: block;
    padding: .5rem .7rem;
    font-weight: 600;
    font-size: .95rem;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius);
    border-bottom: 3px solid transparent;
    transition: color var(--uebergang), background var(--uebergang), border-color var(--uebergang);
}

.navigation a:hover,
.navigation a:focus-visible {
    color: var(--nachtblau);
    background: var(--grund-gedaempft);
}

.navigation a[aria-current="page"] {
    color: var(--nachtblau);
    border-bottom-color: var(--purpurrot);
}

@media (max-width: 62rem) {
    .kopf__schalter {
        display: inline-flex;
    }

    .navigation {
        display: none;
        width: 100%;
        padding-bottom: 1rem;
        /* Die Leiste bleibt beim Blaettern oben stehen. Wird sie hoeher als
           der Bildschirm, laesst sich ihr unteres Ende nicht mehr erreichen –
           auf dem iPhone war der Punkt "Anmelden" deshalb nicht anklickbar.
           Die Liste bekommt darum eine Hoechsthoehe und blaettert selbst.
           dvh statt vh, weil Safari die Adressleiste ein- und ausblendet. */
        max-height: calc(100vh - 5.5rem);
        max-height: calc(100dvh - 5.5rem);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .navigation[data-offen="ja"] {
        display: block;
    }

    .kopf__leiste {
        /* Umbruch nur fuer die Navigation darunter: Marke und Schalter
           gehoeren in dieselbe Zeile. */
        flex-wrap: wrap;
        gap: .75rem;
    }

    .kopf__marke {
        width: min(16rem, 52vw);
    }

    .kopf__schalter {
        padding: .5rem .7rem;
    }

    .navigation ul {
        flex-direction: column;
        gap: 0;
    }

    .navigation a {
        padding: .8rem .25rem;
        border-bottom: 1px solid var(--linie);
        border-radius: 0;
    }

    .navigation__zugang {
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
        border-top: 2px solid var(--linie);
        margin-top: .5rem;
        padding-top: .5rem;
    }

    .navigation a[aria-current="page"] {
        border-bottom-color: var(--purpurrot);
        border-bottom-width: 2px;
    }
}

/* ------------------------------------------------------------------ *
 * 7. Buehne
 * ------------------------------------------------------------------ */

.buehne {
    position: relative;
    background: var(--nachtblau);
}

.buehne__bild {
    display: block;
    width: 100%;
    height: clamp(15rem, 34vw, 26rem);
    object-fit: cover;
}

.buehne__inhalt {
    background: var(--nachtblau);
    color: var(--text-invers);
    padding: 1.75rem 1.5rem;
}

.buehne__inhalt h1 {
    color: var(--text-invers);
    margin-bottom: .4rem;
}

.buehne__inhalt p {
    margin: 0;
    color: #d6e2f0;
    max-width: 46ch;
}

@media (min-width: 48rem) {
    .buehne__inhalt {
        position: absolute;
        left: max(1.25rem, calc((100% - var(--breite)) / 2));
        bottom: 0;
        width: min(38rem, 60%);
        padding: 2.25rem 2.5rem;
    }
}

/* Schmale Kopfzeile fuer Unterseiten */
.seitenkopf {
    background: var(--nachtblau);
    color: var(--text-invers);
    padding-block: clamp(2rem, 5vw, 3.25rem);
    background-image:
        linear-gradient(to bottom right, var(--purpurrot) 0 1.5%, transparent 1.5%),
        linear-gradient(to top left, var(--grasgruen) 0 1.5%, transparent 1.5%);
}

.seitenkopf h1 {
    color: var(--text-invers);
    margin-bottom: .35rem;
}

.seitenkopf p {
    margin: 0;
    color: #d6e2f0;
    max-width: 60ch;
}

/* ------------------------------------------------------------------ *
 * 8. Karten
 * ------------------------------------------------------------------ */

.karte {
    display: flex;
    flex-direction: column;
    background: var(--grund);
    border: 1px solid var(--linie);
    border-radius: var(--radius-gross);
    overflow: hidden;
    transition: box-shadow var(--uebergang), transform var(--uebergang), border-color var(--uebergang);
}

.karte:has(a:hover),
.karte:has(a:focus-visible) {
    box-shadow: var(--schatten-hoch);
    border-color: var(--linie-kraeftig);
    transform: translateY(-2px);
}

.karte__bild {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    /* Auf breiten Karten wuerde das Seitenverhaeltnis das Bild sehr hoch
     * werden lassen und die Seite unnoetig verlaengern. */
    max-height: 15rem;
    object-fit: cover;
    background: var(--grund-akzent);
}

.karte__leib {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: 1.25rem 1.35rem 1.4rem;
    flex: 1;
}

.karte__titel {
    font-size: 1.1rem;
    margin: 0;
}

.karte__titel a {
    text-decoration: none;
    color: var(--nachtblau);
}

.karte__titel a::after {
    content: "";
    position: absolute;
    inset: 0;
}

.karte {
    position: relative;
}

.karte__text {
    margin: 0;
    color: var(--text-gedaempft);
    font-size: .96rem;
}

.karte__meta {
    margin: 0;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--grasgruen);
}

.karte__fuss {
    margin-top: auto;
    padding-top: .75rem;
}

/* Farbiger Streifen oben – greift das Diagonalen-Motiv auf */
.karte--markiert::before {
    content: "";
    display: block;
    height: 5px;
    background: linear-gradient(to right,
        var(--purpurrot) 0 33.3%,
        var(--nachtblau) 33.3% 66.6%,
        var(--grasgruen) 66.6% 100%);
}

/* ------------------------------------------------------------------ *
 * 9. Schaltflaechen
 * ------------------------------------------------------------------ */

/* ------------------------------------------------------------------ *
 * 10. Marken / Etiketten
 * ------------------------------------------------------------------ */

.etikett {
    display: inline-block;
    padding: .2rem .6rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    border-radius: 999px;
    color: var(--text-invers);
    background: var(--grasgruen);
}

.etikett--offen { background: var(--grasgruen); }
.etikett--bald { background: var(--purpurrot); }
.etikett--vorbei { background: var(--grau); }

/* ------------------------------------------------------------------ *
 * 11. Tabellen und Listen
 * ------------------------------------------------------------------ */

.tabelle-huelle {
    overflow-x: auto;
    border: 1px solid var(--linie);
    border-radius: var(--radius-gross);
}

table.tabelle {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: .96rem;
}

table.tabelle th,
table.tabelle td {
    padding: .8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--linie);
    vertical-align: top;
}

table.tabelle th {
    background: var(--grund-gedaempft);
    color: var(--nachtblau);
    font-weight: 700;
    white-space: nowrap;
}

table.tabelle tr:last-child td {
    border-bottom: 0;
}

.liste-schlicht {
    list-style: none;
    padding: 0;
}

.liste-haken {
    list-style: none;
    padding: 0;
}

.liste-haken li {
    position: relative;
    padding-left: 1.7rem;
    margin-bottom: .6rem;
}

.liste-haken li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .45em;
    width: .7rem;
    height: .7rem;
    background: var(--grasgruen);
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

/* ------------------------------------------------------------------ *
 * 12. Hinweise
 * ------------------------------------------------------------------ */

.hinweis {
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--nachtblau);
    background: var(--grund-gedaempft);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.hinweis--erfolg { border-left-color: var(--grasgruen); }
.hinweis--fehler { border-left-color: var(--purpurrot); }

/* CakePHP-Flash-Meldungen. Die Flash-Elemente liefern teils .alert
 * (aus der Bootstrap-Zeit), teils .message – beide sehen gleich aus. */
.alert,
.message {
    margin: 1rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--nachtblau);
    background: var(--grund-gedaempft);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.alert-success, .message.success { border-left-color: var(--grasgruen); }
.alert-danger, .alert-error, .message.error { border-left-color: var(--purpurrot); }
.alert-warning { border-left-color: #b3801a; }
.alert-info { border-left-color: var(--nachtblau); }

.alert a, .message a { font-weight: 600; }

/* ------------------------------------------------------------------ *
 * 13. Fussbereich
 * ------------------------------------------------------------------ */

.fuss {
    margin-top: var(--abstand-gross);
    background: var(--nachtblau);
    color: #d6e2f0;
    border-top: 6px solid;
    border-image: linear-gradient(to right,
        var(--purpurrot) 0 33.3%,
        var(--nachtblau) 33.3% 66.6%,
        var(--grasgruen) 66.6% 100%) 1;
}

.fuss__raster {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    padding-block: clamp(2.25rem, 5vw, 3.25rem);
}

.fuss h2 {
    font-size: 1rem;
    color: var(--text-invers);
    margin-bottom: .8rem;
}

.fuss ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fuss li {
    margin-bottom: .45rem;
}

.fuss a {
    color: #d6e2f0;
    text-decoration: none;
}

.fuss a:hover,
.fuss a:focus-visible {
    color: var(--text-invers);
    text-decoration: underline;
}

/* Beide Marken im Fussbereich gleich breit und auf weissem Grund, damit sie
 * als Paar auftreten. Die Hoehe unterscheidet sich, weil die Seitenverhaeltnisse
 * verschieden sind - die Breite ist das, was als "gleich gross" gelesen wird. */
.fuss__marke,
.fuss__foerderer {
    width: min(17rem, 100%);
}

/* Die Wort-Bild-Marke ist randlos angelegt: die Dreiecke sitzen in den
 * Ecken. Ein Innenabstand wuerde sie vom Rand loesen, deshalb fuellt das
 * SVG die Flaeche ganz aus. Die Rundung schneidet es sauber ab. */
.fuss__marke {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    line-height: 0;
}

.fuss__marke .marke {
    display: block;
    width: 100%;
}

.fuss__abschluss {
    border-top: 1px solid rgba(255, 255, 255, .18);
    padding-block: 1.1rem;
    font-size: .88rem;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    align-items: center;
    justify-content: space-between;
}

/* ------------------------------------------------------------------ *
 * 14. Hilfsklassen
 * ------------------------------------------------------------------ */

.nur-fuer-screenreader {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mittig { text-align: center; }
.ohne-abstand { margin: 0; }
.abstand-oben { margin-top: var(--abstand-gross); }

.bild-rahmen {
    border-radius: var(--radius-gross);
    overflow: hidden;
    background: var(--grund-akzent);
}

/* ------------------------------------------------------------------ *
 * 15. Druck
 * ------------------------------------------------------------------ */

@media print {
    .kopf,
    .fuss,
    .sprungmarke,
    .knopf {
        display: none !important;
    }

    body {
        font-size: 11pt;
        color: #000;
    }

    a::after {
        content: " (" attr(href) ")";
        font-size: .85em;
    }
}

/* Marke im Seitenkopf der Schuelerakademie */
.seitenkopf__marke {
    width: min(30rem, 100%);
    margin-bottom: 1.25rem;
}

/* ------------------------------------------------------------------ *
 * 16. Formulare
 * ------------------------------------------------------------------ */

.formular .input,
.formular .form-group {
    margin-bottom: 1rem;
}

.formular label {
    display: block;
    margin-bottom: .3rem;
    font-weight: 600;
    font-size: .92rem;
    color: var(--nachtblau);
}

.formular input[type="text"],
.formular input[type="email"],
.formular input[type="password"],
.formular input[type="search"],
.formular input[type="date"],
.formular input[type="number"],
.formular input[type="tel"],
.formular input[type="url"],
.formular select,
.formular textarea {
    width: 100%;
    padding: .65rem .8rem;
    font: inherit;
    color: var(--text);
    background: var(--grund);
    border: 1px solid var(--linie-kraeftig);
    border-radius: var(--radius);
}

.formular input:focus-visible,
.formular select:focus-visible,
.formular textarea:focus-visible {
    border-color: var(--nachtblau);
}

.formular .error-message {
    display: block;
    margin-top: .3rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--purpurrot);
}

/* ------------------------------------------------------------------ *
 * 17. Termine
 * ------------------------------------------------------------------ */

.termin-daten {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .2rem .75rem;
    margin: .4rem 0 0;
}

.termin-daten dt {
    font-weight: 600;
    color: var(--text);
}

.termin-daten dd {
    margin: 0;
}

/* Etiketten der Veranstaltungsarten */
.etikett--tagung { background: var(--nachtblau); }
.etikett--schulung { background: var(--grasgruen); }
.etikett--stammtisch { background: var(--purpurrot); }

/* ------------------------------------------------------------------ *
 * 18. Filterleiste und Kartenkopfzeile
 * ------------------------------------------------------------------ */

.filter {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 2rem;
}

.filter__punkt {
    display: inline-block;
    padding: .45rem .95rem;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--nachtblau);
    background: var(--grund-gedaempft);
    border: 1px solid var(--linie);
    border-radius: 999px;
    transition: background var(--uebergang), color var(--uebergang), border-color var(--uebergang);
}

.filter__punkt:hover,
.filter__punkt:focus-visible {
    color: var(--nachtblau);
    background: var(--grund-akzent);
    border-color: var(--linie-kraeftig);
}

.filter__punkt--aktiv,
.filter__punkt--aktiv:hover {
    color: var(--text-invers);
    background: var(--nachtblau);
    border-color: var(--nachtblau);
}

.karte__kopfzeile {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin: 0;
}

.etikett--akademie { background: var(--nachtblau-hell); }
.etikett--sonstiges { background: var(--grau); }

/* ------------------------------------------------------------------ *
 * 19. Detailseite einer Einrichtung
 * ------------------------------------------------------------------ */

.mitglied {
    display: grid;
    gap: 2.5rem;
    align-items: start;
}

@media (min-width: 56rem) {
    .mitglied {
        grid-template-columns: minmax(0, 1fr) 20rem;
    }
}

.mitglied__inhalt :is(p, ul, ol) {
    max-width: var(--breite-text);
}

.mitglied__inhalt img {
    border-radius: var(--radius);
}

.seitenkopf__rueckweg {
    margin: 0 0 .5rem;
    font-size: .92rem;
}

.seitenkopf__rueckweg a {
    color: #cfe0f2;
    text-decoration: none;
    font-weight: 600;
}

.seitenkopf__rueckweg a:hover,
.seitenkopf__rueckweg a:focus-visible {
    color: var(--text-invers);
    text-decoration: underline;
}

/* Kopfbild einer Einrichtung: die Vorlagen sind nur 640 px breit,
   deshalb Hoehe begrenzen statt hochzuskalieren. */
.mitglied__kopfbild {
    display: block;
    width: 100%;
    max-height: 20rem;
    aspect-ratio: 21 / 8;
    object-fit: cover;
    object-position: center;
    border-radius: var(--radius-gross);
    background: var(--grund-akzent);
}

/* ------------------------------------------------------------------ *
 * 20. Schuelerakademie
 * ------------------------------------------------------------------ */

.kennzahl {
    font-size: clamp(2rem, 1.4rem + 2vw, 2.9rem);
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 .25rem;
}

.stationsgruppe {
    display: inline-block;
    margin: 0 0 1.25rem;
    padding: .3rem 0 .3rem 0;
    border-bottom: 3px solid var(--purpurrot);
    font-size: 1.2rem;
    color: var(--nachtblau);
}

.stimme {
    margin: 0 0 1rem;
    padding: .85rem 1.15rem;
    background: var(--grund);
    border-left: 4px solid var(--grasgruen);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text);
}

/* Karussell der Schuelerakademie: Bootstrap 3 wird hier noch geladen,
   die Bilder brauchen aber eine feste Hoehe. */
#myCarousel .item img {
    width: 100%;
    max-height: 30rem;
    object-fit: cover;
    border-radius: var(--radius-gross);
}

#myCarousel .bildueberschrift {
    background: var(--nachtblau) !important;
    border-radius: var(--radius);
}

/* ------------------------------------------------------------------ *
 * 21. Bildergalerie
 * ------------------------------------------------------------------ */

.galerie {
    position: relative;
}

.galerie__spur {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(100%, 22rem);
    scroll-behavior: smooth;
    gap: 1.25rem;
    margin: 0;
    padding: 0 0 .5rem;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    scrollbar-width: thin;
    overscroll-behavior-x: contain;
}

.galerie__bild {
    scroll-snap-align: start;
}

.galerie__bild figure {
    margin: 0;
    height: 100%;
    background: var(--grund);
    border: 1px solid var(--linie);
    border-radius: var(--radius-gross);
    overflow: hidden;
}

.galerie__bild img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--grund-akzent);
}

.galerie__bild figcaption {
    padding: .7rem .9rem;
    font-size: .9rem;
    color: var(--text-gedaempft);
}

.galerie__pfeil {
    position: absolute;
    top: calc(50% - 2rem);
    z-index: 2;
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    padding: 0 0 .2rem;
    font: inherit;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--nachtblau);
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--linie-kraeftig);
    border-radius: 50%;
    box-shadow: var(--schatten);
    cursor: pointer;
}

.galerie__pfeil:hover,
.galerie__pfeil:focus-visible {
    color: var(--text-invers);
    background: var(--nachtblau);
    border-color: var(--nachtblau);
}

.galerie__pfeil[hidden] { display: none; }

.galerie__pfeil--zurueck { left: -1.1rem; }
.galerie__pfeil--vor { right: -1.1rem; }

@media (max-width: 48rem) {
    .galerie__pfeil { display: none; }
}

/* Schulformen */
.schulformen {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .5rem;
}

.schulformen li {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--linie);
}

.schulformen__zahl {
    flex: none;
    min-width: 2.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--nachtblau);
    text-align: right;
}

.schulformen__name {
    color: var(--text-gedaempft);
}

/* Kartenspur (z. B. die Angebote auf der Startseite) */
.galerie--karten .galerie__spur {
    grid-auto-columns: min(100%, 19rem);
    padding-bottom: 1rem;
}

.galerie--karten .galerie__bild {
    display: flex;
}

.galerie--karten .karte {
    width: 100%;
}

/* ------------------------------------------------------------------ *
 * 22. Programm einer Veranstaltung
 * ------------------------------------------------------------------ */

.programm {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.programm__punkt {
    display: grid;
    gap: .35rem 1.5rem;
    padding: 1.1rem 1.35rem;
    background: var(--grund);
    border: 1px solid var(--linie);
    border-left: 4px solid var(--nachtblau);
    border-radius: 0 var(--radius-gross) var(--radius-gross) 0;
}

@media (min-width: 42rem) {
    .programm__punkt {
        grid-template-columns: 9rem minmax(0, 1fr);
    }
}

.programm__zeit {
    font-weight: 700;
    color: var(--nachtblau);
    white-space: nowrap;
}

.programm__zeit .klein {
    display: block;
    font-weight: 400;
}

.programm__inhalt h3 {
    margin: 0 0 .3rem;
    font-size: 1.05rem;
}

/* ------------------------------------------------------------------ *
 * 23. Fliesstext-Seiten und Berichtsbilder
 * ------------------------------------------------------------------ */

/* Textseiten nutzen die volle Containerbreite wie die uebrigen Seiten,
   halten die Zeilenlaenge aber ueber die Spaltenbreite lesbar. */
.lesetext {
    max-width: 68rem;
}

/* Lesebreite unabhaengig von der Schachtelung. Die Texte dieser Seiten
 * stammen teils noch aus dem alten Redaktionssystem und sind
 * unterschiedlich tief verschachtelt; eine Regel nach direkten Kindern
 * traf mal zu und mal nicht. */
.lesetext p,
.lesetext ul,
.lesetext ol,
.lesetext h2,
.lesetext h3,
.lesetext h4 {
    max-width: var(--breite-text);
}

.lesetext img {
    border-radius: var(--radius-gross);
}

.bericht-bild {
    margin: 0;
    background: var(--grund);
    border: 1px solid var(--linie);
    border-radius: var(--radius-gross);
    overflow: hidden;
}

.bericht-bild img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--grund-akzent);
}

.bericht-bild figcaption {
    padding: .7rem .9rem;
    font-size: .88rem;
    color: var(--text-gedaempft);
}

/* Zurueckweg auch im schmalen Kopfbereich */
.seitenkopf .fliess { max-width: var(--breite-text); }

/* ------------------------------------------------------------------ *
 * 24. Formularfelder in Karten
 * ------------------------------------------------------------------ */

.feldpaar {
    margin-bottom: 1rem;
}

.feldpaar label {
    display: block;
    margin-bottom: .3rem;
    font-weight: 600;
    font-size: .92rem;
    color: var(--nachtblau);
}

.feldpaar abbr {
    color: var(--purpurrot);
    text-decoration: none;
    cursor: help;
}

.feldpaar input,
.feldpaar select,
.feldpaar textarea {
    width: 100%;
    padding: .6rem .75rem;
    font: inherit;
    color: var(--text);
    background: var(--grund);
    border: 1px solid var(--linie-kraeftig);
    border-radius: var(--radius);
}

.feldpaar input:focus-visible,
.feldpaar select:focus-visible,
.feldpaar textarea:focus-visible {
    border-color: var(--nachtblau);
}

.feldpaar__hinweis {
    display: block;
    margin-top: .25rem;
    font-size: .82rem;
    color: var(--text-gedaempft);
}

.feldpaar--zwei {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 1rem;
}

/* ------------------------------------------------------------------ *
 * 25. Terminauswahl der Schuelerakademie
 * ------------------------------------------------------------------ */

.feldpaar__fehler {
    display: block;
    margin-top: .25rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--purpurrot);
}

.terminwahl {
    margin: 2.5rem 0 0;
    padding: 0;
    border: 0;
}

.terminwahl__titel {
    padding: 0;
    font-family: var(--schrift-titel, inherit);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--nachtblau);
}

.terminwahl__hinweis {
    margin: .35rem 0 1.5rem;
    color: var(--text-gedaempft);
}

/* Monate nebeneinander: sonst laeuft die Auswahl ueber mehrere Bildschirme. */
.terminwahl__monate {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1.5rem 1.75rem;
    align-items: start;
}

.terminwahl__monat {
    padding: 1rem 1.1rem 1.2rem;
    background: var(--grund);
    border: 1px solid var(--linie);
    border-radius: var(--radius-gross);
}

.terminwahl__monatstitel {
    margin: 0 0 .7rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid var(--linie);
    font-size: .92rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-gedaempft);
}

.terminwahl__tage {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(3.9rem, 1fr));
    gap: .4rem;
}

/* Der Radioknopf bleibt bedienbar, sichtbar ist die Kachel dahinter. */
.terminwahl__feld {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.terminwahl__tag {
    display: block;
    padding: .45rem .3rem;
    text-align: center;
    background: var(--grund);
    border: 1px solid var(--linie-kraeftig);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.terminwahl__tag:hover {
    border-color: var(--nachtblau);
}

.terminwahl__feld:focus-visible + .terminwahl__tag {
    outline: 2px solid var(--nachtblau);
    outline-offset: 2px;
}

.terminwahl__feld:checked + .terminwahl__tag {
    background: var(--nachtblau);
    border-color: var(--nachtblau);
    color: #fff;
}

.terminwahl__zahl {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--nachtblau);
}

.terminwahl__feld:checked + .terminwahl__tag .terminwahl__zahl {
    color: #fff;
}

.terminwahl__wochentag {
    display: block;
    margin-top: .1rem;
    font-size: .68rem;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--text-gedaempft);
}

.terminwahl__feld:checked + .terminwahl__tag .terminwahl__wochentag {
    color: rgba(255, 255, 255, .85);
}

.terminwahl__abschluss {
    margin: 2rem 0 .75rem;
}

/* ------------------------------------------------------------------ *
 * 26. Kleinigkeiten
 * ------------------------------------------------------------------ */

/* Der Download-Knopf steht neben seiner Groessenangabe. */
.karte__fuss .klein {
    margin-left: .6rem;
    color: var(--text-gedaempft);
}

/* Phasen einer Ablaufvariante */
.phasen {
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
    counter-reset: phase;
}

.phase {
    position: relative;
    padding: 0 0 1.1rem 2.1rem;
    counter-increment: phase;
}

.phase::before {
    content: counter(phase);
    position: absolute;
    top: .1rem;
    left: 0;
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    font-size: .8rem;
    font-weight: 700;
    color: #fff;
    background: var(--nachtblau);
    border-radius: 50%;
}

/* Die Linie verbindet die Phasen; an der letzten endet sie. */
.phase:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 1.75rem;
    left: .72rem;
    bottom: .2rem;
    border-left: 1px solid var(--linie);
}

.phase__titel {
    margin: 0;
    font-size: 1rem;
    color: var(--nachtblau);
}

.phase__dauer {
    margin: .1rem 0 .35rem;
    font-size: .85rem;
    color: var(--text-gedaempft);
}

.phase .liste-haken {
    margin: .35rem 0 0;
}

/* Aufzaehlung innerhalb eines Hinweispunkts, etwa die Niveaustufen */
.niveaus {
    margin: .5rem 0 0;
    padding-left: 1.1rem;
    list-style: disc;
}

.niveaus li {
    margin-bottom: .3rem;
    padding-left: 0;
}

.niveaus li::before {
    content: none;
}

.hinweis .liste-haken.ohne-abstand li:last-child {
    margin-bottom: 0;
}

/* Nach dem Hinweiskasten braucht die erste Gruppenueberschrift Luft. */
.hinweis + .stationsgruppe {
    margin-top: 2.25rem;
}

/* ------------------------------------------------------------------ *
 * 27. Ein Medium im Einzelnen
 * ------------------------------------------------------------------ */

.medium {
    display: grid;
    grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 48rem) {
    .medium {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.75rem;
    }
}

.medium__bild img + img {
    margin-top: 1rem;
}

.medium__aktion {
    margin-top: 1.5rem;
}

.medium__aktion .klein {
    margin-top: .6rem;
    color: var(--text-gedaempft);
}

/* Der Beschreibungstext kommt aus dem Editor und bringt eigene Absaetze mit. */
.medium__text > :first-child {
    margin-top: 0;
}

.medium__text img {
    max-width: 100%;
    height: auto;
}

/* ------------------------------------------------------------------ *
 * 28. Artikelbreite für Berichte
 * ------------------------------------------------------------------ */

/* Kopf, Aufmacherbild und Text laufen bündig in einer Spalte. Vorher stand
 * der Text als schmaler Streifen in einer 1200 Pixel breiten Hülle, mit
 * viel Leerraum rechts daneben. */
.huelle--artikel {
    width: min(100% - 2.5rem, 54rem);
}

.seitenkopf .huelle--artikel .fliess {
    max-width: none;
}

.bericht-bild--aufmacher {
    margin-top: 2.5rem;
}

.bericht-bild--aufmacher img {
    width: 100%;
    height: auto;
}

/* Im Artikel füllt der Text die Spalte; die Lesebreite ist die Spalte. */
.huelle--artikel .lesetext,
.huelle--artikel .fliess,
.huelle--artikel .lesetext p,
.huelle--artikel .lesetext ul,
.huelle--artikel .lesetext ol,
.huelle--artikel .lesetext h2,
.huelle--artikel .lesetext h3,
.huelle--artikel .lesetext h4 {
    max-width: none;
}

/* Fortlaufend nummerierte Abschnitte, etwa in der Datenschutzerklärung.
 * Die Nummern zählt der Browser, damit sie beim Umstellen von Abschnitten
 * nicht von Hand nachgeführt werden müssen. */
.lesetext--nummeriert {
    counter-reset: abschnitt;
}

.lesetext--nummeriert h2 {
    counter-increment: abschnitt;
}

.lesetext--nummeriert h2::before {
    content: counter(abschnitt) ". ";
}

/* Widerspruchsfeld der Reichweitenmessung */
.optout {
    width: 100%;
    height: 12rem;
    margin: 1rem 0 1.5rem;
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    background: var(--grund);
}

/* ------------------------------------------------------------------ *
 * 29. Soziale Netzwerke und Fördererlogo
 * ------------------------------------------------------------------ */

.netzwerke {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.netzwerke a {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

.netzwerke__zeichen {
    width: 1.15rem;
    height: 1.15rem;
    flex: none;
}

.netzwerke--nur-zeichen .netzwerke__zeichen {
    width: 1.4rem;
    height: 1.4rem;
}

/* Logo des Fördermittelgebers unter der Wort-Bild-Marke */
.fuss__foerderer {
    margin: 1rem 0 0;
    padding: .6rem .8rem;
    background: #fff;
    border-radius: var(--radius);
}

.fuss__foerderer img {
    display: block;
    width: 100%;
    height: auto;
}

.fuss__foerderhinweis {
    margin: 0 0 .75rem;
    font-size: .88rem;
    opacity: .85;
}
