/* ==========================================================================
   Haselbach 2 – modernes, ruhiges Theme für die Gemeindebücherei Haselbach
   Serif-Überschriften, viel Weißraum, Farbakzente aus dem Logo
   ========================================================================== */

/* ---------- Schriften (lokal, DSGVO-freundlich, SIL OFL) ---------- */
@font-face { font-family: "Fraunces"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/fraunces-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/fraunces-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/fraunces-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }

/* ---------- Farben & Maße ---------- */
:root {
    --bg: #FBF9F5;
    --surface: #FFFFFF;
    --ink: #1D2026;
    --ink-soft: #545B68;
    --line: #E6E1D8;

    /* Akzente aus dem Logo, gedeckt */
    --blue: #0B4F8C;
    --blue-dark: #05447A;
    --red: #B0191D;
    --yellow: #F3B429;
    --green: #437E39;

    /* Abschnitts-Töne */
    --tint-sun: #F8F1E3;
    --tint-sky: #EEF3F9;
    --tint-leaf: #EEF3EB;
    --tint-berry: #F7EEEC;

    --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --wrap: 1160px;
    --narrow: 720px;
    --gutter: clamp(16px, 4vw, 40px);
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 1px 2px rgba(29, 32, 38, .05), 0 12px 32px -8px rgba(29, 32, 38, .14);
    --block-space: clamp(72px, 10vw, 128px);
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: clamp(1rem, .96rem + .2vw, 1.08rem);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.12; letter-spacing: -.015em; margin: 0 0 .5em; text-wrap: balance; }
h3 { font-size: 1.3rem; letter-spacing: -.01em; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: var(--narrow); margin-inline: auto; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Kopfzeile ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(251, 249, 245, .88);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); text-decoration: none; }
/* Logo: gemaltes ABC-Wandbild */
.brand__mark { display: block; flex: 0 0 auto; width: 76px; }
.brand__mark img { width: 100%; height: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.02rem, .9rem + .5vw, 1.2rem); letter-spacing: -.01em; }
.brand__tagline { font-size: .78rem; color: var(--ink-soft); letter-spacing: .02em; margin-top: 2px; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
    display: inline-block; padding: 8px 12px; border-radius: 8px;
    font-weight: 500; font-size: .95rem; color: var(--ink); text-decoration: none;
    transition: color .2s ease, background-color .2s ease;
}
.site-nav a:hover { color: var(--blue); background: rgba(11, 79, 140, .06); }

.nav-toggle { display: none; }

@media (max-width: 880px) {
    .nav-toggle {
        display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
        width: 44px; height: 44px; padding: 12px 11px; border: 1px solid var(--line); border-radius: 10px;
        background: var(--surface); cursor: pointer;
    }
    .nav-toggle__bar { display: block; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .25s ease, opacity .2s ease; }
    .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
    .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .site-nav {
        position: absolute; left: 0; right: 0; top: 100%;
        background: var(--bg); border-bottom: 1px solid var(--line);
        padding: 8px var(--gutter) 20px; display: none;
        box-shadow: 0 16px 24px -16px rgba(29, 32, 38, .15);
    }
    .site-nav.is-open { display: block; }
    .site-nav ul { flex-direction: column; gap: 0; }
    .site-nav li + li { border-top: 1px solid var(--line); }
    .site-nav a { display: block; padding: 14px 4px; font-size: 1.05rem; border-radius: 0; }
    .site-nav a:hover { background: none; }
    .brand__tagline { display: none; }
    .brand__mark { width: 64px; }
}

/* ---------- Blöcke ---------- */
.block { position: relative; padding-block: var(--block-space); background: var(--block-bg, transparent); }
.block--paper { --block-bg: transparent; }
.block--white { --block-bg: var(--surface); }
.block--sun   { --block-bg: var(--tint-sun); }
.block--sky   { --block-bg: var(--tint-sky); }
.block--leaf  { --block-bg: var(--tint-leaf); }
.block--berry { --block-bg: var(--tint-berry); }

.block__head { margin-bottom: 1.75rem; }

/* Dachzeile: kleine Versalien mit Farbstreifen aus dem Logo */
.kicker {
    display: inline-flex; align-items: center; gap: 12px; margin: 0 0 .9rem;
    font-family: var(--font-sans); font-size: .78rem; font-weight: 600;
    letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft);
}
.kicker::before {
    content: ""; width: 28px; height: 3px; border-radius: 2px; flex: 0 0 auto;
    background: linear-gradient(90deg, var(--red) 0 25%, var(--yellow) 25% 50%, var(--green) 50% 75%, var(--blue) 75% 100%);
}

.block__title { font-size: clamp(1.9rem, 1.4rem + 1.9vw, 2.75rem); }
.block__title--xl { font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4.1rem); line-height: 1.04; letter-spacing: -.025em; }

/* ---------- Fließtext ---------- */
.prose { color: var(--ink); }
.prose > :last-child { margin-bottom: 0; }
.prose h3 { margin-top: 1.4em; }
.prose strong { font-weight: 600; }
.prose ul { list-style: none; padding: 0; margin: 0 0 1.3em; }
.prose ul li { position: relative; padding-left: 1.4em; margin-bottom: .5em; }
.prose ul li::before {
    content: ""; position: absolute; left: .1em; top: .72em; width: 7px; height: 7px; border-radius: 50%;
    background: var(--blue);
}
.prose ul li:nth-child(4n+2)::before { background: var(--red); }
.prose ul li:nth-child(4n+3)::before { background: var(--yellow); }
.prose ul li:nth-child(4n+4)::before { background: var(--green); }
.prose ol { padding-left: 1.3em; }
.prose blockquote {
    margin: 1.6em 0; padding: .1em 0 .1em 1.2em; border-left: 3px solid var(--yellow);
    font-family: var(--font-serif); font-style: italic; font-size: 1.3rem; line-height: 1.4; color: var(--ink);
}
.prose blockquote p { margin: 0; }
.prose--list-cols ul { columns: 2 220px; column-gap: 2.5rem; }
.prose--list-cols ul li { break-inside: avoid; }

mark { background: linear-gradient(transparent 60%, rgba(243, 180, 41, .45) 60%); color: inherit; padding: 0 .08em; }

/* ---------- Buttons ---------- */
.buttons-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }
.center .buttons-row { justify-content: center; }
.btn, .contact__form button[type="submit"] {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    min-height: 48px; padding: 12px 24px; border: 1px solid var(--blue); border-radius: 999px;
    background: var(--blue); color: #fff;
    font: 600 .98rem/1.2 var(--font-sans); text-decoration: none; cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.btn:hover, .contact__form button[type="submit"]:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: #CFC8BC; }
.btn--ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--ink); }

/* ---------- Text + Bild ---------- */
.split { display: grid; gap: clamp(36px, 6vw, 88px); align-items: center; }
.split--right { grid-template-columns: 1.05fr .95fr; }
.split--right .photo { order: 2; }
.split--left { grid-template-columns: .95fr 1.05fr; }
.split--top { grid-template-columns: 1fr; max-width: 960px; margin-inline: auto; }
.split--top .split__text { max-width: var(--narrow); }
.split__text { max-width: 560px; }
@media (max-width: 820px) {
    .split--right, .split--left { grid-template-columns: 1fr; }
    .split--right .photo { order: 0; }
}

.photo { margin: 0; position: relative; }
.photo img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.photo figcaption { margin-top: 12px; font-size: .88rem; color: var(--ink-soft); }
/* Rahmen-Varianten (Feldwerte bleiben kompatibel) */
.photo--polaroid img { border-radius: var(--radius); }
.photo--round img { border-radius: 32px; }
.photo--blob img { border-radius: 50%; aspect-ratio: 1; object-fit: cover; }
.photo--blob figcaption { text-align: center; }

/* ---------- Begrüßung ---------- */
.block--intro { padding-block: clamp(56px, 8vw, 112px) clamp(64px, 9vw, 120px); }
.block--intro .prose { font-size: 1.12em; color: var(--ink-soft); max-width: 34em; }
.intro-text { max-width: 820px; }
.intro-text.center { margin-inline: auto; }
.intro-text.center .prose { margin-inline: auto; }

.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.hero__logo img { width: 100%; max-width: 520px; margin-inline: auto; }
@media (max-width: 880px) {
    .hero { grid-template-columns: 1fr; }
    .hero__logo { order: -1; }
    .hero__logo img { max-width: 300px; margin-inline: 0; }
}

/* ---------- Galerie ---------- */
.gallery { list-style: none; margin: 2.75rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 42vw), 1fr)); gap: clamp(12px, 2vw, 20px); }
.gallery__item { margin: 0; }
.gallery__link { display: block; overflow: hidden; border-radius: var(--radius-sm); background: var(--line); }
.gallery__link img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1), opacity .3s ease; }
.gallery__link:hover img, .gallery__link:focus-visible img { transform: scale(1.04); }
.gallery__caption { display: block; font-size: .88rem; color: var(--ink-soft); padding-top: 8px; }

/* Lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1160px, 94vw); max-height: 94vh; overflow: visible; }
.lightbox::backdrop { background: rgba(18, 20, 24, .88); }
.lightbox__frame { margin: 0; }
.lightbox__frame img { max-height: 82vh; width: auto; margin-inline: auto; border-radius: var(--radius-sm); }
.lightbox__caption { color: #E9E6E0; font-size: .95rem; text-align: center; padding-top: 12px; min-height: 1em; }
.lightbox__btn {
    position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 0;
    background: rgba(255, 255, 255, .92); color: var(--ink); font: 500 1.3rem/1 var(--font-sans); cursor: pointer;
    display: grid; place-items: center; box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.lightbox__btn:hover { background: #fff; }
.lightbox__close { top: -56px; right: 0; }
.lightbox__prev { left: -64px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: -64px; top: 50%; transform: translateY(-50%); }
@media (max-width: 1000px) { .lightbox__prev { left: 8px; } .lightbox__next { right: 8px; } }

/* ---------- Kontakt ---------- */
.contact { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(20px, 3vw, 32px); align-items: start; margin-top: .5rem; }
@media (max-width: 880px) { .contact { grid-template-columns: 1fr; } }

.contact__info, .contact__form {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: clamp(24px, 3.2vw, 40px);
}
.contact__label { font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 1.2rem; }
.contact__info .prose p { margin-bottom: 1.1em; }
.contact__info .prose strong { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; }

/* Formular (Grav Form-Plugin) */
.contact__form .form-field { margin-bottom: 1.15rem; }
.contact__form .form-label label, .contact__form label { display: block; font-weight: 500; font-size: .92rem; margin-bottom: 6px; }
.contact__form .required { color: var(--red); }
.contact__form input[type="text"], .contact__form input[type="email"], .contact__form input[type="tel"], .contact__form textarea {
    width: 100%; padding: 12px 14px; border: 1px solid #D6D0C5; border-radius: var(--radius-sm);
    background: var(--bg); font: inherit; font-size: 1rem; color: var(--ink);
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.contact__form textarea { min-height: 150px; resize: vertical; }
.contact__form input:focus, .contact__form textarea:focus { outline: none; border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 4px rgba(11, 79, 140, .12); }
.contact__form input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blue); vertical-align: -3px; margin-right: 6px; }
.contact__form .form-input-wrapper { width: 100%; }
.contact__form .buttons { margin-top: 1.5rem; }
.contact__form .form-errors, .contact__form .notices, .notices { border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 1rem; font-size: .95rem; }
.notices.green, .notices.success { background: #EAF4E6; border: 1px solid #B9D9AC; }
.notices.red, .notices.error, .form-errors { background: #FBECE9; border: 1px solid #EDBDB4; }
.contact__form .form-data.form-honeypot, .contact__form .form-honeypot { position: absolute; left: -9999px; }

/* ---------- Fußzeile ---------- */
.site-footer { background: #1D2026; color: #D9D6D0; padding: 64px 0 28px; margin-top: 0; font-size: .95rem; }
.site-footer a { color: #fff; text-decoration-color: rgba(255,255,255,.35); }
.site-footer a:hover { color: #fff; text-decoration-color: #fff; }
.site-footer__grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .site-footer__grid { grid-template-columns: 1fr; gap: 24px; } }
.site-footer__name { font-family: var(--font-serif); font-weight: 600; font-size: 1.25rem; color: #fff; margin-bottom: .5em; }
.site-footer__label { font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #9EA3AD; margin-bottom: .6em; }
.site-footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; color: #9EA3AD; }
.site-footer__legal a { margin-left: 20px; color: #D9D6D0; }
.site-footer__legal a:first-child { margin-left: 0; }

/* ---------- Hintergrundbild pro Abschnitt ---------- */
.block.has-bg { isolation: isolate; overflow: hidden; }
.block__bg {
    position: absolute; inset: 0; z-index: -1;
    background-size: cover; background-repeat: no-repeat; background-position: center;
    pointer-events: none;
}

/* Helle Schrift für dunkle Hintergrundbilder */
.block--light-text { color: #fff; }
.block--light-text .block__title,
.block--light-text .prose,
.block--light-text .prose strong,
.block--light-text .prose blockquote { color: #fff; }
.block--light-text .kicker,
.block--light-text .photo figcaption,
.block--light-text .gallery__caption,
.block--light-text .muted { color: rgba(255, 255, 255, .8); }
.block--light-text .prose a { color: #fff; }
.block--light-text .block__title,
.block--light-text .prose { text-shadow: 0 1px 12px rgba(0, 0, 0, .25); }
.block--light-text .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .6); }
.block--light-text .btn--ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; border-color: #fff; }
.block--light-text .contact__info, .block--light-text .contact__form { color: var(--ink); text-shadow: none; }
.block--light-text .contact__info .prose, .block--light-text .contact__info .prose strong { color: var(--ink); text-shadow: none; }
.block--light-text .contact__info .prose a { color: var(--blue); }
