/* =========================================================================
   Galerie am Fluss — Design-System
   Palette aus der alten Seite (Template "soft_green"): dunkles Oliv, Laubgrün
   und Creme — hier hell gewendet, das dunkle Oliv trägt Kopf und Fuß.
   ========================================================================= */

:root {
    --ground:     #F3F5EA; /* Creme mit Grünstich (alt: #F5F8EF) */
    --ground-2:   #E8ECD9; /* eine Spur tiefer, für abgesetzte Flächen */
    --text:       #1F2A10; /* fast Schwarz mit Olivton */
    --muted:      #56603F; /* Sekundärtext */
    --river:      #5E7404; /* Oliv (alt: #748F02), dunkel genug für Links */
    --river-deep: #696969; /* Grau des Inhaltskastens der alten Seite (styles2.css), vorher Oliv #182801 */
    --leaf:       #94AF22; /* Laubgrün (alt: aktiver Menüpunkt) */
    --leaf-light: #E4F2A0; /* Laubgrün aufgehellt, für Text auf dem grauen Band */
    --stone:      #7F6E44; /* Khaki, für kleine Überzeilen */
    --line:       #D5DBC0; /* feine Trennlinien */

    --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(--leaf); color: var(--text); }

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: var(--river-deep);
    border-bottom: 3px solid var(--leaf);
    color: var(--ground);
}
.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(--ground);
}
.wordmark b { font-weight: 600; color: var(--leaf-light); }
.wordmark .place {
    display: block; font-size: 0.6rem; letter-spacing: 0.28em;
    color: color-mix(in srgb, var(--ground) 95%, var(--river-deep)); 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(--ground);
    padding-bottom: 2px; border-bottom: 1px solid transparent; white-space: nowrap;
}
nav.main a:hover, nav.main a:focus-visible { color: var(--leaf-light); border-color: var(--leaf-light); }
nav.main .is-active > a, nav.main .is-current > a { color: var(--leaf-light); border-color: var(--leaf-light); }

/* 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(--river-deep); border: 1px solid color-mix(in srgb, var(--leaf) 40%, transparent);
    box-shadow: 0 24px 48px -32px rgba(10, 16, 2, 0.8);
    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(--text); background: var(--leaf); }
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) {
    .site-header .container { flex-direction: column; align-items: flex-start; gap: 0.7rem; }
    nav.main .menu-root { gap: 0.5rem 1.3rem; }
    /* Unterseiten stehen als Kacheln auf der jeweiligen Seite */
    nav.main .submenu { display: none !important; }
    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: color-mix(in srgb, var(--ground) 95%, var(--river-deep)); }
    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(24, 40, 1, 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 (graues Band wie der Kopf) ---- */
.site-footer {
    margin-top: var(--space-section);
    padding-block: clamp(3.5rem, 7vw, 6rem) 2.5rem;
    background: var(--river-deep);
    color: var(--ground);
}
.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: var(--ground); max-width: 32ch; }
.footer-col h4 {
    font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--leaf-light); 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: var(--ground); }
.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) 95%, 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) 95%, var(--river)); }
.meta-menu a:hover, .meta-menu a:focus-visible { color: var(--ground); }

/* ---- Bilder ---- */
picture { display: block; }
a.lightbox { display: block; cursor: zoom-in; }

/* Bilder-Serien: Kunstwerke zentriert und nicht breiter als nötig */
.serie .ce-gallery { margin-inline: auto; }
.serie .ce-image .ce-column, .serie .ce-textpic .ce-column { max-width: 900px; margin-inline: auto; }
.serie .ce-gallery .ce-row + .ce-row { margin-top: clamp(2rem, 5vw, 3.5rem); }
.serie figcaption { text-align: center; }
/* Hochformate nicht höher als der Bildschirm */
.serie .ce-gallery img { max-height: 82vh; width: auto; margin-inline: auto; }
.serie .frame-header { margin-top: clamp(1.5rem, 4vw, 2.5rem); }

/* Innenseiten ohne Hero: weniger Abstand zum Kopf */
.site-header + main > .content-main:first-child { padding-top: clamp(2.5rem, 6vw, 4.5rem); }

/* Vita- und Listentexte der alten Seite: eine Zeile je Absatz, kompakt */
.ce-bodytext p { margin-bottom: 0.45rem; }

.serie-nav {
    display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
    gap: 0.8rem 2rem; padding-block: 1rem;
    border-block: 1px solid var(--line);
    font-family: var(--font-display); font-size: 0.85rem; letter-spacing: 0.04em;
}
.content-main.serie > .serie-nav:last-child { margin-top: clamp(3rem, 7vw, 5rem); }
.serie-nav a { color: var(--river); text-decoration: none; }
.serie-nav a:hover, .serie-nav a:focus-visible { color: var(--river-deep); text-decoration: underline; }
.serie-nav__up { color: var(--muted) !important; }
.serie-nav__steps { display: flex; gap: 2rem; margin-left: auto; }

/* Künstlerseite: Übersicht der Serien */
.series-grid h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.series-grid ul {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: clamp(1.2rem, 3vw, 2.2rem);
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.content-main .series-grid li { padding: 0; margin: 0; }
.content-main .series-grid li::before { display: none; }
.series-grid a { display: block; text-decoration: none; color: var(--text); }
.series-grid li:not(:has(img)) a {
    background: var(--ground-2); padding: 1.4rem 1.2rem;
}
.series-grid li:not(:has(img)) span { margin-top: 0; font-size: 1.05rem; }
.series-grid img {
    width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
    background: var(--ground-2); transition: transform .3s ease, box-shadow .3s ease;
}
.series-grid a:hover img, .series-grid a:focus-visible img {
    transform: translateY(-3px); box-shadow: 0 18px 36px -24px rgba(24, 40, 1, 0.6);
}
.series-grid span {
    display: block; margin-top: 0.7rem;
    font-family: var(--font-display); font-size: 0.9rem; line-height: 1.4;
    border-left: 3px solid var(--leaf); padding-left: 0.6rem;
}

/* Lightbox (gallery.js) */
.lightbox-overlay {
    position: fixed; inset: 0; z-index: 100;
    display: grid; place-items: center; padding: 4vmin;
    background: color-mix(in srgb, #2E2E2E 96%, transparent); /* dunkler als --river-deep, Bilder wirken kräftiger */
}
.lightbox-overlay[hidden] { display: none; }
.lightbox-overlay figure { margin: 0; text-align: center; }
.lightbox-overlay img { max-width: 92vw; max-height: 84vh; width: auto; margin-inline: auto; box-shadow: 0 30px 80px -30px #000; }
.lightbox-overlay figcaption { color: var(--ground); margin-top: 1rem; font-family: var(--font-display); font-size: 0.85rem; }
.lightbox-overlay button {
    position: absolute; border: 0; background: none; cursor: pointer;
    color: var(--ground); font-size: 2.6rem; line-height: 1; padding: 0.6rem 1rem;
}
.lightbox-overlay button:hover, .lightbox-overlay button:focus-visible { color: var(--leaf-light); }
.lb-close { top: 0.5rem; right: 0.5rem; }
.lb-prev { left: 0.5rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 0.5rem; top: 50%; transform: translateY(-50%); }
.lightbox-overlay.is-single .lb-prev, .lightbox-overlay.is-single .lb-next { display: none; }
html.lb-open { overflow: hidden; }

/* ---- 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; }
}
