/************************************************************
1. REGOLE GENERALI & VARIABILI
************************************************************/
:root {
    --primary-color: #18233a;       /* Blu Notte Accademia */
    --accent-color: #d4b06a;        /* Oro Istituzionale standard */
    --accent-hover: #e5c17e;        /* Oro Caldo Luminoso per Hover */
    --text-dark: #2c3e50;
    --bg-light: #f4f6f9;
}

/************************************************************
2. STRUTTURA HERO PREMIUM (MASSIMA ALTEZZA SPINTA A 900PX)
************************************************************/
.hero-formazione {
    background-image: url('../images/bg-formazione.jpg') !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    position: relative !important;
    min-height: 900px !important; 
    display: flex !important;
    align-items: center !important; 
    justify-content: center !important;
    padding: 100px 0 !important;
    box-sizing: border-box !important;
}

.hero-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(8, 14, 26, 0.55) !important; 
    z-index: 1 !important;
}

.hero-content {
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
}

.hero-mini-title {
    color: var(--accent-color) !important;
    letter-spacing: 2px !important;
    font-weight: 600 !important;
    display: inline-block !important;
    margin-bottom: 20px !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

.hero-title {
    color: var(--accent-color) !important;
    font-size: 56px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    margin-top: 0 !important;
    margin-bottom: 25px !important;
    line-height: 1.2 !important;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.5) !important;
}

.hero-subtitle {
    color: #f4f6f9 !important; 
    max-width: 850px !important;
    margin: 0 auto 60px auto !important; 
    font-size: 16px !important;
    line-height: 1.7 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* Allineamento orizzontale dei 3 blocchi della testata */
.hero-boxes {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    gap: 25px !important;
    max-width: 1100px !important;
    margin: 0 auto 55px auto !important; 
}

/* I 3 Box leggeri "effetto vetro" nell'Hero */
.hero-box {
    flex: 1 !important;
    background: rgba(16, 26, 48, 0.35) !important; 
    backdrop-filter: blur(6px) !important; 
    border: 1px solid rgba(212, 176, 106, 0.3) !important;
    padding: 30px 20px !important;
    border-radius: 8px !important;
    text-align: center !important;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.hero-box:hover {
    background: rgba(24, 35, 58, 0.6) !important;
    border-color: var(--accent-hover) !important;
    transform: translateY(-4px) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3) !important;
}

/* FIX GERARCHIA SEO: Forza il nuovo tag H2 dei box alti ad essere piccolo, elegante e simmetrico */
.hero-box h2 {
    font-family: sans-serif !important;
    color: #ffffff !important; 
    font-size: 15px !important; 
    font-weight: 700 !important;
    text-transform: uppercase !important;
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    letter-spacing: 0.8px !important;
    line-height: 1.3 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
    transition: color 0.3s ease, text-shadow 0.3s ease !important;
}

/* Gestisce l'effetto oro al passaggio del mouse sul nuovo tag H2 */
.hero-box:hover h2 {
    color: var(--accent-hover) !important;
    text-shadow: 0 2px 5px rgba(229, 193, 126, 0.3) !important;
}

.hero-box p {
    color: #e2e8f0 !important; 
    font-size: 13px !important;
    line-height: 1.4 !important;
    margin: 0 !important;
}

.breadcrumb-custom a {
    color: var(--accent-color) !important;
    opacity: 0.8 !important;
    text-decoration: none !important;
}
.breadcrumb-custom li {
    color: var(--accent-color) !important;
}

/************************************************************
3. SEZIONE INFERIORE: GRIGLIA E CARD DEI CORSI (POSTER IMPATTO MAX)
************************************************************/
.range {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 30px !important;
    justify-content: center !important;
}
.range::before, .range::after { display: none !important; }

.cell-sm-6.cell-md-4 {
    float: none !important;
    display: flex !important;
    width: calc(33.333% - 20px) !important;
    max-width: 100% !important;
    flex: 0 1 calc(33.333% - 20px) !important;
    margin-top: 20px !important;
}

/* Stile Card dei Corsi */
.post-news-wide {
    background: #ffffff !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s ease !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    text-align: left !important;
}

.post-news-wide:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 16px 32px rgba(24, 35, 58, 0.15) !important;
}

/* Immagini giganti regolate a 440px per vederle benissimo */
.post-news-wide img {
    height: 440px !important; 
    width: 100% !important;
    object-fit: cover !important; 
    object-position: center center !important; 
}

.post-news-wide div[style*="height:220px"],
.post-news-wide div[style*="height:280px"],
.post-news-wide div[style*="height:360px"] {
    height: 440px !important;
}

.post-news-body {
    padding: 25px !important;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    background: #ffffff !important;
}

/* TITOLO DEI CORSI IN BASSO: Blu istituzionale scolpito -> Diventa Oro all'hover */
.post-news-body h3 {
    font-family: 'Merriweather', serif !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    margin: 0 0 14px 0 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.post-news-body h3 a {
    color: var(--primary-color) !important; 
    text-decoration: none !important;
    text-shadow: 0.5px 0.5px 1px rgba(24, 35, 58, 0.15) !important; 
    transition: color 0.3s ease !important;
}

.post-news-wide:hover .post-news-body h3 a,
.post-news-body h3 a:hover {
    color: var(--accent-hover) !important; 
    text-shadow: none !important;
}

.desc-corso-anteprima {
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: #555555 !important;
    margin-bottom: 25px !important;
    flex-grow: 1 !important;
}

.post-news-meta-custom {
    display: flex !important;
    align-items: center !important;
    border-top: 1px solid #f0f2f5 !important;
    padding-top: 15px !important;
    margin-top: auto !important;
    margin-bottom: 15px !important;
    font-size: 13px !important;
    color: #666666 !important;
}

/* Pulsante dei Corsi */
.btn-scheda-accademia {
    display: block !important;
    width: 100% !important;
    padding: 13px 20px !important;
    background: var(--primary-color) !important;
    color: #ffffff !important;
    text-align: center !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    box-shadow: 0 2px 4px rgba(24, 35, 58, 0.1) !important;
}

.btn-scheda-accademia:hover {
    background: var(--accent-hover) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 8px rgba(212, 176, 106, 0.2) !important;
}

/* Contenitore Introduzione SEO */
.seo-wrapper {
    background: #ffffff !important;
    padding: 45px !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 25px rgba(0,0,0,0.03) !important;
    border: 1px solid rgba(0,0,0,0.02) !important;
    text-align: left !important;
}

.seo-wrapper h2, .titolo-sezione-corsi {
    font-family: 'Merriweather', serif !important;
    color: var(--primary-color) !important;
    font-weight: 700 !important;
}

.seo-divider {
    height: 3px !important;
    width: 60px !important;
    background: var(--accent-color) !important;
    margin: 15px auto 30px auto !important;
}

/************************************************************
4. MOBILE & RESPONSIVE NATIVO (CON AUTO-COLLASSAMENTO)
************************************************************/
@media(max-width:991px){

    .page-header,
    .rd-navbar,
    .rd-navbar-wrap {
        background:#ffffff !important;
    }

    .rd-navbar-panel {
        min-height:72px !important;
        padding:10px 15px !important;
        display:flex !important;
        align-items:center !important;
        justify-content:space-between !important;
        box-shadow:0 3px 18px rgba(0,0,0,0.08);
    }

    .rd-navbar-brand { max-width:75% !important; overflow:hidden; }
    .rd-navbar-brand img { max-height:48px !important; width:auto !important; }
    
    .rd-navbar-brand .brand-name,
    .rd-navbar-brand .brand-name a {
        font-size:22px !important;
        line-height:1.1 !important;
        color:#1b1b1b !important;
    }

    .rd-navbar-brand .brand-slogan { display:none !important; }

    .rd-navbar-toggle {
        display:flex !important;
        align-items:center !important;
        justify-content:center !important;
        width:48px !important;
        height:48px !important;
        background:#18233a !important;
        border-radius:10px !important;
    }

    .rd-navbar-toggle span,
    .rd-navbar-toggle span:before,
    .rd-navbar-toggle span:after { background:#ffffff !important; }

    .rd-navbar-nav { background:#101827 !important; padding:20px 0 !important; }
    .rd-navbar-nav li { border-bottom:1px solid rgba(255,255,255,0.05); }
    .rd-navbar-nav li a { color:#ffffff !important; font-size:18px !important; padding:16px 24px !important; font-weight:500 !important; }
    .rd-navbar-nav li a:hover { background:#18233a !important; color:#d4b06a !important; }
    .rd-navbar-dropdown { background:#152033 !important; }

    .hero-formazione {
        min-height: auto !important;
        padding: 120px 20px 60px 20px !important;
    }
    
    .hero-title {
        font-size: 38px !important;
        white-space: normal !important;
    }

    .hero-boxes {
        flex-direction: column !important;
        gap: 15px !important;
    }

    /* Adattamento H2 dei Box alti su smartphone */
    .hero-box h2 {
        font-size: 14px !important;
        margin-top: 5px !important;
    }

    .cell-sm-6.cell-md-4 {
        width: calc(50% - 15px) !important;
        flex: 0 1 calc(50% - 15px) !important;
    }
}

@media(max-width:767px) {
    .cell-sm-6.cell-md-4 {
        width: 100% !important;
        flex: 0 1 100% !important;
    }
}

@media(max-width:600px){
    .rd-navbar-panel { min-height:64px !important; padding:8px 12px !important; }
    .rd-navbar-brand img { max-height:40px !important; }
    .rd-navbar-brand .brand-name, .rd-navbar-brand .brand-name a { font-size:18px !important; }
    
    .hero-formazione { padding:100px 15px 40px 15px !important; }
    .hero-title { font-size:26px !important; }
    .hero-subtitle { font-size:14px !important; }
    
    .post-news-body h3 {
        font-size: 17px !important;
    }
    
    .seo-wrapper h2 { font-size:24px !important; }
    .seo-wrapper p { font-size:15px !important; line-height:1.7 !important; }
    .hero-box { padding:18px !important; }
}