/* ============================================================
   GALLERY – Stylesheet Style 2: Modern Clean
   Grav CMS Template: bilder-video.html.twig
   Kontrast zum Pinnwand-Stil: kühl, minimalistisch, grid-betont
   ============================================================ */


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

.fav-btn {
    all: unset;
    font-size: 32px;
    background: rgba(0, 116, 217);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #aaa;

    border-radius: 50%;
    margin: 10px auto 0 auto;
    transition: transform 0.2s ease, color 0.2s;
}

.fav-btn:hover {
    transform: scale(1.1);
    color: #555;
}

.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: #f8f8f8;
    background-image: none;
    min-height: 100vh;
    padding: 40px 30px;
    transition: opacity 0.3s;
    border-top: 3px solid #222;
    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: 100%;
    margin: 0 auto 50px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 24px;

}

/* Seitentitel */
.header-main h1 {
    font-family: 'Inter', 'Helvetica Neue', sans-serif;
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
    color: #222;
    border: none;
    padding: 6px 0;
    display: inline-block;
    box-shadow: none;
    text-shadow: none;
}

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

/* Jahr-Badge */
.badge {
    background: transparent;
    color: #555;
    padding: 6px 6px;
    font-size: 0.95rem;
    font-weight: bold;
    border: 1px solid #ccc;
    border-radius: 20px;
    box-shadow: none;
    letter-spacing: 0.05em;
    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: transparent;
    border: 1px solid #222;
    border-radius: 2px;
    padding: 5px 14px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    color: #222;
    letter-spacing: 0.04em;
    box-shadow: none;
    transition: 0.15s;
}

.info-btn:hover {
    background: #222;
    color: #fff;
    transform: none;
    box-shadow: none;
}

/* Vor/Zurück Navigation */
.frame-nav {
    background: transparent;
    border: 1px solid #222;
    border-radius: 2px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    color: #222;
    letter-spacing: 0.04em;
    box-shadow: none;
    transition: 0.15s;
}

.frame-nav:hover {
    background: #222;
    color: #fff;
    transform: none;
    box-shadow: none;
}

/* VIP Login-Status Badge */
.vip-status-badge {
    padding: 6px 6px;
    font-size: 0.95rem;
    font-weight: bold;
    border: 1px solid #ccc;
    border-radius: 20px;
    letter-spacing: 0.04em;
    box-shadow: none;
    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: #222;
    color: #fff;
    border-color: #222;
}

.vip-status-badge.is-guest {
    background: transparent;
    color: #888;
    border-color: #ccc;
}

/* Grid Zoom Control */
.grid-zoom-ctrl {
    display: flex;
    align-items: center;
    gap: 2px;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 2px;
    box-shadow: none;
    padding: 2px 8px;
}

.grid-zoom-ctrl button {
    background: none;
    border: none;
    font-size: 1.2rem;
    font-weight: 400;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    min-width: 28px;
    min-height: 28px;
    color: #444;
    transition: color 0.15s;
}

.grid-zoom-ctrl button:hover {
    color: #000;
}

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

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


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

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

.photo-frame {
    background: #fff;
    padding: 0;
    box-shadow: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
    position: relative;
    margin-top: 0;
    border-radius: 0;
    border: 1px solid #e8e8e8;
    overflow: hidden;
}

/* Kein Hover-Effekt durch Rotation – stattdessen dezentes Opacity */
.photo-frame:hover {
    opacity: 0.85;
    transform: none !important;
    box-shadow: none;
    z-index: 10;
}

/* Keine Rotation */
.photo-frame:nth-child(3n+1),
.photo-frame:nth-child(3n+2),
.photo-frame:nth-child(3n+3),
.photo-frame:nth-child(5n+1),
.photo-frame:nth-child(7n+1) {
    transform: none;
}

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

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

/* Kein Pin */
.photo-frame::before {
    display: none;
}

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

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

/* Video Dauer Badge */
.video-duration-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 10;
    letter-spacing: 0.03em;
}

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

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

/* Zuletzt angesehen – Info-Label */
.photo-frame__info-label {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

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

/* Zuletzt angesehen – Rahmen */
.photo-frame.last-viewed {
    outline: 2px solid #222;
    outline-offset: 2px;
    box-shadow: none;
    animation: none;
}


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

.framed-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: #fff;
    background-image: none;
    z-index: 10000;
    flex-direction: column;
    overflow: hidden;
}

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

/* Header mit Buttons */
.lb-header {
    height: 60px;
    min-height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 10100;
    border-bottom: 1px solid #e8e8e8;
    background: #fff;
}

/* Aktions-Buttons im Header */
.lb-op-btn {
    background: transparent;
    border: 1px solid #ccc;
    color: #444;
    padding: 6px 12px;
    cursor: pointer;
    margin-left: 6px;
    font-weight: 400;
    font-size: 0.9rem;
    box-shadow: none;
    border-radius: 2px;
    transition: 0.15s;
}

.lb-op-btn:hover {
    background: #222;
    color: #fff;
    border-color: #222;
    box-shadow: none;
    transform: none;
}

/* 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;
    background: #f8f8f8;
}

/* 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.95);
    border: 1px solid #ddd;
    font-size: 2rem;
    color: #333;
    width: 48px;
    height: 48px;
    border-radius: 2px;
    cursor: pointer;
    z-index: 10050;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
}

.lb-nav:hover {
    background: #222;
    color: #fff;
    border-color: #222;
}

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


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

.lb-thumbnails-wrap {
    background: #fff;
    height: 100px;
    min-height: 100px;
    border-top: 1px solid #e8e8e8;
    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: 8px;
    padding: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
}

.lb-thumb {
    height: 68px;
    width: 68px;
    object-fit: cover;
    opacity: 0.35;
    cursor: pointer;
    flex-shrink: 0;
    border: 1px solid transparent;
    border-radius: 1px;
    transition: opacity 0.15s;
}

.lb-thumb.active {
    opacity: 1;
    border-color: #222;
}

.lb-thumb:hover {
    opacity: 0.7;
}

/* Sprung-Buttons Anfang/Ende */
.lb-thumb-jump {
    background: transparent;
    border: 1px solid #ccc;
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
    padding: 0 8px;
    height: 68px;
    flex-shrink: 0;
    box-shadow: none;
    border-radius: 2px;
    color: #555;
    transition: 0.15s;
}

.lb-thumb-jump:hover {
    background: #222;
    color: #fff;
    border-color: #222;
    box-shadow: none;
    transform: none;
}

.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 - 100px);
}

.framed-lightbox.is-landscape .lb-thumbnails-wrap {
    position: fixed;
    right: 0;
    top: 60px;
    bottom: 0;
    width: 100px;
    height: auto;
    border-top: none;
    border-left: 1px solid #e8e8e8;
    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: 8px;
    gap: 8px;
}

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

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

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


/* ============================================================
   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
   ============================================================ */

body.dark .gallery-wall {
    background-color: #111;
    background-image: none;
    border-top-color: #333;
}

body.dark .gallery-header {
    border-bottom-color: #2a2a2a;
}

body.dark .header-main h1 {
    color: #f0f0f0;
}

body.dark .photo-frame {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

body.dark .passepartout {
    background: #1a1a1a;
}

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

body.dark .photo-frame.last-viewed {
    outline-color: #888;
}

body.dark .photo-frame__info-label {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

body.dark .badge {
    border-color: #444;
    color: #aaa;
    background: transparent;
}

body.dark .info-btn {
    border-color: #555;
    color: #ccc;
    background: transparent;
}

body.dark .info-btn:hover {
    background: #f0f0f0;
    color: #111;
    border-color: #f0f0f0;
}

body.dark .frame-nav {
    border-color: #555;
    color: #ccc;
    background: transparent;
}

body.dark .frame-nav:hover {
    background: #f0f0f0;
    color: #111;
    border-color: #f0f0f0;
}

body.dark .grid-zoom-ctrl {
    border-color: #444;
    background: transparent;
}

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

body.dark .vip-status-badge.is-guest {
    border-color: #444;
    color: #888;
    background: transparent;
}

body.dark .vip-status-badge.is-vip {
    background: #f0f0f0;
    color: #111;
    border-color: #f0f0f0;
}

body.dark .framed-lightbox {
    background-color: #111;
    background-image: none;
}

body.dark .lb-header {
    background: #111;
    border-bottom-color: #2a2a2a;
}

body.dark .lb-main {
    background: #0a0a0a;
}

body.dark .lb-op-btn {
    background: transparent;
    border-color: #444;
    color: #ccc;
}

body.dark .lb-op-btn:hover {
    background: #f0f0f0;
    color: #111;
    border-color: #f0f0f0;
}

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

body.dark .lb-nav {
    background: rgba(20,20,20,0.95);
    border-color: #444;
    color: #ccc;
}

body.dark .lb-nav:hover {
    background: #f0f0f0;
    color: #111;
    border-color: #f0f0f0;
}

body.dark .lb-thumbnails-wrap {
    background: #111;
    border-top-color: #2a2a2a;
}

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

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

body.dark .lb-thumb-jump {
    background: transparent;
    border-color: #444;
    color: #aaa;
}

body.dark .lb-thumb-jump:hover {
    background: #f0f0f0;
    color: #111;
    border-color: #f0f0f0;
}
