/* ============================================================
   FIX RADICALE PER INDEX.HTML - RISOLUZIONE DEFINITIVA
============================================================ */

/* SOLO PER MOBILE - INDEX.HTML */
@media (max-width: 768px) {
    /* RESET E FORZA STILI */
    .home-hero {
        min-height: 180px !important;
        height: 35vh !important;
        max-height: 220px !important;
        padding: 20px 0 15px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
        position: relative !important;
        margin: 0 !important;
    }
    
    /* Assicurati che il contenuto stia dentro l'hero */
    .home-hero .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 15px !important;
        position: relative !important;
        z-index: 2 !important;
    }
    
    /* Titolo molto compatto */
    .home-hero h1 {
        font-size: 1.4rem !important;
        line-height: 1.2 !important;
        margin-bottom: 8px !important;
        padding: 0 !important;
        text-align: center !important;
    }
    
    /* Paragrafo - CORREZIONE: sistema i puntini di sospensione per 2 righe */
    .home-hero p {
        font-size: 0.85rem !important;
        line-height: 1.2 !important;
        margin-bottom: 10px !important;
        max-height: 2.8em !important; /* Altezza per 2 righe (1.4em x 2) */
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2 !important; /* Limita a 2 righe */
        display: -moz-box !important;
        -moz-box-orient: vertical !important;
        -moz-line-clamp: 2 !important;
        display: box !important;
        box-orient: vertical !important;
        line-clamp: 2 !important;
        padding: 0 !important;
    }
    
    /* Container CTA compatto */
    .hero-cta {
        margin-top: 12px !important;
        gap: 8px !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    /* Pulsanti compatti */
    .hero-cta .btn {
        padding: 10px 12px !important;
        font-size: 0.85rem !important;
        min-height: 40px !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Spazio minimo sotto l'hero */
    .home-hero + .section {
        margin-top: 0 !important;
        padding-top: 20px !important;
    }
}

/* PER SCHERMI MOLTO PICCOLI (< 400px) */
@media (max-width: 400px) {
    .home-hero {
        min-height: 150px !important;
        height: 30vh !important;
        max-height: 180px !important;
        padding: 15px 0 10px !important;
    }
    
    .home-hero h1 {
        font-size: 1.2rem !important;
        margin-bottom: 5px !important;
    }
    
    /* TESTO PIÙ COMPATTO - SENZA PUNTINI DI SOSPENSIONE */
    .home-hero p {
        font-size: 0.8rem !important;
        line-height: 1.1 !important;
        margin-bottom: 8px !important;
        max-height: 2.2em !important;
        overflow: hidden !important;
        /* Soluzione alternativa senza -webkit-line-clamp */
        display: block !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important; /* Su una sola riga */
    }
    
    .hero-cta {
        margin-top: 10px !important;
        gap: 6px !important;
    }
    
    .hero-cta .btn {
        padding: 8px 10px !important;
        font-size: 0.8rem !important;
        min-height: 36px !important;
    }
    
    /* SEZIONE SERVIZI PIÙ VICINA */
    .section-light {
        padding-top: 15px !important;
        margin-top: 0 !important;
    }
}

/* ============================================================
   VERSIONE ALTERNATIVA: IMMAGINE DI SFONDO COMPATTA
============================================================ */
@media (max-width: 768px) {
    .home-hero {
        background: 
            linear-gradient(135deg, rgba(10,26,47,0.85), rgba(12,52,98,0.85)),
            url('../img/hero.jpg') center 30% / cover no-repeat !important;
    }
}

/* ============================================================
   CORREZIONE PER IPHONE/SAMSUMG (ALTEZZE SPECIFICHE)
============================================================ */
/* iPhone 5/SE e schermi molto alti e stretti */
@media (max-width: 320px) and (max-height: 570px) {
    .home-hero {
        min-height: 120px !important;
        height: 25vh !important;
        padding: 10px 0 8px !important;
    }
    
    .home-hero h1 {
        font-size: 1.1rem !important;
        margin-bottom: 4px !important;
    }
    
    /* NASCONDI COMPLETAMENTE IL TESTO SU SCHERMI PICCOLISSIMI */
    .home-hero p {
        display: none !important;
    }
    
    .hero-cta .btn {
        padding: 6px 8px !important;
        font-size: 0.75rem !important;
        min-height: 32px !important;
    }
    
    .hero-cta .btn i {
        font-size: 0.8rem !important;
    }
}

/* Schermi landscape (orizzontali) */
@media (max-width: 768px) and (orientation: landscape) {
    .home-hero {
        min-height: 120px !important;
        height: 40vh !important;
        padding: 15px 0 10px !important;
    }
    
    .hero-cta {
        flex-direction: row !important;
        gap: 10px !important;
    }
    
    .hero-cta .btn {
        width: auto !important;
        flex: 1 !important;
    }
}

/* ============================================================
   SOLUZIONE ALTERNATIVA SENZA -WEBKIT-LINE-CLAMP
   (usa questa se il codice sopra dà ancora problemi)
============================================================ */

/* Aggiungi questa classe alternativa al paragrafo se vuoi evitare -webkit-line-clamp */
.hero-text-truncate {
    display: block !important;
    max-height: 2.8em !important;
    line-height: 1.4em !important;
    overflow: hidden !important;
    position: relative !important;
}

.hero-text-truncate::after {
    content: '...';
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
    padding-left: 5px !important;
    background: linear-gradient(to right, transparent, rgba(10,26,47,0.85) 30%) !important;
}

/* Versione senza effetti speciali - solo taglio pulito */
.hero-text-simple {
    display: block !important;
    max-height: 2.8em !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    /* Forza una sola riga per evitare problemi */
    white-space: nowrap !important;
}