/* Sezioni da landing Power BI — tema chiaro sito IG */

/* Hero BI — copy a sinistra, entrata da sinistra */
.hero.hero--bi {
    align-items: stretch;
    justify-content: center;
    text-align: left;
    height: var(--ig-hero-height);
    min-height: var(--ig-hero-height);
    max-height: var(--ig-hero-height);
    padding-top: var(--ig-hero-header, 4.75rem);
    padding-bottom: clamp(1rem, 3vh, 2rem);
    box-sizing: border-box;
}

.hero.hero--bi .hero-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 4vw, 2rem);
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 0;
}

.hero--bi-copy {
    max-width: 42rem;
}

.hero--bi-kicker {
    margin: 0 0 1rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.hero.hero--bi h1 {
    text-align: left;
    margin-left: 0;
}

.hero.hero--bi .hero-subtitle {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    max-width: 40rem;
}

.hero.hero--bi .hero-buttons {
    justify-content: flex-start;
}

.hero.hero--bi .hero-content .animate-on-scroll {
    opacity: 0;
    transform: translateX(-2.75rem);
    transition:
        opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero.hero--bi .hero-content .animate-on-scroll.animated {
    opacity: 1;
    transform: translateX(0);
}

.hero.hero--bi .hero-subtitle.animate-on-scroll.animated {
    opacity: 0.95;
}

@media (prefers-reduced-motion: reduce) {
    .hero.hero--bi .hero-content .animate-on-scroll {
        transform: none;
        transition: opacity 0.4s ease;
    }
}

/* Ritmo verticale uniforme (pagina BI) */
main.bi-page {
    --bi-gap: clamp(2.5rem, 4.5vw, 3.25rem);
    --bi-gap-lg: clamp(3.25rem, 5.5vw, 4.25rem);
    --bi-gap-hero: clamp(3.5rem, 6vw, 4.5rem);
}

.ig-service-values {
    padding: var(--bi-gap-lg) 0;
}

.ig-service-showcase {
    background: linear-gradient(135deg, #003731 0%, #005249 100%);
    color: #fff;
    padding: var(--bi-gap-lg) 0;
}

.ig-service-showcase .section-title,
.ig-service-showcase h3 {
    color: #fff;
}

.ig-service-showcase .section-subtitle {
    color: rgba(255, 255, 255, 0.9);
}

.ig-service-showcase__kicker {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
}

.cs-method-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.cs-method-block {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.4rem 1.25rem 1.15rem;
}

.cs-method-block h3 {
    margin: 0 0 1.15rem;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.45;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.8);
}

.cs-method-block ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.95rem;
}

.cs-method-block li strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: #fff;
}

.cs-method-block li span {
    display: block;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.95rem;
    line-height: 1.5;
}

@media (max-width: 900px) {
    .cs-method-grid {
        grid-template-columns: 1fr;
    }
}

main.bi-page > .intro-section {
    padding: var(--bi-gap-lg) 0 !important;
}

main.bi-page > .hero + .intro-section {
    padding-top: var(--bi-gap-hero) !important;
}

/* Valori → demo (cambio sfondo) */
main.bi-page > #bi-valori {
    padding-bottom: var(--bi-gap-lg) !important;
}

main.bi-page > #bi-demo {
    padding-top: var(--bi-gap-lg) !important;
    padding-bottom: var(--bi-gap-lg) !important;
    scroll-margin-top: 5.5rem;
}

/* Demo → percorso (cambio sfondo) */
main.bi-page > #bi-percorso {
    padding-top: var(--bi-gap-lg) !important;
    padding-bottom: var(--bi-gap) !important;
}

/* Percorso + aree: stesso sfondo #fafafa */
main.bi-page > #bi-aree {
    padding-top: var(--bi-gap) !important;
    padding-bottom: var(--bi-gap-lg) !important;
}

main.bi-page > .bi-cta-section {
    padding: clamp(4.5rem, 8vw, 6.5rem) 1.5rem !important;
}

main.bi-page .bi-section-container {
    padding-top: 0;
    padding-bottom: 0;
}

main.bi-page .bi-demo-intro {
    margin-bottom: clamp(2rem, 3vw, 2.5rem);
}

main.bi-page #bi-aree .bi-demo-intro {
    margin-bottom: clamp(2.25rem, 3.5vw, 2.75rem);
}

main.bi-page .back-link-wrapper {
    margin: var(--bi-gap-lg) 0 var(--bi-gap);
}

@media (max-width: 768px) {
    main.bi-page {
        --bi-gap: 2.25rem;
        --bi-gap-lg: 3.5rem;
        --bi-gap-hero: 3.25rem;
    }

    .hero.hero--bi {
        height: var(--ig-hero-height);
        min-height: var(--ig-hero-height);
        max-height: var(--ig-hero-height);
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

/* Valori BI — card in linea con il sito */
.bi-values-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin: 0 auto;
    max-width: 1040px;
    list-style: none;
}

.bi-value-card {
    padding: 1.65rem 1.5rem 1.5rem;
    margin: 0;
    border-radius: 14px;
    border: 1px solid var(--border-color, rgba(0, 55, 49, 0.1));
    box-shadow: 0 4px 20px rgba(0, 55, 49, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.bi-value-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 36px rgba(0, 55, 49, 0.11);
    border-color: rgba(0, 82, 73, 0.28);
}

.bi-value-card__icon {
    width: 44px;
    height: 44px;
    margin-bottom: 1rem;
    color: var(--primary-color, #005249);
    flex-shrink: 0;
}

.bi-value-card h3 {
    margin: 0 0 0.55rem;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--primary-color, #003731);
}

.bi-value-card p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-secondary, #555);
    flex-grow: 1;
}

@media (max-width: 1024px) {
    .bi-values-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .bi-values-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .bi-value-card {
        padding: 1.35rem 1.25rem;
    }
}

.bi-percorso-section .bi-data-flow {
    margin-top: 0;
}

.bi-tag {
    display: block;
    margin-bottom: 0.65rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary-color, #005249);
}

.bi-areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.bi-area-card {
    height: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.bi-area-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 55, 49, 0.12);
}

.bi-area-card__icon {
    width: 44px;
    height: 44px;
    margin-bottom: 1rem;
    color: var(--primary-color, #005249);
}

.bi-area-card h3 {
    margin-bottom: 0.5rem;
}

.bi-demo-intro {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Grafico origine → cruscotto */
.bi-data-flow {
    max-width: 1040px;
    margin: 0 auto;
}

.bi-data-flow__head {
    margin: 0 0 1.75rem;
    padding: 0 0.5rem;
    text-align: center;
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
}

.bi-data-flow__title {
    font-size: clamp(1.65rem, 3.5vw, 2.15rem);
    margin: 0 0 0.65rem;
    color: var(--primary-color, #003731);
}

.bi-data-flow__lead {
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.12rem);
    line-height: 1.65;
    color: #555;
}

.bi-data-flow__canvas {
    position: relative;
    padding: 1.75rem 1.35rem 1.5rem;
    border-radius: 22px;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 82, 73, 0.06), transparent 55%),
        linear-gradient(180deg, #fafcfb 0%, #fff 48%, #f4faf8 100%);
    border: 1px solid rgba(0, 55, 49, 0.11);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 20px 50px rgba(0, 55, 49, 0.09);
}

.bi-data-flow__grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) 3rem minmax(7.25rem, 10.5rem) 3rem minmax(0, 1.2fr);
    gap: 0 0.15rem;
    align-items: center;
    min-height: 272px;
}

.bi-data-flow__zone-badge {
    display: table;
    margin: 0 auto 0.85rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #5c6d69;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 55, 49, 0.12);
    border-radius: 999px;
}

.bi-data-flow__zone-badge--to {
    color: #fff;
    background: var(--primary-color, #003731);
    border-color: transparent;
}

.bi-data-flow__nodes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    max-width: 248px;
    margin: 0 auto;
}

.bi-data-flow__node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 0.5rem 0.65rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-color, #003731);
    background: #fff;
    border: 1px solid rgba(0, 55, 49, 0.1);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0, 55, 49, 0.07);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.bi-data-flow__node svg {
    width: 1.25rem;
    height: 1.25rem;
    padding: 0.4rem;
    box-sizing: content-box;
    color: var(--primary-color, #005249);
    background: rgba(0, 82, 73, 0.08);
    border-radius: 10px;
}

a.bi-data-flow__node:hover {
    border-color: rgba(0, 82, 73, 0.35);
    box-shadow: 0 10px 26px rgba(0, 82, 73, 0.14);
    transform: translateY(-3px);
}

.bi-data-flow__zone--hub {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.bi-data-flow__zone--hub::before {
    content: "";
    position: absolute;
    width: min(100%, 11rem);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(93, 242, 214, 0.14) 0%, transparent 68%);
    pointer-events: none;
}

.bi-data-flow__lanes {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.15rem;
    height: 100%;
    min-height: 200px;
    padding: 2rem 0;
    position: relative;
}

.bi-data-flow__lanes--out {
    justify-content: center;
    gap: 0;
    padding: 0;
    min-height: 0;
}

.bi-data-flow__lane {
    --bi-flow-arrow: #005249;
    display: block;
    height: 2px;
    border-radius: 0;
    background: var(--bi-flow-arrow);
    position: relative;
    overflow: visible;
    margin-right: 5px;
}

.bi-data-flow__lane::after {
    content: "";
    position: absolute;
    right: -5px;
    top: 50%;
    width: 0;
    height: 0;
    margin-top: -4px;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid var(--bi-flow-arrow);
}

.bi-data-flow__lane--single {
    height: 2px;
    margin-top: 0;
}

.bi-data-flow__hex {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
    width: 100%;
    aspect-ratio: 1 / 1.1;
    max-width: 10.25rem;
    min-height: 7.5rem;
    margin: 0 auto;
    text-align: center;
    color: #fff;
    background:
        linear-gradient(160deg, rgba(93, 242, 214, 0.12) 0%, transparent 42%),
        linear-gradient(155deg, #006b5f 0%, #003731 48%, #002420 100%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    box-shadow:
        0 16px 40px rgba(0, 55, 49, 0.32),
        0 0 0 1px rgba(93, 242, 214, 0.22) inset;
    filter: drop-shadow(0 4px 14px rgba(0, 82, 73, 0.2));
}

.bi-data-flow__hex::after {
    content: "";
    position: absolute;
    inset: 10%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    box-shadow: inset 0 0 0 1px rgba(93, 242, 214, 0.32);
    pointer-events: none;
}

.bi-data-flow__hex-title {
    position: relative;
    z-index: 1;
    font-size: clamp(0.78rem, 1.6vw, 0.92rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    padding: 0 0.65rem;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.bi-data-flow__hex-sub {
    position: relative;
    z-index: 1;
    margin-top: 0.1rem;
    font-size: clamp(0.6rem, 1.35vw, 0.7rem);
    font-weight: 600;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.88);
}

.bi-data-flow__hex-sub--accent {
    margin-top: 0.2rem;
    padding-top: 0.2rem;
    border-top: 1px solid rgba(93, 242, 214, 0.28);
    color: #5df2d6;
    font-weight: 700;
    font-size: clamp(0.62rem, 1.4vw, 0.72rem);
    letter-spacing: 0.04em;
}

.bi-data-flow__dashboard {
    position: relative;
    background: linear-gradient(165deg, #0a1014 0%, #070c11 45%, #0d151c 100%);
    border: 1px solid rgba(93, 242, 214, 0.22);
    border-radius: 16px;
    padding: 0.85rem 0.75rem 0.65rem;
    box-shadow:
        0 18px 44px rgba(0, 55, 49, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    max-width: 300px;
    margin: 0 auto;
    overflow: hidden;
}

.bi-data-flow__dash-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2aa38f, #5df2d6, #2aa38f);
}

.bi-data-flow__dash-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.bi-data-flow__dash-kpis div {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.35rem 0.25rem;
    text-align: center;
}

.bi-data-flow__dash-kpis small {
    display: block;
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9fb0b8;
}

.bi-data-flow__dash-kpis strong {
    font-size: 0.9rem;
    color: #5df2d6;
    font-weight: 700;
}

.bi-data-flow__dash-chart {
    width: 100%;
    height: auto;
    display: block;
}

.bi-data-flow__dash-badge {
    display: block;
    margin-top: 0.4rem;
    text-align: center;
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9fb0b8;
}

.bi-demo-section-kicker {
    margin: 0 0 1rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary-color, #005249);
}

.bi-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 0 0 1rem;
}

.bi-tabs button {
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    background: #fff;
    border: 1px solid rgba(0, 55, 49, 0.2);
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.bi-tabs button:hover {
    border-color: var(--primary-color, #005249);
    color: var(--primary-color, #005249);
}

.bi-tabs button[aria-selected="true"] {
    background: var(--primary-color, #003731);
    border-color: var(--primary-color, #003731);
    color: #fff;
}

.bi-demo-note {
    margin: 1rem auto 0;
    max-width: 720px;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.65;
    color: #666;
}

.bi-demo-note b {
    color: var(--primary-color, #003731);
}

@media (max-width: 860px) {
    .bi-data-flow__grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        min-height: 0;
    }

    .bi-data-flow__lanes {
        flex-direction: row;
        min-height: 0;
        padding: 0.35rem 1rem;
        gap: 0.35rem;
        justify-content: center;
        flex-wrap: wrap;
    }

    .bi-data-flow__lanes--out {
        padding: 0.25rem 1rem 0.75rem;
    }

    .bi-data-flow__lane {
        flex: 1 1 18%;
        min-width: 2.5rem;
        max-width: 4rem;
    }

    .bi-data-flow__lane--single {
        flex: 1 1 40%;
        max-width: 8rem;
    }

    .bi-data-flow__zone--from {
        order: 1;
    }

    .bi-data-flow__lanes:not(.bi-data-flow__lanes--out) {
        order: 2;
    }

    .bi-data-flow__zone--hub {
        order: 3;
    }

    .bi-data-flow__lanes--out {
        order: 4;
    }

    .bi-data-flow__zone--to {
        order: 5;
    }

    .bi-data-flow__hex {
        max-width: 8.5rem;
        min-height: 6.75rem;
    }

    .bi-data-flow__lane {
        height: 2px;
        margin-right: 0;
        margin-bottom: 6px;
        align-self: center;
    }

    .bi-data-flow__lane::after {
        right: 50%;
        top: auto;
        bottom: -5px;
        margin-top: 0;
        margin-right: -4px;
        border-top: 6px solid var(--bi-flow-arrow);
        border-right: 4px solid transparent;
        border-left: 4px solid transparent;
        border-bottom: 0;
    }
}

@media (max-width: 480px) {
    .bi-data-flow__nodes {
        grid-template-columns: 1fr;
    }

    .bi-data-flow__dash-kpis {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bi-area-card:hover,
    .bi-value-card:hover {
        transform: none;
    }
}
/* Hero: titoli e copy sempre visibili nel viewport (tutte le pagine) */

:root {
    --ig-hero-header: 4.75rem;
}

.hero {
    min-height: min(40rem, 100svh);
    max-height: none;
    padding: max(5.25rem, calc(var(--ig-hero-header) + 0.75rem)) clamp(1.25rem, 4vw, 2rem)
        clamp(1.25rem, 4.5vh, 2.75rem);
    box-sizing: border-box;
    overflow: hidden;
}

.hero-content {
    width: 100%;
    max-width: min(1000px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.hero h1 {
    font-size: var(--ig-hero-title);
    line-height: 1.15;
    margin-bottom: clamp(0.5rem, 1.5vh, 1.25rem);
    text-wrap: balance;
    overflow-wrap: break-word;
    hyphens: auto;
}

.hero-subtitle {
    font-size: var(--ig-hero-lead);
    line-height: 1.5;
    margin-bottom: clamp(0.85rem, 2.5vh, 2rem);
    text-wrap: pretty;
}

.hero-buttons {
    margin-top: clamp(0.65rem, 2vh, 1.75rem);
    gap: clamp(0.65rem, 1.5vw, 1.25rem);
}

/* Landing BI / ProTrack / gestionale */
.hero.hero--bi {
    min-height: min(40rem, 100svh);
    align-items: stretch;
    justify-content: center;
    padding-top: var(--ig-hero-header);
    padding-bottom: clamp(1rem, 3vh, 2rem);
}

.hero.hero--bi .hero-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 clamp(1.5rem, 4vw, 2rem);
    transform: translateY(-2.25vh);
}

.hero--bi-copy {
    max-width: min(34rem, 58vw);
}

.hero.hero--bi h1 {
    font-size: var(--ig-hero-title);
    max-width: 22em;
}

.hero.hero--bi .hero-subtitle {
    font-size: var(--ig-hero-lead);
    max-width: 36em;
}

.hero.hero--pt h1 {
    font-size: var(--ig-hero-title);
    max-width: 19em;
}

.hero.hero--pt .hero--bi-copy {
    max-width: min(32rem, 56vw);
}

/* Grafica hero a destra, testo a sinistra */
.hero.hero--bi .hero-image[src*="hero-v2"],
.hero.hero--bi .hero-image[src*="hero%20servizi"],
.hero.hero--bi .hero-image[src*="hero servizi"] {
    object-fit: cover;
    object-position: right center;
    transform: none !important;
}

.hero.hero--bi:hover .hero-image[src*="hero-v2"],
.hero.hero--bi:hover .hero-image[src*="hero%20servizi"],
.hero.hero--bi:hover .hero-image[src*="hero servizi"] {
    transform: none !important;
}

.hero.hero--bi .hero-overlay {
    background: linear-gradient(
        102deg,
        rgba(0, 18, 16, 0.9) 0%,
        rgba(0, 22, 20, 0.78) 36%,
        rgba(0, 35, 32, 0.42) 56%,
        rgba(0, 55, 49, 0.14) 78%,
        transparent 100%
    );
}

/* Home video / Three.js */
.hero--video {
    min-height: min(100svh, 54rem);
    max-height: 100svh;
    padding-top: max(5rem, var(--ig-hero-header));
    padding-bottom: clamp(1.25rem, 4vh, 2.5rem);
}

.hero--video .hero-content {
    max-width: min(40rem, 92vw);
}

.hero--video h1 {
    font-size: var(--ig-hero-title);
    text-wrap: balance;
}

/* Chi siamo */
.hero--ig-chi-siamo {
    min-height: min(36rem, 100svh);
    max-height: 100svh;
    overflow: hidden;
}

.hero--ig-chi-siamo .hero-content {
    padding: clamp(4.25rem, 8.5vh, 5.5rem) clamp(1.25rem, 4vw, 2rem) clamp(1rem, 3vh, 1.75rem);
}

.hero--ig-chi-siamo h1 {
    font-size: var(--ig-hero-title);
    text-wrap: balance;
    max-width: 18em;
}

.hero-ig-chi-siamo-subtitle {
    font-size: var(--ig-hero-lead);
}

/* Servizi hub */
body.servizi-page .mk-hero.sv-page-hero {
    min-height: min(34rem, 100svh);
    max-height: 100svh;
    overflow: hidden;
}

body.servizi-page .sv-page-hero__grid {
    padding: max(5rem, calc(var(--ig-hero-header) + 0.5rem)) 0 clamp(1.25rem, 3.5vh, 2.5rem);
    min-height: 0;
    align-items: center;
}

body.servizi-page .sv-page-hero__copy h1.mk-display {
    max-width: none;
    font-size: clamp(1.45rem, 3.8vw + 0.35rem, 3.35rem) !important;
    line-height: 1.12;
    text-wrap: balance;
}

body.servizi-page .sv-page-hero__copy > p {
    font-size: clamp(0.9rem, 1.4vw + 0.3rem, 1.1rem);
    max-width: 42em;
    text-wrap: pretty;
}

@media (max-height: 820px) {
    .hero {
        min-height: auto;
        padding-top: max(4.5rem, var(--ig-hero-header));
        padding-bottom: 1rem;
    }

    .hero h1 {
        font-size: var(--ig-hero-title);
    }

    .hero-subtitle {
        font-size: var(--ig-hero-lead);
        margin-bottom: 0.65rem;
    }

    .hero-buttons {
        margin-top: 0.5rem;
    }

    .hero.hero--bi .hero-content {
        padding-top: 0;
        padding-bottom: 0;
        transform: translateY(-1vh);
    }

    .hero.hero--bi h1,
    .hero.hero--pt h1 {
        font-size: var(--ig-hero-title);
    }

    body.servizi-page .sv-page-hero__grid {
        padding-top: 4.5rem;
        padding-bottom: 1rem;
    }

    body.servizi-page .sv-page-hero__copy h1.mk-display {
        font-size: clamp(1.25rem, 5vw, 1.65rem) !important;
    }
}

@media (max-width: 768px) {
    .hero--bi-copy,
    .hero.hero--pt .hero--bi-copy {
        max-width: 100%;
    }

    .hero.hero--bi h1,
    .hero.hero--pt h1 {
        max-width: none;
    }

    .hero.hero--bi .hero-image[src*="hero-v2"],
    .hero.hero--bi .hero-image[src*="hero%20servizi"],
    .hero.hero--bi .hero-image[src*="hero servizi"] {
        object-fit: cover;
        object-position: 80% center;
        opacity: 0.5;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero.hero--bi .hero-image {
        transform: none !important;
    }
}
