/**
 * Stili specifici per la pagina Home
 * 
 * @package Martina
 */

/* Layout sezioni */
.page-home .home-section {
    padding: clamp(56px, 8vw, 110px) 0;
    background-color: transparent; /* gestito dal tema (body) */
}

/* Sezione "Cosa posso fare per te" */
.page-home .home-section-inner {
    max-width: 980px;
    margin: 0 auto;
}

.page-home .presentation-section .home-section-inner {
    max-width: 1120px;
}

/* Sezione servizi: 3 card (era 4, Consulenza Express disattivata) */
.page-home .services-section .home-section-inner {
    max-width: 1280px;
}

.page-home .home-section-title {
    font-size: clamp(28px, 3.8vw, 44px);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    color: var(--theme-text);
    transition: color 600ms ease;
    text-align: center;
}

/* Titoli centrati nella sezione servizi */
.page-home .services-section .home-section-title,
.page-home .services-section .home-section-subtitle {
    text-align: center;
}

/* Titolo centrato anche per Prima & Dopo */
.page-home .before-after-section .home-section-title {
    text-align: center;
}

/* Subtitle (usato nella sezione servizi) */
.page-home .home-section-subtitle {
    margin: 0 0 28px;
    color: var(--theme-muted);
    text-align: center;
    font-size: clamp(15px, 1.3vw, 17px);
    line-height: 1.7;
}

/* Hero (presentazione) */
.page-home .home-hero {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: clamp(24px, 4vw, 56px);
    align-items: center;
}

.page-home .home-hero__copy {
    text-align: center;
}

.page-home .home-hero__title {
    font-size: clamp(28px, 4vw, 46px); /* ridotto: era 34px, 5vw, 58px */
    line-height: 1.02;
    letter-spacing: -0.03em;
    margin: 0 0 16px;
    color: var(--theme-text);
}

/* Sottotitolo hero: dimensione a metà tra titolo e lead */
.page-home .home-hero__subtitle {
    font-size: clamp(20px, 2.5vw, 30px);
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin: 0 0 14px;
    color: var(--theme-text);
    font-weight: 500;
}

.page-home .home-hero__lead {
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.65;
    color: var(--theme-muted);
    margin: 0 0 22px;
}

.page-home .home-hero__cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Bottoni (scope minimo, senza framework) */
.page-home .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.15rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    line-height: 1;
    transition: transform 220ms ease, background-color 220ms ease, border-color 220ms ease, color 220ms ease;
    will-change: transform;
}

.page-home .btn:active {
    transform: translateY(1px);
}

.page-home .btn--primary {
    background-color: var(--color-primary);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.page-home .btn--primary:hover {
    background-color: var(--color-primary-dark);
}

.page-home .btn--ghost {
    background-color: transparent;
    color: var(--theme-text);
    border: 1px solid var(--theme-border);
}

.page-home .btn--ghost:hover {
    background-color: rgba(var(--color-primary-rgb), 0.18);
    border-color: var(--color-border);
}

.page-home .home-hero__image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    background: var(--color-gray-100);
}

.page-home .home-hero__image--placeholder {
    aspect-ratio: 4 / 5;
    background:
        radial-gradient(1200px 600px at 20% 10%, rgba(var(--color-primary-rgb), 0.45), transparent 60%),
        linear-gradient(180deg, var(--color-gray-100), var(--color-gray-50));
}

/* Calendly in hero home */
.page-home .home-hero__calendly {
    min-height: 400px;
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.page-home .home-calendly-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--color-gray-100), var(--color-gray-50));
    color: var(--theme-muted);
    font-size: 0.9375rem;
}

.page-home .home-hero__calendly .calendly-inline-widget {
    min-height: 600px;
    border-radius: 18px;
}

@media (max-width: 900px) {
    .page-home .home-hero__calendly {
        min-height: 320px;
    }
    .page-home .home-hero__calendly .calendly-inline-widget {
        min-height: 500px;
    }
}

/* ============================
   Servizi (3 card, testo in evidenza)
   Desktop: 3 colonne
   Mobile: carousel con peek
   ============================ */
.page-home .services-carousel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

@media (max-width: 1100px) and (min-width: 901px) {
    .page-home .services-carousel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }
}

.page-home .service-card {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--shadow-md);
    min-height: 320px;
    isolation: isolate;
    cursor: pointer;
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 320ms ease;
}

.page-home .service-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.page-home .service-card__media {
    position: absolute;
    inset: 0;
    background: var(--service-bg, linear-gradient(180deg, #fff, rgba(246,207,221,0.2)));
    transform: scale(1.02);
    transition: transform 320ms ease;
    opacity: 0.5;
}

.page-home .service-card:hover .service-card__media {
    opacity: 0.65;
}

/* Contenuto sempre in evidenza (titolo + testo + link) */
.page-home .service-card__content {
    position: relative;
    z-index: 2;
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 320px;
    justify-content: flex-end;
}

.page-home .service-card__title {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
}

.page-home .service-card__text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    max-width: 46ch;
    color: var(--color-text-primary);
}

.page-home .service-card__link {
    color: var(--color-link-active);
    font-weight: 700;
    text-decoration: none;
    margin-top: 4px;
}

.page-home .service-card__link:hover {
    text-decoration: underline;
}

/* Mobile carousel */
@media (max-width: 900px) {
    /* Evita scrollbar orizzontale dovuta ai “peek” */
    .page-home .services-section {
        overflow-x: clip;
    }

    .page-home .services-carousel {
        display: flex;
        gap: 14px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 10px 12vw 18px;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        padding-left: 12vw;
        padding-right: 12vw;
        overscroll-behavior-x: contain;
    }

    .page-home .services-carousel::-webkit-scrollbar {
        display: none;
    }

    .page-home .service-card {
        flex: 0 0 78vw;
        scroll-snap-align: center;
        min-height: 340px;
        transform: scale(0.92);
        opacity: 0.62;
        transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), opacity 420ms ease, box-shadow 420ms ease;
    }

    .page-home .service-card.is-centered {
        transform: scale(1);
        opacity: 1;
        box-shadow: var(--shadow-lg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-home .service-card,
    .page-home .service-card__media {
        transition: none;
    }
}

/* Reveal (fade morbido) */
.page-home .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 800ms ease, transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.page-home .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Accessibilità: riduci animazioni se richiesto */
@media (prefers-reduced-motion: reduce) {
    .page-home .reveal,
    .page-home .home-section-title {
        transition: none;
        transform: none;
        opacity: 1;
    }
}

@media (max-width: 900px) {
    .page-home .home-hero {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    /* In mobile: testo prima (ordine naturale del DOM), immagine dopo */
    .page-home .home-hero__copy {
        order: 1;
    }
    .page-home .home-hero__media {
        order: 2;
    }
}
