/* ==================================================================
   estia/hero-slideshow — style.css
   Estratto da nuova_home/hero.css (parte hero, non chrome).
   La chrome è già in wp-theme/estia/assets/css/chrome.css (fase 1).
   ================================================================== */

/* ------------------------------------------------------------------ */
/* Local tokens (scoped to hero block — not duplicating global tokens) */
/* ------------------------------------------------------------------ */
.estia-hero-slideshow {
    --gold:         #f5be42;
    --gold-hover:   #e9ad2e;
    --blue:         #4c70af;
    --blue-hover:   #3c5d94;
    --ink:          #141618;
    --ink-soft:     #2b2b2b;
    --text-muted:   #575655;
    --divider:      #dcdcdc;
    --content-max:  1680px;
    --radius:       10px;
    --radius-lg:    14px;
    --bg-fade:      1400ms;
    --accent:       var(--gold);
    --accent-hover: var(--gold-hover);
    --accent-ink:   #1f1f1f;
    --nav-color:    #ffffff;
}

/* ------------------------------------------------------------------ */
/* HERO SHELL                                                          */
/* ------------------------------------------------------------------ */
.estia-hero-slideshow.hero {
    position: relative;
    width: 100%;
    min-height: 680px;
    height: 100vh;
    overflow: hidden;
    isolation: isolate;
    color: #fff;
}

/* ---------- background slideshow with Ken-Burns drift ---------- */
.estia-hero-slideshow .hero-bg { position: absolute; inset: 0; z-index: 0; }

/* ---------- background single image (slideshow OFF) ---------- */
.estia-hero-slideshow .hero-bg__pic {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.estia-hero-slideshow .hero-bg__pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.estia-hero-slideshow .hero-bg__slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    opacity: 0;
    transform: scale(1.14) translate(-1.5%, -1%);
    transition:
        opacity   var(--bg-fade) ease-in-out,
        transform var(--bg-fade) ease-out;
    will-change: opacity, transform;
}
.estia-hero-slideshow .hero-bg__slide.is-active {
    opacity: 1;
    animation: estia-kenburns 12s ease-out forwards;
}
@keyframes estia-kenburns {
    from { transform: scale(1.06) translate(0, 0); }
    to   { transform: scale(1.14) translate(-1.5%, -1%); }
}

/* Reading scrim */
.estia-hero-slideshow .hero-bg__scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(10,15,25,.38) 0%, rgba(10,15,25,0) 24%),
        linear-gradient(190deg, rgba(10,15,25,0) 35%, rgba(10,15,25,.55) 100%),
        radial-gradient(120% 70% at 0% 90%, rgba(10,15,25,.35) 0%, transparent 60%);
    pointer-events: none;
}

/* variant: soft scrim */
.estia-hero-slideshow[data-scrim="soft"] .hero-bg__scrim {
    background:
        linear-gradient(180deg, rgba(10,15,25,.25) 0%, rgba(10,15,25,0) 30%),
        linear-gradient(180deg, rgba(10,15,25,0) 55%, rgba(10,15,25,.35) 100%);
}

/* ------------------------------------------------------------------ */
/* HEADLINE / COPY                                                     */
/* ------------------------------------------------------------------ */
.estia-hero-slideshow .hero-copy {
    position: relative;
    z-index: 3;
    max-width: min(var(--content-max), calc(100% - 96px));
    margin: 0 auto;
    padding: clamp(140px, 20vh, 220px) clamp(4px, 1vw, 12px) 0;
}

.estia-hero-slideshow .hero-headline {
    font-family: 'Manrope', system-ui, sans-serif;
    font-weight: 800;
    font-size: clamp(40px, 6.2vw, 96px);
    line-height: 1.02;
    letter-spacing: -0.025em;
    color: #fff;
    text-shadow: 0 2px 24px rgba(0,0,0,.25);
    max-width: 14ch;
    text-wrap: balance;
}
.estia-hero-slideshow .hero-headline em {
    font-style: normal;
    font-weight: 400;
    color: var(--accent);
}

/* variant: all-sans headline */
.estia-hero-slideshow[data-display="sans"] .hero-headline {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    letter-spacing: -0.04em;
}
.estia-hero-slideshow[data-display="sans"] .hero-headline em {
    font-style: normal;
    font-weight: 700;
}

.estia-hero-slideshow .hero-sub {
    margin-top: 22px;
    max-width: 46ch;
    font-size: 1.25rem;
    line-height: 1.7;
    color: rgba(255,255,255,.88);
    font-weight: 500;
    text-shadow: 0 1px 6px rgba(0,0,0,.25);
    text-wrap: pretty;
}

/* ------------------------------------------------------------------ */
/* STATS ROW (.hero-stats)                                             */
/* ------------------------------------------------------------------ */
.estia-hero-slideshow .hero-stats {
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}
.estia-hero-slideshow .hero-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.estia-hero-slideshow .hero-stat strong {
    font-family: 'Manrope', system-ui, sans-serif;
    font-weight: 700;
    font-size: 28px;
    color: #fff;
    letter-spacing: -.02em;
    line-height: 1;
}
.estia-hero-slideshow[data-display="sans"] .hero-stat strong {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}
.estia-hero-slideshow .hero-stat span {
    font-size: 11px;
    color: rgba(255,255,255,.72);
    text-transform: uppercase;
    letter-spacing: 1.4px;
    font-weight: 500;
}

/* ------------------------------------------------------------------ */
/* SEARCH PANEL                                                        */
/* ------------------------------------------------------------------ */
.estia-hero-slideshow .search-panel {
    position: absolute;
    left: 50%;
    bottom: 250px;
    transform: translateX(-50%);
    z-index: 3;
    width: min(var(--content-max), calc(100% - 96px));
}

.estia-hero-slideshow .tabs {
    display: flex;
    gap: 2px;
    margin-bottom: -1px;
}

.estia-hero-slideshow .tab {
    min-width: 200px;
    height: 46px;
    padding: 0 22px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--ink);
    background: rgba(255,255,255,.98);
    border-radius: 12px 12px 0 0;
    border: 1px solid rgba(255,255,255,.8);
    border-bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    transition: background .18s ease, color .18s ease, opacity .18s ease;
    position: relative;
    opacity: .85;
    font-family: inherit;
    cursor: pointer;
}
.estia-hero-slideshow .tab:hover:not(.is-active) {
    background: #fff;
    opacity: 1;
    color: var(--ink);
}
.estia-hero-slideshow .tab.is-active {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: rgba(0,0,0,.06);
    opacity: 1;
}
.estia-hero-slideshow .tab.is-active::after {
    content: "";
    position: absolute;
    left: 22px;
    bottom: 10px;
    width: 18px; height: 2px;
    background: var(--accent-ink);
    border-radius: 2px;
}

.estia-hero-slideshow .search-form {
    background: rgba(255,255,255,.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 22px 22px 22px;
    display: grid;
    grid-template-columns: 1fr 1.6fr 1fr 0.75fr auto;
    gap: 8px;
    align-items: end;
    box-shadow: 0 20px 50px rgba(8, 20, 40, .25), 0 0 0 1px rgba(255,255,255,.4) inset;
}

/* Form a 2 campi (Valuta, Cambia): primo campo auto, secondo riempie,
   btn-invia ancorato a destra. */
.estia-hero-slideshow .search-form[data-field-count="2"] {
    grid-template-columns: auto 1fr auto;
}

/* Accent-style search form (gold) */
.estia-hero-slideshow[data-search="accent"] .search-form {
    background: var(--accent);
    box-shadow: 0 18px 40px rgba(245,190,66,.35);
}
.estia-hero-slideshow[data-search="accent"] .search-form .field label {
    color: var(--accent-ink);
    opacity: .72;
}
.estia-hero-slideshow[data-search="accent"] .field { border-right-color: rgba(0,0,0,.12); }

.estia-hero-slideshow .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 0 10px;
    border-right: 1px solid rgba(0,0,0,.08);
}
.estia-hero-slideshow .field:last-of-type { border-right: 0; }

.estia-hero-slideshow .field label {
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding-left: 2px;
}

.estia-hero-slideshow .select,
.estia-hero-slideshow .input {
    position: relative;
    height: 34px;
    display: flex;
    align-items: center;
}
.estia-hero-slideshow .select select,
.estia-hero-slideshow .input input {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 100%;
    padding: 0 28px 0 2px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    outline: none;
    font-family: inherit;
    min-width: 0;
}
.estia-hero-slideshow .input input {
    cursor: text;
    padding: 0 4px;
}
.estia-hero-slideshow .input input::placeholder {
    color: rgba(0, 0, 0, .35);
    font-weight: 500;
}
.estia-hero-slideshow .select::after {
    content: "";
    position: absolute;
    right: 8px;
    top: 50%;
    width: 8px; height: 8px;
    border-right: 1.5px solid #555;
    border-bottom: 1.5px solid #555;
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.estia-hero-slideshow .btn-invia {
    background: var(--blue);
    color: #fff;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1.5px;
    font-size: 12.5px;
    height: 54px;
    min-width: 168px; /* allinea le larghezze cross-tab (Valuta = Cerca = Continua) */
    padding: 0 32px;
    border-radius: 10px;
    transition: background .15s ease, transform .15s ease, box-shadow .2s ease;
    align-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 18px rgba(76,112,175,.3);
    margin-left: 8px;
    font-family: inherit;
    cursor: pointer;
    border: none;
}
.estia-hero-slideshow .btn-invia::before {
    content: "";
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    position: relative;
}
.estia-hero-slideshow .btn-invia:hover {
    background: var(--blue-hover);
    box-shadow: 0 12px 24px rgba(76,112,175,.4);
}
.estia-hero-slideshow .btn-invia:active { transform: translateY(1px); }

/* Accent-mode button */
.estia-hero-slideshow[data-search="accent"] .btn-invia { background: var(--blue); }
.estia-hero-slideshow[data-search="accent"] .btn-invia:hover { background: var(--blue-hover); }

/* ------------------------------------------------------------------ */
/* SLIDESHOW INDICATORS                                                */
/* ------------------------------------------------------------------ */
.estia-hero-slideshow .hero-dots {
    position: absolute;
    right: clamp(24px, 4.5%, 72px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}
.estia-hero-slideshow .hero-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.4);
    cursor: pointer;
    transition: background .2s ease, transform .2s ease, height .3s ease;
    border: 0;
    padding: 0;
}
.estia-hero-slideshow .hero-dot.is-active {
    background: var(--accent);
    height: 24px;
    border-radius: 3px;
}
.estia-hero-slideshow .hero-dot:hover:not(.is-active) {
    background: rgba(255,255,255,.7);
    transform: scale(1.3);
}

/* ------------------------------------------------------------------ */
/* RESPONSIVE                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 1200px) {
    .estia-hero-slideshow .hero-dots { display: none; }
    .estia-hero-slideshow .search-form { grid-template-columns: 1fr 1fr 1fr; }
    .estia-hero-slideshow .search-form .field { border-right: 0; }
    .estia-hero-slideshow .btn-invia {
        grid-column: 1 / -1;
        justify-self: stretch;
        justify-content: center;
        margin-left: 0;
    }
}

@media (max-width: 760px) {
    .estia-hero-slideshow .hero-copy {
        margin-top: max(190px, 20vh);
        padding: 0 20px;
        max-width: 100%;
    }
    .estia-hero-slideshow .search-panel {
        width: calc(100% - 30px);
        bottom: 72px;
    }
    .estia-hero-slideshow .hero-bg__scrim {
        background:
            linear-gradient(180deg,
                rgba(36, 62, 106, .58) 0%,
                rgba(36, 62, 106, .32) 45%,
                rgba(36, 62, 106, .65) 100%);
    }
    .estia-hero-slideshow .tabs {
        padding-left: 0;
    }
    .estia-hero-slideshow .tab {
        min-width: 0;
        flex: 1 1 0;
        padding: 0 8px;
        font-size: 11.5px;
        line-height: 1.15;
        text-align: center;
    }
    .estia-hero-slideshow .search-form,
    .estia-hero-slideshow .search-form[data-field-count="2"] {
        grid-template-columns: 1fr;
        padding: 10px 12px;
    }
    .estia-hero-slideshow .field {
        border-right: 0;
        border-bottom: 1px solid rgba(0,0,0,.08);
        padding: 6px 8px;
        gap: 4px;
    }
    .estia-hero-slideshow .field:last-of-type { border-bottom: 0; }
    .estia-hero-slideshow .select,
    .estia-hero-slideshow .input {
        height: 32px;
    }
    .estia-hero-slideshow .btn-invia {
        grid-column: auto;
        margin-left: 0;
        height: 44px;
        padding: 0 24px;
    }
    .estia-hero-slideshow .tab.is-active::after {
        display: none;
    }
}

/* ============================================================
   Mobile compresso (<=760px, altezza <630px): es. smartphone in
   landscape. Riduce push-down hero-copy e alza la search-panel
   dal 72 di default.
   ============================================================ */
@media (max-width: 760px) and (max-height: 629px) {
    .estia-hero-slideshow .hero-copy {
        margin-top: max(150px, 20vh);
    }
    .estia-hero-slideshow .search-panel {
        bottom: 150px;
    }
}

/* ============================================================
   Desktop intermedio (761-1278px), viewport alto (>800px):
   .search-panel ravvicinata al bottom (250 -> 150).
   ============================================================ */
@media (min-width: 761px) and (max-width: 1278px) and (min-height: 801px) {
    .estia-hero-slideshow .search-panel {
        bottom: 150px;
    }
}

/* ============================================================
   Desktop intermedio (761-1278px), viewport basso (<=800px):
   .search-panel quasi a filo bottom (250 -> 50).
   ============================================================ */
@media (min-width: 761px) and (max-width: 1278px) and (max-height: 800px) {
    .estia-hero-slideshow .search-panel {
        bottom: 50px;
    }
}

/* ============================================================
   Desktop intermedio (761-1278px), viewport molto compresso (<=650px):
   .search-panel torna a 150px (overrides la regola 50px sopra).
   ============================================================ */
@media (min-width: 761px) and (max-width: 1278px) and (max-height: 650px) {
    .estia-hero-slideshow .search-panel {
        bottom: 150px;
    }
}

/* ============================================================
   Laptop 1080p / display Full-HD (1280-1920px wide, max 1100px alto):
   compensazione anti-overlap sub/trust ↔ search-panel via riduzione
   padding-top hero-copy + tipografia sub/stats. La search-panel è
   posizionata a `bottom: 200px` dal blocco `min-width: 1280px` sotto
   (user request 2026-05-23; valore precedente 250px).
   ============================================================ */
@media (min-width: 1280px) and (max-height: 1100px) {
    .estia-hero-slideshow .hero-copy {
        padding-top: clamp(110px, 13vh, 140px);
    }
    /* Font-size override rimosso (user request 2026-05-21): preservare
       la dimensione "grande" del headline anche su laptop 1280+. */
    .estia-hero-slideshow .hero-sub {
        margin-top: 12px;
        max-width: 50ch;
    }
    .estia-hero-slideshow .hero-stats {
        margin-top: 14px;
        gap: 14px;
    }
    .estia-hero-slideshow .hero-stat strong {
        font-size: 20px;
    }
    .estia-hero-slideshow .hero-stat span {
        font-size: 10px;
        letter-spacing: 1.2px;
    }
    .estia-hero-slideshow .tab {
        height: 42px;
    }
    .estia-hero-slideshow .search-form {
        padding: 16px 18px;
    }
    .estia-hero-slideshow .btn-invia {
        height: 46px;
    }
}

/* ============================================================
   Desktop pieno (>=1280px): search-panel si restringe al 70%
   quando il form ha 2 campi (Valuta la tua casa, Cambia
   amministratore) per evitare spazio vuoto. Cerca (4 campi)
   resta a larghezza piena. Transition coordinata col tab switch.
   ============================================================ */
@media (min-width: 1280px) {
    .estia-hero-slideshow .search-panel {
        bottom: 200px;
        transition: width .28s cubic-bezier(.4, 0, .2, 1);
    }
    .estia-hero-slideshow .search-panel:has(.search-form[data-field-count="2"]) {
        width: min(calc(var(--content-max) * 0.7), calc((100% - 96px) * 0.7));
    }
}

/* ============================================================
   Themed native select dropdown (progressive enhancement).
   Browser con `appearance: base-select` (Chrome/Edge 130+) usano
   un picker stilizzabile a tema. Browser senza supporto vedono
   la dropdown nativa di sistema: il blocco @supports è no-op.
   ============================================================ */
@supports (appearance: base-select) {
    .estia-hero-slideshow .select select {
        appearance: base-select;
    }

    /* Nasconde l'icona built-in del nuovo control: la freccia è
       già disegnata dallo ::after del wrapper .select. */
    .estia-hero-slideshow .select select::picker-icon {
        display: none;
    }

    /* Pannello dropdown */
    .estia-hero-slideshow .select select::picker(select) {
        appearance: base-select;
        background: #fff;
        border: 1px solid var(--divider, #B8C4D9);
        border-radius: var(--radius-md, 6px);
        box-shadow: var(--shadow-card, 0 20px 50px rgba(15, 30, 60, .15));
        padding: 6px;
        margin-top: 6px;
        min-width: max-content;
        max-height: 320px;
        overflow-y: auto;
        font-family: var(--font-body);
        animation: estia-hero-picker-in .14s var(--ease-default, ease-out);
    }

    @keyframes estia-hero-picker-in {
        from { opacity: 0; transform: translateY(-4px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    /* Singola option */
    .estia-hero-slideshow .select select option {
        padding: 10px 12px;
        border-radius: var(--radius-sm, 4px);
        font-size: 14px;
        font-weight: 500;
        color: var(--text-dark, #3C3C3B);
        cursor: pointer;
        transition: background .12s ease, color .12s ease;
    }

    .estia-hero-slideshow .select select option:hover,
    .estia-hero-slideshow .select select option:focus,
    .estia-hero-slideshow .select select option:focus-visible {
        background: var(--surface-muted, #F4F3F9);
        color: var(--blue-hero, #243E6A);
        outline: none;
    }

    /* Opzione selezionata: highlight giallo brand */
    .estia-hero-slideshow .select select option:checked {
        background: var(--yellow, #F5BE42);
        color: var(--blue-dark, #1F3A6D);
        font-weight: 700;
    }

    /* Nessun checkmark: il fill giallo è già un'indicazione chiara. */
    .estia-hero-slideshow .select select option::checkmark {
        display: none;
    }
}
