/* ==================================================================
   Grundschule Tangstedt – Gestaltung
   Leitidee: ein gut geführtes Grundschulheft. Tintenblau auf Heftweiß,
   die Schulheft-Lineatur als einziges großes Gestaltungselement.
   ================================================================== */

:root {
    --ink: #172B52;          /* Tintenblau: Überschriften, Flächen */
    --night: #0E1C3A;        /* Nachtblau: Fußbereich */
    --text: #26365A;         /* Fließtext */
    --muted: #5A6883;        /* Nebeninformationen */
    --paper: #F7F9FC;        /* Heftweiß */
    --white: #FFFFFF;
    --rule: #C6D4EA;         /* Linienblau */
    --band: #E6EEF9;         /* Mittelband der Lineatur */
    --pencil: #F0C25A;       /* Buntstift-Gelb, nur für Fokus & Markierung */

    /* Leichter Himmel unter der Kopfzeile: wenig Blau, das in Heftweiß übergeht */
    --sky: linear-gradient(to bottom, #CFE1F4 0, #E3EDF8 4.5rem, #F0F5FB 8rem, #F7F9FC 11rem, #F7F9FC);

    --font: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, -apple-system, sans-serif;
    --hand: "Grundschrift", "Segoe Print", "Comic Sans MS", cursive;

    --wrap: 1160px;
    --gap: clamp(1.25rem, 3vw, 2rem);
    --radius: 14px;
    --radius-big: 22px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 6rem;
}

body {
    margin: 0;
    background: var(--sky) no-repeat 0 4.75rem / 100% 11rem, var(--paper);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-color: var(--pencil); text-decoration-thickness: 3px; }

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

h1, h2, h3 { color: var(--ink); line-height: 1.15; margin: 0; }

address { font-style: normal; }

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--gap);
}

.icon {
    width: 1.25em; height: 1.25em;
    flex-shrink: 0;
    fill: none; stroke: currentColor; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
}
.icon--small { width: 1em; height: 1em; }

.a11y {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
    position: absolute; left: 1rem; top: -4rem; z-index: 100;
    background: var(--ink); color: var(--white);
    padding: .6rem 1rem; border-radius: 8px;
}
.skip:focus { top: 1rem; }

/* ------------------------------------------------------------------
   Kopfbereich
   ------------------------------------------------------------------ */

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--white);
    border-bottom: 1px solid #B8C8DE;                    /* Trennstrich */
    box-shadow: 0 2px 10px -2px rgba(14, 28, 58, .14);  /* leichte Schattierung */
    transition: box-shadow .2s;
}
.site-header.is-scrolled { box-shadow: 0 6px 24px -10px rgba(14, 28, 58, .32); }

.site-header__inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; min-height: 4.75rem;
}

.brand {
    display: flex; align-items: center; gap: .75rem;
    text-decoration: none; color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand__logo { height: 54px; width: auto; }
.brand__name { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }

.nav__list {
    list-style: none; margin: 0; padding: 0;
    display: flex; align-items: center; gap: .25rem;
}

.nav__link {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .55rem .85rem;
    border: 0; border-radius: 999px;
    background: none;
    font: inherit; font-weight: 700; font-size: .98rem;
    color: var(--ink); text-decoration: none;
    cursor: pointer;
}
.nav__link:hover { background: var(--band); text-decoration: none; }
.nav__link.is-active { background: var(--band); box-shadow: inset 0 -3px 0 var(--pencil); }

.nav__link--contact { background: var(--ink); color: var(--white); margin-left: .5rem; }
.nav__link--contact:hover, .nav__link--contact.is-active { background: var(--night); box-shadow: none; }

.nav__item { position: relative; }
.nav__link--sub .icon { transition: transform .2s; }
.nav__item.is-open .nav__link--sub .icon { transform: rotate(180deg); }

.nav__sub {
    list-style: none; margin: 0; padding: .5rem;
    position: absolute; top: calc(100% + .5rem); left: 0;
    min-width: 15rem;
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    box-shadow: 0 18px 40px -18px rgba(14, 28, 58, .4);
    display: none;
}
.nav__item.is-open .nav__sub,
.nav__item:focus-within .nav__sub { display: block; }

.nav__sub a {
    display: block; padding: .6rem .8rem;
    border-radius: 8px; text-decoration: none; color: var(--ink);
}
.nav__sub a:hover { background: var(--band); }

.nav-toggle {
    display: none; align-items: center; gap: .45rem;
    padding: .5rem .9rem;
    background: var(--band); color: var(--ink);
    border: 0; border-radius: 999px;
    font: inherit; font-weight: 700; cursor: pointer;
}
.nav-toggle__close { display: none; }

/* ------------------------------------------------------------------
   Schaltflächen & Links
   ------------------------------------------------------------------ */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .85rem 1.4rem;
    border-radius: 999px; border: 2px solid var(--ink);
    background: var(--ink); color: var(--white);
    font: inherit; font-weight: 700; text-decoration: none;
    cursor: pointer; transition: background .15s, color .15s;
}
.btn:hover { background: var(--night); border-color: var(--night); text-decoration: none; }
.btn--quiet { background: transparent; color: var(--ink); }
.btn--quiet:hover { background: var(--band); color: var(--ink); border-color: var(--ink); }
.btn--small { padding: .55rem 1rem; font-size: .95rem; }

.text-link { font-weight: 700; }

.round-btn {
    width: 2.75rem; height: 2.75rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 1.5px solid var(--rule);
    background: var(--white); color: var(--ink); cursor: pointer;
}
.round-btn:hover:not(:disabled) { border-color: var(--ink); }
.round-btn:disabled { opacity: .35; cursor: default; }

/* ------------------------------------------------------------------
   Startseite: Schulheft-Kopf
   ------------------------------------------------------------------ */

.hero { padding-block: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2.5rem); }

.hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: stretch;
}

/* Text links: Titel oben, Knöpfe unten – bündig mit Ober- und Unterkante des Fotos */
.hero__text { display: flex; flex-direction: column; }

.hero__title {
    font-family: var(--hand);
    font-weight: 400;
    font-size: clamp(2.1rem, 4.6vw, 4rem);
    color: var(--ink);
    margin: -.52em 0 1.25rem;   /* oberste Heftlinie auf Höhe der Fotokante */
}

/*  Die Lineatur: Maße passend zur Grundschrift berechnet
    (Zeilenhöhe 2em → Grundlinie bei 1,4545em).
    Oberlinie, Mittellinie, Grundlinie, Unterlinie – Mittelband getönt. */
.lineatur {
    display: block; position: relative;
    line-height: 2;
    padding-left: .12em;
    white-space: nowrap;
}
.lineatur::before,
.lineatur::after {
    content: ""; position: absolute; left: 0; right: 0;
    pointer-events: none;
}
.lineatur::before {               /* Mittelband zwischen Mittel- und Grundlinie */
    top: .9545em; height: .5em;
    background: var(--band);
    border-top: 1px solid var(--rule);
    border-bottom: 2px solid #9FB4D6;
}
.lineatur::after {                /* Ober- und Unterlinie */
    top: .5245em; height: 1.37em;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}
.lineatur__ink {
    position: relative; z-index: 1;
    display: inline-block;
    animation: schreiben 1.5s cubic-bezier(.55, .1, .35, 1) .2s both;
}
.lineatur__ink--second { animation-delay: 1.15s; }

@keyframes schreiben {
    from { clip-path: inset(-30% 100% -30% 0); }
    to   { clip-path: inset(-30% 0 -30% 0); }
}

.hero__lead {
    font-size: 1.15rem; max-width: 34rem;
    margin: auto 0 0;   /* nach unten: letzte Zeile schließt mit der Fotounterkante ab */
}


/* Fotos */
.slider { min-width: 0; position: relative; display: flex; flex-direction: column; aspect-ratio: 16 / 9; }

.slider__frame {
    position: relative;
    flex: 1;
    min-height: 0;
    border-radius: var(--radius-big);
    overflow: hidden;
    background: var(--band);
}
.slider__slide {
    position: absolute; inset: 0; margin: 0;
    opacity: 0; transition: opacity 1.1s ease;
}
.slider__slide.is-active { opacity: 1; }
.slider__slide { pointer-events: none; }
.slider__slide.is-active { pointer-events: auto; }
.slider__link { display: block; width: 100%; height: 100%; }
.slider__link img { transition: transform .6s ease; }
.slider__link:hover img { transform: scale(1.025); }
.slider__link:focus-visible { outline-offset: -5px; border-radius: var(--radius-big); }
/* Bildunterschrift liegt über dem Foto, soll Klicks aber durchlassen */
.slider__bar { pointer-events: none; }
.slider__controls { pointer-events: auto; }
.slider__go {
    display: inline-flex; align-items: center; gap: .35rem;
    margin-top: .35rem; font-weight: 700; font-size: .92rem; color: var(--white);
}
.slider__go[hidden] { display: none; }
.slider:hover .slider__go .icon { transform: translateX(3px); }
.slider__go .icon { transition: transform .2s; }
.slider__slide img { width: 100%; height: 100%; object-fit: cover; }

.slider__bar {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
    padding: 4rem 1.4rem 1.1rem;
    border-radius: 0 0 var(--radius-big) var(--radius-big);
    background: linear-gradient(to top, rgba(14, 28, 58, .85), rgba(14, 28, 58, .45) 55%, rgba(14, 28, 58, 0));
    color: var(--white);
}
.slider__caption { margin: 0; text-shadow: 0 1px 6px rgba(14, 28, 58, .5); }
.slider__caption strong { display: block; color: var(--white); font-size: 1.1rem; }
.slider__text { display: block; color: #DCE6F5; font-size: .95rem; }
.slider__text:empty { display: none; }

.slider__controls { display: flex; align-items: center; gap: .75rem; }
.slider__dots { display: flex; gap: .4rem; }

.slider__dot {
    width: 2.25rem; height: 1.5rem; padding: 0;
    border: 0; background: none; cursor: pointer;
    display: flex; align-items: center;
}
.slider__dot span {
    display: block; width: 100%; height: 4px;
    border-radius: 4px; background: rgba(255, 255, 255, .35);
    position: relative; overflow: hidden;
}
.slider__dot span::after {
    content: ""; position: absolute; inset: 0;
    background: var(--white);
    transform: scaleX(0); transform-origin: left;
}
.slider__dot.is-active span::after { animation: fortschritt var(--interval, 7s) linear forwards; }
.slider.is-paused .slider__dot.is-active span::after { animation: none; transform: scaleX(1); }

@keyframes fortschritt { to { transform: scaleX(1); } }

.slider__pause {
    width: 2.25rem; height: 2.25rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .55);
    background: rgba(14, 28, 58, .35); color: var(--white); cursor: pointer;
}
.slider__pause:hover { background: rgba(14, 28, 58, .6); }
.slider__icon-play { display: none; }
.slider.is-paused .slider__icon-play { display: block; }
.slider.is-paused .slider__icon-pause { display: none; }

/* Link-Karte in Texten: kleines Vorschaubild + Titel + Zusatzinfo */
.link-card-wrap { margin: 1.25rem 0; }
.link-card {
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.1rem; align-items: center;
    max-width: 36rem; padding: .85rem 1.1rem .85rem .85rem;
    background: #FFFFFF; border: 1px solid #C6D4EA; border-radius: 14px;
    color: inherit; text-decoration: none;
    box-shadow: 0 10px 22px -18px rgba(14, 28, 58, .55);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.link-card:hover { transform: translateY(-2px); border-color: #9FB4D6; box-shadow: 0 18px 30px -20px rgba(14, 28, 58, .6); text-decoration: none; }
.link-card__media {
    width: 6.5rem; aspect-ratio: 4 / 3; overflow: hidden;
    border-radius: 8px; background: #E6EEF9;
    display: flex; align-items: center; justify-content: center; color: #172B52;
}
.link-card__media img { width: 100%; height: 100%; object-fit: cover; }
.link-card--file .link-card__media { width: 5rem; aspect-ratio: 3 / 4; border: 1px solid #C6D4EA; box-shadow: 2px 3px 0 #E6EEF9; background: #FFFFFF; }
.link-card--file .link-card__media img { object-position: top; }
.link-card__media--icon .icon { width: 2rem; height: 2rem; }
.link-card__body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.link-card__title { font-weight: 700; font-size: 1.1rem; color: #172B52; line-height: 1.3; text-underline-offset: .15em; }
.link-card:hover .link-card__title { text-decoration: underline; text-decoration-color: #F0C25A; text-decoration-thickness: 3px; }
.link-card__meta { font-size: .92rem; color: #5A6883; line-height: 1.45; }
.link-card__action { display: inline-flex; align-items: center; gap: .35rem; margin-top: .2rem; font-size: .92rem; font-weight: 700; color: #172B52; }

/* ------------------------------------------------------------------
   Startseite: Neuigkeiten auf einer Rechenheft-Seite
   Kariertes Papier, das Datum oben rechts wie im Heft,
   Fotogalerien als eingeklebte Sofortbilder mit Klebeband.
   ------------------------------------------------------------------ */

.news-board {
    --karo: #DFE7F4;
    padding-block: clamp(2rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem);
    margin-top: clamp(.5rem, 1.5vw, 1rem);
    background-color: var(--white);
    background-image:
        linear-gradient(var(--karo) 1px, transparent 1px),
        linear-gradient(90deg, var(--karo) 1px, transparent 1px);
    background-size: 1.5rem 1.5rem;
    background-position: center -1px;
    border-block: 1px solid var(--rule);
}

.news-board__head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}
.news-board__title {
    font-family: var(--hand); font-weight: 400;
    font-size: clamp(2.2rem, 4vw, 3.2rem);
}
.news-board__title .lineatur { min-width: 6.8em; }
.news-board__head .btn { background: var(--white); }
.news-board__head .btn:hover { background: var(--band); }

/* „Aktuelles“ wird erst geschrieben, wenn es ins Bild kommt (nur mit JavaScript) */
.js .lineatur--onview .lineatur__ink { animation: none; clip-path: inset(-30% 100% -30% 0); }
.js .lineatur--onview.is-written .lineatur__ink { animation: schreiben 1.1s cubic-bezier(.55, .1, .35, 1) both; }

.news-board__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: clamp(1rem, 2.5vw, 1.75rem);
}
.news-board__grid--single { grid-template-columns: minmax(0, 1fr); max-width: 50rem; }

/* Datum wie im Heft: handschriftlich, oben rechts, auf einer Linie */
.heft-date {
    align-self: flex-end;
    font-family: var(--hand); color: var(--ink);
    font-size: 1.05rem; line-height: 1.9;
    padding: 0 .3rem;
    border-bottom: 1.5px solid #9FB4D6;
}
.heft-date--small { align-self: flex-start; font-size: .9rem; line-height: 1.75; padding: 0 .15rem; }

/* Der neueste Beitrag, groß */
.news-lead {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--radius-big);
    overflow: hidden;
    box-shadow: 0 26px 44px -30px rgba(14, 28, 58, .5);
}
.news-lead__link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.news-lead__link:hover { text-decoration: none; }
.news-lead__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--band); }
.news-lead__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.news-lead__link:hover .news-lead__media img { transform: scale(1.03); }
.news-lead__body { display: flex; flex-direction: column; gap: .55rem; padding: 1.25rem 1.6rem 1.6rem; flex: 1; }
.news-lead__title {
    font-size: clamp(1.5rem, 2.5vw, 2.05rem);
    font-weight: 800; letter-spacing: -.015em; line-height: 1.15;
    text-underline-offset: .15em;
}
.news-lead__link:hover .news-lead__title { text-decoration: underline; text-decoration-color: var(--pencil); text-decoration-thickness: 4px; }
.news-lead__text { margin: 0; font-size: 1.06rem; }
.news-lead__more {
    display: inline-flex; align-items: center; gap: .4rem;
    margin-top: auto; padding-top: .35rem;
    font-weight: 700; color: var(--ink);
}
.news-lead__more .icon { transition: transform .2s; }
.news-lead__link:hover .news-lead__more .icon { transform: translateX(4px); }

/* „Neu!“-Aufkleber */
.sticker {
    position: absolute; top: 1rem; right: 1rem;
    width: 4.75rem; height: 4.75rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--pencil); color: var(--ink);
    font-family: var(--hand); font-size: 1.3rem; line-height: 1;
    transform: rotate(-12deg);
    box-shadow: 0 8px 16px -8px rgba(14, 28, 58, .6), inset 0 0 0 4px var(--pencil), inset 0 0 0 5.5px rgba(23, 43, 82, .25);
    animation: aufkleben .5s cubic-bezier(.3, 1.5, .5, 1) .3s both;
}
@keyframes aufkleben {
    from { transform: rotate(-30deg) scale(.4); opacity: 0; }
    to   { transform: rotate(-12deg) scale(1); opacity: 1; }
}

/* Drei weitere Beiträge daneben */
.news-stack {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: clamp(.75rem, 1.5vw, 1rem);
}
.news-stack li { flex: 1; display: flex; }
.news-mini {
    flex: 1;
    display: grid; grid-template-columns: minmax(6rem, 38%) minmax(0, 1fr);
    gap: 1rem; align-items: center;
    padding: .75rem;
    background: var(--white);
    border: 1px solid var(--rule); border-radius: var(--radius);
    color: inherit; text-decoration: none;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.news-mini:hover { text-decoration: none; transform: translateY(-3px); border-color: #9FB4D6; box-shadow: 0 16px 28px -22px rgba(14, 28, 58, .6); }
.news-mini__img { width: 100%; height: 100%; min-height: 6.5rem; max-height: 9.5rem; object-fit: cover; border-radius: 10px; background: var(--band); }
.news-mini__img--none {
    display: flex; align-items: center; justify-content: center;
    color: #9FB4D6;
    background-color: var(--paper);
    background-image: linear-gradient(var(--karo) 1px, transparent 1px), linear-gradient(90deg, var(--karo) 1px, transparent 1px);
    background-size: .75rem .75rem;
}
.news-mini__img--none .icon { width: 2.25rem; height: 2.25rem; }
.news-mini__text { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.news-mini__title { font-weight: 700; font-size: 1.08rem; line-height: 1.3; color: var(--ink); text-underline-offset: .15em; }
.news-mini:hover .news-mini__title { text-decoration: underline; text-decoration-color: var(--pencil); text-decoration-thickness: 3px; }
.news-mini__teaser {
    font-size: .93rem; line-height: 1.45; color: var(--muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Fotogalerien als eingeklebte Sofortbilder */
.snapshots {
    display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3rem); align-items: center;
    margin-top: clamp(2.75rem, 5vw, 4rem);
}
.snapshots__title { font-family: var(--hand); font-weight: 400; font-size: 1.55rem; line-height: 1.5; margin-bottom: .5rem; }
.snapshots__list {
    list-style: none; margin: 0; padding: 1rem 0 0;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(1rem, 2.5vw, 2rem); align-items: start;
}
.snapshot { --tilt: -2.5deg; }
.snapshot:nth-child(2) { --tilt: 2deg; }
.snapshot:nth-child(3) { --tilt: -1deg; }
.snapshot:nth-child(4) { --tilt: 2.8deg; }
.snapshot__link {
    position: relative; display: block;
    padding: .6rem .6rem .15rem;
    background: var(--white);
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(14, 28, 58, .14), 0 16px 26px -16px rgba(14, 28, 58, .5);
    color: var(--ink); text-decoration: none;
    transform: rotate(var(--tilt));
    transition: transform .25s ease, box-shadow .25s ease;
}
.snapshot__link:hover, .snapshot__link:focus-visible {
    text-decoration: none;
    transform: rotate(0deg) translateY(-6px) scale(1.03);
    box-shadow: 0 2px 3px rgba(14, 28, 58, .12), 0 26px 34px -18px rgba(14, 28, 58, .55);
}
.snapshot__link::before {           /* Klebeband */
    content: ""; position: absolute; z-index: 1;
    top: -.75rem; left: 50%;
    width: 4.75rem; height: 1.5rem;
    transform: translateX(-50%) rotate(calc(var(--tilt) * -1.6));
    background: rgba(240, 194, 90, .62);
    clip-path: polygon(0 8%, 5% 0, 10% 10%, 15% 0, 85% 0, 90% 10%, 95% 0, 100% 8%, 100% 92%, 95% 100%, 90% 90%, 85% 100%, 15% 100%, 10% 90%, 5% 100%, 0 92%);
}
.snapshot__link img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--band); }
.snapshot__caption {
    display: block; padding: .45rem .15rem 0;
    font-family: var(--hand); font-size: 1.02rem; line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.snapshot__count { display: block; padding: 0 .15rem .5rem; font-size: .8rem; color: var(--muted); }

/* ------------------------------------------------------------------
   Abschnitte
   ------------------------------------------------------------------ */

.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--tight { padding-top: clamp(1.5rem, 3vw, 2.5rem); }

.section__head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    margin-bottom: 1.75rem;
}
.section__title {
    font-size: clamp(1.75rem, 3.2vw, 2.4rem);
    font-weight: 800; letter-spacing: -.015em;
}

.empty {
    padding: 2rem; background: var(--white);
    border: 1px dashed var(--rule); border-radius: var(--radius);
    color: var(--muted);
}

/* Karten für Beiträge */
.card {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    overflow: hidden;
}
.card__link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.card__link:hover { text-decoration: none; }
.card__link:hover .card__title { text-decoration: underline; text-decoration-color: var(--pencil); text-decoration-thickness: 3px; }
.card__media { aspect-ratio: 16 / 10; background: var(--band); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 1.1rem 1.25rem 1.4rem; display: flex; flex-direction: column; gap: .35rem; }
.card__date { font-size: .88rem; color: var(--muted); }
.card__title { font-size: 1.2rem; font-weight: 700; line-height: 1.3; text-underline-offset: .18em; }
.card__text { margin: 0; color: var(--text); font-size: .98rem; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 1.5rem;
}

/* Kontaktband */
.contact-band {
    display: grid; grid-template-columns: 1.1fr 1fr 1.15fr 1fr;
    gap: 2rem; align-items: start;
}
.contact-band__text { color: var(--muted); margin: .5rem 0 0; }
.contact-band__item { display: flex; gap: .85rem; }
.contact-band__icon { color: var(--ink); margin-top: .2rem; }

/* ------------------------------------------------------------------
   Unterseiten
   ------------------------------------------------------------------ */

.page-head {
    background: linear-gradient(to bottom, #CFE1F4 0, #E3EDF8 4.5rem, #F0F5FB 8rem, var(--white) 11rem, var(--white));
    border-bottom: 1px solid var(--rule);
    padding-block: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 2.5rem);
}
.page-head__back {
    display: inline-flex; align-items: center; gap: .35rem;
    font-weight: 700; margin-bottom: 1rem; text-decoration: none;
}
.page-head__title {
    font-size: clamp(2rem, 4.5vw, 3.1rem);
    font-weight: 800; letter-spacing: -.02em;
    max-width: 22ch;
    padding-bottom: .4rem;
    background: linear-gradient(var(--pencil), var(--pencil)) 0 100% / 3.5rem 5px no-repeat;
}
.page-head__lead { font-size: 1.15rem; color: var(--muted); margin: 1rem 0 0; max-width: 40rem; }

.article { max-width: 46rem; }
.article__meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; color: var(--muted); margin: 0 0 1.5rem; }
.article__figure { margin: 0 0 2rem; }
.article__figure img { width: 100%; border-radius: var(--radius-big); }

.prose { max-width: 42rem; font-size: 1.1rem; line-height: 1.75; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.45rem; font-weight: 800; margin: 2.25rem 0 .75rem; }
.prose p, .prose ul { margin: 0 0 1.1rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: .4rem; }
.prose li::marker { color: var(--ink); }
.prose strong { color: var(--ink); }

.section--more { background: var(--white); border-top: 1px solid var(--rule); }
.section--more .section__title { margin-bottom: 1.5rem; }

.pager {
    display: flex; align-items: center; justify-content: center; gap: 1.5rem;
    margin-top: 2.5rem;
}
.pager__link { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; }
.pager__info { color: var(--muted); }

/* Downloads */
.files { list-style: none; margin: 0; padding: 0; max-width: 52rem; border-top: 2px solid #9FB4D6; }
.file {
    display: grid; grid-template-columns: auto 1fr auto; gap: 1.1rem; align-items: center;
    padding: 1.35rem .25rem; border-bottom: 1px solid var(--rule);
}
.file__icon { width: 2rem; height: 2rem; color: var(--ink); }
.file__preview {
    width: 3.5rem; height: auto; aspect-ratio: 3 / 4; object-fit: cover; object-position: top;
    border: 1px solid var(--rule); border-radius: 4px; background: var(--white);
    box-shadow: 2px 3px 0 var(--band);
}
.file__title { font-size: 1.15rem; font-weight: 700; }
.file__text p { margin: .15rem 0 0; color: var(--muted); }
.file__meta { font-size: .9rem; }
.file__missing { color: var(--muted); font-style: italic; }

/* Kontaktseite */
.contact-page { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.contact-card {
    background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
    padding: 1.5rem 1.6rem;
}
.contact-card__title { font-size: 1.1rem; font-weight: 800; margin-bottom: .75rem; }
.contact-card__list { margin: 0; }
.contact-card__list dt { font-weight: 700; color: var(--ink); }
.contact-card__list dd { margin: 0 0 .75rem; overflow-wrap: anywhere; }

.fatal__detail { font-size: .9rem; color: var(--muted); }
.fatal__detail code { word-break: break-word; }

/* Fotogalerien */
.card__media { position: relative; }
.card__badge {
    position: absolute; left: .75rem; bottom: .75rem;
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .25rem .65rem; border-radius: 999px;
    background: rgba(14, 28, 58, .82); color: var(--white);
    font-size: .85rem; font-weight: 700;
}

.gallery-intro { margin-bottom: 2rem; }

.gallery {
    list-style: none; margin: 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: .75rem;
}
.gallery__link {
    display: block; overflow: hidden;
    border-radius: var(--radius);
    background: var(--band);
}
.gallery__link img {
    width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
    transition: transform .35s ease, opacity .2s;
}
.gallery__link:hover img { transform: scale(1.04); }
.gallery__link:focus-visible { outline-offset: 2px; }

.lightbox-open, .lightbox-open body { overflow: hidden; }

.lightbox {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(9, 17, 36, .97);
    display: flex; align-items: center; justify-content: center;
    padding: 3.5rem 4.5rem;
}
.lightbox[hidden] { display: none; }
.lightbox__figure {
    margin: 0; max-width: 100%; max-height: 100%;
    display: flex; flex-direction: column; align-items: center; gap: .85rem;
}
.lightbox__img {
    max-width: 100%; max-height: calc(100vh - 10rem);
    width: auto; height: auto;
    border-radius: 8px;
    transition: opacity .2s;
    background: rgba(255, 255, 255, .04);
}
.lightbox.is-loading .lightbox__img { opacity: .35; }
.lightbox__bar {
    display: flex; gap: 1rem; align-items: baseline;
    color: #D7E1F2; font-size: .98rem; text-align: center; max-width: 46rem;
}
.lightbox__count { color: #9FB4D6; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lightbox__caption:empty { display: none; }

.lightbox__btn {
    position: absolute;
    width: 3rem; height: 3rem;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .12); color: var(--white);
    cursor: pointer; transition: background .15s;
}
.lightbox__btn:hover { background: rgba(255, 255, 255, .24); }
.lightbox__btn[hidden] { display: none; }
.lightbox__btn .icon { width: 1.5rem; height: 1.5rem; }
.lightbox__btn--close { top: 1rem; right: 1rem; }
.lightbox__btn--prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox__btn--next { right: 1rem; top: 50%; transform: translateY(-50%); }

/* ------------------------------------------------------------------
   Fußbereich
   ------------------------------------------------------------------ */

.site-footer {
    background: var(--night); color: #C9D4E8;
    padding-top: clamp(2.5rem, 6vw, 4rem);
    margin-top: clamp(2rem, 5vw, 3rem);
}
.site-footer a { color: #E6EEF9; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-decoration-color: var(--pencil); }
.site-footer__grid {
    display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 2rem;
    padding-bottom: 2.5rem;
}
.site-footer__name { font-family: var(--hand); font-size: 1.35rem; color: var(--white); margin: 0 0 .75rem; line-height: 1.6; }
.site-footer__title { color: var(--white); font-size: 1rem; font-weight: 700; margin-bottom: .6rem; }
.site-footer__list { list-style: none; margin: 0; padding: 0; }
.site-footer__list li { margin-bottom: .4rem; overflow-wrap: anywhere; }
.site-footer__bottom {
    border-top: 1px solid rgba(198, 212, 234, .2);
    padding-block: 1.25rem; font-size: .9rem;
}
.site-footer__bottom p { margin: 0; }

/* Fehlerseite */
.fatal { display: grid; place-items: center; min-height: 100vh; padding: 2rem; }
.fatal__box { max-width: 32rem; background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); padding: 2rem; }

/* ------------------------------------------------------------------
   Kleinere Bildschirme
   ------------------------------------------------------------------ */

@media (max-width: 1080px) {
    .nav-toggle { display: inline-flex; }
    .nav {
        display: none;
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--rule);
        box-shadow: 0 20px 30px -20px rgba(14, 28, 58, .35);
        max-height: calc(100vh - 4.75rem); overflow-y: auto;
    }
    .nav.is-open { display: block; }
    .nav-open .nav-toggle__open { display: none; }
    .nav-open .nav-toggle__close { display: block; }
    .nav__list {
        flex-direction: column; align-items: stretch; gap: 0;
        width: 100%; max-width: var(--wrap); margin-inline: auto;
        padding: .5rem var(--gap) 1.25rem;
    }
    .nav__link { width: 100%; justify-content: space-between; border-radius: 10px; padding: .8rem .9rem; font-size: 1.05rem; }
    .nav__link--contact { margin: .5rem 0 0; justify-content: center; }
    .nav__sub { position: static; box-shadow: none; border: 0; border-left: 2px solid var(--rule); border-radius: 0; margin: 0 0 .5rem 1rem; padding: 0 0 0 .5rem; }

    .hero__grid { grid-template-columns: 1fr; }
    .hero__lead { margin-top: 0; }
    .slider { aspect-ratio: auto; }
    .slider__frame { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
    .news-board__grid { grid-template-columns: 1fr; }
    .news-mini__img { max-height: 8rem; }
    .snapshots { grid-template-columns: 1fr; }
    .snapshots__intro { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
    .contact-band, .contact-page { grid-template-columns: 1fr 1fr; }
    .site-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    body { font-size: 1rem; }
    .brand__name { font-size: 1rem; }
    .brand__logo { height: 38px; }
    .slider__frame { aspect-ratio: 4 / 3; }
    .contact-band, .contact-page, .site-footer__grid { grid-template-columns: 1fr; }
    .slider__frame { aspect-ratio: 4 / 3; }
    .slider__bar { padding: 3rem 1rem .85rem; }
    .slider__text { display: none !important; }
    .slider__dot { width: 1.6rem; }
    .news-lead__body { padding: 1.1rem 1.15rem 1.3rem; }
    .news-mini { grid-template-columns: 6.25rem minmax(0, 1fr); align-items: start; padding: .6rem; gap: .85rem; }
    .news-mini__img { min-height: 0; aspect-ratio: 1 / 1; height: auto; }
    .news-mini__teaser { display: none; }
    .sticker { width: 4rem; height: 4rem; font-size: 1.1rem; top: .75rem; right: .75rem; }
    .link-card { gap: .85rem; padding: .7rem; }
    .link-card__media { width: 5rem; }
    .link-card--file .link-card__media { width: 4rem; }
    .snapshots__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1.25rem; }
    .file { grid-template-columns: auto 1fr; }
    .file .btn, .file__missing { grid-column: 2; justify-self: start; }
    .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
    .gallery__link { border-radius: 10px; }
    .lightbox { padding: 3.75rem .5rem 1rem; }
    .lightbox__img { max-height: calc(100vh - 9rem); }
    .lightbox__btn--prev, .lightbox__btn--next { top: auto; bottom: 1rem; transform: none; }
    .lightbox__figure { padding-bottom: 3.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .lineatur__ink { animation: none; }
    .js .lineatur--onview .lineatur__ink { clip-path: none; }
    .sticker { animation: none; }
}

@media print {
    .site-header, .site-footer, .slider__bar, .lightbox, .snapshots { display: none; }
    body { background: #fff; }
}
