/* ─────────────────────────────────────────────────
   FEATURES — navigazione scroll-driven
───────────────────────────────────────────────── */
.feat-track {
    /* 1 viewport per il blocco pinnato + 1 per ciascuna slide (l'altezza esatta la imposta front-page.php in base al numero di slide) */
    height: calc(100vh * 4);
}

.feat-block {
    position: sticky;
    top: 0;
    height: 100vh;
    height: var(--vh, 100vh);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: 1fr;
    grid-template-areas: "left img";
    align-items: center;
    gap: clamp(2rem, 5vw, 6rem);
    padding: clamp(2rem, 4vh, 4rem) clamp(1.5rem, 4vw, 4rem);
    background: var(--white);
    box-sizing: border-box;
}

/* ── Colonna sinistra ──────────────────────────── */
.feat-left {
    grid-area: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(1.6rem, 3.5vh, 3rem);
    padding: 0;
}

.feat-label {
    overflow: hidden;
}

.feat-label span {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.4;
}

.feat-title-wrap {
    overflow: visible;
}

.feat-title {
    font-size: clamp(3rem, 6.5vw, 7rem);
    font-weight: 400;
    letter-spacing: -.03em;
    line-height: 1;
    color: var(--black);
    margin: 0;
    /* Riserva l'altezza di 2 righe: il titolo resta ancorato in alto e la
       descrizione sotto non si sposta cambiando tema, né viene mai coperta. */
    min-height: 2.05em;
}

.feat-desc-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
    overflow: hidden;
    max-width: 32rem;
    align-self: flex-start;
    text-align: left;
}

.feat-desc {
    font-size: clamp(1rem, 1.3vw, 1.3rem);
    line-height: 1.55;
    color: var(--black);
    opacity: 0.7;
    margin: 0;
}

.feat-cta {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--black);
    align-self: flex-start;
    transition: gap .25s;
    text-decoration: none;
}

.feat-cta:hover { gap: 1rem; }

/* ── Immagine grande (colonna destra) ──────────── */
.feat-img-wrap {
    grid-area: img;
    position: relative;
    width: clamp(320px, 42vw, 640px);
    height: 80vh;
    overflow: hidden;
    border-radius: 2px;
    flex-shrink: 0;
}

#featCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* ── Indicatore numerico sopra il titolo (01 02 03) ── */
/* Numeri allineati in alto al bordo dell'immagine (immagine 80vh centrata →
   bordo superiore a 10vh dal top del blocco). */
.feat-nums {
    position: absolute;
    top: 10vh;
    left: clamp(1.5rem, 4vw, 4rem);
    display: flex;
    align-items: baseline;
    gap: 1.1rem;
}

.feat-num {
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--black);
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
    /* Stato inattivo: più piccolo e leggero */
    font-size: 1.4rem;
    font-weight: 400;
    opacity: 0.35;
    line-height: 1;
    transition: opacity .3s, font-size .3s, font-weight .3s;
}

.feat-num.is-active {
    /* Stato attivo: grande e bold */
    font-size: 2.6rem;
    font-weight: 700;
    opacity: 1;
}

/* Separatore "/" fra i numeri: sempre piccolo e leggero */
.feat-num-sep {
    font-size: 1.4rem;
    font-weight: 400;
    opacity: 0.3;
    color: var(--black);
    line-height: 1;
    user-select: none;
}

/* ── Navigazione: frecce (senza cerchio), allineate in basso al bordo dell'immagine.
   L'immagine è alta 80vh e centrata verticalmente nel blocco da 100vh → il suo
   bordo inferiore cade a 10vh dal fondo, quindi ci ancoriamo lì. ───── */
.feat-nav {
    display: none;
}

.feat-arrow {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--black);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    transition: opacity .25s, transform .25s;
    flex-shrink: 0;
}

.feat-arrow svg {
    width: clamp(48px, 4.5vw, 68px);
    height: clamp(48px, 4.5vw, 68px);
    display: block;
}

/* Freccia successiva: stessa icona specchiata */
.feat-arrow--next svg { transform: scaleX(-1); }

.feat-arrow:hover { opacity: 0.5; }
.feat-arrow--prev:hover { transform: translateX(-3px); }
.feat-arrow--next:hover { transform: translateX(3px); }

/* ── Animazione testo: inner span si muove ────── */
.feat-title__inner,
.feat-aside__inner {
    display: block;
    will-change: transform;
}

/* Uscita: sale verso l'alto */
.feat-title__inner.exit,
.feat-aside__inner.exit {
    animation: textExit .35s cubic-bezier(.55,0,1,.45) forwards;
}

/* Entrata: arriva dal basso */
.feat-title__inner.enter,
.feat-aside__inner.enter {
    animation: textEnter .4s cubic-bezier(.22,1,.36,1) forwards;
}

@keyframes textExit {
    from { transform: translateY(0);     opacity: 1; }
    to   { transform: translateY(-110%); opacity: 0; }
}

@keyframes textEnter {
    from { transform: translateY(110%);  opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* ── Mobile ─────────────────────────────────────── */
@media (max-width: 768px) {
    .feat-block {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        grid-template-areas:
            "img"
            "left";
        gap: 0;
        padding: 0;
        overflow: clip; /* clip non rompe sticky come hidden */
        height: 100vh;
        height: var(--vh, 100vh);
        box-sizing: border-box;
    }

    /* Immagine altezza fissa ancorata in alto */
    .feat-img-wrap {
        grid-area: img;
        width: 100%;
        height: 55vh;
        flex-shrink: 0;
        border-radius: 0;
        order: unset;
        align-self: start;
    }

    /* Testo ancorato in basso */
    .feat-left {
        grid-area: left;
        width: 100%;
        padding: 1.4rem 1.8rem 1.8rem;
        gap: 0.8rem;
        box-sizing: border-box;
        justify-content: flex-end;
        align-self: end;
    }

    /* Mobile: numeri di nuovo nel flusso, niente altezza riservata sul titolo */
    .feat-nums {
        position: static;
        margin-bottom: 0.5rem;
    }

    .feat-title {
        font-size: clamp(1.6rem, 6vw, 2.8rem);
        min-height: 0;
    }

    /* Mobile: testo a sinistra, leggibile (la "prova" a destra è solo desktop) */
    .feat-desc-wrap {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        align-self: stretch;
        text-align: left;
        gap: 0.8rem;
    }

    .feat-cta { align-self: flex-start; }

    /* Mobile: frecce di nuovo nel flusso, non assolute */
    .feat-nav {
        position: static;
        gap: 1rem;
        margin-top: 0.8rem;
    }

    .feat-arrow svg {
        width: 34px;
        height: 34px;
    }
}
