/* ==========================================================================
   SWIPER HERO SLIDER - STILI FRONTEND
   ========================================================================== */

.she-swiper {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.she-swiper .she-slide {
    display: flex;
    justify-content: center;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
}

/* ── Overlay ────────────────────────────── */
.she-swiper .she-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ── Titolo Globale Unico Fisso ─────────── */
.she-swiper .she-global-title-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    width: 100%;
    max-width: 900px;
    padding: 0 2.5rem;
    text-align: center;
    pointer-events: none;
    box-sizing: border-box;
}

.she-swiper .she-global-title {
    margin: 0;
}

/* ── Content ────────────────────────────── */
.she-swiper .she-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1140px; /* Allargato leggermente per dare un "respiro" migliore su desktop */
    padding: 2rem 5%;
    box-sizing: border-box;
    margin: 0 auto; /* Mantiene il contenitore invisibile sempre centrato nello schermo */
    
    /* Attiviamo Flexbox a colonna per muovere gli elementi interni */
    display: flex;
    flex-direction: column;
}

/* Gestione Allineamenti Interni tramite Flexbox */
.she-swiper .she-align-left {
    align-items: flex-start;
    text-align: left;
}

.she-swiper .she-align-center {
    align-items: center;
    text-align: center;
}

.she-swiper .she-align-right {
    align-items: flex-end;
    text-align: right;
}

/* Sicurezza per annullare margini indesiderati sul testo */
.she-swiper .she-title,
.she-swiper .she-text,
.she-swiper .she-btn {
    margin-left: 0;
    margin-right: 0;
}

/* ── Elementi della Slide ───────────────── */
.she-swiper .she-title {
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 1rem;
}

.she-swiper .she-text {
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.7;
    margin: 0 0 1.5rem;
}

.she-swiper .she-btn {
    display: inline-block;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.she-swiper .she-btn:hover {
    transform: translateY(-3px);
}

/* ── Componenti di Navigazione ──────────── */
.she-swiper .swiper-button-prev,
.she-swiper .swiper-button-next {
    background: rgba(0,0,0,0.25);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    transition: background 0.2s ease;
    z-index: 10;
    margin-top: -24px; /* Fix: allinea al centro perfetto calcolando la metà esatta dei 48px di altezza */
}
/* Fix: Allontaniamo le frecce dai bordi esterni in modo simmetrico */
.she-swiper .swiper-button-prev {
    left: 25px; 
}

.she-swiper .swiper-button-next {
    right: 25px; 
}

.she-swiper .swiper-button-prev:hover,
.she-swiper .swiper-button-next:hover {
    background: rgba(0,0,0,0.50);
}

.she-swiper .swiper-button-prev::after,
.she-swiper .swiper-button-next::after {
    font-size: 22px;
}

/* ── Architettura Animazioni CSS ────────── */
.she-swiper.she-has-anim .she-slide-title,
.she-swiper.she-has-anim .she-text,
.she-swiper.she-has-anim .she-btn {
    opacity: 0;
    transition-property: transform, opacity;
    transition-duration: var(--she-anim-dur, 800ms);
    transition-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
}

/* Offset direzionali (Stato Iniziale) */
.she-swiper.she-anim-slide-up .she-slide-title,
.she-swiper.she-anim-slide-up .she-text,
.she-swiper.she-anim-slide-up .she-btn { transform: translateY(40px); }

.she-swiper.she-anim-slide-down .she-slide-title,
.she-swiper.she-anim-slide-down .she-text,
.she-swiper.she-anim-slide-down .she-btn { transform: translateY(-40px); }

.she-swiper.she-anim-slide-left .she-slide-title,
.she-swiper.she-anim-slide-left .she-text,
.she-swiper.she-anim-slide-left .she-btn { transform: translateX(40px); }

.she-swiper.she-anim-slide-right .she-slide-title,
.she-swiper.she-anim-slide-right .she-text,
.she-swiper.she-anim-slide-right .she-btn { transform: translateX(-40px); }

/* Esecuzione sulla Slide Attiva */
.she-swiper.she-has-anim .swiper-slide-active .she-slide-title,
.she-swiper.she-has-anim .swiper-slide-active .she-text,
.she-swiper.she-has-anim .swiper-slide-active .she-btn {
    opacity: 1;
    transform: translate(0, 0) !important;
}

/* ── Responsive ─────────────────────────── */
@media (max-width: 767px) {
    .she-swiper .she-content { padding: 1.5rem; }
    .she-swiper .swiper-button-prev,
    .she-swiper .swiper-button-next { display: none; }
}

/* ── Carosello Sponsor ───────────────────── */
.she-sponsors-wrapper {
    padding: 2rem 0;
    width: 100%;
}

.she-sponsor-item {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.she-sponsor-img {
    max-width: 140px;
    height: auto;
    max-height: 70px;
    object-fit: contain;
    filter: grayscale(var(--she-sponsor-gray, 100%))
            blur(var(--she-sponsor-blur, 0px))
            brightness(100%);
    opacity: var(--she-sponsor-opacity, 0.6);
    transform: scale(1) translateY(0);
    transform-origin: center center;
    transition: filter var(--she-sponsor-transition, 350ms) ease,
                opacity var(--she-sponsor-transition, 350ms) ease,
                transform var(--she-sponsor-transition, 350ms) ease;
    will-change: filter, opacity, transform;
}

.she-sponsor-item a {
    display: block;
    text-decoration: none;
}

/* Lo stato hover viene applicato anche quando lo sponsor non ha un link. */
.she-sponsor-item:hover .she-sponsor-img {
    filter: grayscale(var(--she-sponsor-gray-hover, 0%))
            blur(var(--she-sponsor-blur-hover, 0px))
            brightness(var(--she-sponsor-brightness, 100%));
    opacity: var(--she-sponsor-opacity-hover, 1);
    transform: scale(var(--she-sponsor-scale, 1))
               translateY(calc(-1 * var(--she-sponsor-lift, 0px)));
}

/* Su dispositivi touch non simuliamo effetti hover persistenti. */
@media (hover: none) {
    .she-sponsor-item:hover .she-sponsor-img {
        filter: grayscale(var(--she-sponsor-gray, 100%))
                blur(var(--she-sponsor-blur, 0px))
                brightness(100%);
        opacity: var(--she-sponsor-opacity, 0.6);
        transform: scale(1) translateY(0);
    }
}

/* ── Slider Articoli Split-Screen Parallasse ───────────────────── */
.she-posts-slider-container {
    width: 100%;
    position: relative;
    padding: 2rem 0;
}

.she-post-slide {
    display: flex !important;
    flex-direction: row;
    align-items: stretch;
    background-color: transparent;
    overflow: hidden;
    min-height: 480px;
}

/* Colonna Immagine (Sinistra) */
.she-post-image-col {
    width: 60%;
    position: relative;
    overflow: hidden;
}

/* Effetto Parallasse: lo sfondo deve essere più largo della slide per potersi muovere */
.she-post-bg-image {
    position: absolute;
    top: 0;
    left: -10%;
    width: 120%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

/* Colonna Contenuto (Destra) */
.she-post-content-col {
    width: 40%;
    background: #f2f2f2; /* Colore grigio chiaro come da foto */
    display: flex;
    align-items: center;
    padding: 3rem;
    box-sizing: border-box;
}

.she-post-content-inner {
    width: 100%;
}

/* Categoria (Pillola Verde) */
.she-post-category span {
    display: inline-block;
    background-color: #556b43; /* Colore verde militare dell'immagine */
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 20px;
    border-radius: 20px;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
}

/* Titolo Articolo */
.she-post-title {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1.5rem 0;
}
.she-post-title a {
    color: #000000;
    text-decoration: none;
    transition: opacity 0.2s;
}
.she-post-title a:hover { opacity: 0.8; }

/* Riassunto (Muted) */
.she-post-excerpt {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555555;
    margin-bottom: 2rem;
}

/* Autore */
.she-post-author {
    font-size: 0.85rem;
    font-weight: 700;
    color: #000000;
    letter-spacing: 0.05em;
    margin-bottom: 2.5rem;
}

/* Footer & Pulsanti Navigazione */
.she-post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.she-post-nav-buttons {
    display: flex;
    gap: 8px;
}

.she-posts-prev, .she-posts-next {
    background: #556b43;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.she-posts-prev:hover, .she-posts-next:hover {
    background: #3e5030;
}

/* Bottone Leggi Tutto */
.she-post-readmore {
    display: inline-block;
    padding: 8px 24px;
    border: 1px solid #556b43;
    color: #556b43;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.25s ease;
}
.she-post-readmore:hover {
    background: #556b43;
    color: #ffffff;
}

/* 📱 Responsive Mobile & Tablet (Schermi inferiori a 991px) */
@media (max-width: 991px) {
    
    .she-post-slide {
        flex-direction: column !important;
        align-items: stretch !important;
        min-height: auto !important;
        position: relative;
        
        /* ✅ MARGINE DI SICUREZZA: Distanzia i post nel flusso verticale dello Swiper */
        margin-bottom: 30px !important; 
        
        /* ✅ ANTI-FLICKER: Ferma lo sfarfallamento dei pixel su sfondi scuri eliminando i lag di rendering della GPU mobile */
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
    }

    /* L'immagine occupa il 100% della larghezza */
    .she-post-image-col {
        width: 100% !important;
        height: 300px;
        position: relative;
        overflow: hidden;
    }

    .she-post-bg-image {
        left: 0;
        width: 100%;
        height: 100%;
    }

   /* Il box di testo si sovrappone parzialmente all'immagine */
    .she-post-content-col {
        width: 100% !important;
        margin-top: -60px;
        position: relative;
        z-index: 5;
        
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        
        padding: 2rem 1.5rem !important;
        border-radius: 12px 12px 12px 12px; /* ✅ Arrotondiamo anche gli angoli inferiori visto il distacco */
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); /* Un'ombra più definita per staccare dal fondo scuro */
        
        /* ✅ ANTI-FLICKER aggiuntivo sul pannello in trasparenza */
        transform: translateZ(0);
    }

	/* Forza l'altezza minima ereditata da Elementor anche sulla card riflessa */
    .she-post-content-inner {
        width: 100%;
    }

    /* Ottimizzazione spazi interni per i testi su mobile */
    .she-post-category span {
        margin-bottom: 1rem;
    }

    .she-post-title {
        font-size: 1.6rem; /* Riduce leggermente il titolo per non farlo andare a capo troppe volte */
        margin-bottom: 1rem;
    }

    .she-post-excerpt {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .she-post-author {
        margin-bottom: 1.5rem;
    }
}