/* ═══════════════════════════════════════════════════════════════
   TELEBORSA CORPORATE — HOMEPAGE B (test A/B, anteprima privata)
   Caricato SOLO sul template template-homepage-b.php.
   Tutte le regole sono scope-ate su .home-b e usano il prefisso hb-
   per non interferire con main.css. Riuso intenzionale dal tema:
   .hero-video (gestione pausa mobile/reduced-motion in main.js).
   ═══════════════════════════════════════════════════════════════ */

.home-b {
    --hb-dark:     #141414;
    --hb-dark-2:   #241a12;
    --hb-ink:      #161616;
    --hb-orange:   var(--color-orange, #F75C06);
    --hb-orange-2: #C84A05;
    --hb-text:     #1a1a1a;
    --hb-muted:    #4a4a4a;
    --hb-ease:     cubic-bezier(0.22, 1, 0.36, 1);

    overflow-x: clip;
    background: #fff;
}

/* ── Layout di base ───────────────────────────────────────────── */

.home-b .hb-inner {
    max-width: 1360px;
    margin-inline: auto;
    padding-inline: clamp(20px, 4vw, 48px);
}

/* ── Eyebrow (sopratitolo) ────────────────────────────────────── */

.home-b .hb-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 20px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--hb-orange);
}
.home-b .hb-eyebrow::before {
    content: '';
    width: 44px;
    height: 2px;
    background: var(--hb-orange);
    flex: none;
}
.home-b .hb-eyebrow--dark { color: var(--hb-orange); }

/* ── Titoli di sezione ────────────────────────────────────────── */

.home-b .hb-h2 {
    margin: 0 0 clamp(40px, 5vw, 72px);
    font-size: clamp(36px, 4.5vw, 72px);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -0.02em;
    color: var(--hb-text);
}
.home-b .hb-h2--light { color: #fff; }

/* ── Bottoni B ────────────────────────────────────────────────── */

.home-b .hb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    padding: 0 36px;
    border-radius: 999px;
    font-family: var(--font-family);
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease,
                border-color 0.25s ease, transform 0.25s ease,
                box-shadow 0.25s ease;
}
.home-b .hb-btn:hover { transform: translateY(-2px); }

.home-b .hb-btn--solid {
    background: var(--hb-orange);
    color: #fff;
}
.home-b .hb-btn--solid:hover {
    background: #ff6a14;
    box-shadow: 0 12px 32px rgba(247, 92, 6, 0.35);
}

.home-b .hb-btn--ghost {
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    color: #fff;
    background: transparent;
}
.home-b .hb-btn--ghost:hover {
    background: #fff;
    border-color: #fff;
    color: var(--hb-text);
}

.home-b .hb-btn--white {
    background: #fff;
    color: var(--hb-orange-2);
}
.home-b .hb-btn--white:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.home-b .hb-btn--outline {
    border: 1.5px solid var(--hb-orange);
    color: var(--hb-orange);
    background: transparent;
}
.home-b .hb-btn--outline:hover {
    background: var(--hb-orange);
    color: #fff;
}

/* ── Reveal (ingresso in viewport, delay via --d) ─────────────── */

.home-b .reveal-b {
    opacity: 0;
    transform: translateY(34px);
    transition: opacity 0.8s var(--hb-ease), transform 0.8s var(--hb-ease);
    transition-delay: var(--d, 0ms);
}
.home-b .reveal-b.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════
   1. HERO B — dark, gradiente + glow, video, titolo gigante
   ═══════════════════════════════════════════════════════════════ */

.home-b .hb-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--header-h, 114px) + 40px) 0 120px;
    background: linear-gradient(165deg, var(--hb-dark) 30%, var(--hb-dark-2) 100%);
    color: #fff;
}

.home-b .hb-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
.home-b .hb-hero__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-b .hb-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(8, 8, 8, 0.72) 0%,
        rgba(8, 8, 8, 0.55) 55%,
        var(--hb-dark) 100%);
}

.home-b .hb-hero__glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(720px 520px at 82% 78%,
        rgba(247, 92, 6, 0.28), transparent 70%);
    pointer-events: none;
}

.home-b .hb-hero__content {
    position: relative;
    z-index: 1;
    width: 100%;
}

.home-b .hb-hero__title {
    margin: 0;
    font-size: clamp(44px, 7vw, 110px);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.025em;
}
.home-b .hb-hero__line { display: block; }
.home-b .hb-hero__line--accent { color: var(--hb-orange); }

.home-b .hb-hero__sub {
    margin: 28px 0 0;
    max-width: 640px;
    font-size: clamp(18px, 1.6vw, 25px);
    font-weight: 300;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.78);
}

.home-b .hb-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 44px;
}

/* Indicatore scroll minimal: linea verticale con punto che scende */
.home-b .hb-hero__scroll {
    position: absolute;
    left: 50%;
    bottom: 36px;
    width: 1px;
    height: 64px;
    background: rgba(255, 255, 255, 0.25);
    overflow: hidden;
    z-index: 1;
}
.home-b .hb-hero__scroll span {
    position: absolute;
    left: -1px;
    top: -40%;
    width: 3px;
    height: 40%;
    border-radius: 3px;
    background: var(--hb-orange);
    animation: hb-scroll-drop 2.2s var(--hb-ease) infinite;
}
@keyframes hb-scroll-drop {
    0%   { top: -40%; }
    70%  { top: 100%; }
    100% { top: 100%; }
}

/* ═══════════════════════════════════════════════════════════════
   2. CLIENTI — fondo bianco, loghi grigi in scorrimento (design PROPOSTA)
   ═══════════════════════════════════════════════════════════════ */

.home-b .hb-marquee {
    padding: clamp(56px, 7vw, 100px) 0;
    background: #fff;
}

.home-b .hb-marquee__label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 0 0 44px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--hb-orange);
}

.home-b .hb-marquee__viewport {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.home-b .hb-marquee__track {
    display: flex;
    width: max-content;
    animation: hb-marquee 38s linear infinite;
}
.home-b .hb-marquee__track:hover { animation-play-state: paused; }

@keyframes hb-marquee {
    to { transform: translateX(-50%); }
}

.home-b .hb-marquee__list {
    display: flex;
    align-items: center;
    gap: clamp(48px, 6vw, 96px);
    padding: 0 clamp(24px, 3vw, 48px) 0 0;
    margin: 0;
    list-style: none;
}
/* Loghi grigi direttamente su bianco (niente chip) */
.home-b .hb-marquee__item {
    flex: none;
    display: flex;
    align-items: center;
}
.home-b .hb-marquee__item img {
    display: block;
    height: 38px;
    width: auto;
    max-width: none;
    filter: grayscale(100%);
    opacity: 0.55;
    transition: filter 0.25s ease, opacity 0.25s ease;
}
.home-b .hb-marquee__item:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   3. MANIFESTO / INTRO — light, tipografia grande, keyword evidenziate
   ═══════════════════════════════════════════════════════════════ */

.home-b .hb-intro {
    padding: clamp(96px, 12vw, 170px) 0;
    background: #fff;
}

.home-b .hb-intro__text {
    margin: 0;
    max-width: 76%;
    font-size: clamp(28px, 3.2vw, 52px);
    font-weight: 300;
    line-height: 1.28;
    letter-spacing: -0.015em;
    color: var(--hb-text);
}

/* Frase chiave: sottolineatura arancio che "cresce" al reveal */
.home-b .hb-mark {
    font-style: normal;
    font-weight: 400;
    background-image: linear-gradient(rgba(247, 92, 6, 0.35), rgba(247, 92, 6, 0.35));
    background-repeat: no-repeat;
    background-position: 0 88%;
    background-size: 0% 0.18em;
    transition: background-size 0.9s var(--hb-ease) 0.5s;
}
.home-b .hb-intro__text.visible .hb-mark {
    background-size: 100% 0.18em;
}

/* ═══════════════════════════════════════════════════════════════
   4. SERVIZI — righe editoriali full-width, hover dark (no numeri)
   ═══════════════════════════════════════════════════════════════ */

.home-b .hb-services {
    padding: clamp(96px, 11vw, 150px) 0;
    background: var(--color-bg-light, #F1F1F1);
}

.home-b .hb-services__list {
    border-top: 1px solid rgba(0, 0, 0, 0.14);
}

.home-b .hb-svc {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 88px;
    gap: clamp(24px, 3vw, 48px);
    align-items: center;
    margin-inline: -24px;
    padding: clamp(32px, 4.5vw, 60px) 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 4px;
    transition: background 0.35s ease;
}
.home-b .hb-svc:hover { background: var(--hb-ink); }

.home-b .hb-svc__title {
    margin: 0 0 14px;
    font-size: clamp(28px, 3.4vw, 54px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--hb-text);
    transition: color 0.35s ease, transform 0.45s var(--hb-ease);
}
.home-b .hb-svc__desc {
    margin: 0;
    max-width: 58ch;
    font-size: clamp(16px, 1.25vw, 19px);
    line-height: 1.6;
    color: var(--hb-muted);
    transition: color 0.35s ease;
}
.home-b .hb-svc:hover .hb-svc__title { color: #fff; transform: translateX(10px); }
.home-b .hb-svc:hover .hb-svc__desc  { color: rgba(255, 255, 255, 0.65); }

.home-b .hb-svc__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 1.5px solid var(--hb-orange);
    color: var(--hb-orange);
    transition: background 0.3s ease, color 0.3s ease, transform 0.45s var(--hb-ease);
}
.home-b .hb-svc__arrow svg { width: 26px; height: 26px; }
.home-b .hb-svc:hover .hb-svc__arrow {
    background: var(--hb-orange);
    color: #fff;
    transform: translateX(6px);
}

/* Link "esteso": l'intera riga è cliccabile */
.home-b .hb-svc__arrow::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════
   5. NUMERI — dark + glow, cifre giganti con count-up
   ═══════════════════════════════════════════════════════════════ */

.home-b .hb-stats {
    position: relative;
    padding: clamp(110px, 13vw, 180px) 0;
    background: var(--hb-ink);
    color: #fff;
    overflow: clip;
}

.home-b .hb-stats__glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(640px 460px at 88% 12%,
        rgba(247, 92, 6, 0.16), transparent 70%);
    pointer-events: none;
}

.home-b .hb-stats__grid {
    position: relative;
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: clamp(48px, 7vw, 110px);
    align-items: start;
}

.home-b .hb-stats__head .hb-h2 { margin-bottom: 0; }

.home-b .hb-stats__text {
    margin: 28px 0 0;
    font-size: clamp(16px, 1.25vw, 19px);
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.62);
}

.home-b .hb-stats__list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(48px, 5vw, 80px) clamp(32px, 4vw, 64px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-b .hb-stat {
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    padding-top: 26px;
}
/* Griglia sfalsata: la colonna destra parte più in basso */
.home-b .hb-stat:nth-child(even) { margin-top: 56px; }

.home-b .hb-stat__num {
    display: block;
    font-size: clamp(64px, 8vw, 136px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.home-b .hb-stat__label {
    display: block;
    margin-top: 14px;
    max-width: 32ch;
    font-size: clamp(14px, 1.1vw, 17px);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.55);
}

/* ═══════════════════════════════════════════════════════════════
   6. CASE HISTORY — light, card oversize con parallasse
   ═══════════════════════════════════════════════════════════════ */

.home-b .hb-case {
    padding: clamp(100px, 12vw, 170px) 0;
    background: #fff;
}

.home-b .hb-case__item {
    display: grid;
    grid-template-columns: 55fr 45fr;
    gap: clamp(40px, 5vw, 88px);
    align-items: center;
    margin-top: clamp(64px, 8vw, 110px);
}
.home-b .hb-case__item--reverse .hb-case__media { order: 2; }

.home-b .hb-case__media {
    border-radius: 0;
    overflow: hidden;
    aspect-ratio: 6 / 5;
    background: #eee;
}
.home-b .hb-case__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Margine extra per la parallasse JS (translateY ±24px) */
    transform: scale(1.1);
    will-change: transform;
}
.home-b .hb-case__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ddd, #f5f5f5);
}

.home-b .hb-case__tagline {
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--hb-orange);
}

.home-b .hb-case__title {
    margin: 0 0 18px;
    font-size: clamp(32px, 4vw, 62px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--hb-text);
}

.home-b .hb-case__desc {
    margin: 0 0 34px;
    max-width: 48ch;
    font-size: clamp(16px, 1.3vw, 19px);
    line-height: 1.65;
    color: var(--hb-muted);
}

/* ═══════════════════════════════════════════════════════════════
   7. CTA FINALE — gradiente arancio pieno
   ═══════════════════════════════════════════════════════════════ */

.home-b .hb-cta {
    position: relative;
    padding: clamp(110px, 13vw, 180px) 0;
    background: linear-gradient(135deg, var(--hb-orange) 0%, var(--hb-orange-2) 100%);
    color: #fff;
    text-align: center;
    overflow: clip;
}
.home-b .hb-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(560px 380px at 18% 0%,
        rgba(255, 255, 255, 0.14), transparent 70%);
    pointer-events: none;
}

.home-b .hb-cta__content { position: relative; }

.home-b .hb-cta__title {
    margin: 0 auto;
    max-width: 18ch;
    font-size: clamp(36px, 5vw, 80px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.home-b .hb-cta__text {
    margin: 26px auto 48px;
    max-width: 52ch;
    font-size: clamp(17px, 1.4vw, 21px);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
}

.home-b .hb-cta__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}
/* Ghost su fondo arancio: hover bianco con testo arancio */
.home-b .hb-cta .hb-btn--ghost:hover { color: var(--hb-orange-2); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — breakpoint allineati a main.css
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .home-b .hb-hero { padding-top: calc(var(--header-h, 80px) + 32px); }

    .home-b .hb-svc { grid-template-columns: 1fr 64px; }
    .home-b .hb-svc__arrow { width: 56px; height: 56px; }
    .home-b .hb-svc__arrow svg { width: 22px; height: 22px; }

    .home-b .hb-stats__grid { grid-template-columns: 1fr; }
    .home-b .hb-intro__text { max-width: 100%; }

    .home-b .hb-case__item,
    .home-b .hb-case__item--reverse { grid-template-columns: 1fr; }
    .home-b .hb-case__item--reverse .hb-case__media { order: 0; }
    .home-b .hb-case__media { aspect-ratio: 16 / 10; }
}

@media (max-width: 768px) {
    .home-b .hb-hero__actions .hb-btn { width: 100%; }

    .home-b .hb-marquee__item img { height: 30px; }

    .home-b .hb-svc {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-inline: -16px;
        padding-inline: 16px;
    }
    .home-b .hb-svc__arrow {
        position: absolute;
        top: 28px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
    .home-b .hb-svc__arrow svg { width: 18px; height: 18px; }
    .home-b .hb-svc:hover .hb-svc__title { transform: none; }

    .home-b .hb-stats__list { gap: 36px 24px; }
    .home-b .hb-stat:nth-child(even) { margin-top: 32px; }

    .home-b .hb-cta__actions .hb-btn { width: 100%; max-width: 360px; }
}

@media (max-width: 480px) {
    .home-b .hb-stats__list { grid-template-columns: 1fr; }
    .home-b .hb-stat:nth-child(even) { margin-top: 0; }
    .home-b .hb-stat__num { font-size: 56px; }
}

/* ═══════════════════════════════════════════════════════════════
   ACCESSIBILITÀ — prefers-reduced-motion
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .home-b .reveal-b {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .home-b .hb-hero__scroll span { animation: none; }
    .home-b .hb-btn:hover { transform: none; }
    .home-b .hb-mark {
        background-size: 100% 0.18em;
        transition: none;
    }
    /* Marquee fermo: i loghi diventano una griglia statica centrata */
    .home-b .hb-marquee__track {
        animation: none;
        width: 100%;
    }
    .home-b .hb-marquee__list {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px 24px;
        padding: 0 24px;
    }
    .home-b .hb-marquee__list[aria-hidden="true"] { display: none; }
    .home-b .hb-marquee__viewport {
        -webkit-mask-image: none;
        mask-image: none;
    }
    .home-b .hb-case__media img { transform: none !important; }
    .home-b .hb-svc:hover .hb-svc__title,
    .home-b .hb-svc:hover .hb-svc__arrow { transform: none; }
}
