/* ============================================================
   GALLERY – Stylesheet
   Grav CMS Template: bilder-video.html.twig
   ============================================================ */


/* ============================================================
   1. FAVORITEN BUTTON
   ============================================================ */

.fav-btn {
    all: unset;
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    background: rgba(0, 116, 217);
    border-radius: 50%;
    margin: 10px auto 0 auto;
    transition: transform 0.2s ease, background 0.2s, color 0.2s;
}

.fav-btn:hover {
    transform: scale(1.1);
    background: rgba(0,0,0,0.6);
}

.fav-btn.active {
    color: gold;
    background: rgba(0,0,0,0.7);
    text-shadow: 0 0 8px rgba(255,215,0,0.9);
}


/* ============================================================
   2. GALERIE WAND & HEADER
   ============================================================ */

.gallery-wall {
    background-color: #c8a96e;
    background-image:
        radial-gradient(ellipse at 20% 30%, rgba(180,130,60,0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(150,100,40,0.3) 0%, transparent 50%),
        var(--gallery-texture);
    min-height: 100vh;
    padding: 20px 20px;
    transition: opacity 0.3s;
    border-top: 6px solid #8B5E2A;
    border-bottom: 6px solid #8B5E2A;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.2), inset 0 -2px 8px rgba(0,0,0,0.15);
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    overflow-x: hidden;
}

.gallery-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto 50px;
    text-align: center;
}

/* Seitentitel */
.header-main h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    margin: 0;
    color: #3a2a1a;
    border: none;
    padding: 6px 20px;
    display: inline-block;
    box-shadow: none;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}


/* Badge-Zeile unter dem Titel */
.badge-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}

/* Jahr-Badge */
.badge {
    background: #8B5E2A;
    color: #fff;
    padding: 6px 6px;
    font-size: 0.95rem;
    font-weight: bold;
    border: none;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    display: inline-flex;       /* macht das Element zu einem flex container */
    align-items: center;        /* vertikale Zentrierung */
    justify-content: center;    /* horizontale Zentrierung */
    text-align: center;
}


/* Info-Wiki Button */
.info-btn {
    background: #c8a96e;
    border: 2px solid #8B5E2A;
    border-radius: 20px;
    padding: 6px 16px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95rem;
    color: #3a2a1a;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: 0.2s;
}

.info-btn:hover {
    background: #b8935a;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Vor/Zurück Navigation */
.frame-nav {
    background: #c8a96e;
    border: 2px solid #8B5E2A;
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: bold;
    color: #3a2a1a;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: 0.2s;
}

.frame-nav:hover {
    background: #b8935a;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

/* VIP Login-Status Badge */
.vip-status-badge {

    padding: 6px 6px;
    font-size: 0.95rem;
    font-weight: bold;
    border: 2px solid #8B5E2A;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    display: inline-flex;       /* macht das Element zu einem flex container */
    align-items: center;        /* vertikale Zentrierung */
    justify-content: center;    /* horizontale Zentrierung */
    text-align: center;
}

.vip-status-badge.is-vip {
    background: #8B5E2A;
    color: #fff;
}

.vip-status-badge.is-guest {
    background: #8B5E2A;
    color: #fff;
}

/* Grid Zoom Control */
.grid-zoom-ctrl {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #c8a96e;
    border: 2px solid #8B5E2A;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    padding: 3px 10px;
}

.grid-zoom-ctrl button {
    background: none;
    border: none;
    font-size: 1.4rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    min-width: 32px;
    min-height: 32px;
    color: #3a2a1a;
}

.grid-zoom-ctrl button:disabled {
    opacity: 0.25;
    cursor: default;
}

#gridZoomLabel {
    font-size: 0.65rem;
    letter-spacing: 2px;
    min-width: 28px;
    text-align: center;
}


/* ============================================================
   3. FOTO GRID & BILDKACHELN
   ============================================================ */

.photo-grid {
    display: grid;
    gap: 40px;
    max-width: 1300px;
    margin: 0 auto;
    align-items: start;

}

.photo-frame {
    background: #fff;
    padding: 10px 10px 28px 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    margin-top: 35px;
    border-radius: 2px;
}

/* Leichte zufällige Rotation für Polaroid-Effekt */
.photo-frame:nth-child(3n+1) { transform: rotate(-2deg); }
.photo-frame:nth-child(3n+2) { transform: rotate(1.5deg); }
.photo-frame:nth-child(3n+3) { transform: rotate(-1deg); }
.photo-frame:nth-child(5n+1) { transform: rotate(2deg); }
.photo-frame:nth-child(7n+1) { transform: rotate(-2.5deg); }

.photo-frame:hover {
    transform: rotate(0deg) scale(1.04) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    z-index: 10;
}

/*
.passepartout {
    background: #fff;
    padding: 0;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.photo-frame img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}
*/

.passepartout {
    background: #fff;
    padding: 0;
    display: block;
}

.photo-frame img {
    width: 100%;
    height: auto;
    display: block;
}

/* Pin-Nadel oben */
.photo-frame::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: radial-gradient(circle at 35% 35%, #ff6b6b, #c0392b);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    z-index: 2;
}


/* Video Play-Button Overlay */
.photo-frame[data-video] {
    position: relative;
}

.photo-frame[data-video]::before {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
    pointer-events: none;
    z-index: 10;
    opacity: 0.85;
}

/* Video Dauer Badge */
.video-duration-badge {
    position: absolute;
    bottom: 18px;
    right: 18px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 10;
}

/* Private Bilder – Schloss-Badge */
.photo-frame--private {
    position: relative;
}

.photo-frame--private::after {
    content: '🔒';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.2rem;
    z-index: 10;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

/* Zuletzt angesehen – Info-Label */
.photo-frame__info-label {
    position: absolute;
    top: -35px;
    left: 0;
    right: 0;
    text-align: center;
    background: #1a1a1a;
    color: #fff;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.photo-frame.last-viewed .photo-frame__info-label {
    opacity: 1;
}

/* Zuletzt angesehen – Rahmen & Animation */
.photo-frame.last-viewed {
    outline: 3px solid #1a1a1a;
    outline-offset: 4px;
    box-shadow:
        0 0 0 6px rgba(26,26,26,0.1),
        0 10px 25px rgba(0,0,0,0.3);
    animation: lastViewedPulse 0.6s ease-out;
}

@keyframes lastViewedPulse {
    0% {
        outline-width: 1px;
        box-shadow: 0 0 0 2px rgba(26,26,26,0.2), 0 5px 15px rgba(0,0,0,0.2);
    }
    100% {
        outline-width: 3px;
        box-shadow: 0 0 0 6px rgba(26,26,26,0.1), 0 10px 25px rgba(0,0,0,0.3);
    }
}


/* ============================================================
   4. LIGHTBOX – GRUNDSTRUKTUR
   ============================================================ */

.framed-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: #f4f2ee;
    background-image: var(--gallery-texture);
    z-index: 10000;
    flex-direction: column;
    overflow: hidden;
}

.framed-lightbox.is-open {
    display: flex;
}

/* Header mit Buttons */
.lb-header {
    height: 70px;
    min-height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 10100;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    background: rgba(244,242,238,0.95);
}

/* Aktions-Buttons im Header */
.lb-op-btn {
    background: #fff;
    border: 2px solid #1a1a1a;
    color: #333;
    padding: 6px 12px;
    cursor: pointer;
    margin-left: 8px;
    font-weight: bold;
    box-shadow: 2px 2px 0px #1a1a1a;
    transition: 0.2s;
}

.lb-op-btn:hover {
    box-shadow: 1px 1px 0px #1a1a1a;
    transform: translate(1px, 1px);
}

/* Haupt-Bereich mit Bild */
.lb-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    width: 100vw;
    min-height: 0;
}

/* Viewer & Slide-Track */
.lb-viewer {
    width: 100%;
    height: 100%;
    position: relative;
}

.lb-track {
    display: flex;
    width: 300%;
    height: 100%;
    transform: translateX(-33.3333%);
    will-change: transform;
    align-items: stretch;
}

.lb-slide {
    width: 33.3333%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
}

/* Bild-Container */
.lb-img-wrap {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
}

/* Hauptbild */
.lb-image {
    max-width: calc(90vw - 20px);
    max-height: calc(90vh - 80px);
    object-fit: contain;
    display: block;
    width: auto;
    height: auto;
}

/* Vor/Zurück Navigations-Buttons */
.lb-nav {
    background: rgba(255,255,255,0.9);
    border: 1px solid #ddd;
    font-size: 3rem;
    color: #333;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10050;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-nav.prev { left: 20px; }
.lb-nav.next { right: 20px; }


/* ============================================================
   5. LIGHTBOX – THUMBNAIL LEISTE
   ============================================================ */

.lb-thumbnails-wrap {
    background: #fff;
    height: 110px;
    min-height: 110px;
    border-top: 1px solid #ddd;
    z-index: 10200;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.lb-thumbnails-wrap.is-hidden {
    height: 0;
    min-height: 0;
    border-top: none;
    overflow: hidden;
}

.lb-thumbnails {
    display: flex;
    gap: 12px;
    padding: 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
}

.lb-thumb {
    height: 75px;
    width: 75px;
    object-fit: cover;
    opacity: 0.4;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid transparent;
}

.lb-thumb.active {
    opacity: 1;
    border-color: #333;
    transform: scale(1.05);
}

/* Sprung-Buttons Anfang/Ende */
.lb-thumb-jump {
    background: #fff;
    border: 2px solid #1a1a1a;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0 8px;
    height: 75px;
    flex-shrink: 0;
    box-shadow: 2px 2px 0px #1a1a1a;
    transition: 0.2s;
}

.lb-thumb-jump:hover {
    box-shadow: 1px 1px 0px #1a1a1a;
    transform: translate(1px, 1px);
}

.lb-thumbnails-wrap.is-hidden .lb-thumb-jump {
    display: none;
}


/* ============================================================
   6. LIGHTBOX – LANDSCAPE MODUS (Thumbs rechts)
   ============================================================ */

.framed-lightbox.is-landscape .lb-main {
    width: calc(100vw - 110px);
}

.framed-lightbox.is-landscape .lb-thumbnails-wrap {
    position: fixed;
    right: 0;
    top: 70px;
    bottom: 0;
    width: 110px;
    height: auto;
    border-top: none;
    border-left: 1px solid #ddd;
    flex-direction: column;
}

.framed-lightbox.is-landscape .lb-thumbnails-wrap.is-hidden {
    width: 0;
    border: none;
}

.framed-lightbox.is-landscape .lb-thumbnails {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    height: 100%;
    touch-action: pan-y;
    padding: 10px;
    gap: 10px;
}

.framed-lightbox.is-landscape .lb-thumb {
    width: 86px;
    height: 86px;
}

.framed-lightbox.is-landscape .lb-thumb-jump {
    width: 86px;
    height: auto;
    padding: 8px 0;
}

.framed-lightbox.is-landscape .lb-image {
    max-width: calc(100vw - 130px);
    max-height: calc(100vh - 90px);
}


/* ============================================================
   7. LIGHTBOX – ROTIERTER MODUS (Bild 90° gedreht)
   ============================================================ */

#magnetLightboxEl.is-rotated .lb-img-wrap {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

#magnetLightboxEl.is-rotated .lb-image {
    max-width: 80vh;
    max-height: 90vw;
}

#magnetLightboxEl.is-rotated .lb-thumb {
    transform: rotate(90deg);
}


/* ============================================================
   8. LIGHTBOX – VIDEO
   ============================================================ */

.lb-video {
    max-width: calc(90vw - 20px);
    max-height: calc(90vh - 80px);
    display: block;
    background: #000;
}


/* ============================================================
   9. RESPONSIVE – MOBILE (max 768px)
   ============================================================ */
@media (max-width: 768px) {

    /* ── Gallery Header Layout ── */
    .gallery-header {
        display: grid;
        grid-template-columns: 80px 1fr 80px;
        grid-template-rows: auto auto;
        align-items: start;
        gap: 4px;
        margin: 0 auto 20px;
    }

    .gallery-header .nav-wrap:first-child {
        grid-row: 1;
        grid-column: 1;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        padding-top: 4px;
    }

    .gallery-header .nav-wrap:last-child {
        grid-row: 1;
        grid-column: 3;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding-top: 4px;
    }

    .header-main {
        grid-row: 1 / 3;
        grid-column: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    /* ── Fav Button ── */
    .fav-btn {
        font-size: 22px;
        width: 34px;
        height: 34px;
        margin: 0;
        flex-shrink: 0;
    }

    /* ── Seitentitel ── */
    .header-main h1 {
        font-size: 1.3rem;
        margin: 0;
        text-align: center;
        word-break: break-word;
        hyphens: auto;
        padding: 0 4px;
    }

    /* ── Badge Zeile ── */
    .badge-row {
        justify-content: center;
        gap: 4px;
        flex-wrap: wrap;
        margin-top: 2px;
    }

    .badge,
    .info-btn,
    .vip-status-badge,
    #styleToggleBtn {
        font-size: 0.78rem;
        padding: 4px 10px;
    }

    .grid-zoom-ctrl {
        padding: 2px 6px;
    }

    .grid-zoom-ctrl button {
        font-size: 1rem;
        min-width: 24px;
        min-height: 24px;
    }

    #gridZoomLabel {
        font-size: 0.5rem;
        min-width: 18px;
    }

    /* ── Nav Buttons ── */
    .frame-nav {
        font-size: 0.72rem;
        padding: 6px 7px;
        white-space: normal;
        word-break: break-word;
        line-height: 1.2;
        max-width: 75px;
    }

    /* ── Foto Grid ── */
    .photo-grid { gap: 16px; }
    .photo-frame { margin-top: 18px; }
    .photo-frame__info-label {
        font-size: 0.65rem;
        padding: 3px 6px;
        top: -26px;
    }

    /* ── Lightbox ── */
    .lb-nav { display: none; }
    .lb-header { padding: 0 10px; height: 58px; min-height: 58px; }
    .lb-op-btn {
        padding: 7px 10px;
        min-width: 38px;
        font-size: 1rem;
        margin-left: 5px;
    }
    .lb-image { max-width: 98vw; max-height: 75vh; }
    .lb-img-wrap { padding: 0; }
    .lb-video { max-width: 98vw; max-height: 75vh; }

    #magnetLightboxEl.is-rotated .lb-video {
        max-width: 80vh;
        max-height: 90vw;
    }

    .framed-lightbox.is-landscape .lb-thumbnails-wrap {
        height: calc(100% - 58px) !important;
    }
}


/* ============================================================
   10. DARKMODE
   ============================================================ */

/* Galerie Wand */
body.dark .gallery-wall {
    background-color: #1a1a1a;
    background-image: none;
}

/* Titel */
body.dark .gallery-header h1,
body.dark .header-main h1 {
    color: #e8e6e1;
    border-color: #555;
    box-shadow: 4px 4px 0px #000;
}

/* Bildkacheln */
body.dark .photo-frame {
    background: #2a2a2a;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

body.dark .passepartout {
    background: #2a2a2a;
}

body.dark .photo-frame img {
    opacity: 0.9;
}

/* Zuletzt angesehen */
body.dark .photo-frame.last-viewed {
    outline-color: #e8e6e1;
    box-shadow: 0 0 0 6px rgba(255,255,0,0.4), 0 10px 25px rgba(0,0,0,0.5);
}

body.dark .photo-frame__info-label {
    background: #e8e6e1;
    color: #1a1a1a;
}

/* Header Elemente */
body.dark .badge {
    background: #333;
    border-color: #555;
    box-shadow: 2px 2px 0px #000;
}

body.dark .info-btn {
    background: #2a2a2a;
    border-color: #555;
    color: #e8e6e1;
    box-shadow: 2px 2px 0px #000;
}

body.dark .info-btn:hover {
    box-shadow: 1px 1px 0px #000;
}

body.dark .frame-nav {
    background: #2a2a2a;
    border-color: #555;
    color: #e8e6e1;
    box-shadow: 3px 3px 0px #000;
}

body.dark .frame-nav:hover {
    box-shadow: 1px 1px 0px #000;
}

body.dark .grid-zoom-ctrl {
    background: #2a2a2a;
    border-color: #555;
    box-shadow: 2px 2px 0px #000;
}

body.dark .grid-zoom-ctrl button {
    color: #e8e6e1;
}

body.dark .vip-status-badge.is-guest {
    background: #2a2a2a;
    border-color: #555;
    color: #e8e6e1;
    box-shadow: 2px 2px 0px #000;
}

body.dark .vip-status-badge.is-vip {
    background: #e8e6e1;
    color: #1a1a1a;
    box-shadow: 2px 2px 0px #000;
}

/* Lightbox */
body.dark .framed-lightbox {
    background-color: #1a1a1a;
    background-image: none;
}

body.dark .lb-header {
    background: rgba(26,26,26,0.95);
    border-bottom-color: rgba(255,255,255,0.08);
}

body.dark .lb-op-btn {
    background: #2a2a2a;
    border-color: #555;
    color: #e8e6e1;
    box-shadow: 2px 2px 0px #000;
}

body.dark .lb-op-btn:hover {
    box-shadow: 1px 1px 0px #000;
}

body.dark #magnetLbCounter {
    color: #e8e6e1;
}

body.dark .lb-nav {
    background: rgba(42,42,42,0.9);
    border-color: #555;
    color: #e8e6e1;
}

/* Thumbnail Leiste */
body.dark .lb-thumbnails-wrap {
    background: #2a2a2a;
    border-top-color: #444;
}

body.dark .lb-thumb {
    opacity: 0.5;
}

body.dark .lb-thumb.active {
    opacity: 1;
    border-color: #e8e6e1;
}

body.dark .lb-thumb-jump {
    background: #2a2a2a;
    border-color: #555;
    color: #e8e6e1;
    box-shadow: 2px 2px 0px #000;
}

body.dark .lb-thumb-jump:hover {
    box-shadow: 1px 1px 0px #000;
}
