/* ==========================================================================
   Kindergruppe HATSCHIPUH — theme styles
   Modern, dependency-free, WCAG 2.1 AA. Brand palette from the original site.
   ========================================================================== */

:root {
    --color-accent: #e07a1f;          /* darkened #f29547 for AA contrast on white */
    --color-accent-soft: #f29547;
    --color-green: #7c8a3e;           /* darkened #bad08a/#b7c868 for contrast */
    --color-green-soft: #bad08a;
    --color-ink: #333333;
    --color-ink-soft: #545454;
    --color-bg: #ffffff;
    --color-bg-alt: #faf6f0;
    --color-border: #e6ded4;

    --font-body: "Segoe UI", "Helvetica Neue", Arial, sans-serif;

    --step--1: clamp(0.83rem, 0.78rem + 0.25vw, 0.95rem);
    --step-0: clamp(1rem, 0.92rem + 0.4vw, 1.2rem);
    --step-1: clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem);
    --step-2: clamp(1.6rem, 1.35rem + 1.2vw, 2.3rem);
    --step-3: clamp(2rem, 1.6rem + 2vw, 3.2rem);

    --space: clamp(1rem, 0.8rem + 1vw, 1.75rem);
    --container: 68rem;
    --radius: 12px;
}

/* Reset-ish */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.6;
    color: var(--color-ink);
    background: var(--color-bg);
    /* Sticky footer: body is a column flex, main grows to push footer down. */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); }
a:hover { color: #b5610f; }

h1, h2, h3 { line-height: 1.2; color: var(--color-ink); }
h1 { font-size: var(--step-3); margin: 0 0 0.5em; }
h2 { font-size: var(--step-2); margin: 1.6em 0 0.5em; }
h3 { font-size: var(--step-1); margin: 1.4em 0 0.4em; }

.container { width: min(100% - 2 * var(--space), var(--container)); margin-inline: auto; }
.prose { padding-block: calc(var(--space) * 1.5); }
/* Give page bodies breathing room below the header banner. */
.page-body { padding-top: calc(var(--space) * 1.5); }
.prose ul { padding-left: 1.25em; }
.prose li { margin-bottom: 0.4em; }

/* Accessibility helpers */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
    white-space: nowrap; border: 0;
}
.skip-link {
    position: fixed; left: 0.5rem; top: 0.5rem;
    background: var(--color-accent); color: #fff;
    padding: 0.6rem 1rem; border-radius: var(--radius);
    z-index: 100; transition: transform 0.15s ease;
    transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

:where(a, button, [tabindex]):focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Header / nav ----------
   The brand logo is a WHITE wordmark, so the header always needs a coloured
   or dark backdrop. Inner pages: solid green bar. Home: transparent overlay
   sitting on top of the dark hero slideshow. */
.site-header {
    background: var(--color-green);
}
.site-header__inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space); padding-block: 0.75rem; flex-wrap: wrap;
}
.site-logo img { width: clamp(140px, 30vw, 240px); height: auto; }

/* Home: overlay the header on top of the hero. */
.site-header--overlay {
    position: absolute; inset-inline: 0; top: 0; z-index: 10;
    background: transparent;
}
.site-header--overlay::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    /* Taller, stronger scrim so the white logo + nav stay readable over any slide. */
    height: 200%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.35) 45%, rgba(0,0,0,0));
    pointer-events: none;
}
/* Extra legibility for the overlaid nav/logo regardless of the photo behind. */
.site-header--overlay .primary-nav__link,
.site-header--overlay .nav-toggle__label { text-shadow: 0 1px 3px rgba(0,0,0,0.6); }
.site-header--overlay .site-logo img { filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5)); }
.page-template-home .hero { margin-top: 0; }
/* Pull the hero up under the overlay header on home. */
.page-template-home main { margin-top: 0; }

.nav-toggle {
    display: none;
    align-items: center; gap: 0.5rem;
    background: none; border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius); padding: 0.5rem 0.8rem;
    font: inherit; color: #fff; cursor: pointer;
}
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
    display: block; width: 22px; height: 2px;
    background: #fff; position: relative;
}
.nav-toggle__bar::before, .nav-toggle__bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bar::before { top: -7px; }
.nav-toggle__bar::after { top: 7px; }

.primary-nav__list {
    list-style: none; display: flex; flex-wrap: wrap;
    gap: 0.25rem 0.75rem; margin: 0; padding: 0;
}
.primary-nav__link {
    display: block; padding: 0.5rem 0.6rem;
    text-decoration: none;
    font-size: var(--step--1); font-weight: 600;
    letter-spacing: 0.03em; text-transform: uppercase;
    border-radius: var(--radius);
    color: #fff;
}
.primary-nav__link:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.primary-nav__link.is-active { color: #fff; box-shadow: inset 0 -3px 0 #fff; }

@media (max-width: 48rem) {
    .nav-toggle { display: inline-flex; }
    .primary-nav {
        flex-basis: 100%;
        display: grid; grid-template-rows: 0fr;
        transition: grid-template-rows 0.25s ease;
    }
    .primary-nav__list { overflow: hidden; flex-direction: column; }
    .primary-nav.is-open { grid-template-rows: 1fr; }
    .primary-nav__link {
        padding: 0.75rem 0.9rem;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }
    /* When the menu is open, make the whole overlay header a solid panel so the
       links read against a consistent background instead of the photo behind. */
    .site-header { transition: background-color 0.2s ease; }
    .site-header:has(.primary-nav.is-open),
    .site-header--overlay:has(.primary-nav.is-open) {
        background: var(--color-green);
    }
    .site-header--overlay:has(.primary-nav.is-open) { background: #1c1c1c; }
    .site-header--overlay:has(.primary-nav.is-open)::before { display: none; }
    .nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
    .nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { top: 0; transform: rotate(45deg); }
    .nav-toggle[aria-expanded="true"] .nav-toggle__bar::after { top: 0; transform: rotate(-45deg); }
}

/* ---------- Hero slideshow (crossfade) ---------- */
.hero {
    position: relative; background: #000; overflow: hidden;
    min-height: clamp(22rem, 56vw, 40rem);
}
.hero__track { list-style: none; margin: 0; padding: 0; }
.hero__slide {
    position: absolute; inset: 0;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    z-index: 1;
}
/* Active slide fades in on top; the outgoing slide fades out beneath it,
   so the two overlap for a true crossfade (no snap, no flash of black). */
.hero__slide.is-active { opacity: 1; z-index: 2; }
.hero__img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.hero__caption {
    position: absolute; left: 0; right: 0; bottom: 0;
    margin: 0; padding: clamp(0.75rem, 3vw, 1.5rem) clamp(1rem, 4vw, 3rem);
    padding-bottom: clamp(1.25rem, 4vw, 2rem);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
    color: #fff; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    font-size: var(--step-1); font-weight: 600;
}

.hero__controls {
    position: absolute; inset-block: 0; inset-inline: 0;
    display: flex; align-items: center; justify-content: space-between;
    pointer-events: none; padding: 0.5rem clamp(0.5rem, 2vw, 1rem);
    z-index: 3; /* above the stacked slides (which use z-index 1–2) */
}
.hero__btn {
    pointer-events: auto;
    width: 2.75rem; height: 2.75rem; border-radius: 50%;
    border: none; background: rgba(0,0,0,0.45); color: #fff;
    font-size: 1.5rem; line-height: 1; cursor: pointer;
    display: grid; place-items: center;
}
.hero__btn:hover { background: rgba(0,0,0,0.7); }
/* Pause/play tucked into the bottom-right corner. */
.hero__btn--pause {
    position: absolute; right: clamp(0.5rem, 2vw, 1rem); bottom: 0.75rem;
    width: 2.25rem; height: 2.25rem; font-size: 1rem;
    z-index: 3; /* above the stacked slides */
}

/* ---------- Sub-page banner ---------- */
.page-banner {
    position: relative; overflow: hidden;
    min-height: clamp(10rem, 28vw, 18rem);
    background: var(--color-green);
}
.page-banner__img {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover;
}

/* ---------- Info notice ----------
   Content comes from the page body (Markdown): a heading, a list of dates,
   and a note paragraph. Styled generically so staff just edit Markdown. */
.info-notice {
    margin-block: var(--space);
    background: var(--color-bg-alt);
    border: 2px solid var(--color-green-soft);
    border-radius: var(--radius);
    padding: var(--space);
    text-align: center;
}
.info-notice > :first-child { margin-top: 0; }
.info-notice > :last-child { margin-bottom: 0; }
.info-notice h2 { margin-top: 0; color: var(--color-accent); }
.info-notice ul {
    list-style: none; margin: 0 auto 0.5rem; padding: 0;
    font-weight: 600;
}
.info-notice li { margin: 0.2em 0; }
.info-notice p { margin: 0.5rem 0 0; color: var(--color-ink-soft); }

/* ---------- Cards / kontakt ---------- */
.kontakt-grid {
    display: grid; gap: var(--space);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    margin-block: var(--space);
}
.card {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space);
}
.card h2 { margin-top: 0; font-size: var(--step-1); }
.address-card__list { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; margin: 0; }
.address-card__list dt { font-weight: 700; color: var(--color-ink-soft); }
.address-card__list dd { margin: 0; }
.address-card address { font-style: normal; }
.map-link { display: inline-block; margin-top: 0.35rem; font-size: var(--step--1); }
.vorstand-list { list-style: none; margin: 0; padding: 0; }
.vorstand-list li { padding: 0.35rem 0; border-bottom: 1px solid var(--color-border); }
.vorstand-list li:last-child { border-bottom: 0; }
.vorstand-list__role { font-weight: 700; color: var(--color-ink-soft); }
.legal { font-size: var(--step--1); color: var(--color-ink-soft); }
.legal h2 { color: var(--color-ink); }

/* ---------- Stellen / PDFs ---------- */
.stellen-list { list-style: none; padding: 0; margin: var(--space) 0 0; display: grid; gap: 0.75rem; }
.stellen-list__item {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem;
    background: var(--color-bg-alt); border: 1px solid var(--color-border);
    border-radius: var(--radius); padding: var(--space);
}
.stellen-list__title { font-weight: 600; }
.pdf-link, .map-link { color: var(--color-accent); font-weight: 600; text-decoration: underline; }
.pdf-link {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 0.9rem; border: 2px solid var(--color-accent);
    border-radius: var(--radius); text-decoration: none;
}
.pdf-link:hover { background: var(--color-accent); color: #fff; }

/* ---------- Footer ---------- */
.site-footer {
    margin-top: calc(var(--space) * 2);
    border-top: 3px solid var(--color-green-soft);
    background: var(--color-bg-alt);
}
.site-footer__inner {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space);
    padding-block: var(--space); justify-content: space-between;
}
.site-footer__meta { margin: 0; font-size: var(--step--1); color: var(--color-ink-soft); }
.site-footer__legal { margin: 0.35rem 0 0; font-size: var(--step--1); }
.site-footer__legal a { color: var(--color-ink-soft); }
.site-footer__legal a:hover { color: var(--color-accent); }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero__track { scroll-behavior: auto; }
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
