/* Gemeinsames Erscheinungsbild aller Seiten. CI: RAL 7016 (#383e42), warmes Gold, Cormorant + Inter.
   Wird nach site.css geladen und überschreibt dessen Grundwerte. Die Startseite ergänzt home.css. */
@font-face {
    font-family: "Inter";
    src: url("../assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212;
}
@font-face {
    font-family: "Inter";
    src: url("../assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Cormorant";
    src: url("../assets/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2");
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: "Cormorant";
    src: url("../assets/fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2");
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}

:root {
    --ral: #383e42;
    --ral-deep: #2a2f32;
    --ral-night: #1f2326;
    --ink: #f4f2ee;
    --ink-solid: #f4f2ee;
    --warm: #f1c48f;
    --grid: rgba(244, 242, 238, .045);
    --glass: rgba(44, 50, 54, .55);
    --glass-edge: rgba(244, 242, 238, .16);
    --surface: rgba(56, 62, 66, .42);
    --gutter: clamp(20px, 3.6vw, 64px);
    --display: "Cormorant", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --sans: "Inter", "Segoe UI", system-ui, sans-serif;
    /* Werte aus site.css */
    --bg: var(--ral-night);
    --bg-soft: var(--surface);
    --bg-strong: rgba(56, 62, 66, .7);
    --line: rgba(244, 242, 238, .1);
    --line-strong: rgba(241, 196, 143, .32);
    --text: var(--ink);
    --muted: #a9b1b5;
    --accent: var(--warm);
    --accent-strong: #f6d8b0;
    --gold: var(--warm);
    --header-shadow: none;
}

body {
    background: var(--ral-night);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
body::before {
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 56px 56px;
    background-position: center top;
    mask-image: linear-gradient(180deg, #000 0, rgba(0, 0, 0, .35) 640px, transparent 1400px);
}
h1,
h2,
h3 {
    overflow-wrap: break-word;
    font-family: var(--display);
    font-weight: 500;
    letter-spacing: 0;
}
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--warm);
    outline-offset: 3px;
}
.eyebrow,
.section-tag,
.timeline-date {
    color: var(--warm);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.skip-link:not(:focus) {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus { position: fixed; top: 12px; left: 12px; z-index: 80; padding: 12px 16px; background: var(--ink); color: var(--ral-night); }

/* ------------------------------------------------------------ top bar + menu */
.topbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    height: 72px;
    padding-inline: var(--gutter);
    border-bottom: 1px solid transparent;
    transition: background .4s ease, backdrop-filter .4s ease, border-color .4s ease;
}
body:not(.home-page) .topbar,
.is-scrolled .topbar {
    background: rgba(31, 35, 38, .72);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    backdrop-filter: blur(18px) saturate(1.3);
    border-bottom-color: var(--line);
}
.topbar-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 15px; font-weight: 500; }
.topbar-brand img { border-radius: 50%; }
.topbar-brand em { font-family: var(--display); font-size: 19px; font-style: italic; }
.topbar-nav { display: flex; gap: 30px; font-size: 14px; }
.topbar-nav a, .topbar-login { text-decoration: none; opacity: .82; transition: opacity .2s; }
.topbar-nav a:hover, .topbar-login:hover, .topbar-nav a[aria-current] { opacity: 1; }
.topbar-nav a[aria-current] { box-shadow: 0 1px 0 var(--warm); }
.topbar-actions { display: flex; justify-content: flex-end; align-items: center; gap: 22px; font-size: 14px; }
.experience-menu-toggle {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 9px 16px; border: 1px solid var(--glass-edge); border-radius: 999px;
    background: var(--glass); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer;
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.experience-menu-toggle i { position: relative; width: 16px; height: 8px; border-block: 1.5px solid currentColor; }
.experience-menu {
    position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; overflow-y: auto;
    padding: 96px 0 40px;
    background: rgba(24, 27, 30, .9); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.experience-menu[hidden] { display: none; }
.experience-menu nav { display: grid; width: min(560px, 86vw); }
.experience-menu a {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none;
    font-family: var(--display); font-size: clamp(32px, 6vw, 52px); line-height: 1;
}
.experience-menu a span:last-child { font-family: var(--sans); font-size: 18px; color: var(--warm); }
.experience-menu a[aria-current] span:first-child { font-style: italic; color: var(--warm); }
.experience-menu .menu-group {
    margin-top: 32px; padding-bottom: 8px;
    color: var(--warm); font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
}
.experience-menu .menu-group ~ a { font-size: clamp(24px, 4vw, 34px); padding: 12px 0; }
body.menu-open { overflow: hidden; }

/* ------------------------------------------------------------ buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn, .button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 0 24px; border-radius: 999px;
    font-size: 15px; font-weight: 500; text-decoration: none;
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover, .button:hover:not(:disabled) { transform: translateY(-1px); }
.btn-light, .button-primary {
    border: 1px solid transparent;
    background: var(--ink); color: var(--ral-night) !important;
}
.btn-glass, .button-secondary, .button-ghost {
    border: 1px solid var(--glass-edge); background: var(--glass); color: var(--ink);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.button-ghost { background: transparent; }
.button-secondary:hover, .button-ghost:hover { border-color: rgba(244, 242, 238, .34); }
.link-arrow, .text-link { text-decoration: none; color: var(--warm) !important; font-size: 15px; }
.link-arrow { white-space: nowrap; }

/* ------------------------------------------------------------ subpages */
body:not(.home-page) .page-shell {
    max-width: calc(1560px + 2 * var(--gutter));
    margin: 0 auto;
    padding: 112px var(--gutter) 0;
}
body:not(.home-page) main > *,
.admin-shell > *,
.admin-layout > * { min-width: 0; }
body:not(.home-page) main { display: grid; gap: clamp(24px, 2.6vw, 36px); padding-bottom: clamp(56px, 6vw, 88px); }

.page-intro, .about-story-hero { padding-bottom: clamp(16px, 3vw, 36px); border-bottom: 1px solid var(--line); }
.page-intro h1,
.about-story-copy h1 {
    max-width: 18ch;
    margin: 18px 0 20px;
    font-size: clamp(44px, 6.4vw, 88px);
    line-height: 1;
}
.about-story-centered .about-story-copy h1 { margin-inline: auto; }
.hero-text { max-width: 60ch; font-size: 18px; }
.about-longform-block h2,
.about-rhythm-head h2 {
    font-size: clamp(28px, 2.6vw, 40px); line-height: 1.08;
}
.panel h2, .auth-card h1 { font-size: clamp(26px, 2.2vw, 32px); line-height: 1.08; }
.panel h3 { font-family: var(--display); font-size: clamp(21px, 1.7vw, 25px); line-height: 1.12; }

.page-surface,
.panel,
.legal-layout,
.auth-card {
    padding: clamp(22px, 3vw, 36px);
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.auth-card { box-shadow: 0 40px 120px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .05); }

input, select, textarea {
    color: var(--ink);
    background-color: rgba(31, 35, 38, .55) !important;
    border-color: var(--line) !important;
    border-radius: 12px !important;
}
input:focus, select:focus, textarea:focus { border-color: rgba(241, 196, 143, .5) !important; }
::placeholder { color: rgba(169, 177, 181, .7); }

/* Über uns: redaktionelles Layout, Überschrift links, Text rechts */
.about-story-centered, .about-rhythm-centered, .about-longform-centered { max-width: none; }
.about-story-hero { max-width: none !important; width: auto !important; margin: 0 !important; padding-inline: 0 !important; justify-items: start !important; }
.about-story-hero, .about-story-hero * { text-align: left !important; }
.about-story-copy .hero-text { margin-inline: 0 !important; }
.about-story-copy { max-width: 900px; margin: 0 !important; }
.about-story-copy h1 { margin-inline: 0 !important; }
.about-longform-block, .about-rhythm {
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-auto-flow: dense;
    column-gap: clamp(32px, 6vw, 96px); row-gap: 0;
    padding: clamp(28px, 4vw, 48px) 0; border-bottom: 1px solid var(--line); text-align: left;
}
.about-longform-block > .section-tag { grid-column: 1; grid-row: 1; align-self: start; margin: 0; }
.about-longform-block > h2 { grid-column: 1; grid-row: 1 / span 6; align-self: start; margin: 0; padding-top: 34px; }
.about-longform-block > p:not(.section-tag), .about-rhythm-text p {
    grid-column: 2; margin: 0 0 18px; max-width: 62ch; color: var(--muted); font-size: 17px; line-height: 1.75;
}
.about-rhythm-head, .about-rhythm-text { text-align: left !important; max-width: none !important; margin: 0 !important; }
.about-rhythm-head h2 { margin: 14px 0 18px; }
.about-rhythm-head p { color: var(--muted); }
.about-rhythm-head .section-tag { color: var(--warm) !important; }
.about-rhythm-text p { margin-top: 0 !important; }
.about-closing {
    padding: clamp(40px, 6vw, 80px) 0; text-align: center; border: 0 !important; background: none !important;
}
.about-closing p {
    max-width: 26ch; margin: 0 auto; color: var(--ink) !important;
    font-family: var(--display); font-style: italic; font-size: clamp(26px, 2.6vw, 38px); line-height: 1.18;
}
@media (max-width: 860px) {
    .about-longform-block, .about-rhythm { grid-template-columns: 1fr; }
    .about-longform-block > .section-tag, .about-longform-block > h2, .about-longform-block > p:not(.section-tag) { grid-column: 1; grid-row: auto; }
    .about-longform-block > h2 { margin-bottom: 18px; }
}

/* ------------------------------------------------------------ footer */
.site-footer {
    display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 0;
    padding: 36px var(--gutter); border-top: 1px solid var(--line);
    background: var(--ral-night); color: var(--muted); font-size: 14px;
}
.site-footer p { margin: 0; }
.site-footer .footer-links { gap: 22px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* Interner Bereich */
.no-topbar .page-shell { max-width: none; padding-top: clamp(24px, 4vw, 48px); }
.admin-topbar { align-items: end; padding-bottom: clamp(16px, 3vw, 32px); border-bottom: 1px solid var(--line); }
.admin-topbar-copy h1 { margin: 10px 0 8px; font-size: clamp(34px, 3.4vw, 52px); line-height: 1; }

/* Login-Seiten ohne Kopfleiste */
.auth-body .page-shell { padding-top: 0 !important; }
.auth-body .auth-logo { display: block; width: 56px; margin: 0 auto 22px; border-radius: 50%; }

@media (max-width: 860px) {
    .topbar { grid-template-columns: auto 1fr auto; gap: 14px; height: 64px; }
    .topbar-nav { justify-content: center; gap: 20px; font-size: 14px; }
    .topbar-nav a { display: inline-flex; align-items: center; min-height: 44px; }
    .topbar-login { display: none; }
    .topbar-brand span { display: none; }
    body:not(.home-page) .page-shell { padding-top: 104px; }
    .site-footer { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
    /* phones: only "Über uns" stays next to the menu button, the rest is in the menu */
    .topbar-nav a:not(:first-child) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .btn, .button { transition: none; }
}

/* ============================================================ responsive
   Kleine Handys, Handy quer, Touch-Geräte, Kalender und große Bildschirme. */

/* Seitentitel wachsen gleichmäßig mit der Breite. */
.page-intro h1,
.about-story-copy h1 {
    font-size: clamp(34px, 3.2vw + 16px, 66px);
}

/* Touch-Geräte: Links und Buttons mindestens 44 px hoch antippbar */
@media (pointer: coarse) {
    .site-footer a, .auth-links a, .link-arrow, .text-link {
        display: inline-flex; align-items: center; min-height: 44px;
    }
    .site-footer .footer-links { column-gap: 22px; row-gap: 0; }
    .btn, .button { min-height: 46px; }
}

/* Handy quer und niedrige Fenster: weniger Höhe für Kopf und Titel */
@media (orientation: landscape) and (max-height: 520px) {
    .topbar { height: 56px; }
    body:not(.home-page) .page-shell { padding-top: 84px; }
    .page-intro h1,
.about-story-copy h1 {
        font-size: clamp(30px, 9vh + 8px, 56px);
        max-width: 24ch;
    }
    .experience-menu { place-items: start center; padding-top: 72px; }
    .experience-menu a { padding: 10px 0; font-size: clamp(24px, 7vh, 40px); }
}

/* Kalender auf schmalen Bildschirmen: kompakte Monatsansicht ohne Seitwärtsscrollen.
   Termine erscheinen als farbige Balken, ein Tipp öffnet die Details. */
@media (max-width: 700px) {
    .calendar-head { flex-direction: row !important; flex-wrap: wrap; align-items: flex-end !important; row-gap: 12px; }
    .calendar-actions { flex-direction: row !important; flex-wrap: nowrap; }
    .calendar-actions .button { width: auto !important; min-width: 0; padding: 0 16px; }
    .calendar-scroll { margin: 0 !important; padding: 0 !important; overflow: visible; }
    .calendar-grid { min-width: 0 !important; gap: 4px !important; }
    .calendar-weekday { font-size: 12px !important; letter-spacing: .04em; padding-bottom: 4px; }
    .panel:has(.calendar-grid) { padding: 18px 12px; border-radius: 18px; }
    .panel:has(.calendar-grid) .calendar-head { padding-inline: 6px; }
    .calendar-day {
        min-height: 50px !important; padding: 6px 3px 4px !important; gap: 2px !important;
        border-radius: 10px; align-content: start; justify-items: stretch; overflow: hidden;
    }
    .calendar-day strong { font-size: 13px; font-weight: 600; text-align: center; }
    .calendar-day.is-empty { border-color: transparent; }
    .calendar-event-pill {
        display: block; width: 100%; max-width: none !important; height: 16px;
        padding: 5px 0 !important; border: 0 !important; border-radius: 0;
        font-size: 0 !important; line-height: 0; color: transparent;
        background-clip: content-box !important; transform: none !important; box-shadow: none !important;
    }
    .calendar-event-pill + .calendar-event-pill { margin-top: -6px; }
    .calendar-event-pill:focus-visible { outline: 2px solid var(--warm); outline-offset: 0; }
}
@media (max-width: 360px) {
    .calendar-grid { gap: 3px !important; }
    .panel:has(.calendar-grid) { padding-inline: 8px; }
    .calendar-day { border-radius: 8px; padding: 5px 2px 3px !important; }
    .calendar-head h2 { font-size: 26px; }
}

/* Sehr große Bildschirme (ab 2400 px): leicht vergrößern, damit nichts winzig wirkt. */
@media (min-width: 2400px) { :root { --z: 1.15; } }
@media (min-width: 3200px) { :root { --z: 1.4; } }
@media (min-width: 2400px) {
    .topbar, .experience-menu nav, .page-shell, .site-footer,
    .film-chapter, .film-hint,
    .home-page main > section:not(.film) { zoom: var(--z); }
    .home-page .page-shell { zoom: 1; }
}

/* Breite Bildschirme: Platz in der Breite nutzen, kompaktere Abstände */
@media (min-width: 1100px) {
    .hero-text { max-width: 72ch; font-size: 17px; }
    .page-intro, .about-story-hero { padding-bottom: 24px; }
    .page-intro h1,
.about-story-copy h1 { max-width: 26ch; margin: 12px 0 14px; }
    .about-story-copy { max-width: 1100px; }
    .about-longform-block, .about-rhythm { padding: 32px 0; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
    .about-longform-block > p:not(.section-tag), .about-rhythm-text p { max-width: 80ch; font-size: 16px; }
    .about-closing { padding: 48px 0; }
    .calendar-day { min-height: 92px; }
    .contact-grid { gap: 20px; }
}

.calendar-head h2 { hyphens: manual; white-space: nowrap; }
@media (max-width: 700px) {
    .admin-modal-head { flex-wrap: wrap; gap: 12px; }
    .admin-modal-head > div { flex: 1 1 160px; min-width: 0; }
    .admin-modal-head .button { flex: none; width: auto !important; }
}
@media (max-width: 600px) {
    h1, h2, h3 { hyphens: auto; hyphenate-limit-chars: 12 5 5; }
    .calendar-head h2 { hyphens: manual; }
}

/* ============================================================ effects (js/fx.js) */
html, body { overflow-x: clip; }

/* fade-in while scrolling */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .9s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * 80ms); }
.reveal.is-in { opacity: 1; transform: none; }

/* warm candle light following the pointer */
body::after {
    content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0; transition: opacity .6s ease;
    background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 30%), rgba(241, 196, 143, .07), transparent 60%);
    mix-blend-mode: screen;
}
body.has-light::after { opacity: 1; }
body.menu-open::after { opacity: 0; }

/* big outlined word behind subpage titles */
.page-intro, .about-story-hero { position: relative; isolation: isolate; }
.hero-word {
    position: absolute; z-index: -1; right: -2vw; top: 50%; pointer-events: none; user-select: none; white-space: nowrap;
    font-family: var(--display); font-style: italic; font-weight: 500; line-height: .8; letter-spacing: -.02em;
    font-size: clamp(110px, 19vw, 360px); color: transparent; -webkit-text-stroke: 1px rgba(241, 196, 143, .16);
    transform: translateY(calc(-50% + var(--sy, 0) * .25px));
    animation: hero-word 1.6s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes hero-word { from { opacity: 0; translate: 6vw 0; } }
@media (max-width: 700px) {
    .hero-word { top: -28px; right: -4vw; font-size: 30vw; -webkit-text-stroke-color: rgba(241, 196, 143, .11); transform: translateY(calc(var(--sy, 0) * .2px)); }
}

/* reading progress under the top bar (subpages) */
body:not(.home-page) .topbar::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; transform-origin: left;
    transform: scaleX(var(--progress, 0)); background: linear-gradient(90deg, rgba(241, 196, 143, .2), var(--warm));
}

/* soft cross-fade between pages (supported browsers) */
@view-transition { navigation: auto; }
.topbar { view-transition-name: topbar; }
::view-transition-old(root) { animation: vt-out .28s ease both; }
::view-transition-new(root) { animation: vt-in .5s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); } }

/* buttons: light sweep on hover */
.btn-light, .button-primary { position: relative; overflow: hidden; }
.btn-light::after, .button-primary::after {
    content: ""; position: absolute; inset: 0; transform: translateX(-120%);
    background: linear-gradient(100deg, transparent 30%, rgba(241, 196, 143, .45) 50%, transparent 70%);
    transition: transform .7s ease;
}
.btn-light:hover::after, .button-primary:hover:not(:disabled)::after { transform: translateX(120%); }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .hero-word { animation: none; transform: translateY(-50%); }
    @view-transition { navigation: none; }
}
