/* ==========================================================================
   estia/performance-counter — style.css
   Adattato da nuova_home/performance.css.
   Scope-isolation: .estia-performance-counter
   Selettori adattati al markup di render.php:
     .performance-section__inner (ex .perf-container)
     .performance-counters       (ex .perf-grid)
     .performance-counter        (ex .perf-stat)
     .perf-number                (invariato, data-target su di esso)
     .perf-suffix                (nuovo, affianca il numero)
     .perf-label                 (invariato)
   ========================================================================== */

.estia-performance-counter {
    --perf-ink:   #F5BE42;
    --perf-gold:  #f5be42;
    --perf-muted: #6b7184;

    font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
    color: var(--perf-ink);
    background: #ffffff;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: clamp(64px, 8vw, 112px) 0;
}

.estia-performance-counter *,
.estia-performance-counter *::before,
.estia-performance-counter *::after { box-sizing: border-box; }

/* ── Inner container ── */
.estia-performance-counter .performance-section__inner {
    max-width: 1680px;
    margin: 0 auto;
    padding: 0 clamp(24px, 4vw, 72px);
    text-align: center;
}

/* ── Eyebrow (frozen-style, size leggermente bumpato) ── */
.estia-performance-counter .perf-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    color: var(--perf-muted);
    text-transform: uppercase;
    font-weight: 600;
    font-size: clamp(15px, 1.4vw, 20px);
    letter-spacing: 2.8px;
    margin-bottom: 56px;
}
.estia-performance-counter .perf-eyebrow::before,
.estia-performance-counter .perf-eyebrow::after {
    content: "";
    display: inline-block;
    width: 48px;
    height: 1px;
    background: var(--perf-muted);
    opacity: .5;
}

/* ── Heading (legacy h2 — non più nel render, ma manteniamo style nel caso) ── */
.estia-performance-counter h2 {
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    color: var(--perf-ink);
    margin: 0 0 12px;
    letter-spacing: -0.01em;
}
.estia-performance-counter .performance-lead {
    color: var(--perf-muted);
    max-width: 760px;
    margin: 36px auto 0;
    font-size: clamp(15px, 1.4vw, 20px);
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 2.2px;
    text-transform: uppercase;
}

/* ── Grid of counters (4 col matching frozen) ── */
.estia-performance-counter .performance-counters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(24px, 4vw, 64px);
    align-items: start;
}

/* ── Single counter ── */
.estia-performance-counter .performance-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .6s ease, transform .6s ease;
}

/* Subtle vertical divider between counters */
.estia-performance-counter .performance-counter:not(:last-child)::after {
    content: "";
    position: absolute;
    right: calc(clamp(24px, 4vw, 64px) / -2);
    top: 18%;
    bottom: 18%;
    width: 1px;
    background: linear-gradient(180deg,
        rgba(27, 40, 69, 0) 0%,
        rgba(27, 40, 69, .15) 50%,
        rgba(27, 40, 69, 0) 100%);
}

/* Animate in when section gets .is-visible */
.estia-performance-counter.is-visible .performance-counter {
    opacity: 1;
    transform: none;
}
.estia-performance-counter.is-visible .performance-counter:nth-child(1) { transition-delay:   0ms; }
.estia-performance-counter.is-visible .performance-counter:nth-child(2) { transition-delay: 120ms; }
.estia-performance-counter.is-visible .performance-counter:nth-child(3) { transition-delay: 240ms; }
.estia-performance-counter.is-visible .performance-counter:nth-child(4) { transition-delay: 360ms; }

/* ── Number wrapper (frozen markup: span.perf-number > span.perf-number__value [+ span.perf-number__suffix]) ── */
.estia-performance-counter .perf-number {
    font-family: 'Manrope', 'Montserrat', system-ui, sans-serif;
    font-weight: 400;
    font-size: clamp(56px, 7vw, 104px);
    line-height: 1;
    letter-spacing: -.03em;
    color: var(--perf-ink);
    font-feature-settings: "tnum" 1;
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
}
.estia-performance-counter .perf-number__value {
    /* Inherits font from .perf-number */
}
.estia-performance-counter .perf-number__suffix,
.estia-performance-counter .perf-number__prefix {
    font-size: .5em;
    font-weight: 400;
    color: var(--perf-gold);
    align-self: center;
    letter-spacing: 0;
}

/* Backward-compat con il vecchio markup .perf-suffix */
.estia-performance-counter .perf-suffix {
    font-size: clamp(24px, 3.5vw, 48px);
    font-weight: 400;
    color: var(--perf-gold);
    line-height: 1;
    letter-spacing: 0;
    align-self: flex-start;
    margin-top: 6px;
}

/* ── Label ── */
.estia-performance-counter .perf-label {
    color: var(--perf-muted);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .3px;
    line-height: 1.4;
    max-width: 22ch;
    text-wrap: balance;
}

/* ── Responsive ── */
@media (max-width: 860px) {
    .estia-performance-counter .performance-counters {
        grid-template-columns: repeat(2, 1fr);
        gap: 48px 24px;
    }
    /* Niente divider a fine riga */
    .estia-performance-counter .performance-counter:nth-child(2)::after { display: none; }
}

@media (max-width: 480px) {
    .estia-performance-counter .performance-counters {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .estia-performance-counter .performance-counter::after { display: none; }
}
