/* ==========================================================================
   mod_gallerysemplice v5 — CSS Completo
   Supporta: Grid, Horizontal, Vertical, Carousel con swipe mobile
   ========================================================================== */

:root {
    --gs-color-primary: #667eea;
    --gs-color-primary-dark: #764ba2;
    --gs-color-bg: #f8f9fa;
    --gs-color-white: #ffffff;
    --gs-color-border: #e2e8f0;
    --gs-color-text: #2d3748;
    --gs-color-text-light: #64748b;
    --gs-radius: 8px;
    --gs-transition: 0.3s ease-out;
    /* v20: bordo e ombra immagini — sovrascrivibili via inline style sul wrapper */
    --gs-img-border-width: 2px;
    --gs-img-border-color: #e2e8f0;
    --gs-img-border-padding: 0px;
    --gs-img-shadow: 0 2px 6px rgba(0,0,0,0.10);
    --gs-img-shadow-hover: 0 6px 18px rgba(102,126,234,0.22);
}

/* v17: dark mode automatico SOLO se il wrapper ha classe gs-scheme-auto.
   PHP aggiunge la classe solo quando color_scheme = 'auto'.
   Quando è 'light', 'dark' o 'custom' la classe non c'è → questo blocco
   non si applica mai → l'inline style o i valori :root chiaro vincono sempre. */
@media (prefers-color-scheme: dark) {
    .gs-wrapper.gs-scheme-auto {
        --gs-color-bg: #1e1e2e;
        --gs-color-white: #2a2a3e;
        --gs-color-border: #3d3d5c;
        --gs-color-text: #e2e8f0;
        --gs-color-text-light: #a1a1b4;
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   WRAPPER PRINCIPALE
   ════════════════════════════════════════════════════════════════════════════ */

.gs-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    color: var(--gs-color-text);
}

/* ════════════════════════════════════════════════════════════════════════════
   LAYOUT 1: GRIGLIA (Grid)
   ════════════════════════════════════════════════════════════════════════════ */

.gs-grid {
    width: 100%;
}

.gs-item {
    position: relative;
    background: var(--gs-color-white);
    border-radius: var(--gs-radius);
    overflow: hidden;
    /* v20: bordo e ombra da variabili CSS — valori da PHP via inline style */
    border: var(--gs-img-border-width) solid var(--gs-img-border-color);
    padding: var(--gs-img-border-padding);
    box-shadow: var(--gs-img-shadow);
    transition: box-shadow var(--gs-transition), transform var(--gs-transition), border-color var(--gs-transition);
    cursor: pointer;
}

.gs-item:hover {
    border-color: var(--gs-color-primary);
    box-shadow: var(--gs-img-shadow-hover);
    transform: translateY(-4px);
}

.gs-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    overflow: hidden;
    background: var(--gs-color-bg);
}

.gs-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* v13: zoom e schiarimento su hover */
    transition: transform 0.35s ease, filter 0.35s ease;
    filter: brightness(1);
}

.gs-item:hover .gs-thumbnail {
    transform: scale(1.07);
    filter: brightness(1.15);
}

.gs-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--gs-transition);
}

.gs-item:hover .gs-overlay {
    opacity: 1;
}

.gs-expand-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--gs-transition), transform var(--gs-transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-size: 24px;
}

.gs-expand-btn:hover {
    background: var(--gs-color-white);
    transform: scale(1.1);
}

.gs-caption {
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--gs-color-text);
    background: var(--gs-color-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-top: 1px solid var(--gs-color-border);
}

/* ════════════════════════════════════════════════════════════════════════════
   LAYOUT 2 & 3 & 4: CAROUSEL (Horizontal, Vertical, Full)
   ════════════════════════════════════════════════════════════════════════════ */

.gs-carousel {
    position: relative;
    background: var(--gs-color-white);
    border-radius: var(--gs-radius);
    overflow: hidden;
    /* v20: bordo e ombra da variabili */
    border: var(--gs-img-border-width) solid var(--gs-img-border-color);
    box-shadow: var(--gs-img-shadow);
    /* FIX v11: se PHP imposta height inline, i figli devono ereditarla */
    display: flex;
    flex-direction: column;
}

.gs-carousel-container {
    position: relative;
    width: 100%;
    /* FIX v11: occupa tutta l'altezza disponibile nel carousel */
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden;
}

.gs-carousel-slide {
    position: relative;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Carousel Orizzontale ── */
.gs-carousel-horizontal {
    margin-bottom: 20px;
}

.gs-carousel-horizontal .gs-carousel-slide {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 6;
    position: relative;
}

.gs-carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gs-carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 20px;
    font-size: 1.2rem;
    margin: 0;
}

.gs-carousel-caption h3 {
    margin: 0;
    color: white;
}

/* ── Carousel Full (modalità Carosello) ── */
.gs-carousel-full .gs-carousel-container {
    /* FIX v11: il container prende tutta l'altezza del wrapper */
    height: 100%;
}

.gs-carousel-full .gs-carousel-slide {
    /* FIX v11: rimuove aspect-ratio fisso, usa height 100% del container */
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: var(--gs-color-bg);
}

.gs-carousel-image-full {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    /* v14: zoom e schiarimento su hover (stessa UX della griglia) */
    transition: transform 0.35s ease, filter 0.35s ease;
    filter: brightness(1);
    cursor: zoom-in;
}

.gs-carousel-slide:hover .gs-carousel-image-full {
    transform: scale(1.05);
    filter: brightness(1.12);
}

/* ════════════════════════════════════════════════════════════════════════════
   LAYOUT 3: VERTICALE
   ════════════════════════════════════════════════════════════════════════════ */

.gs-vertical {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 300px;
    margin: 0 auto;
}

.gs-vertical-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--gs-radius);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: box-shadow var(--gs-transition), transform var(--gs-transition);
}

.gs-vertical-item:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.gs-vertical-image {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.gs-vertical-caption {
    padding: 10px;
    font-size: 0.85rem;
    color: var(--gs-color-text);
    background: var(--gs-color-white);
    border-top: 1px solid var(--gs-color-border);
    text-align: center;
}

/* ════════════════════════════════════════════════════════════════════════════
   NAVIGATION CAROUSEL
   ════════════════════════════════════════════════════════════════════════════ */

.gs-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 24px;
    color: var(--gs-color-primary);
    cursor: pointer;
    transition: background-color var(--gs-transition), transform var(--gs-transition);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.gs-carousel-prev { left: 20px; }
.gs-carousel-next { right: 20px; }

.gs-carousel-nav:hover {
    background: var(--gs-color-white);
    transform: translateY(-50%) scale(1.1);
}

.gs-carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

/* ════════════════════════════════════════════════════════════════════════════
   DOTS NAVIGATION
   ════════════════════════════════════════════════════════════════════════════ */

.gs-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: var(--gs-color-white);
    flex-wrap: wrap;
    flex-shrink: 0; /* FIX v11: non sottrarre spazio al container immagini */
}

.gs-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--gs-color-primary);
    background: transparent;
    cursor: pointer;
    transition: background-color var(--gs-transition), transform var(--gs-transition);
}

.gs-dot:hover    { transform: scale(1.2); }
.gs-dot.active   { background: var(--gs-color-primary); }

/* ── Dots Numerati ── */
.gs-dots-numbered .gs-dot-number {
    width: auto;
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #b0c4de;
    background: transparent;
    color: var(--gs-color-text);
    font-weight: bold;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--gs-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gs-dots-numbered .gs-dot-number:hover {
    border-color: var(--gs-color-primary);
    color: var(--gs-color-primary);
    transform: scale(1.1);
}

.gs-dots-numbered .gs-dot-number.active {
    background: var(--gs-color-primary);
    color: white;
    border-color: var(--gs-color-primary);
}

/* ════════════════════════════════════════════════════════════════════════════
   MODAL LIGHTBOX (Grid only)

   FIX v5:
   - .gs-modal-content: height: 90vh (non max-height) → i figli flex funzionano
   - .gs-modal-scroll:  min-height: 0 → può ridursi sotto il suo contenuto
   - .gs-modal-image:   max-height: 100% funziona ora che il parent ha altezza definita
   - Larghezza controllata dall'attributo CSS inline passato da PHP (lightbox_size)
   ════════════════════════════════════════════════════════════════════════════ */

.gs-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    padding: 20px;
}

.gs-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gs-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    animation: fadeIn 0.3s ease-out;
    z-index: 1;
}

.gs-modal-content {
    position: relative;
    background: var(--gs-color-white);
    border-radius: 12px;
    width: 90vw;
    max-width: 1200px;
    /* FIX v14: height di base; il valore reale viene impostato da PHP
       via inline style (es. style="height:560px") e sovrascrive questo.
       max-height limita su schermi piccoli. */
    height: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s ease-out;
    z-index: 2;
    overflow: hidden;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.gs-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    color: var(--gs-color-text);
    cursor: pointer;
    transition: background-color var(--gs-transition), transform var(--gs-transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gs-modal-close:hover {
    background: var(--gs-color-white);
    transform: rotate(90deg);
}

.gs-modal-scroll {
    /* ↓ FIX: flex:1 + min-height:0 → si espande nel contenitore e può restringersi */
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.06);
    padding: 16px;
}

.gs-modal-image {
    /* ↓ FIX: ora funziona perché il parent ha altezza definita */
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

.gs-modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--gs-color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gs-color-white);
    flex-shrink: 0;
}

.gs-image-counter {
    font-size: 0.85rem;
    color: var(--gs-color-text-light);
    font-weight: 600;
}

.gs-image-title {
    flex: 1;
    text-align: center;
    padding: 0 16px;
    font-size: 0.9rem;
    color: var(--gs-color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gs-modal-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 12px;
    pointer-events: none;
    z-index: 5;
}

.gs-nav-btn {
    background: rgba(255, 255, 255, 0.85);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 24px;
    color: var(--gs-color-primary);
    cursor: pointer;
    transition: background-color var(--gs-transition), transform var(--gs-transition);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gs-nav-btn:hover {
    background: var(--gs-color-white);
    transform: scale(1.1);
}

/* ════════════════════════════════════════════════════════════════════════════
   SWIPE MOBILE (Gesture Support)
   ════════════════════════════════════════════════════════════════════════════ */

.gs-carousel-slide {
    transition: opacity 0.3s ease-out;
}

.gs-carousel-slide.swipe-out { opacity: 0; }
.gs-carousel-slide.swipe-in  { animation: swipeIn 0.4s ease-out; }

@keyframes swipeIn {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ════════════════════════════════════════════════════════════════════════════
   ALERT
   ════════════════════════════════════════════════════════════════════════════ */

.gs-alert {
    padding: 16px;
    border-radius: var(--gs-radius);
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.gs-alert-info {
    background: #e0f2fe;
    color: #0c4a6e;
    border-left: 4px solid #0284c7;
}

@media (prefers-color-scheme: dark) {
    .gs-wrapper.gs-scheme-auto .gs-alert-info {
        background: #0c2340;
        color: #7dd3fc;
        border-left-color: #0284c7;
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .gs-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .gs-carousel-nav { width: 40px; height: 40px; font-size: 20px; }
    .gs-carousel-prev { left: 10px; }
    .gs-carousel-next { right: 10px; }
}

@media (max-width: 640px) {
    .gs-grid {
        grid-template-columns: 1fr !important;
    }
    .gs-modal-content {
        width: 96vw !important;
        max-width: 96vw !important;
        max-height: 92vh;
    }
    .gs-carousel-nav  { width: 36px; height: 36px; font-size: 18px; }
    .gs-modal-close   { width: 36px; height: 36px; font-size: 20px; }
    .gs-carousel-horizontal .gs-carousel-slide { aspect-ratio: 4 / 3; }
    /* FIX v11: no aspect-ratio su .gs-carousel-full in mobile, usa height dal wrapper */
    .gs-carousel-dots { padding: 10px; gap: 5px; }
    .gs-dot { width: 10px; height: 10px; }
    .gs-dots-numbered .gs-dot-number { min-width: 32px; height: 32px; font-size: 0.75rem; }
    .gs-vertical { max-width: 100%; }
}

/* ════════════════════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ════════════════════════════════════════════════════════════════════════════ */

button:focus,
button:focus-visible {
    outline: 2px solid var(--gs-color-primary);
    outline-offset: 2px;
}

/* ════════════════════════════════════════════════════════════════════════════
   PRINT
   ════════════════════════════════════════════════════════════════════════════ */

@media print {
    .gs-modal,
    .gs-carousel-nav,
    .gs-carousel-dots,
    .gs-modal-close,
    .gs-overlay {
        display: none !important;
    }
    .gs-item { page-break-inside: avoid; }
}


/* ════════════════════════════════════════════════════════════════════════════
   v6 — STRIP ORIZZONTALE (.gs-strip-h)
   ════════════════════════════════════════════════════════════════════════════ */

/* Contenitore principale: flex row con pulsanti ai lati */
.gs-strip-h {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* Viewport: prende tutto lo spazio disponibile, clip il track */
.gs-strip-h-viewport {
    flex: 1 1 0%;       /* si espande, non si restringe, base 0 */
    min-width: 0;       /* evita overflow del flex item */
    overflow: hidden;
    border-radius: var(--gs-radius);
    background: var(--gs-color-bg);
}

/* Track: flex row, larghezze item imposte dal JS in px */
.gs-strip-h-inner {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    height: 100%;
    width: max-content;     /* si estende quanto serve per contenere tutti gli item */
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* ════════════════════════════════════════════════════════════════════════════
   v6 — STRIP VERTICALE (.gs-strip-v)
   ════════════════════════════════════════════════════════════════════════════ */

/* Wrapper esterno: colonna centrata con pulsanti sopra/sotto */
.gs-strip-v-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* Viewport verticale: overflow hidden, dimensioni fisse da PHP */
.gs-strip-v {
    overflow: hidden;
    border-radius: var(--gs-radius);
    background: var(--gs-color-bg);
    position: relative;
}

/* Track verticale: flex colonna */
.gs-strip-v-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* ════════════════════════════════════════════════════════════════════════════
   v6 — ITEM CONDIVISO (usato sia da strip-h che da strip-v)
   ════════════════════════════════════════════════════════════════════════════ */

.gs-strip-item {
    flex-shrink: 0;     /* non si restringe mai */
    position: relative;
    cursor: pointer;
    box-sizing: border-box;
}

/* Wrapper immagine: dimensioni fisse da PHP, overflow hidden */
.gs-strip-img-wrap {
    position: relative;
    overflow: hidden;
    border-radius: var(--gs-radius);
    background: var(--gs-color-bg);
    /* v20: bordo e ombra da variabili */
    border: var(--gs-img-border-width) solid var(--gs-img-border-color);
    padding: var(--gs-img-border-padding);
    box-shadow: var(--gs-img-shadow);
    box-sizing: border-box;
}

/* Immagine: copre l'intera area del wrap */
.gs-strip-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gs-strip-item:hover .gs-strip-img {
    transform: scale(1.05);
}

/* Overlay lente su hover */
.gs-strip-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.40);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: var(--gs-radius);
    pointer-events: none;
}

.gs-strip-item:hover .gs-strip-overlay {
    opacity: 1;
}

/* Caption sotto ogni immagine */
.gs-strip-caption {
    padding: 5px 6px;
    font-size: 0.78rem;
    color: var(--gs-color-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    background: var(--gs-color-white);
}

/* ════════════════════════════════════════════════════════════════════════════
   v6 — PULSANTI STRIP (prev/next, su/giù)
   ════════════════════════════════════════════════════════════════════════════ */

.gs-strip-btn {
    flex-shrink: 0;
    background: var(--gs-color-white);
    border: 1.5px solid var(--gs-color-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1rem;
    color: var(--gs-color-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
    padding: 0;
}

.gs-strip-btn:hover:not(:disabled) {
    background: var(--gs-color-primary);
    color: #fff;
    transform: scale(1.1);
}

.gs-strip-btn:disabled {
    opacity: 0.30;
    cursor: default;
    pointer-events: none;
}

/* ════════════════════════════════════════════════════════════════════════════
   v6 — RESPONSIVE strip
   ════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
    /* Strip orizzontale: colonna su mobile, pulsanti diventano frecce orizzontali */
    .gs-strip-h {
        gap: 6px;
    }
    .gs-strip-btn {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }
    /* Strip verticale: allarga a tutta la larghezza disponibile */
    .gs-strip-v-wrap {
        width: 100% !important;
    }
    .gs-strip-v {
        width: 100% !important;
    }
    .gs-strip-v-inner .gs-strip-img-wrap {
        width: 100% !important;
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   v6 — DARK MODE strip
   ════════════════════════════════════════════════════════════════════════════ */

/* v17: strip dark mode scoped su .gs-scheme-auto */
@media (prefers-color-scheme: dark) {
    .gs-wrapper.gs-scheme-auto .gs-strip-h-viewport,
    .gs-wrapper.gs-scheme-auto .gs-strip-v { background: var(--gs-color-white); }
    .gs-wrapper.gs-scheme-auto .gs-strip-btn {
        background: var(--gs-color-white);
        border-color: var(--gs-color-border);
        color: var(--gs-color-primary);
    }
    .gs-wrapper.gs-scheme-auto .gs-strip-btn:hover:not(:disabled) {
        background: var(--gs-color-primary);
        color: #fff;
    }
    .gs-wrapper.gs-scheme-auto .gs-strip-caption { background: var(--gs-color-white); color: var(--gs-color-text-light); }
}

/* ════════════════════════════════════════════════════════════════════════════
   v11 — CAROUSEL: pulsante Chiudi e Fullscreen
   ════════════════════════════════════════════════════════════════════════════ */

/* Pulsante ✕ chiudi — visibile solo in modalità fullscreen */
.gs-carousel-close {
    display: none; /* nascosto di default, visibile solo in fullscreen */
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 20px;
    color: var(--gs-color-text);
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: none;
    align-items: center;
    justify-content: center;
    transition: background-color var(--gs-transition), transform var(--gs-transition);
}

.gs-carousel-close:hover {
    background: var(--gs-color-white);
    transform: rotate(90deg);
}

/* Pulsante ⛶ espandi fullscreen — sempre visibile */
.gs-carousel-fullscreen {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 18px;
    color: var(--gs-color-text);
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--gs-transition), transform var(--gs-transition);
}

.gs-carousel-fullscreen:hover {
    background: var(--gs-color-primary);
    color: #fff;
    transform: scale(1.1);
}

/* Stato fullscreen del carousel */
.gs-carousel.gs-carousel-is-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9998;
    border-radius: 0;
    background: #000;
}

.gs-carousel.gs-carousel-is-fullscreen .gs-carousel-close {
    display: flex;
}

.gs-carousel.gs-carousel-is-fullscreen .gs-carousel-fullscreen {
    display: none;
}

.gs-carousel.gs-carousel-is-fullscreen .gs-carousel-image-full {
    object-fit: contain;
}
