/*
 * Wippringser Dorfgemeinschaft – öffentliches Design
 * Leitidee: Dorfblatt statt App. Papier, Tinte, Linien; Farben aus dem Wimmelbild.
 */

@font-face {
    font-family: "Source Serif 4";
    src: url("fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Source Serif 4";
    src: url("fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
    font-weight: 200 900;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Source Sans 3";
    src: url("fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --papier: #f5f0e6;
    --papier-tief: #ebe3d3;
    --weiss: #fffdf8;
    --tinte: #1d2420;
    --tinte-weich: #4b534d;
    --tinte-leise: #575c55;
    --linie: #d5cab5;
    --linie-kraeftig: #b7aa92;
    --gruen: #2e5339;
    --gruen-dunkel: #1f3a28;
    --ziegel: #9a3b20;
    --ziegel-hell: #f3e2d6;

    --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
    --sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;

    --breite: 1120px;
    --rand: clamp(16px, 4vw, 32px);
}

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

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

body {
    margin: 0;
    background: var(--papier);
    color: var(--tinte);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
}

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

a {
    color: var(--gruen);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--ziegel);
}

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

h1,
h2,
h3 {
    font-family: var(--serif);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0;
    text-wrap: balance;
}

p {
    margin: 0 0 1em;
}

.hidden,
[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.huelle {
    max-width: var(--breite);
    margin: 0 auto;
    padding: 0 var(--rand);
}

.zum-inhalt {
    position: absolute;
    left: -9999px;
}

.zum-inhalt:focus {
    left: var(--rand);
    top: 8px;
    z-index: 100;
    background: var(--weiss);
    padding: 8px 12px;
}

/* ---------- Kopf ---------- */

.kopf {
    background: var(--papier);
    border-bottom: 1px solid var(--linie);
}

.kopf__innen {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: 18px;
    padding-bottom: 18px;
}

.wortmarke {
    display: flex;
    flex-direction: column;
    color: var(--tinte);
    text-decoration: none;
    line-height: 1;
}

.wortmarke:hover {
    color: var(--tinte);
}

.wortmarke__ort {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.65rem;
    letter-spacing: -0.02em;
}

.wortmarke__verein {
    margin-top: 5px;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tinte-weich);
}

.hauptnav {
    display: flex;
    gap: 26px;
    font-size: 1rem;
}

.hauptnav a {
    color: var(--tinte);
    text-decoration: none;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.hauptnav a:hover,
.hauptnav a[aria-current="page"] {
    border-bottom-color: var(--ziegel);
    color: var(--tinte);
}

@media (max-width: 860px) {
    .kopf__innen {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding-bottom: 0;
    }

    .hauptnav {
        width: calc(100% + 2 * var(--rand));
        margin: 0 calc(-1 * var(--rand));
        padding: 0 var(--rand) 10px;
        gap: 22px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .hauptnav::-webkit-scrollbar {
        display: none;
    }
}

/* ---------- Bühne (Startseite) ---------- */

.buehne {
    position: relative;
    border-bottom: 1px solid var(--linie);
}

.buehne__bild {
    width: 100%;
    height: clamp(260px, 52vw, 560px);
    object-fit: cover;
    object-position: center 40%;
    background-color: var(--papier-tief);
}

.buehne__bildnachweis {
    position: absolute;
    right: var(--rand);
    top: 12px;
    font-size: 0.8rem;
    color: var(--tinte);
    background: rgba(245, 240, 230, 0.88);
    padding: 2px 8px;
}

.buehne__text {
    position: relative;
    margin-top: -88px;
    /* Box ragt um den Seitenrand nach links heraus, damit der Text bündig mit den Abschnitten darunter bleibt */
    margin-left: calc(-1 * var(--rand));
    max-width: calc(640px + var(--rand));
    background: var(--papier);
    padding: 30px 34px 34px var(--rand);
}

.buehne h1 {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.buehne__einleitung {
    margin: 16px 0 24px;
    font-size: 1.2rem;
    color: var(--tinte-weich);
    max-width: 34em;
}

.dachzeile {
    display: block;
    margin-bottom: 10px;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ziegel);
    font-weight: 600;
}

@media (max-width: 640px) {
    .buehne__text {
        margin: 0;
        padding: 24px 0 32px;
    }
}

/* ---------- Knöpfe & Links ---------- */

.knopf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 20px;
    border: 1px solid var(--gruen);
    border-radius: 3px;
    background: var(--gruen);
    color: var(--weiss);
    font: 600 1rem/1.2 var(--sans);
    text-decoration: none;
    cursor: pointer;
}

.knopf:hover {
    background: var(--gruen-dunkel);
    border-color: var(--gruen-dunkel);
    color: var(--weiss);
}

.knopf--leise {
    background: transparent;
    color: var(--tinte);
    border-color: var(--linie-kraeftig);
}

.knopf--leise:hover {
    background: var(--weiss);
    color: var(--tinte);
    border-color: var(--tinte);
}

.knopf:disabled {
    background: var(--linie);
    border-color: var(--linie);
    color: var(--tinte-leise);
    cursor: not-allowed;
}

.knopfreihe {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 22px;
    align-items: center;
}

.pfeillink {
    font-weight: 600;
}

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

.abschnitt {
    padding: clamp(48px, 7vw, 88px) 0;
}

.abschnitt--getoent {
    background: var(--papier-tief);
    border-top: 1px solid var(--linie);
    border-bottom: 1px solid var(--linie);
}

.abschnitt__kopf {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 24px;
    padding-bottom: 14px;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--tinte);
}

.abschnitt__kopf h2 {
    font-size: clamp(1.8rem, 3.4vw, 2.5rem);
}

.abschnitt__einleitung {
    max-width: 40em;
    color: var(--tinte-weich);
    margin: 14px 0 0;
}

.leer {
    padding: 28px 0;
    color: var(--tinte-weich);
    font-style: italic;
}

.mehr {
    margin-top: 28px;
}

/* ---------- Termine ---------- */

.termine {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 48px;
}

.termin {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 18px;
    padding: 22px 0;
    border-bottom: 1px solid var(--linie);
}

.termin__datum {
    text-align: center;
    line-height: 1;
    padding-top: 2px;
}

.termin__tag {
    display: block;
    font-family: var(--serif);
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--ziegel);
}

.termin__monat {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tinte-weich);
}

.termin h3 {
    font-size: 1.3rem;
}

.termin__zeit {
    margin: 6px 0 0;
    color: var(--tinte-weich);
}

.termin__notiz {
    margin: 8px 0 0;
    font-size: 0.95rem;
    color: var(--tinte-leise);
}

.termin__jetzt {
    display: inline-block;
    margin-bottom: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ziegel);
}

.termin--vorbei {
    opacity: 0.55;
}

@media (max-width: 760px) {
    .termine {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- Chronik ---------- */

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

.chronik__jahrgang {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 28px;
    padding: 24px 0;
    border-bottom: 1px solid var(--linie-kraeftig);
}

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

.chronik__ereignis + .chronik__ereignis {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dotted var(--linie-kraeftig);
}

.chronik__datum {
    display: block;
    padding-top: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ziegel);
}

.chronik__datum + .chronik__titel {
    padding-top: 2px;
}

.chronik__jahr {
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--gruen);
}

.chronik__titel {
    font-size: 1.35rem;
    padding-top: 4px;
}

.chronik__ereignis details {
    margin-top: 6px;
}

.chronik__ereignis summary {
    display: inline-block;
    cursor: pointer;
    color: var(--gruen);
    font-weight: 600;
    list-style: none;
    padding: 4px 0;
}

.chronik__ereignis summary::-webkit-details-marker {
    display: none;
}

.chronik__ereignis summary::after {
    content: " +";
}

.chronik__ereignis details[open] summary::after {
    content: " –";
}

.chronik__ereignis summary:hover {
    color: var(--ziegel);
}

.chronik__text {
    max-width: 42em;
    margin-top: 8px;
    font-family: var(--serif);
    font-size: 1.08rem;
}

.chronik__bilder {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.vorschau {
    width: 96px;
    height: 96px;
    padding: 0;
    border: 1px solid var(--linie-kraeftig);
    background: var(--weiss);
    cursor: zoom-in;
}

.vorschau img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vorschau:hover {
    border-color: var(--tinte);
}

@media (max-width: 640px) {
    .chronik__jahrgang {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }

    .chronik__jahr {
        font-size: 1.5rem;
    }
}

/* ---------- Vereine ---------- */

.vereine {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    column-gap: 48px;
}

.verein {
    padding: 24px 0;
    border-bottom: 1px solid var(--linie);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.verein img {
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border: 1px solid var(--linie);
}

.verein h3 {
    font-size: 1.3rem;
}

.verein__text {
    color: var(--tinte-weich);
}

.verein__text p:last-child {
    margin-bottom: 0;
}

.verein a.pfeillink {
    margin-top: auto;
}

/* ---------- Fotoarchiv ---------- */

.filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    margin: 22px 0 6px;
}

.filter--unter {
    margin-top: 4px;
    font-size: 0.95rem;
}

.filter button {
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 6px 0;
    font: 600 1rem var(--sans);
    color: var(--tinte-weich);
    cursor: pointer;
}

.filter button:hover {
    color: var(--tinte);
}

.filter button[aria-pressed="true"] {
    color: var(--tinte);
    border-bottom-color: var(--ziegel);
}

.archiv {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px 28px;
    margin-top: 26px;
}

.archivbild {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: zoom-in;
}

.archivbild__rahmen {
    display: block;
    aspect-ratio: 4 / 3;
    background: var(--papier-tief);
    border: 1px solid var(--linie-kraeftig);
    padding: 6px;
}

.archivbild__rahmen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.92);
    transition: filter 0.2s;
}

.archivbild:hover .archivbild__rahmen img {
    filter: none;
}

.archivbild__leer {
    display: grid;
    place-items: center;
    height: 100%;
    color: var(--tinte-leise);
}

.archivbild__titel {
    display: block;
    margin-top: 12px;
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.25;
}

.archivbild:hover .archivbild__titel {
    color: var(--ziegel);
}

.archivbild__text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 4px;
    font-size: 0.95rem;
    color: var(--tinte-weich);
}

.archivbild__anzahl {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
    color: var(--tinte-leise);
}

@media (max-width: 900px) {
    .archiv {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .archiv {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- Lightbox ---------- */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    /* Oben ausgerichtet statt mittig: sonst verschieben unterschiedlich lange Bildtexte die ganze Karte */
    align-items: flex-start;
    justify-content: center;
    padding: max(16px, 4vh) 16px 16px;
    background: rgba(20, 24, 21, 0.9);
}

.lightbox__karte {
    position: relative;
    width: min(960px, 100%);
    max-height: calc(100vh - max(16px, 4vh) - 16px);
    overflow-y: auto;
    background: var(--papier);
}

.lightbox__bild {
    position: relative;
    /* Feste Höhe, damit Pfeile und Schließen-Knopf beim Blättern an derselben Stelle bleiben */
    height: min(68vh, 760px);
    background: #111;
}

.lightbox__bild img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lightbox__unterschrift {
    padding: 20px 24px 26px;
}

.lightbox__unterschrift h2 {
    font-size: 1.5rem;
}

.lightbox__text {
    margin-top: 10px;
    font-family: var(--serif);
    color: var(--tinte-weich);
}

.lightbox__zaehler {
    display: block;
    margin-top: 4px;
    font-size: 0.9rem;
    color: var(--tinte-leise);
}

.lightbox__knopf {
    position: absolute;
    width: 44px;
    height: 44px;
    border: 0;
    background: rgba(245, 240, 230, 0.92);
    color: var(--tinte);
    font: 600 1.3rem/1 var(--sans);
    cursor: pointer;
}

.lightbox__knopf:hover {
    background: var(--weiss);
}

.lightbox__zu {
    top: 0;
    right: 0;
}

.lightbox__zurueck {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox__weiter {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

body.ohne-scroll {
    overflow: hidden;
}

/* ---------- Seiten mit Fließtext (Impressum, Wipper-Haus) ---------- */

.seite {
    padding: clamp(36px, 6vw, 72px) 0 clamp(56px, 8vw, 96px);
}

.seite__kopf {
    max-width: 44em;
    margin-bottom: 36px;
}

.seite__kopf h1 {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 700;
}

.seite__kopf p {
    margin-top: 14px;
    font-size: 1.15rem;
    color: var(--tinte-weich);
}

.unternav {
    display: flex;
    gap: 22px;
    margin-bottom: 32px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--linie);
}

.unternav a {
    color: var(--tinte-weich);
    text-decoration: none;
    font-weight: 600;
}

.unternav a:hover {
    color: var(--tinte);
}

.rechtstext {
    max-width: 46em;
}

.rechtstext h2 {
    font-size: 2rem;
    margin: 0 0 18px;
    padding-top: 24px;
}

.rechtstext h3 {
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tinte-weich);
    margin: 30px 0 8px;
}

.rechtstext ul {
    padding-left: 1.2em;
    margin: 0 0 1em;
}

.rechtstext section + section {
    margin-top: 56px;
    border-top: 2px solid var(--tinte);
}

.rechtstext__stand {
    color: var(--tinte-leise);
    font-size: 0.95rem;
}

/* ---------- Formular ---------- */

.formular {
    max-width: 720px;
    display: grid;
    gap: 22px;
}

.formular__zeile {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.feld label,
.feld legend {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

fieldset.feld {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.feld__paar {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 10px;
}

.feld__hinweis {
    display: block;
    margin-top: 4px;
    font-size: 0.9rem;
    color: var(--tinte-leise);
}

.feld input,
.feld textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--linie-kraeftig);
    border-radius: 3px;
    background: var(--weiss);
    color: var(--tinte);
    font: 1rem/1.4 var(--sans);
}

.feld input:focus,
.feld textarea:focus {
    outline: 2px solid var(--gruen);
    outline-offset: 0;
    border-color: var(--gruen);
}

.meldung {
    max-width: 720px;
    margin-bottom: 24px;
    padding: 14px 18px;
    border-left: 4px solid var(--gruen);
    background: var(--weiss);
}

.meldung--fehler {
    border-left-color: var(--ziegel);
    background: var(--ziegel-hell);
}

.formular__datenschutz {
    font-size: 0.95rem;
    color: var(--tinte-weich);
    margin: 0;
}

@media (max-width: 640px) {
    .formular__zeile {
        grid-template-columns: minmax(0, 1fr);
    }
}

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

.fuss {
    background: var(--tinte);
    color: #d8d2c4;
    padding: 48px 0 28px;
    font-size: 0.98rem;
}

.fuss a {
    color: #f5f0e6;
}

.fuss a:hover {
    color: #e9b49c;
}

.fuss__raster {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 32px;
}

.fuss__name {
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 600;
    color: #f5f0e6;
    margin-bottom: 8px;
}

.fuss address {
    font-style: normal;
}

.fuss ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.fuss__klein {
    margin-top: 36px;
    padding-top: 18px;
    border-top: 1px solid rgba(245, 240, 230, 0.18);
    font-size: 0.88rem;
    color: #a9a394;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
}

.fuss__klein a {
    color: #a9a394;
}

@media (max-width: 640px) {
    .fuss__raster {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition: none !important;
    }
}

/* ---------- Anmeldeseite ---------- */

.formular--schmal {
    max-width: 440px;
}

.anmelden__merken {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
}

.anmelden__merken input {
    width: 18px;
    height: 18px;
    accent-color: var(--gruen);
}

.anmelden__neben {
    margin-top: 24px;
}

/* ---------- Nach oben ---------- */

.nach-oben {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--papier);
    border-radius: 3px;
    background: var(--tinte);
    color: var(--papier);
    font: 600 0.95rem/1 var(--sans);
    cursor: pointer;
}

.nach-oben:hover {
    background: var(--gruen-dunkel);
}

@media (max-width: 640px) {
    .nach-oben {
        width: 44px;
        justify-content: center;
        padding: 0;
        font-size: 1.2rem;
    }

    .nach-oben__text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }
}

/* Bei geöffneter Bildergalerie stört der Nach-oben-Knopf */
body.ohne-scroll .nach-oben {
    display: none;
}
