/*
Theme Name: Thesa Kunst
Theme URI: https://example.com/thesa-kunst
Author: Julius Terheyden Schütte
Description: Maßgeschneidertes WordPress-Theme für die Kunstseite von Gamma Thesa Terheyden.
Version: 1.1.0
Text Domain: thesa
*/

/* =========================================================
   style.css (refactored)
   - Struktur: Tokens -> Reset -> Base -> Layout -> Components -> Animations -> Responsive
   - Mehr CSS-Variablen für wiederkehrende Werte
   - Doppelte Regeln zusammengeführt (z.B. body / gallery-item / hide)
   ========================================================= */

/* ---------- Fonts ---------- */
@font-face {
    font-family: "Mank Sans";
    src: url("assets/fonts/MankSans-Medium.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
    /* Typography */
    --font-family-base: "Mank Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.6;

    /* Colors */
    --color-text: #5b5b5b;
    --color-link: #5e5e5e;
    --color-bg: #ffffff;
    --color-black: #000000;

    --color-glass: rgba(255, 255, 255, 0.6);
    --blur-glass: blur(10px);

    --color-border: #ddd;
    --color-border-light: #eee;

    --color-muted: #999;
    --color-muted-2: #888;
    --color-muted-3: #aaa;

    --color-overlay-bg: rgba(255, 255, 255, 0.7);
    --color-overlay-border: rgba(155, 155, 155, 0.6);
    --color-shadow: rgba(0, 0, 0, 0.10);
    --logo-background: yellow;

    --color-lightbox-bg: rgba(0, 0, 0, 0.6);
    --color-lightbox-border: #ffffff;
    --color-lightbox-caption: #ccc;
    --color-lightbox-close: #f1f1f1;
    --color-lightbox-close-hover: #bbb;

    --color-slider-placeholder: #f4f4f4;
    --color-slider-control-bg: rgba(0, 0, 0, 0.5);
    --color-slider-control-bg-hover: rgba(0, 0, 0, 0.8);

    --bg-blur: 5px;

    /* Layout */
    --layout-max-width: 1600px;
    --sidebar-width: 300px;
    --content-max-width: 1200px;

    /* Spacing */
    --space-xxs: 5px;
    --space-xs: 10px;
    --space-s: 15px;
    --space-m: 20px;
    --space-l: 40px;
    --space-xl: 80px;

    /* Radius */
    --radius-xs: 5px;
    --radius-s: 10px;
    --radius-l: 18px;
    --radius-xl: 30px;
    --radius-pill: 15px;
    --radius-round: 50%;

    /* Motion */
    --dur-fast: 0.2s;
    --dur: 0.3s;
    --dur-med: 0.4s;
    --dur-slow: 1s;

    /* Z-Index */
    --z-sticky: 1100;
    --z-sticky-bar: 1101;
    --z-overlay: 2000;
    --z-overlay-close: 2001;

    /* Hero slider sizing */
    --hero-max-width: 1000px;
    --hero-height: 400px;

    /* Gallery */
    --gallery-columns: 3;
    --gallery-gap: 15px;
}

html {
    scroll-behavior: smooth;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family-base);
}

/* Gibt allen Elementen mit einer ID (Anker-Zielen) beim Scrollen automatisch Luft nach oben */
[id] {
    scroll-margin-top: 5dvh;
    /* Passe diesen Wert an, bis es für dich perfekt im Blickfeld liegt */
}

a {
    color: inherit;
    text-decoration: none;
}

/* ---------- Base ---------- */
body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: var(--line-height-base);
    max-width: 100dvw;
    overflow-x: hidden;
    
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    /* removes the tiny gap below images */
}

/* ---------- Layout ---------- */
.site-container {
    display: flex;
    max-width: var(--layout-max-width);
    margin: 0 auto;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: sticky;
    top: 0;
    padding: var(--space-l) var(--space-m);
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Main content */
.content-area {
    flex: 1;
    padding: var(--space-s);
    max-width: var(--content-max-width);
}

section {
    padding: var(--space-s) 0;
}

/* Typography */
h2 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: var(--space-m);
    text-transform: uppercase;
    letter-spacing: 2px;
}

h3 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: var(--space-xs);
}

/* ---------- Sidebar components ---------- */
.logo-wrapper {
    display: block;
    margin-bottom: var(--space-l);
    text-decoration: none;
}

.circle-logo {
    width: 100px;
    height: 100px;
    background-color: var(--color-border);
    border-radius: var(--radius-round);
    margin: 0 auto;
    overflow: hidden;
}

.circle-logo img {
    background-color: var(--logo-background);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Navigation */
.menu-list {
    list-style: none;
    text-align: center;
}

.menu-list li {
    margin-bottom: 8px;
}

.menu-list a {
    text-decoration: none;
    color: var(--color-link);
    font-weight: normal;
    font-size: var(--font-size-base);
    transition: color var(--dur) ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
    padding: var(--space-xxs) var(--space-xs);

    &::after {
        content: "";
        position: absolute;
        width: 100%;
        height: 100%;
        pointer-events: none;
        background-color: var(--logo-background);
        left: 0;
        top: 0;
        opacity: 0;
        border-radius: var(--radius-s);
        transform: scaleX(0);
        transition: transform var(--dur) ease, opacity var(--dur) ease;
        z-index: -1;
        padding: var(--space-xxs) var(--space-xs);
    }

    &:hover {
        color: var(--color-black);
        text-decoration: underline;
        /* Hier ist sie wieder! */

        &::after {
            transform: scaleX(1);
            opacity: 1;
        }
    }
}

/* separator line from PHP logic */
.menu-list li.separator {
    height: 1px;
    background-color: var(--color-border);
    width: 40px;
    margin: var(--space-s) auto;
}

/* .menu-list a.active {
    font-weight: bold;
    color: var(--color-black);
    text-decoration: underline;
} */

.legal-links {
    font-size: 11px;
    line-height: 1.8;
}

.copyright {
    font-size: 10px;
    text-align: center;
    color: var(--color-muted);
    margin-top: var(--space-m);
}

/* ---------- Gallery (masonry via CSS columns) ---------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: var(--gallery-gap);
}

.gallery {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: var(--space-m);
}


.gallery-item {
    break-inside: avoid;
    position: relative;
    opacity: 1;
    width: 100%;
    height: 300px;
    transform: scale(1);
    animation: fadeIn 0.5s ease-in-out;
    border-radius: var(--radius-l);
    outline: 2px solid var(--color-border);
    backdrop-filter: blur(var(--bg-blur));
    -webkit-backdrop-filter: blur(var(--bg-blur));
    overflow: hidden;
    transition: all var(--dur) ease-out;
    border: solid 2px transparent;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.gallery-item:hover {
    cursor: pointer;
    border: solid 2px var(--logo-background);
    box-shadow: 0 4px 15px var(--color-shadow);
    outline: 2px solid transparent;
}

.gallery-item:active {
    transform: scale(.95);
}

/* hard hidden state (used by JS filter) */
.gallery-item.hide {
    display: none;
}


.categories {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-xs);
    justify-content: center;
    margin-bottom: var(--space-m);

    li {
        list-style: none;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-pill);
        display: flex;
        align-items: center;
        justify-content: center;
        &:hover {
            background-color: var(--logo-background);
            cursor: pointer;
        }

        a {
            padding: var(--space-xxs) var(--space-xs);
            font-size: var(--font-size-base);
            &.active {
                text-decoration: underline;
                font-weight: bold;

            }
        }


    } 

    @media screen and (max-width: 992px) {
        flex-wrap: wrap;
    }
}

/* Optional overlay (caption on hover) */
.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    background: var(--color-overlay-bg);
    padding: var(--space-xxs) var(--space-xs);
    backdrop-filter: blur(var(--bg-blur));
    -webkit-backdrop-filter: blur(var(--bg-blur));
    font-size: .9rem;
    font-weight: bold;
    opacity: 0;
    height: 0;
    transition: opacity var(--dur), height var(--dur);
    text-align: center;
    pointer-events: none;
}

.gallery-item:hover .overlay {
    height: calc(30px + var(--space-xxs) * 2);
    opacity: 1;
}




/* Sort controls */
.sort-controls {
    text-align: center;
    margin-bottom: var(--space-m);
    font-size: 12px;
    color: var(--color-muted);
}

.sort-controls span {
    margin-right: var(--space-xs);
}

.btn-sort {
    background: none;
    border: 1px solid #ccc;
    color: #666;
    padding: var(--space-xxs) var(--space-xs);
    margin: 0 2px;
    cursor: pointer;
    border-radius: var(--radius-pill);
    transition: all var(--dur-fast);
    font-size: 11px;
}

.btn-sort:hover {
    background: #eee;
    color: #333;
    border-color: var(--color-muted);
}

/* ---------- Vita / Text Sections ---------- */
.text-columns {
    display: flex;
    gap: var(--space-l);
}

.text-columns .col {
    flex: 1;
}

.text-columns ul {
    list-style: none;
    margin-top: var(--space-xs);
}

.text-columns li {
    margin-bottom: var(--space-xxs);
}


.vita-text,
.text-section,
.text-modal {
    line-height: 1.25;
    font-size: 1.3rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-wrap: break-word;

    h3 {
        font-size: 1.7rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin: var(--space-l) 0 var(--space-xs) 0;
    }

    h4 {
        font-size: 1.5rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin: var(--space-s) 0 var(--space-xxs) 0;
        position: relative;
        display: flex;
    }
    
    .text-modal-content a {
        color: var(--color-link);
        text-decoration: none;
        transition: color var(--dur) ease;
        position: relative;

        &:hover {
            color: var(--color-black);
            text-decoration: underline;
        }
        &::after {
            content: " ⭎";
            font-size: 1.3rem;

            &:hover {
                color: var(--color-black);
                transform: scale(1.05);
            }
        }
    }


}

.vita-text,
.text-section {
    max-width: var(--content-max-width);
}

/* ==========================================================================
   Gutenberg-Bilder im Fließtext absichern (Im Thesa-Style)
   ========================================================================== */

/* Der Wrapper für das Bild */
.text-section .wp-block-image {
    margin: var(--space-l) 0;
    /* Nutzt dein großes Spacing für genug Luft zum Text */
    max-width: 100%;
}

/* Das eigentliche Bild (analog zum .gallery-item Style) */
.text-section .wp-block-image img {
    max-width: 100%;
    height: auto;
    display: block;

    /* --- DEIN STYLE --- */
    border-radius: var(--radius-l);
    /* Deine 18px Rundung */
    /* Dein Standard-Rahmen */
    border: 2px solid transparent;
    /* Unsichtbarer Platzhalter für den Hover-Rahmen */
    transition: all var(--dur) ease-out;
    /* Deine Standard-Animation */
}

/* Dein typischer Hover-Effekt (wie bei den Galerien) */
.text-section .wp-block-image img:hover {
    border-color: var(--logo-background);
    /* Wird beim Hover gelb */
    box-shadow: 0 4px 15px var(--color-shadow);
    /* Dein weicher Schatten */
    outline-color: transparent;
    /* Der graue Rahmen verschwindet */
}

/* --- Ausrichtungen (Die Buttons im Editor: Links / Rechts / Mittig) --- */
.text-section .alignleft {
    float: left;
    margin-right: var(--space-m);
    margin-bottom: var(--space-s);
    max-width: 50%;
}

.text-section .alignright {
    float: right;
    margin-left: var(--space-m);
    margin-bottom: var(--space-s);
    max-width: 50%;
}

.text-section .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Bildunterschriften (falls im Editor eine eingetragen wird) */
.text-section .wp-block-image figcaption {
    font-size: 0.85em;
    color: var(--color-muted);
    /* Deine Farbe für dezentere Texte */
    text-align: center;
    margin-top: var(--space-xs);
}

/* Clearfix, damit der Text nach gefloateten Bildern nicht umbricht */
.text-section::after {
    content: "";
    display: table;
    clear: both;
}


/* Gemeinsame Styles für beide Kopier-Buttons (Galerie & Vita) */
.btn-copy-anchor,
.btn-copy-link {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    opacity: 0.5;
    /* Dein Wunsch-Standardwert */
    color: var(--color-text);
    transition: all 0.3s ease-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.btn-copy-anchor:hover,
.btn-copy-link:hover {
    opacity: 1 !important;
    transform: scale(1.1);
}

/* Der Tooltip (identisch für beide) */
.copy-tooltip {
    position: absolute;
    /* Vertikal zentrieren */
    top: 50%;
    /* Rechtsbündig mit dem linken Rand des Buttons (plus etwas Abstand) */
    right: calc(100% + 10px);
    /* Perfekte vertikale Zentrierung via transform */
    transform: translateY(-50%) translateX(10px);

    background: var(--logo-background);
    color: var(--color-text);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

/* Pfeil rechts am Tooltip */
.copy-tooltip::after {
    content: "";
    position: absolute;
    /* Mittig an der rechten Seite platzieren */
    top: 50%;
    left: 100%;
    margin-top: -5px;
    /* Hälfte der Border-Breite für Zentrierung */

    border-width: 5px;
    border-style: solid;
    /* Pfeilfarbe zeigt nach rechts zum Button */
    border-color: transparent transparent transparent var(--logo-background);
}

/* Aktiv-Zustand: Wenn kopiert wurde */
.btn-copy-anchor.is-copied .copy-tooltip,
.btn-copy-link.is-copied .copy-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.btn-copy-anchor.is-copied svg,
.btn-copy-link.is-copied svg {
    color: #28a745;
    /* Das Icon wird kurz grün */
}

/* --- Styles für den Copy-Button im Overlay --- */
.btn-copy-link {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: var(--color-overlay-bg);
    color: var(--color-text);
    outline: 2px solid var(--color-overlay-border);
    border-radius: var(--radius-s, 4px);
    /* Nutzt deine Variablen, falls vorhanden */
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    z-index: 10;
    opacity: 1;
    backdrop-filter: blur(var(--bg-blur));
    -webkit-backdrop-filter: blur(var(--bg-blur));
    /* Wichtig, falls das Overlay pointer-events: none hat */
}

.btn-copy-link:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.01);
}

.btn-copy-link:active {
    transform: scale(0.98);
}

/* Zustand, wenn der Link erfolgreich kopiert wurde */
.btn-copy-link.is-copied {
    /* Ein positives Grün */
    color: white;
    transform: scale(0.9);
}

/* Exhibition Section*/

.exhibition {
    width: 100%;
    flex-wrap: wrap;
    text-wrap: wrap;
}

.exhibition-section{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-s);
}   

.exhibition-single-page {
    gap: var(--space-s);

    p {
        padding: var(--space-xxs) 0;
    }

    .section {
        margin: var(--space-m) 0 var(--space-l) 0;
    }
}

.exhibition-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: var(--space-m);
    width: 100%;
}

.exhibition-item {
    border: 1px solid var(--color-border);
    padding: var(--space-m);
    border-radius: var(--radius-l);
    transition: box-shadow var(--dur), border-color var(--dur);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-evenly;
    gap: var(--space-xs);
    height: 100%;
    width: 100%;
    margin: 0;
    &:hover {
        border-color: var(--logo-background);
        box-shadow: 0 4px 15px var(--color-shadow);   
    }
}
.exhibition-item:only-child {
    max-width: 600px;
    /* Bremst das Item ab. Passe den Wert einfach an dein Design an */
    justify-self: center;
    align-self: center;
    /* Zentriert das Item horizontal in der Grid-Spalte */
}
    
.exhibition-title {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
    padding: 0;
    justify-self: flex-start;
    align-self: flex-start;
    letter-spacing: 1px;
    text-decoration: none;
    color: var(--color-link);
    transition: color var(--dur) ease;
    font-size: 1.5rem;
    line-height: 1.6rem;

}

.exhibition-image {
    display: block;
    border-radius: var(--radius-s);
    overflow: hidden;
    transition: transform var(--dur);
    width: 100%;
    max-height: 300px;
    margin: 0;
    padding: 0;
    img{
        object-fit: cover;
        width: 100%;
        height: 100%;
    }
}
    

.exhibition-excerpt{
    font-size: 1rem;
    color: var(--color-muted);
}

.exhibition-post-title {
    font-size: 3rem;
    display: flex;
    align-items: center;
    font-weight: bold;
    width: 100%;
    margin-bottom: var(--space-xs);
    letter-spacing: 1px;
    line-height: 3rem;
    text-decoration: none;
    color: var(--color-link);
    position: sticky;
    top: 2dvh;
    background: var(--color-glass);
    backdrop-filter: var(--blur-glass);
    border: 1px solid var(--color-border);
    padding: var(--space-xs) var(--space-m);
    border-radius: var(--radius-l);
    z-index: 800;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all var(--dur) ease-out;
    &.is-sticky {
        font-size: 1.8rem;

    }

    
}

@media screen and (max-width: 768px) {
    .exhibition-post-title {
        font-size: 2rem;
        top: calc(80px + 1dvh);
        line-height: 1.8rem;
        &.is-sticky {
            font-size: 1.5rem;
        }
    }
}

@media screen and (max-width: 425px) {
    .exhibition-post-title {
        font-size: 1.2rem;
        &.is-sticky {
            font-size: 1.2rem;
        }
    }
}


.exhibition-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    /* Keine feste Height! Die Höhe ergibt sich aus dem Inhalt */
    margin-bottom: var(--space-l);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 2px solid var(--logo-background);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);

    .exhibition-hero-image {
        /* Das Bild definiert jetzt die Höhe des Vaters */
        display: block;
        width: auto;
        max-width: 100%;

        /* Hier setzen wir die Bremse für Desktop */
        height: auto;
        max-height: 500px;

        object-fit: contain;
        position: relative;
        z-index: 1;
    }

    .exhibition-hero-background-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        /* Das Hintergrundbild füllt immer genau den Platz aus, 
           den das Hauptbild oben vorgibt */
        height: 100%;
        object-fit: cover;
        transform: scale(1.2);
        filter: blur(8px) brightness(0.7);
        z-index: 0;
    }
}

/* Buttons in Vita */
.btn-clean {
    background: var(--color-overlay-bg);
    backdrop-filter: blur(var(--bg-blur));
    -webkit-backdrop-filter: blur(var(--bg-blur));
    border: 1px solid var(--color-text);
    color: var(--color-text);
    padding: var(--space-xs) 30px;
    cursor: pointer;
    border-radius: var(--radius-s);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
    transition: all var(--dur);
    align-self: center;
    margin: var(--space-s) 0;

}

.btn-clean:hover {
    background: var(--logo-background);
}

.btn-clean:active {
    transform: scale(0.95);
}

/* Text content inside Vita blocks */
.text-content {
    line-height: 1.8;
    margin-bottom: var(--space-m);
}

.vita-block {
    margin-bottom: 30px;
}

/* ---------- Intro / Hero ---------- */
.intro-section {
    text-align: center;
    max-width: 800px;
    margin: 0 auto var(--space-xl) auto;
}

.intro-quote {
    font-style: italic;
    font-size: 18px;
    margin-bottom: 30px;
    color: var(--color-muted-2);
}

.intro-quote footer {
    display: block;
    margin-top: var(--space-xs);
    font-size: 12px;
    font-style: normal;
    color: var(--color-muted-3);
}

/* ---------- Lightbox & Text Modal ---------- */
.lightbox {
    display: none;
    position: fixed;
    z-index: var(--z-overlay);
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--color-lightbox-bg);
    backdrop-filter: blur(var(--bg-blur));
    -webkit-backdrop-filter: blur(var(--bg-blur));

    /* JS sets display:flex when opened */
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    display: block;
    max-width: 90%;
    max-height: 80vh;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 5px solid var(--logo-background);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    animation-name: zoom;
    animation-duration: var(--dur);
}

.lightbox-caption {
    display: block;
    width: 80%;
    text-align: center;
    color: var(--color-lightbox-caption);
    padding: var(--space-s) 0;
    min-height: 50px;
    background: radial-gradient(circle, var(--color-lightbox-bg), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.lightbox-close {
    position: absolute;
    top: var(--space-m);
    right: 30px;
    color: var(--color-lightbox-close);
    font-size: 40px;
    font-weight: bold;
    transition: color var(--dur);
    cursor: pointer;
    z-index: var(--z-overlay-close);
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--color-lightbox-close-hover);
    text-decoration: none;
    cursor: pointer;
}

/* Text modal content (inside #text-modal.lightbox) */
.text-modal-content {
    background: var(--color-bg);
    width: 80%;
    max-width: var(--content-max-width);
    height: 80vh;
    overflow-y: auto;
    padding: var(--space-l);
    margin: 50px auto;
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    animation-name: zoom;
    animation-duration: var(--dur);
}

.text-modal-body {
    height: 100%;
    overflow-y: scroll;
    padding: var(--space-s) 0;
    -webkit-overflow-scrolling: touch;   /* For smoother scrolling on iOS */

        /* Stärke des Verlaufs */
    --fade: 28px;

    /* Safari braucht die WebKit Variante */
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0,
        black var(--fade),
        black calc(100% - var(--fade)),
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        transparent 0,
        black var(--fade),
        black calc(100% - var(--fade)),
        transparent 100%
    );

    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

/* Close Animation: gleicher Zoom, nur rückwärts */
.lightbox.is-closing .lightbox-content,
.lightbox.is-closing .text-modal-content {
    animation: zoomBack var(--dur) forwards;
}

/* Optional, Hintergrund beim Schließen weich ausblenden */
@keyframes lightboxFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.lightbox.is-closing {
    animation: lightboxFadeOut var(--dur) forwards;
}

/* ---------- Hero slider ---------- */
.hero-slider-container {
    position: relative;
    /*max-width: var(--hero-max-width);*/
    width: 100%;
    height: var(--hero-height);
    margin: 0 auto var(--space-xl) auto;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: var(--color-slider-placeholder);
    border: var(--logo-background) solid 2px;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;

    opacity: 0;
    transition: opacity var(--dur-slow) ease-in-out;
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    z-index: 2;
}

.slider-btns {
    opacity: 0;
    pointer-events: none;
    margin: 0 15px;
}

.hero-slider-container:hover .slider-btns {
    opacity: 1;
    pointer-events: auto;
    margin: 0 5px;
    backdrop-filter: var(--bg-blur);
    -webkit-backdrop-filter: var(--bg-blur);
    border: var(--logo-background) solid 2px;
}

.slider-prev,
.slider-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: background-color var(--dur), opacity var(--dur), margin var(--dur), left var(--dur), right var(--dur);
    border: none;
    border-radius: var(--radius-s);
    background-color: var(--color-slider-control-bg);
    z-index: 10;
    user-select: none;
    box-shadow: 0 0 10px -5px var(--color-lightbox-bg);
}

.slider-prev {
    left: 0;
}

.slider-next {
    right: 0;
}

.slider-btns:hover {
    background-color: var(--color-slider-control-bg-hover);
}

.slider-next:hover {
    right: 5px;
}

.slider-prev:hover {
    left: 5px;
}


/* Links Section */
.external-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    grid-auto-rows: 60px;
    gap: var(--space-s);
    padding: 0;
    margin: 0;
    list-style: none;
    /* list-style gehört eigentlich auf das ul-Element */

    .external-link {
        padding: 0;
        margin: 0;
        position: relative;
        /* Für den Tooltip */

        /* HIER IST DER FIX: Das Listenelement (die Grid-Zelle) 
           wird hart auf 50px Höhe begrenzt! */
        height: 100%;

        display: flex;
        /* Damit das a-Tag darin den Platz füllen kann */

        a {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 4px var(--space-xs);
            border: 1px solid var(--color-border);
            border-radius: var(--radius-s);
            transition: background-color var(--dur), border-color var(--dur);
            color: var(--color-link);
            text-decoration: none;

            /* Das a-Tag nimmt jetzt exakt die 50px vom li ein */
            width: 100%;
            height: 100%;
            overflow: hidden;

            &:hover {
                background-color: var(--logo-background);
                border-color: var(--logo-background);
                color: var(--color-black);
            }

            img {
                max-width: 100%;
                /* Höhe wird auf 100% (minus Padding) der 50px gezwungen */
                max-height: 100%;
                height: auto;
                width: auto;
                object-fit: contain;
                /* Wichtig: Inline-Elemente machen manchmal einen unsichtbaren Abstand nach unten, block behebt das */
                display: block;
            }

            .fallback-text {
                font-weight: bold;
                text-align: center;
                text-transform: uppercase;
                letter-spacing: 1px;
                font-size: 0.85rem;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }
        }

        @media (hover: hover) {
            /* Tooltip */
            &::before {
                position: absolute;
                content: var(--dynamic-content);
                font-size: 1.2rem;
                color: var(--color-muted);
                pointer-events: none;
                opacity: 0;
                transition: all var(--dur) ease-out;
                bottom: 0;
                left: 0;
                text-wrap: wrap;
                line-height: 1.2;
                height: 100%;
                width: 100%;
                transform: translate(0, 5px);
                padding: var(--space-xs);
                display: flex;
                justify-content: center;
                align-items: center;
                border-radius: var(--radius-s);
                z-index: 20;
                backdrop-filter: blur(var(--bg-blur));
                -webkit-backdrop-filter: blur(var(--bg-blur));
                border: 1px solid transparent;
            }

            &:hover::before {
                opacity: 1;
                background-color: var(--color-overlay-bg);
                border: 1px solid var(--color-border);
                transform: translate(0, 0);
            }
        }
        
    }
}



/* ---------- Animations ---------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Zoom (lightbox + modal) */
@keyframes zoom {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes zoomBack {
    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(0);
        opacity: 0;
    }
}

/* Pop animation for filtering (JS adds .anim-out / .anim-in) */
@keyframes popOutAnimation {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

@keyframes popInAnimation {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.gallery-item.anim-out {
    animation: popOutAnimation var(--dur-med) forwards ease-out;
    pointer-events: none;
}

.gallery-item.anim-in {
    animation: popInAnimation var(--dur-med) ease-out;
}

/* ---------- Mobile responsive ---------- */
.menu-toggle {
    display: none;
    /* hidden on desktop */
}

@media screen and (max-width: 1200px) {
    .gallery-grid {
        column-count: 2;
    }
}


@media screen and (max-width: 860px) {
    .site-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 80px;  
        justify-content: center;
        position: sticky;
        top: 0;
        z-index: var(--z-sticky);
        background: var(--color-bg);

        padding: var(--space-xs) var(--space-m);
        border-bottom: 1px solid var(--color-border-light);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }

    .mobile-header-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: var(--color-bg);
        position: relative;
        z-index: var(--z-sticky-bar);
    }

    .circle-logo {
        width: 50px;
        height: 50px;
    }

    .logo-wrapper {
        margin-bottom: 0;
    }

    /* Hamburger */
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        padding: var(--space-xs);
    }

    .menu-toggle span {
        display: block;
        width: 25px;
        height: 2px;
        background-color: var(--color-text);
        margin: 5px 0;
        transition: var(--dur);
    }

    /* Overlay menu (does not push content) */
    .main-nav {
        opacity: 0;
        display: block;
        pointer-events: none;
        position: absolute;
        top: calc(80px + 1dvh);
        transition: max-height .8s ease-out 0s, opacity .8s ease-out 0.1s;
        width: calc(100% - 2 * var(--space-m));
        background: var(--color-bg);
        max-height: 0;
        overflow: hidden;
        border-radius: var(--radius-l);
        padding: var(--space-m) 0;
        border-bottom: 1px solid var(--color-border);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.10);
        z-index: 1000;
        text-align: center;
    }

    body::after{
        backdrop-filter: blur(0);
        transition: backdrop-filter var(--dur);
    }

    body:has(.main-nav.is-open)::after {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100dvw;
        height: 100dvh;
        z-index: 10;
        background-color: var(--color-lightbox-bg);
        backdrop-filter: blur(var(--bg-blur));
    }

    body:has(.main-nav.is-open) {
        overflow: hidden;
    }

    .main-nav.is-open {
        display: block;
        z-index: 1001;
        pointer-events: auto;
        opacity: 1;
        transition: max-height 1s ease-out 0.1s, opacity .3s ease-out 0s;
        max-height: 800px;
    }

    .copyright {
        margin-bottom: var(--space-m);
    }

    .content-area {
    }




    .gallery-grid {
        column-count: 1;
    }

    .text-columns {
        flex-direction: column;
        gap: var(--space-m);
    }
}
