/* ===========================================
   SABA HERO EDITORIAL — hero 2026 split asimmetrico
   Pannello testo (fondo crema) + immagine autentica.
   Contrasto AA per COSTRUZIONE: testo su solido, non su foto.
   Nessun !important (eccetto reset reduced-motion).
   Pronto per futura migrazione a @layer components.
   =========================================== */

.saba-hero-editorial {
    container-type: inline-size; /* container query, non viewport (design-ui §5) */
    overflow: hidden;
}

/* Titolo display — il "momento" che mancava all'hero centrato */
.saba-hero-editorial .hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    font-weight: 800;
    text-wrap: balance;
    margin: 0;
}

/* Parola-accento: bordeaux (primary) per AA su crema (~7.3:1).
   L'ocra (accent) qui fallirebbe AA (~2:1) — usato solo su fondi scuri. */
.saba-hero-editorial .hero-title .accent {
    color: var(--wp--preset--color--primary);
}

.saba-hero-editorial .hero-lead {
    max-width: 38ch;
    line-height: 1.6;
    margin: 0;
}

/* Immagine verticale, bordi morbidi su scala token */
.saba-hero-editorial .hero-media img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--wp--custom--border--radius--xl, 16px);
}

/* Ingresso sobrio: lo stato finale è VISIBILE di default, l'animazione
   parte da sola via CSS (nessun gating JS — design-ui §4). */
.saba-hero-editorial .hero-enter {
    animation: sabaHeroEnter 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.saba-hero-editorial .hero-media.hero-enter {
    animation-delay: 0.12s;
}

@keyframes sabaHeroEnter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

/* Stack / mobile: ratio immagine più largo, titolo più contenuto */
@container (max-width: 720px) {
    .saba-hero-editorial .hero-media img {
        aspect-ratio: 4 / 3;
    }
    .saba-hero-editorial .hero-title {
        font-size: clamp(2rem, 9vw, 3rem);
    }
    .saba-hero-editorial .hero-lead {
        max-width: none;
    }
}

/* Accessibilità: niente motion se l'utente lo chiede — contenuto subito visibile */
@media (prefers-reduced-motion: reduce) {
    .saba-hero-editorial .hero-enter {
        animation: none !important;
        opacity: 1;
        transform: none;
    }
}

/* ===========================================
   VARIANTE B — Bordeaux (pannello pieno)
   Su fondo bordeaux l'accento torna OCRA: ocra su bordeaux ~3.5:1
   (ok per testo large), mentre il bordeaux sarebbe invisibile.
   =========================================== */
.saba-hero-editorial--bordeaux .hero-title .accent {
    color: var(--wp--preset--color--accent);
}

.saba-hero-editorial--bordeaux .hero-lead {
    opacity: 0.92; /* bianco appena ammorbidito, resta ben sopra AA */
}

/* ===========================================
   VARIANTE C — Bento (griglia pilastri 2x2)
   =========================================== */
.saba-hero-bento .hero-bento-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--wp--preset--spacing--small, 1rem);
}

.saba-hero-bento .hero-bento-tile {
    transition: transform 0.2s cubic-bezier(0.22, 0.61, 0.36, 1),
                box-shadow 0.2s ease;
}

.saba-hero-bento .hero-bento-tile :where(h3) {
    margin: 0 0 0.25rem;
    line-height: 1.2;
}

.saba-hero-bento .hero-bento-tile :where(p) {
    margin: 0;
}

.saba-hero-bento .hero-bento-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--wp--custom--shadow--md, 0 8px 24px rgba(0, 0, 0, 0.08));
}

/* Su container stretto le tile passano a colonna singola */
@container (max-width: 520px) {
    .saba-hero-bento .hero-bento-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   VARIANTE VIDEO (colonna media) — saba-hero-editorial-video
   =========================================== */
.saba-hero-editorial .hero-media video {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--wp--custom--border--radius--xl, 16px);
}

@container (max-width: 720px) {
    .saba-hero-editorial .hero-media video {
        aspect-ratio: 16 / 9;
    }
}

/* ===========================================
   VARIANTE VIDEO DI SFONDO (full-bleed) — saba-hero-video-cover
   Scrim a gradiente per leggibilità a prescindere dalla luminosità del video.
   =========================================== */
.saba-hero-video-cover {
    border-radius: var(--wp--custom--border--radius--xl, 16px);
    overflow: hidden;
}

/* L'accento, su scrim scuro, torna OCRA (il bordeaux sarebbe invisibile) */
.saba-hero-video-cover .hero-title .accent {
    color: var(--wp--preset--color--accent);
}

/* Scrim: sopra video e dim del cover, sotto il contenuto */
.saba-hero-video-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg,
        rgba(0, 0, 0, 0.20) 0%,
        rgba(0, 0, 0, 0.30) 45%,
        rgba(0, 0, 0, 0.60) 100%);
}

.saba-hero-video-cover > .wp-block-cover__inner-container {
    position: relative;
    z-index: 2;
}
