/* ===== FILE: assets/site.css ===== */

/* --------------------------------------------------------------------------
   Theme tokens. Light is the default. Dark applies via [data-theme="dark"]
   or, for users without JS who prefer dark, via the media query at the end.
   --primary is overridden at runtime by the CMS setting (theme_color_style()).
   -------------------------------------------------------------------------- */
:root {
    --primary: #4a5d23;
    --on-primary: #ffffff;

    --bg: #f7f7f5;
    --surface: #ffffff;
    --surface-alt: #efefec;
    --text: #1c1e1a;
    --text-muted: #5d6058;
    --border: #e2e2dd;

    --shadow-sm: 0 1px 2px rgba(20, 24, 16, .06);
    --shadow-md: 0 4px 16px rgba(20, 24, 16, .08);
    --shadow-lg: 0 12px 40px rgba(20, 24, 16, .16);

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;

    --header-bg: rgba(255, 255, 255, .78);
    --overlay: rgba(15, 18, 12, .5);

    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #14161a;
    --surface: #1e2127;
    --surface-alt: #262a31;
    --text: #e8e9e6;
    --text-muted: #a3a69e;
    --border: #34383f;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);

    --header-bg: rgba(24, 27, 32, .78);
    --overlay: rgba(0, 0, 0, .65);

    color-scheme: dark;
}

/* No-JS dark preference fallback (JS users get data-theme set) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg: #14161a;
        --surface: #1e2127;
        --surface-alt: #262a31;
        --text: #e8e9e6;
        --text-muted: #a3a69e;
        --border: #34383f;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
        --shadow-md: 0 4px 16px rgba(0, 0, 0, .35);
        --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
        --header-bg: rgba(24, 27, 32, .78);
        --overlay: rgba(0, 0, 0, .65);
        color-scheme: dark;
    }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
    font-size: 1.03rem;
    -webkit-font-smoothing: antialiased;
    transition: background-color .3s ease, color .3s ease;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }

h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }

a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }

::selection { background: var(--primary); color: var(--on-primary); }

/* --------------------------------------------------------------------------
   Top bar — visible only at the very top of the page
   -------------------------------------------------------------------------- */
.topbar {
    background: var(--primary);
    color: #fff;
    font-size: .82rem;
    padding: .45rem 0;
    --topbar-h: 2.1rem; /* fallback; JS misst die echte Höhe */
    transition: margin-top .35s ease, opacity .3s ease;
}
.topbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
}
.topbar-slogan { font-weight: 550; letter-spacing: .01em; }
.topbar-contact {
    display: inline-flex; align-items: center; flex-wrap: wrap; gap: 1.1rem;
}
.topbar-contact a { color: #fff; text-decoration: none; }
.topbar-contact a:hover { text-decoration: underline; }
.topbar-label { opacity: .75; margin-right: .25rem; }
.topbar-sep {
    width: 1px; height: .9rem; background: rgba(255,255,255,.35);
    display: inline-block;
}

/* Icon and value sit on one line, vertically centred. */
.topbar-contact a,
.topbar-contact > span {
    display: inline-flex;
    align-items: center;
    gap: .38rem;
}

.topbar-contact .icon {
    width: 1.05em;
    height: 1.05em;
    opacity: .9;      /* slightly softened so the numbers stay dominant */
}

/* Hidden state: slid up out of view, space collapsed via negative margin */
.topbar.is-hidden {
    margin-top: calc(-1 * var(--topbar-h, 2.1rem));
    opacity: 0;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Header — sticky glass bar
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: .85rem 1.25rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.site-header .logo {
    font-weight: 750; font-size: 1.15rem; letter-spacing: -.01em;
    color: var(--text); text-decoration: none;
    display: flex; align-items: center; gap: .55rem;
}
.site-header .logo::before {
    content: "";
    width: .95rem; height: .95rem; border-radius: 4px;
    background: var(--primary);
    display: inline-block;
}
.site-header nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.site-header nav a {
    color: var(--text-muted); text-decoration: none; font-size: .95rem; font-weight: 550;
    transition: color .2s ease;
}
.site-header nav a:hover { color: var(--primary); }
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; width: 100%;
}

/* Theme toggle */
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.4rem; height: 2.4rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer; font-size: 1.05rem;
    transition: transform .2s ease, border-color .2s ease, background-color .3s ease;
}
.theme-toggle:hover { border-color: var(--primary); transform: scale(1.08); }
.theme-toggle:active { transform: scale(.95); }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
main { display: block; }

.text-section, .product-section {
    padding-top: clamp(0.1rem, 7vw, 0rem);
    padding-right: 0px;
    padding-bottom: clamp(3rem, 7vw, 0rem);
    padding-left: 0px;
    scroll-margin-top: 4.5rem; /* offset for sticky header on anchor jumps */
}

/* Subtle alternation for rhythm */
.text-section:nth-of-type(even), .product-section:nth-of-type(even) {
    background: var(--surface-alt);
    /* bleed to full width */
    box-shadow: 0 0 0 100vmax var(--surface-alt);
    clip-path: inset(0 -100vmax);
}

/* First section acts as a hero: bigger type */
main > section:first-of-type h2 {
    font-size: clamp(2.1rem, 5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -.02em;
}
main > section:first-of-type p { font-size: 1.12rem; color: var(--text-muted); }

.section-head { max-width: 640px; margin-bottom: 2.25rem; }
.subtitle {
    color: var(--text-muted); font-size: 1.05rem; margin: .35rem 0 0;
}

/* Rich text */
.rich-text { max-width: 720px; }
.rich-text :where(p, ul, ol, blockquote) { margin: .9rem 0; }
.rich-text blockquote {
    border-left: 3px solid var(--primary);
    padding: .25rem 0 .25rem 1.1rem;
    color: var(--text-muted);
    font-style: italic;
}

/* --------------------------------------------------------------------------
   Product grid & cards
   -------------------------------------------------------------------------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.5rem;
}

.product-card .product-open {
    all: unset; cursor: pointer; display: flex; flex-direction: column;
    width: 100%; height: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.product-card .product-open:hover,
.product-card .product-open:focus-visible {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.product-card .product-open img,
.product-cover-placeholder {
    width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
    background: var(--surface-alt);
    transition: transform .35s ease;
}
.product-card .product-open:hover img { transform: scale(1.04); }
.product-card h3 { margin: .9rem 1rem 0; color: var(--text); }
.product-card p {
    margin: .3rem 1rem .9rem; color: var(--text-muted);
    font-size: .93rem; flex: 1;
}
.product-more {
    display: inline-block; margin: 0 1rem 1.05rem;
    color: var(--primary); font-weight: 650; font-size: .9rem;
}
.product-card .product-open:hover .product-more { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 100; }
.modal[hidden] { display: none; }
.modal-backdrop {
    position: absolute; inset: 0;
    background: var(--overlay);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
.modal-panel {
    position: relative; margin: 4vh auto; width: min(740px, 92vw);
    max-height: 88vh; overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.25rem, 3vw, 2.25rem);
    animation: modal-in .28s cubic-bezier(.2, .9, .3, 1);
}
@keyframes modal-in {
    from { opacity: 0; transform: translateY(16px) scale(.985); }
    to   { opacity: 1; transform: none; }
}
.modal-close {
    position: absolute; top: .9rem; right: 1rem;
    font-size: 1.5rem; line-height: 1; background: var(--surface-alt);
    border: 1px solid var(--border); color: var(--text);
    width: 2.3rem; height: 2.3rem; border-radius: 50%;
    cursor: pointer; transition: background-color .2s ease, transform .2s ease;
}
.modal-close:hover { background: var(--border); transform: rotate(90deg); }
.modal-panel:focus { outline: none; }
.modal-panel h2 { margin-top: .25rem; padding-right: 3rem; }

/* Gallery */
.gallery { position: relative; margin: 0 0 1.5rem; border-radius: var(--radius); overflow: hidden; }
.gallery-slide { display: none; margin: 0; }
.gallery-slide.is-active { display: block; }
.gallery-slide img { width: 100%; display: block; }
.gallery-prev, .gallery-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 50%; width: 2.6rem; height: 2.6rem;
    cursor: pointer; font-size: 1.1rem;
    transition: transform .2s ease, border-color .2s ease;
}
.gallery-prev:hover, .gallery-next:hover { transform: translateY(-50%) scale(1.1); border-color: var(--primary); }
.gallery-prev { left: .6rem; }
.gallery-next { right: .6rem; }

.product-price { font-size: 1.2rem; }
.product-price strong {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .3rem .8rem;
    display: inline-block;
}

.product-documents ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.product-documents li a {
    display: inline-flex; align-items: center; gap: .55rem;
    padding: .6rem .9rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none; font-weight: 550;
    transition: border-color .2s ease, transform .2s ease;
}
.product-documents li a:hover { border-color: var(--primary); transform: translateX(3px); }
.product-documents li a::before { content: "📄"; font-size: 1rem; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    padding: 2.5rem 0; color: var(--text-muted);
    background: var(--surface); border-top: 1px solid var(--border);
    margin-top: 3rem;
}
.site-footer .container {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 1rem;
}
.site-footer nav a { color: var(--text-muted); margin-left: 1.25rem; }
.site-footer nav a:hover { color: var(--primary); }

/* --------------------------------------------------------------------------
   Cookie note — floating card
   -------------------------------------------------------------------------- */
.cookie-note {
    --cookie-note-max-width: 540px;
    position: fixed;
    bottom: 1rem;
    left: calc(50% - (var(--cookie-note-max-width) / 2));                       /* was: right: 1rem */
    transform: translateX(-50%);      /* centers the element on its own width */
    width: calc(100% - 2rem);         /* keeps a gutter on small screens */
    max-width: var(--cookie-note-max-width);
    z-index: 200; 
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem;
    display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
    animation: modal-in .35s ease both .4s;
}
.cookie-note[hidden] { display: none; }
.cookie-note p { margin: 0; font-size: .88rem; color: var(--text-muted); flex: 1; min-width: 220px; }
.cookie-note button {
    background: var(--primary); color: var(--on-primary); border: none;
    padding: .55rem 1.3rem; border-radius: 999px; cursor: pointer;
    font: inherit; font-weight: 600;
    transition: transform .2s ease, opacity .2s ease;
}
.cookie-note button:hover { transform: scale(1.05); opacity: .92; }

/* --------------------------------------------------------------------------
   Motion sensitivity
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .topbar-inner { justify-content: center; text-align: center; }
    .topbar-sep { display: none; }
    .site-header { flex-direction: column; align-items: stretch; padding: .75rem 1rem; }
    .site-header nav { justify-content: center; gap: .9rem; overflow-x: auto; }
    .site-header .logo { justify-content: center; }
    .modal-panel { margin: 2vh auto; max-height: 94vh; }
    .cookie-note { bottom: .75rem; }
}

/* Karussell: volle Breite aus dem Container heraus (Hero-Band) */
.carousel-section {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    scroll-margin-top: 4.5rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0 0 0.5rem;
    position: relative;
}
.carousel-subtitle { text-align: center; color: var(--text-muted); margin: 1.5rem 0 .5rem; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

.carousel { position: relative; overflow: hidden; padding-bottom: 5px; }
.carousel-track {
    display: flex;
    transition: transform .5s cubic-bezier(.25, .8, .3, 1);
}
.carousel-slide {
    flex: 0 0 100%; margin: 0; position: relative;
    display: none;
}
.carousel-slide.is-active { display: block; }
.carousel-slide img {
    width: 100%; height: clamp(280px, 55vh, 560px);
    object-fit: cover; display: block;
}
.carousel-slide figcaption {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,.65));
    color: #fff; padding: 2rem 1.25rem .8rem;
    font-size: .95rem;
}
.carousel-prev, .carousel-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border: 1px solid var(--border); color: var(--text);
    border-radius: 50%; width: 2.6rem; height: 2.6rem;
    cursor: pointer; font-size: 1.1rem; z-index: 5;
}
.carousel-prev { left: 1rem; }
.carousel-next { right: 1rem; }
.carousel-prev:hover, .carousel-next:hover { border-color: var(--primary); }

.carousel-dots {
    display: flex; justify-content: center; gap: .55rem;
    margin-top: 1rem;
}
.carousel-dot {
    width: .65rem; height: .65rem; border-radius: 50%;
    border: 1px solid var(--border); background: var(--surface-alt);
    cursor: pointer; padding: 0;
    transition: background-color .25s ease, transform .25s ease;
}
.carousel-dot.is-active { background: var(--primary); transform: scale(1.25); border-color: var(--primary); }

/* Karte */
.map-section {
    padding-top: clamp(0.1rem, 7vw, 0rem);
    padding-right: 0px;
    padding-bottom: clamp(3rem, 7vw, 0rem);
    padding-left: 0px;
    scroll-margin-top: 4.5rem;
}
.map-layout {
    display: grid; grid-template-columns: 1fr 2fr; gap: 2rem; align-items: start;
}
.map-address {
    font-style: normal; font-size: 1.05rem; line-height: 1.8;
    color: var(--text);
    border-left: 3px solid var(--primary);
    padding-left: 1.1rem;
}
.map-embed {
    position: relative; border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--surface-alt);
    min-height: 320px;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 1rem; text-align: center; padding: 1.5rem;
}
.map-embed iframe { width: 100%; height: 340px; border: 0; display: block; }
.map-consent-text { max-width: 420px; color: var(--text-muted); font-size: .9rem; margin: 0; }
.map-load-btn {
    background: var(--primary); color: var(--on-primary); border: none;
    padding: .6rem 1.5rem; border-radius: 999px; cursor: pointer;
    font: inherit; font-weight: 600;
}
.map-load-btn:hover { opacity: .9; }

@media (max-width: 800px) {
    .map-layout { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- Icons */
/* SVG sprite host: present in the DOM but takes no layout space. */
.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Icon instances. Size scales with font-size, colour follows the text. */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;   /* optical alignment with surrounding text */
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;             /* keeps icons from squashing in flex rows */
}

/* Optional size modifiers */
.icon-sm { width: .85em; height: .85em; }
.icon-lg { width: 1.4em;  height: 1.4em; }
.icon-xl { width: 2em;    height: 2em; }

/* Theme toggle button icon alignment */
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle .icon {
    flex-shrink: 0;
}