/**
 * Bloc Fest Pro - Carosello Immagini & Slideshow Event Gallery
 * Gestione Slideshow, Touch Swipe, Indicatori/Cursori Segmentati & Geist Typography
 *
 * @version 4.15.0
 */

/* Contenitore Principale del Widget */
.bloc-gallery-carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

/* Finestra Visibile dello Slideshow */
.bloc-gallery-viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #000000;
    border-radius: 0px;
    box-sizing: border-box;
    touch-action: pan-y;
    cursor: grab;
}

.bloc-gallery-viewport:active,
.bloc-gallery-viewport.is-dragging {
    cursor: grabbing;
}

/* Traccia Scorrevole (Flex container) */
.bloc-gallery-track {
    display: flex;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.bloc-gallery-track.no-transition {
    transition: none !important;
}

/* Singola Slide */
.bloc-gallery-slide {
    flex: 0 0 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #050505;
}

/* Immagine della Slide */
.bloc-gallery-img-wrap {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bloc-gallery-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bloc-gallery-slide.is-contain .bloc-gallery-img {
    object-fit: contain;
}

/* Proporzioni / Aspect Ratio Preimpostati */
.bloc-gallery-viewport.aspect-16-9 {
    aspect-ratio: 16 / 9;
}

.bloc-gallery-viewport.aspect-4-3 {
    aspect-ratio: 4 / 3;
}

.bloc-gallery-viewport.aspect-3-2 {
    aspect-ratio: 3 / 2;
}

.bloc-gallery-viewport.aspect-1-1 {
    aspect-ratio: 1 / 1;
}

.bloc-gallery-viewport.aspect-21-9 {
    aspect-ratio: 21 / 9;
}

/* Overlay Gradiente Opzionale per Leggibilità */
.bloc-gallery-overlay-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,0.75) 100%);
    pointer-events: none;
}

/* Didascalia e Crediti Fotografo */
.bloc-gallery-caption-box {
    position: absolute;
    bottom: 20px;
    left: 24px;
    right: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    color: #ffffff;
    z-index: 5;
    pointer-events: none;
}

.bloc-gallery-caption-title {
    font-family: 'Geist', sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.bloc-gallery-caption-credit {
    font-family: 'Geist Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    opacity: 0.85;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

/* Frecce di Navigazione Laterali */
.bloc-gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bloc-gallery-nav-btn.nav-prev {
    left: 16px;
}

.bloc-gallery-nav-btn.nav-next {
    right: 16px;
}

.bloc-gallery-carousel-wrapper:hover .bloc-gallery-nav-btn,
.bloc-gallery-nav-btn.always-visible {
    opacity: 1;
    visibility: visible;
}

.bloc-gallery-nav-btn:hover {
    background: #ffffff;
    color: #000000;
    transform: translateY(-50%) scale(1.08);
    border-color: #ffffff;
}

.bloc-gallery-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* ========================================================
   SISTEMA DI CURSORI / PAGINAZIONE INFERIORE
   ======================================================== */

.bloc-gallery-cursor-container {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 15;
}

/* Posizione: Sotto il carosello (Esterno) */
.bloc-gallery-cursor-container.is-below {
    margin-top: 18px;
    padding: 0 4px;
}

/* Posizione: Sovrapposto in Basso (Overlay sull'immagine) */
.bloc-gallery-cursor-container.is-overlay {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    padding: 0 24px;
}

/* Quando il cursore è in overlay, distanzia la didascalia verso l'alto */
.bloc-gallery-carousel-wrapper.has-overlay-cursor .bloc-gallery-caption-box {
    bottom: 56px;
}


/* --------------------------------------------------------
   STILE 1: BARRE ORIZZONTALI SEGMENTATE (Mockup / Story Bar)
   -------------------------------------------------------- */
.bloc-cursor-segmented-bars {
    display: flex;
    width: 100%;
    max-width: 100%;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0 auto;
}

.bloc-segment-item {
    flex: 1 1 0%;
    min-width: 12px;
    height: 24px; /* Area di click / touch ampia */
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding: 0;
    margin: 0;
    background: transparent !important;
    border: none !important;
    outline: none;
    touch-action: manipulation;
}

.bloc-segment-track {
    display: block;
    width: 100%;
    height: 4px;
    min-height: 2px;
    background-color: rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    position: relative;
    overflow: hidden;
    transition: background-color 0.25s ease, height 0.2s ease, transform 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.bloc-segment-item:hover .bloc-segment-track {
    background-color: rgba(255, 255, 255, 0.55);
    transform: scaleY(1.3);
}

.bloc-segment-fill {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: #ffffff;
    border-radius: 999px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    transition: width 0.1s linear;
}

.bloc-segment-item.is-active .bloc-segment-fill,
.bloc-segment-item.is-passed .bloc-segment-fill {
    width: 100%;
}


/* --------------------------------------------------------
   STILE 2: LINEA CONTINUA CON CURSORE SCORREVOLE (Scrubber)
   -------------------------------------------------------- */
.bloc-cursor-scrubber-line {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 24px;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0;
    margin: 0 auto;
    background: transparent !important;
    border: none !important;
    outline: none;
    touch-action: manipulation;
}

.bloc-scrubber-track {
    display: block;
    width: 100%;
    height: 4px;
    min-height: 2px;
    background-color: rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
    transition: background-color 0.25s ease, transform 0.2s ease;
}

.bloc-cursor-scrubber-line:hover .bloc-scrubber-track {
    background-color: rgba(255, 255, 255, 0.55);
    transform: scaleY(1.3);
}

.bloc-scrubber-thumb {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100%;
    background-color: #ffffff;
    border-radius: 999px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1), width 0.3s ease;
}


/* --------------------------------------------------------
   STILE 3: NUMERAZIONE MONOSPACE + BARRA (01 ── 06)
   -------------------------------------------------------- */
.bloc-cursor-number-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    max-width: 480px;
    color: #ffffff;
    font-family: 'Geist Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    margin: 0 auto;
}

.bloc-num-current {
    min-width: 24px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.bloc-num-track {
    flex: 1 1 0%;
    display: block;
    height: 4px;
    min-height: 2px;
    background-color: rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.bloc-num-fill {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100%;
    background-color: #ffffff;
    border-radius: 999px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bloc-num-total {
    min-width: 24px;
    opacity: 0.6;
    font-variant-numeric: tabular-nums;
}


/* --------------------------------------------------------
   STILE 4: PILLOLE GEOMETRICHE ALLUNGATE (Pill Dots)
   -------------------------------------------------------- */
.bloc-cursor-pill-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
}

.bloc-pill-dot {
    height: 24px;
    display: flex;
    align-items: center;
    background: transparent !important;
    border: none !important;
    padding: 0 2px;
    margin: 0;
    cursor: pointer;
    outline: none;
    touch-action: manipulation;
}

.bloc-pill-dot-inner {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
}

.bloc-pill-dot:hover .bloc-pill-dot-inner {
    background-color: rgba(255, 255, 255, 0.65);
}

.bloc-pill-dot.is-active .bloc-pill-dot-inner {
    width: 32px;
    background-color: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
}


/* --------------------------------------------------------
   STILE 5: BADGE CONTATORE MONOSPACE ([ 01 / 06 ])
   -------------------------------------------------------- */
.bloc-cursor-counter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-family: 'Geist Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    font-variant-numeric: tabular-nums;
    margin: 0 auto;
}

.bloc-badge-cur {
    color: #ffffff;
}

.bloc-badge-sep {
    margin: 0 4px;
    opacity: 0.5;
}

.bloc-badge-tot {
    opacity: 0.65;
}


/* ========================================================
   LIGHTBOX POPUP INGRANDIMENTO FOTO (Opzionale)
   ======================================================== */
.bloc-gallery-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.bloc-gallery-lightbox-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.bloc-gallery-lightbox-img {
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transform: scale(0.96);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bloc-gallery-lightbox-overlay.is-active .bloc-gallery-lightbox-img {
    transform: scale(1);
}

.bloc-gallery-lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
}

.bloc-gallery-lightbox-close:hover {
    background: #ffffff;
    color: #000000;
}

/* Adattamenti Mobile (<= 767px) */
@media (max-width: 767px) {
    .bloc-gallery-caption-box {
        bottom: 14px;
        left: 16px;
        right: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .bloc-gallery-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .bloc-cursor-segmented-bars {
        gap: 4px;
    }
}
