/* ============================================================
   fux_sitepackage_hsgm — Lightbox des Relaunch-Rahmens
   (JavaScript/lightbox.js, geladen von Layouts/Page/Relaunch.html)
   ============================================================
   Verschoben aus fux_products_hsgm/products.css (2026-10-30): die Lightbox
   gilt jetzt auch fuer Standard-Elemente mit "Bild vergroessern" und
   gehoert damit zum Rahmen. Unveraendert uebernommen; die var()-Fallbacks
   tragen die Tokenwerte aus products.css (:root). Produktspezifische
   Link-Flaechen (.slideshow-slide/.gallery-item/.delivery-card-media >
   a.lightbox) bleiben in products.css.
   Kontraste wie bisher: Bedienelemente Weiss auf rgba(29,29,31,.6) ueber
   dem Backdrop, Fokusrahmen Weiss 13,4:1 (A11y LB-02); Linkfokus #0066cc
   nach innen (LB-01).
   ============================================================ */

/* body.fux-relaunch-Variante: sonst gewinnt body.fux-relaunch
   a:focus-visible (relaunch-frame.css, Offset nach aussen) und der Rahmen
   wird von overflow:hidden abgeschnitten (A11y LB-01) */
a.lightbox:focus-visible,
body.fux-relaunch a.lightbox:focus-visible {
    outline: 3px solid var(--hsgm-blue, #0066cc);
    outline-offset: -3px;
}

/* Standard-Elemente (fluid_styled_content, "Bild vergroessern"): der Link
   ist inline um ein Block-Bild und hat damit keine Flaeche fuer den
   Fokusrahmen (A11y-Review 2026-11-02, B-1) — als Block wie die
   Produkt-Links in products.css */
.ce-gallery a.lightbox {
    display: block;
    border-radius: var(--radius-sm, 0.5rem);
}

.lightbox-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 4rem 4.5rem 3rem;
    border: 0;
    box-sizing: border-box;
    background: transparent;
    color: var(--white, #fff);
    overflow: hidden;
}

.lightbox-dialog[open] {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-dialog::backdrop {
    background: rgba(29, 29, 31, 0.92);
}

/* Bild, Beschriftung und Zaehler im Fluss (A11y LB-04): bei 400 % Zoom
   ueberlagert eine mehrzeilige Beschriftung nichts, das Bild schrumpft */
.lightbox-figure {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.lightbox-image {
    flex: 0 1 auto;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: var(--white, #fff);
    border-radius: var(--radius-md, 1rem);
}

.lightbox-caption {
    flex: 0 0 auto;
    max-width: 60ch;
    max-height: 30dvh;
    overflow-y: auto;
    text-align: center;
    font-size: var(--font-size-small, 0.875rem);
    color: #f5f5f7;
}

.lightbox-counter {
    flex: 0 0 auto;
    margin: 0;
    font-size: var(--font-size-small, 0.875rem);
    color: #f5f5f7;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    width: 3rem;
    height: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    background: rgba(29, 29, 31, 0.6);
    color: var(--white, #fff);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close {
    top: 1rem;
    right: 1rem;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--hsgm-blue, #0066cc);
    border-color: var(--hsgm-blue, #0066cc);
}

/* body.fux-relaunch-Variante: sonst blauer 2px-Rahmen der globalen Regel,
   auf dem Backdrop nur 2,4:1 (A11y LB-02); Weiss 13,4:1 */
.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible,
body.fux-relaunch .lightbox-close:focus-visible,
body.fux-relaunch .lightbox-prev:focus-visible,
body.fux-relaunch .lightbox-next:focus-visible {
    outline: 3px solid var(--white, #fff);
    outline-offset: 2px;
}

.lightbox-close[hidden],
.lightbox-prev[hidden],
.lightbox-next[hidden],
.lightbox-counter[hidden],
.lightbox-caption[hidden] {
    display: none;
}

@media (max-width: 575.98px) {
    .lightbox-dialog {
        padding: 4rem 0.5rem 4rem;
    }

    .lightbox-prev,
    .lightbox-next {
        top: auto;
        bottom: 0.5rem;
        transform: none;
    }
}

/* Blaettern: das Bild gleitet aus der Richtung herein (wie der Hero-Slider) */
@media (prefers-reduced-motion: no-preference) {
    .lightbox-figure.is-entering-next {
        animation: fux-lightbox-in-next 0.25s ease-out;
    }

    .lightbox-figure.is-entering-prev {
        animation: fux-lightbox-in-prev 0.25s ease-out;
    }

    .lightbox-dialog[open] {
        animation: fux-lightbox-fade 0.2s ease-out;
    }
}

@keyframes fux-lightbox-in-next {
    from { opacity: 0; transform: translateX(2rem); }
    to { opacity: 1; transform: none; }
}

@keyframes fux-lightbox-in-prev {
    from { opacity: 0; transform: translateX(-2rem); }
    to { opacity: 1; transform: none; }
}

@keyframes fux-lightbox-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Wischen und Ziehen (User 2026-10-15): pan-y laesst das senkrechte
   Scrollen beim Browser, waagrechte Gesten gehen an lightbox.js; das Bild
   laesst sich nicht als Datei herausziehen. */
.lightbox-dialog {
    touch-action: pan-y pinch-zoom;
}

.lightbox-image {
    -webkit-user-drag: none;
    user-select: none;
}
