/* ═════════════════════════════════════════════════════════════
   LIGHTBOX.CSS – ALLES FÜR DIE GROSSANSICHT AN EINEM ORT
   ═════════════════════════════════════════════════════════════
   Gehört zu js/lightbox.js (Markup + Logik). Wer das Aussehen oder einen
   Effekt der Grossansicht ändern will (Hintergrund, Pfeile, Miniaturen,
   Übergänge, Hell-Modus …), macht das NUR hier – die
   Änderung gilt automatisch auf ALLEN Seiten mit Grossansicht
   (Fotografie-Kategorien, Behind the Scenes, URBNVIBE, …).

   Einbinden (in <head>, nach style.css / header.css, VOR theme.css):
       <link rel="stylesheet" href="css/lightbox.css">
   Mehr dazu (so wird ein Bild "gross anklickbar") steht ganz oben
   in js/lightbox.js.

   Inhalt:
     1. Steuerung (Pfeile & Schliessen)
     2. Grossansicht-Overlay, Slides, Miniatur-Leiste
     3. Klickbare Elemente auf der Seite  [data-lightbox]
     4. Hell-Modus
   ═════════════════════════════════════════════════════════════ */

/* ─── 1. LIGHTBOX-STEUERUNG (PFEILE & SCHLIESSEN) ───
   Exakt der gleiche Look wie die Pfeile beim "Meine Projekte"-Slider auf
   index.html (.slider-arrow) – zentral hier gepflegt und geteilt von der
   Fotografie-Galerie (landschaften/portrait/wildlife/streetfotografie),
   bts.html und URBNVIBE. */
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) translateZ(0);
    -webkit-transform: translateY(-50%) translateZ(0);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(15, 15, 15, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000000;
    transition: background 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    outline: none;
}

@media (hover: hover) and (pointer: fine) {
    .lightbox-nav-btn:hover {
        background: rgba(255, 255, 255, 0.22);
        border-color: rgba(255, 255, 255, 0.5);
    }
}

.lightbox-prev-btn {
    left: 20px;
}

.lightbox-next-btn {
    right: 20px;
}

.lightbox-close-btn {
    top: 20px;
    right: 20px;
    left: auto;
    transform: translateZ(0);
}

/* Pfeile ausschliesslich auf echten Touch-Geräten ausblenden (nicht bei
   schmalen PC-Fenstern, siehe .slider-arrow-Pendant auf index.html) – das
   X zum Schliessen bleibt dort trotzdem immer sichtbar. */
@media (hover: none), (pointer: coarse) {

    .lightbox-prev-btn,
    .lightbox-next-btn {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .lightbox-nav-btn {
        width: 42px;
        height: 42px;
        font-size: 0.95rem;
    }

    .lightbox-prev-btn {
        left: 10px;
    }

    .lightbox-next-btn {
        right: 10px;
    }

    .lightbox-close-btn {
        top: 12px;
        right: 12px;
    }
}

/* ─── 2. GEMEINSAME GROSSANSICHT (LIGHTBOX) ───
   Native CSS-Scroll-Snap-Galerie – exakt dasselbe Prinzip wie die
   Produktbild-Galerie bei Digitec (und wie der "Meine Projekte"-Slider
   hier auf index.html, .apple-slider-track): Touch-Swipe und der
   2-Finger-Trackpad-Swipe laufen komplett nativ über den Browser
   (overflow-x + scroll-snap-type), das gibt die butterweiche, native
   Physik/Einrasten OHNE eigene Zieh-Berechnung. Nur für die Maus (die
   kein natives horizontales Wischen kennt) simuliert js/lightbox.js
   das Scrollen per Klicken-&-Ziehen, genau wie beim Projekte-Slider. */
.photo-lightbox {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.96);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    /* Gleicher Öffnen/Schliessen-Übergang wie das Mobile-Menü (siehe
       .mobile-menu/.mobile-menu.open in header.css): immer display:flex,
       Ein-/Ausblenden rein über opacity + ein kurzes Verschieben +
       pointer-events, nie über display – dadurch ist beides animierbar. */
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.photo-lightbox.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.photo-lightbox-content {
    width: 100vw;
    height: 100vh;
    position: relative;
    box-sizing: border-box;
    display: flex;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    touch-action: pan-x pan-y pinch-zoom;
    -webkit-user-select: none;
    user-select: none;
}

.photo-lightbox-content::-webkit-scrollbar {
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .photo-lightbox-content {
        cursor: grab;
    }
}

.photo-lightbox-content.is-dragging {
    scroll-snap-type: none;
    cursor: grabbing;
}

.photo-lightbox-slide {
    flex: 0 0 100%;
    width: 100vw;
    height: 100vh;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 10px;
}

.photo-lightbox-slide > img {
    max-width: 96vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
    -webkit-user-drag: none;
    border: none;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
    background: transparent;
}

@media (max-width: 768px) {
    .photo-lightbox-slide > img {
        max-width: 98vw;
        max-height: 94vh;
    }
}

/* Etwas weniger Höhe, sobald die Miniatur-Leiste unten sichtbar ist
   (.has-thumbs, nur bei mehr als 1 Bild – siehe js/lightbox.js),
   damit das Bild nicht dahinter verschwindet. */
.photo-lightbox.has-thumbs .photo-lightbox-slide > img {
    max-height: calc(100vh - 112px);
}

@media (max-width: 768px) {
    .photo-lightbox.has-thumbs .photo-lightbox-slide > img {
        max-height: calc(100vh - 96px);
    }
}

/* Motiv mit nur einem Foto (.is-single, siehe js/lightbox.js): Pfeile
   machen dort keinen Sinn und werden ausgeblendet. */
.photo-lightbox.is-single .lightbox-prev-btn,
.photo-lightbox.is-single .lightbox-next-btn {
    display: none !important;
}

/* ─── MINIATUR-LEISTE UNTEN IN DER LIGHTBOX ───
   Kleine quadratische Vorschaubilder zum direkten Springen zwischen den
   Fotos, ohne erst durchblättern zu müssen. */
.lightbox-thumbs {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18px;
    z-index: 1000000;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0 16px;
    max-width: 100vw;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.lightbox-thumbs::-webkit-scrollbar {
    display: none;
}

.lightbox-thumb {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    padding: 0;
    background: #111111;
    opacity: 0.55;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .lightbox-thumb:hover {
        opacity: 0.85;
    }
}

.lightbox-thumb.active {
    opacity: 1;
    border-color: #ffffff;
}

@media (max-width: 640px) {
    .lightbox-thumbs {
        bottom: 12px;
        gap: 8px;
    }

    .lightbox-thumb {
        width: 44px;
        height: 44px;
        border-radius: 5px;
    }
}

/* ─── 3. KLICKBARE ELEMENTE AUF DER SEITE ───
   Alles mit data-lightbox="…" öffnet beim Klick die Grossansicht. */
[data-lightbox] {
    cursor: zoom-in;
}



/* ─── 4. HELL-MODUS ───
   (greift nur bei html[data-theme="light"], siehe theme.js / theme.css) */
/* Grossansicht: heller Hintergrund, dunkle Bedienelemente */
html[data-theme="light"] .photo-lightbox {
  background-color: rgba(251, 250, 245, 0.97);
}

html[data-theme="light"] .photo-lightbox-slide > img {
  box-shadow: 0 0 30px rgba(37, 35, 31, 0.22);
}

html[data-theme="light"] .lightbox-nav-btn {
  background: rgba(251, 250, 245, 0.82);
  border-color: rgba(37, 35, 31, 0.2);
  color: var(--lt-text);
  box-shadow: 0 6px 20px rgba(37, 35, 31, 0.16);
}

@media (hover: hover) and (pointer: fine) {
  html[data-theme="light"] .lightbox-nav-btn:hover {
    background: rgba(37, 35, 31, 0.08);
    border-color: rgba(37, 35, 31, 0.4);
  }
}

html[data-theme="light"] .lightbox-thumb {
  border-color: rgba(37, 35, 31, 0.2);
  background: var(--lt-surface-2);
}

html[data-theme="light"] .lightbox-thumb.active {
  border-color: var(--lt-text);
}

