/* =========================================================================
   Galerie am Fluss — Design-System
   Palette: Weser (Petrol-Grün) & Wesersandstein (Ocker) auf Salbei-Papier
   ========================================================================= */

:root {
    --ground:     #E8EBE5; /* pale sage-grey paper, river mist */
    --ground-2:   #DFE3DB; /* a shade deeper, for inset surfaces */
    --text:       #1C2522; /* near-black with a green undertone */
    --muted:      #5A655F; /* secondary text */
    --river:      #3C5A54; /* the Weser — muted petrol-green, the signature */
    --river-deep: #243A35; /* deep water, dark footer band */
    --stone:      #AC8862; /* Wesersandstein — greyed warm ochre */
    --line:       #C7CDC3; /* faint dividers */

    --font-display: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
    --font-body: Georgia, "Times New Roman", Times, serif;

    --container: min(92%, 1180px);
    --space-section: clamp(4.5rem, 11vw, 8.5rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--ground) url("../Images/paper-bg.jpg") center / cover no-repeat fixed;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

::selection { background: var(--river); color: var(--ground); }

a { color: inherit; }

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

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

/* ---- Typography ---- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 300;
    line-height: 1.08;
    letter-spacing: -0.015em;
    margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.6rem, 7vw, 5.2rem); }
h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.7rem); font-weight: 400; }
h4 { font-size: 1.1rem; font-weight: 600; }

p { margin: 0 0 1.2rem; }
p:last-child { margin-bottom: 0; }

a { transition: color .2s; }

ul, ol { margin: 0 0 1.2rem; padding-left: 1.2rem; }
li { margin-bottom: 0.4rem; }

/* shared layout helper */
.container { width: var(--container); margin-inline: auto; }

/* ---- Header ---- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--ground) 82%, transparent);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--line);
}
.site-header .container {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 1.5rem; padding-block: 1.05rem;
}
.wordmark {
    font-family: var(--font-display);
    font-weight: 400; font-size: 1.05rem;
    letter-spacing: 0.34em; text-transform: lowercase;
    text-decoration: none; white-space: nowrap; color: var(--text);
}
.wordmark b { font-weight: 600; }
.wordmark .place {
    display: block; font-size: 0.6rem; letter-spacing: 0.28em;
    color: var(--muted); margin-top: 0.25rem;
}
nav.main { font-family: var(--font-display); font-size: 0.82rem; letter-spacing: 0.08em; }
nav.main ul { list-style: none; margin: 0; padding: 0; }
nav.main .menu-root { display: flex; flex-wrap: wrap; gap: clamp(0.9rem, 2vw, 1.9rem); }
nav.main li { position: relative; }
nav.main a {
    display: block; text-decoration: none; color: var(--text);
    padding-bottom: 2px; border-bottom: 1px solid transparent; white-space: nowrap;
}
nav.main a:hover, nav.main a:focus-visible { color: var(--river); border-color: var(--river); }
nav.main .is-active > a, nav.main .is-current > a { color: var(--river); border-color: var(--river); }

/* marker on top-level items that carry a submenu */
nav.main .menu-root > .has-sub > a::after {
    content: ""; display: inline-block; width: 5px; height: 5px;
    margin-left: 0.5rem; vertical-align: middle; opacity: 0.55;
    border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
}

/* ---- Dropdowns (desktop) ---- */
nav.main .submenu {
    position: absolute; top: 100%; left: 0; z-index: 60; min-width: 220px;
    display: flex; flex-direction: column;
    background: var(--ground); border: 1px solid var(--line);
    box-shadow: 0 24px 48px -32px rgba(28, 37, 34, 0.55);
    padding: 0.4rem 0;
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
nav.main li:hover > .submenu,
nav.main li:focus-within > .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
nav.main .submenu a { padding: 0.55rem 1.2rem; border-bottom: none; letter-spacing: 0.04em; }
nav.main .submenu a:hover, nav.main .submenu a:focus-visible { color: var(--river); background: var(--ground-2); }
nav.main .submenu .has-sub > a::after { content: "\203A"; float: right; margin-left: 0.8rem; color: var(--muted); }
/* third level flies out to the side */
nav.main .submenu .submenu { top: -0.4rem; left: 100%; }

/* ---- Mobile: nested inline, indented (no JS) ---- */
@media (max-width: 880px) {
    nav.main .menu-root { gap: 0.5rem 1.3rem; }
    nav.main .submenu {
        position: static; opacity: 1; visibility: visible; transform: none;
        min-width: 0; border: none; box-shadow: none; background: transparent;
        padding: 0.1rem 0 0.3rem 0.9rem;
    }
    nav.main .submenu a { padding: 0.25rem 0; font-size: 0.95em; color: var(--muted); }
    nav.main .submenu .has-sub > a::after { content: ""; }
    nav.main .menu-root > .has-sub > a::after { display: none; }
}

/* ---- Hero (colPos 10) ---- */
.hero {
    padding-top: clamp(3rem, 8vw, 6rem);
    background: url("../Images/hero-bg.jpg") center bottom / cover no-repeat;
}
.hero .container > * { max-width: 62ch; }
.hero h1, .hero h2 { margin-bottom: 1.4rem; }
.hero p { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--muted); max-width: 48ch; }
/* an em-phrase trick: italic serif inside a sans headline */
.hero h1 em, .hero h2 em {
    font-family: var(--font-body); font-style: italic; font-weight: 400;
    color: var(--river); letter-spacing: 0;
}

/* ---- River line divider ---- */
.river-band { height: 120px; margin-top: var(--space-section); }
.river-band canvas { width: 100%; height: 100%; display: block; }

/* ---- Main content (colPos 0) ---- */
.content-main { padding-block: var(--space-section); }
.content-main > * + * { margin-top: clamp(3rem, 7vw, 6rem); }

/* ---- Buttons / links from RTE & menu ---- */
.content-main a, .hero a { color: var(--river); text-underline-offset: 3px; }
.content-main a:hover, .hero a:hover { color: var(--river-deep); }

/* =========================================================================
   fluid_styled_content — Inhaltselemente im Galerie-Look
   ========================================================================= */
.frame { margin: 0; }
.frame-space-before-medium { margin-top: clamp(2rem, 5vw, 4rem); }
.frame-space-after-medium { margin-bottom: clamp(2rem, 5vw, 4rem); }

/* eyebrow style for "Header (small)" / overline via header_layout 5 */
.frame-type-header .frame-header h2,
.frame .frame-header .header-layout-5 {
    font-family: var(--font-display); font-weight: 600;
    font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--stone); margin-bottom: 1rem;
}

.frame-header { max-width: 60ch; }

/* text & media */
.ce-bodytext { max-width: 65ch; }
.ce-bodytext p { color: var(--text); }

figure.image, .ce-media { margin: 0; }
.ce-image img, figure.image img {
    width: 100%;
    box-shadow: 0 1px 0 var(--line), 0 30px 60px -40px rgba(28, 37, 34, 0.5);
}
figcaption, .ce-image figcaption {
    font-family: var(--font-display); font-size: 0.78rem;
    color: var(--muted); margin-top: 0.85rem; line-height: 1.5;
}

/* textmedia: text + media side by side */
.ce-textpic .ce-gallery,
.ce-above .ce-gallery, .ce-below .ce-gallery { margin-bottom: 1.5rem; }

.ce-intext.ce-right .ce-gallery { float: right; margin: 0 0 1rem 2.5rem; max-width: 46%; }
.ce-intext.ce-left .ce-gallery { float: left; margin: 0 2.5rem 1rem 0; max-width: 46%; }

/* a clean 2-column grid when an editor places media beside text */
.ce-textpic.ce-nowrap .ce-gallery { max-width: 48%; }

/* gallery / multi-image rows */
.ce-gallery .ce-row { display: grid; gap: clamp(1.2rem, 3vw, 2.4rem); }
.ce-gallery[data-ce-columns="2"] .ce-row { grid-template-columns: repeat(2, 1fr); }
.ce-gallery[data-ce-columns="3"] .ce-row { grid-template-columns: repeat(3, 1fr); }
.ce-gallery .ce-column { margin: 0; }

/* bullet lists */
.content-main ul { list-style: none; padding-left: 0; }
.content-main ul li { position: relative; padding-left: 1.4rem; }
.content-main ul li::before {
    content: ""; position: absolute; left: 0; top: 0.7em;
    width: 0.5rem; height: 1px; background: var(--stone);
}

/* table */
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); }
th { font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.06em; }

/* ---- Footer (dunkles Wasser-Band) ---- */
.site-footer {
    margin-top: var(--space-section);
    padding-block: clamp(3.5rem, 7vw, 6rem) 2.5rem;
    background: var(--river-deep) url("../Images/footer-bg.jpg") center / cover no-repeat;
    color: color-mix(in srgb, var(--ground) 88%, var(--river));
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
.site-footer .wordmark { font-size: 1.2rem; color: var(--ground); }
.footer-intro { margin-top: 1.2rem; font-size: 0.95rem; color: color-mix(in srgb, var(--ground) 78%, var(--river)); max-width: 32ch; }
.footer-col h4 {
    font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--stone); margin: 0 0 1.1rem; font-weight: 600;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a { font-family: var(--font-display); font-size: 0.9rem; text-decoration: none; color: color-mix(in srgb, var(--ground) 88%, var(--river)); }
.footer-col a:hover, .footer-col a:focus-visible { color: var(--ground); }
.footer-base {
    margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: 1.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
    font-family: var(--font-display); font-size: 0.76rem;
    color: color-mix(in srgb, var(--ground) 65%, var(--river)); letter-spacing: 0.03em;
}
.meta-menu { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.meta-menu a { text-decoration: none; color: color-mix(in srgb, var(--ground) 75%, var(--river)); }
.meta-menu a:hover, .meta-menu a:focus-visible { color: var(--ground); }

/* ---- Responsive ---- */
@media (max-width: 880px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .ce-gallery[data-ce-columns="3"] .ce-row { grid-template-columns: repeat(2, 1fr); }
    .ce-intext.ce-right .ce-gallery, .ce-intext.ce-left .ce-gallery { float: none; max-width: 100%; margin: 0 0 1.5rem; }
}
@media (max-width: 540px) {
    body { font-size: 17px; }
    .footer-grid { grid-template-columns: 1fr; }
    .ce-gallery[data-ce-columns="2"] .ce-row,
    .ce-gallery[data-ce-columns="3"] .ce-row { grid-template-columns: 1fr; }
}

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