﻿/* Vetrina della home (HomeHighlightsViewComponent): usa la palette di header.css (:root) */
.home-highlights {
    display: grid;
    gap: 1.25rem;
    margin: 1rem 0 1.5rem;
}

.home-nation {
    margin: 0;
    padding: .5rem .85rem;
    border-radius: var(--radius, 6px);
    background: var(--accent-soft, #e8f5fb);
    color: var(--accent-dark, #0f5f86);
    font-size: .9rem;
}

    .home-nation a {
        margin-left: .5rem;
        font-weight: 600;
        color: var(--accent-dark, #0f5f86);
        text-decoration: underline;
    }

/* ---------- Hero ---------- */
.home-hero {
    padding: 1.25rem 2rem;
    border-radius: calc(var(--radius, 6px) * 3);
    border: 1px solid var(--border, #e2e4ec);
    box-shadow: 0 6px 24px rgba(21, 26, 45, .06);
    overflow: hidden;
    position: relative;
    isolation: isolate;
    /* alone dorato dietro alla tartaruga, in tema con le monete */
    background-image: radial-gradient(circle at 88% 30%, rgba(240, 180, 40, .20) 0, rgba(240, 180, 40, 0) 38%), linear-gradient(135deg, var(--accent-soft, #e8f5fb) 0%, #fff 55%, var(--bg-soft, #f4f5f8) 100%);
}

/* ---------- Step dell'hero (js/home/highlights.js) ----------
   i due step stanno nella stessa cella della griglia: il riquadro prende l'altezza del piu' alto e non salta al cambio */
.home-steps__track {
    position: relative;
    z-index: 1;
    display: grid;
}

.home-step {
    grid-area: 1 / 1;
    min-width: 0;
    transition: opacity .5s ease, visibility .5s ease;
}

.home-steps .home-step:not(.is-active) {
    opacity: 0;
    visibility: hidden;
}

.home-step--intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.home-step--benefits {
    align-self: center;
}

/* pulsante "Perche' sceglierci?" e controlli: solo con JavaScript attivo */
.home-steps:not(.is-ready) .home-steps__why,
.home-steps:not(.is-ready) .home-steps__controls {
    display: none;
}

.home-steps__controls {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin-top: .75rem;
}

.home-steps__arrow, .home-steps__pause {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 .6rem;
    border: 1px solid var(--brand-border, #d9e1ec);
    border-radius: 999px;
    background: #fff;
    color: var(--brand-blue-dark, #1478a6);
    font-size: .85rem;
    font-weight: 600;
}

    .home-steps__arrow:hover, .home-steps__arrow:focus-visible,
    .home-steps__pause:hover, .home-steps__pause:focus-visible {
        border-color: var(--brand-blue-dark, #1478a6);
        background: var(--brand-blue-soft, #e8f5fb);
    }

.home-steps__pause {
    margin-left: .5rem;
}

/* pallino visibile piccolo, area da toccare di 24px (WCAG 2.5.8) */
.home-steps__dot {
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    position: relative;
}

    .home-steps__dot::before {
        content: "";
        position: absolute;
        inset: 50% auto auto 50%;
        width: .65rem;
        height: .65rem;
        margin: -.325rem 0 0 -.325rem;
        border-radius: 999px;
        background: var(--brand-border, #d9e1ec);
        transition: width .2s ease, margin .2s ease, background-color .2s ease;
    }

    .home-steps__dot.is-active::before {
        width: 1.4rem;
        margin-left: -.7rem;
        background: var(--brand-blue-dark, #1478a6);
    }

    .home-steps__dot:focus-visible {
        outline: 2px solid var(--brand-blue-dark, #1478a6);
        outline-offset: 2px;
        border-radius: 999px;
    }

/* ---------- Vantaggi della piattaforma ---------- */
.home-benefits__title {
    margin: 0 0 .75rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--brand-ink, #151a2d);
}

    .home-benefits__title:focus {
        outline: none;
    }

.home-benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-benefit {
    display: grid;
    grid-template-columns: auto 1fr;
    align-content: start;
    column-gap: .75rem;
    height: 100%;
    padding: .8rem .9rem;
    border-radius: calc(var(--radius, 6px) * 2);
    border: 1px solid var(--brand-border, #d9e1ec);
    background: rgba(255, 255, 255, .88);
    color: inherit;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

    .home-benefit:hover, .home-benefit:focus-visible {
        border-color: var(--brand-blue-dark, #1478a6);
        box-shadow: 0 6px 16px rgba(21, 26, 45, .09);
        color: inherit;
        text-decoration: none;
        transform: translateY(-1px);
    }

    .home-benefit i {
        grid-row: span 2;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.4rem;
        height: 2.4rem;
        border-radius: .8rem;
        background: var(--brand-blue-soft, #e8f5fb);
        color: var(--brand-blue, #1899d2);
        font-size: 1.1rem;
    }

    .home-benefit h3 {
        margin: 0 0 .15rem;
        font-size: 1rem;
        font-weight: 700;
        color: var(--brand-blue-dark, #1478a6);
    }

    .home-benefit p {
        margin: 0;
        font-size: .86rem;
        line-height: 1.35;
        color: var(--brand-ink-soft, #4a5178);
    }

/* con l'hero spento i vantaggi restano una sezione fissa */
.home-benefits-box {
    padding: 1.25rem 1.5rem;
    border-radius: calc(var(--radius, 6px) * 3);
    border: 1px solid var(--border, #e2e4ec);
    background: var(--brand-surface, #f6fafc);
}

@media (max-width: 991.98px) {
    .home-benefits {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .home-benefits {
        gap: .5rem;
    }

    .home-benefit {
        grid-template-columns: 1fr;
        padding: .65rem;
    }

        .home-benefit i {
            grid-row: auto;
            width: 2rem;
            height: 2rem;
            margin-bottom: .35rem;
            font-size: .95rem;
        }

        .home-benefit h3 {
            font-size: .9rem;
        }

        .home-benefit p {
            font-size: .8rem;
        }

    .home-steps__pause span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }
}

.home-hero__text, .home-hero__mascot {
    position: relative;
    z-index: 1;
}

.home-hero__text {
    max-width: 46rem;
}

.home-hero__title {
    margin: 0 0 .5rem;
    font-size: clamp(1.6rem, 3.2vw, 2.4rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--ink, #151a2d);
}

.home-hero__lead {
    margin: 0 0 1.25rem;
    font-size: 1.05rem;
    color: var(--ink-soft, #4a5178);
}

.home-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
}

.home-btn {
    padding: .65rem 1.2rem;
    border-radius: 999px;
    font-weight: 700;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

    .home-btn i {
        margin-right: .35rem;
    }

.home-highlights .home-btn--primary {
    /* theme.css colora le varianti .btn-*: !important per tenere il colore dell'hero */
    background-color: var(--accent, #1478a6) !important;
    border: 2px solid var(--accent, #1478a6);
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(20, 120, 166, .3);
}

    .home-highlights .home-btn--primary:hover, .home-highlights .home-btn--primary:focus {
        background-color: var(--accent-dark, #0f5f86) !important;
        border-color: var(--accent-dark, #0f5f86);
        color: #fff !important;
        transform: translateY(-1px);
    }

.home-btn--ghost {
    background-color: transparent !important;
    border: 2px solid var(--accent, #1478a6);
    color: var(--accent-dark, #0f5f86);
}

    /* al passaggio del mouse il pulsante si riempie: con il solo fondo chiaro il cambio non si notava */
    .home-btn--ghost:hover, .home-btn--ghost:focus {
        background-color: var(--accent, #1478a6) !important;
        border-color: var(--accent, #1478a6);
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(20, 120, 166, .3);
    }

.home-btn--link {
    background-color: transparent !important;
    border: 2px solid transparent;
    color: var(--ink-soft, #4a5178);
}

    .home-btn--link:hover, .home-btn--link:focus {
        color: var(--accent-dark, #0f5f86);
        background-color: var(--accent-soft, #e8f5fb) !important;
        text-decoration: underline;
    }

.home-hero__kicker {
    margin: 0 0 .25rem;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent-dark, #0f5f86);
}

/* mascotte: la nuvola dei pensieri con le cose da scambiare sopra la tartaruga */
.home-hero__mascot {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-right: 1rem;
}

.home-cloud {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 2.6rem);
    gap: .45rem;
    margin: 0 0 1.1rem;
    padding: .8rem 1rem;
    list-style: none;
    border-radius: 2.2rem;
    background: #fff;
    border: 1px solid var(--border, #e2e4ec);
    box-shadow: 0 6px 18px rgba(21, 26, 45, .08);
}

    .home-cloud::before, .home-cloud::after {
        content: "";
        position: absolute;
        border-radius: 50%;
        background: #fff;
        border: 1px solid var(--border, #e2e4ec);
        box-shadow: 0 3px 8px rgba(21, 26, 45, .06);
    }

    .home-cloud::before {
        width: .9rem;
        height: .9rem;
        left: 52%;
        bottom: -.8rem;
    }

    .home-cloud::after {
        width: .5rem;
        height: .5rem;
        left: 56%;
        bottom: -1.35rem;
    }

    .home-cloud li {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 2.6rem;
        border-radius: .8rem;
        background: var(--accent-soft, #e8f5fb);
        color: var(--accent, #1478a6);
        font-size: 1.15rem;
    }

.home-hero__turtle {
    display: block;
    width: 10.5rem;
    height: auto;
}

/* ---------- Numeri ---------- */
.home-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: .75rem;
}

.home-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .15rem;
    padding: 1rem 1.1rem;
    border-radius: calc(var(--radius, 6px) * 2);
    background: var(--bg, #fff);
    border: 1px solid var(--border, #e2e4ec);
    box-shadow: 0 2px 8px rgba(21, 26, 45, .05);
    transition: transform .15s ease, box-shadow .15s ease;
}

    .home-stat:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(21, 26, 45, .09);
    }

    .home-stat i {
        color: var(--accent, #1478a6);
        font-size: 1.2rem;
    }

    .home-stat strong {
        font-size: 1.6rem;
        line-height: 1.1;
        color: var(--ink, #151a2d);
    }

    .home-stat span {
        font-size: .85rem;
        color: var(--ink-soft, #4a5178);
    }

.home-stat--status strong {
    font-size: 1.05rem;
}

.home-stat--status.is-degraded i {
    color: #b7791f;
}

/* ---------- Fiducia ---------- */
.home-trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem 1.5rem;
    margin: 0;
    padding: .75rem 0 0;
    border-top: 1px solid var(--border, #e2e4ec);
    list-style: none;
    font-size: .88rem;
    color: var(--ink-soft, #4a5178);
}

    .home-trust i {
        margin-right: .3rem;
        color: var(--accent, #1478a6);
    }

@media (max-width: 767.98px) {
    .home-hero {
        padding: 1.25rem;
    }

    .home-hero__mascot {
        display: none;
    }

    .home-hero__actions .btn {
        flex: 1 1 100%;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-btn, .home-stat, .home-step, .home-benefit, .home-steps__dot::before {
        transition: none;
    }

        .home-btn:hover, .home-stat:hover, .home-benefit:hover {
            transform: none;
        }
}

/* ---------- Home: filtri a scomparsa ----------
   Sulla home senza ricerca la colonna filtri non occupa lo spazio degli annunci: un pulsante apre il pannello
   (la ricerca di base e' nell'header, i filtri completi restano nelle pagine di categoria e ricerca) */
.search--home #filters {
    flex: 0 0 100%;
    max-width: 100%;
}

.search--home .search-toggle--home {
    width: auto !important;
    display: inline-block !important;
}

@media (min-width: 768px) {
    .search--home #searchForm.collapse:not(.show) {
        display: none;
    }

    .search--home #searchForm.collapse.show {
        display: block;
        margin-bottom: 1rem;
    }
}

/* ---------- Home: pannello filtri aperto a tutta larghezza ----------
   i campi si dispongono in colonne invece che in una sola, e i pulsanti stanno su una riga */
@media (min-width: 768px) {
    .search--home #searchForm.collapse.show {
        overflow: visible;
    }

    .search--home #searchForm .search-panel__body {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 2rem;
        align-items: start;
    }

        .search--home #searchForm .search-panel__body > .search-panel__text,
        .search--home #searchForm .search-panel__body > .search-panel__category {
            grid-column: 1 / -1;
        }

    .search--home #searchForm .search-panel__body > .search-panel__section {
        width: 100%;
        min-width: 0;
    }

    .search--home #searchForm .search-panel__footer {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: .75rem 1rem;
        padding: .25rem 1.1rem 1rem;
    }

        .search--home #searchForm .search-panel__footer .btn-block {
            width: auto;
            min-width: 12rem;
        }

        .search--home #searchForm .search-panel__footer .search-alert {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: .5rem .75rem;
        }
}


/* ---------- Monete Happycoin sullo sfondo dell'hero ----------
   immagine ridotta (img/home/happycoin-bg.webp) copiata da img/happy_coin_oro-verde2.webp, che pesa 800 KB */
.home-coin {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    background: url("/img/home/happycoin-bg.webp") center / contain no-repeat;
    animation: home-coin-float 7s ease-in-out infinite alternate;
}

.home-coin--a {
    top: -3rem;
    right: -3rem;
    width: 15rem;
    height: 15rem;
    opacity: .2;
    transform: rotate(-14deg);
    animation-duration: 11s;
}

.home-coin--b {
    left: 41%;
    bottom: -2rem;
    width: 6.5rem;
    height: 6.5rem;
    opacity: .2;
    filter: blur(1.5px);
    animation-delay: -3s;
}

.home-coin--c {
    top: 1.1rem;
    left: 56%;
    width: 2.8rem;
    height: 2.8rem;
    opacity: .5;
    animation-delay: -1.5s;
}

.home-coin--d {
    right: 24%;
    bottom: 1.2rem;
    width: 2.2rem;
    height: 2.2rem;
    opacity: .45;
    animation-delay: -5s;
}

@keyframes home-coin-float {
    from {
        translate: 0 -.4rem;
        rotate: -8deg;
    }

    to {
        translate: 0 .5rem;
        rotate: 10deg;
    }
}

@media (max-width: 767.98px) {
    .home-coin--a {
        width: 10rem;
        height: 10rem;
        top: -2rem;
        right: -2.5rem;
    }

    .home-coin--b, .home-coin--d {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-coin {
        animation: none;
    }
}
