/*
 * hsd-scroll-effect.css
 * Hector Solis Digital — Sezione "Digitalizzazione"
 * UNA sola computadora: centrada en A, viaja a la izquierda en B
 * -------------------------------------------------------
 * NON modificare hsd-theme.css né custom.css
 */

/* ============================================================
   SEZIONE A — Computer centrada + 4 testi angoli
   ============================================================ */

.hsd-digital-a {
    position: relative;
    background-color: var(--hsd-white);
    overflow: hidden;
    padding: 70px 0 80px;
}

/* Grid 3 colonne: testo | computer | testo */
.hsd-digital-grid {
    display: grid;
    grid-template-columns: 1fr 240px 1fr;
    grid-template-rows: 1fr 1fr;
    align-items: center;
    gap: 32px 24px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 380px;
}

/* Testi angoli */
.hsd-corner-text {
    font-family: var(--hsd-font);
    font-size: 0.92rem;
    font-weight: 400;
    line-height: 1.55;
    color: var(--hsd-text);
    max-width: 210px;
}

.hsd-corner-text strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--hsd-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.hsd-corner-tl { grid-column: 1; grid-row: 1; text-align: right; justify-self: end;   }
.hsd-corner-tr { grid-column: 3; grid-row: 1; text-align: left;  justify-self: start; }
.hsd-corner-bl { grid-column: 1; grid-row: 2; text-align: right; justify-self: end;   }
.hsd-corner-br { grid-column: 3; grid-row: 2; text-align: left;  justify-self: start; }

/* Computer: occupa entrambe le righe al centro */
.hsd-computer-wrap {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   IL COMPUTER / IMMAGINE — dimensioni gestite dal JS durante il volo
   ============================================================ */

.hsd-computer {
    width: 220px;
    height: 158px;
    border-radius: 12px;
    object-fit: cover;
    display: block;
    box-shadow: 0 8px 32px rgba(31, 95, 175, 0.13);
    margin-bottom: 28px;
    flex-shrink: 0;
    /* Fallback colore se immagine non caricata */
    background: #E2E8F0;
}

/* ============================================================
   SEZIONE B — Computer viaggia qui da secA (JS lo sposta)
   ============================================================ */

.hsd-digital-b {
    background-color: var(--hsd-bg-alt);
    padding: 80px 0 100px;
    overflow: visible; /* non hidden — il computer arriva da fuori */
}

.hsd-digital-b .container > .row {
    align-items: center;
    min-height: 320px;
}

/* Contenitore che riceve il computer — inizia vuoto, visibile */
.hsd-computer-col {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 220px;
}

/* Testo: inizia nascosto, appare dopo che il computer atterra */
.hsd-text-col {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s ease 0.3s, transform 0.7s ease 0.3s;
}

.hsd-text-col.hsd-animate {
    opacity: 1;
    transform: translateX(0);
}

/* Computer in B — un po' più grande */
.hsd-computer-b {
    width: 260px;
    height: 185px;
    background: #E2E8F0;
    border-radius: 14px;
    border: 3px solid #CBD5E1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 40px rgba(31, 95, 175, 0.15);
    margin-bottom: 28px;
}

.hsd-computer-b::after {
    content: '';
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 65px;
    height: 16px;
    background: #CBD5E1;
    border-radius: 0 0 4px 4px;
}

.hsd-computer-b::before {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 8px;
    background: #B0BEC5;
    border-radius: 4px;
}

.hsd-computer-b-screen {
    width: 212px;
    height: 142px;
    background: linear-gradient(135deg, #DBEAFE 0%, #EFF6FF 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
}

.hsd-computer-b-screen i {
    font-size: 2.8rem;
    color: var(--hsd-blue);
    opacity: 0.75;
}

.hsd-computer-b-screen span {
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--hsd-blue);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.6;
}

/* --- Testo in B: parte FUORI SCHERMO a sinistra, appare dopo computer --- */
.hsd-text-col {
    /* Stato iniziale: nascosto a destra */
    transform: translateX(60px);
    opacity: 0;
    transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.45s,
                opacity   0.85s ease 0.45s;
    /* delay: aspetta che il computer arrivi */
}

.hsd-text-col.hsd-animate {
    transform: translateX(0);
    opacity: 1;
}

/* Testo grande */
.hsd-cta-big {
    font-family: var(--hsd-font);
    font-size: clamp(2rem, 5vw, 3.6rem);
    font-weight: 800;
    line-height: 1.12;
    color: var(--hsd-text);
    text-transform: uppercase;
}

.hsd-cta-big span {
    color: var(--hsd-blue);
}

.hsd-cta-sub {
    font-size: 1rem;
    font-weight: 400;
    color: var(--hsd-text);
    margin-top: 1rem;
    line-height: 1.75;
}

/* ============================================================
   RESPONSIVE MOBILE (< 768px)
   ============================================================ */
@media (max-width: 767px) {

    /* Sezione A: una colonna */
    .hsd-digital-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 20px;
        min-height: unset;
    }

    .hsd-corner-tl,
    .hsd-corner-tr,
    .hsd-corner-bl,
    .hsd-corner-br {
        grid-column: 1;
        grid-row: auto;
        text-align: center;
        justify-self: center;
        max-width: 100%;
    }

    .hsd-computer-wrap {
        grid-column: 1;
        grid-row: auto;
        order: -1;
    }

    .hsd-computer {
        width: 170px;
        height: 122px;
    }

    .hsd-computer-screen {
        width: 136px;
        height: 90px;
    }

    /* Sezione B mobile: entra dall'alto */
    .hsd-computer-col {
        min-height: 180px;
    }

    .hsd-text-col {
        transform: translateY(30px);
        transition: opacity 0.7s ease 0.3s, transform 0.7s ease 0.3s;
    }

    .hsd-text-col.hsd-animate {
        transform: translateY(0);
        opacity: 1;
    }

    .hsd-cta-big {
        text-align: center;
        font-size: clamp(1.8rem, 8vw, 2.6rem);
    }

    .hsd-cta-sub {
        text-align: center;
    }

    .hsd-computer-b {
        width: 200px;
        height: 144px;
        margin-bottom: 40px;
    }

    .hsd-computer-b-screen {
        width: 164px;
        height: 110px;
    }
}