
/* =========================================
   STILE ICONE SVG INLINE (Sostituti FontAwesome)
   ========================================= */
.icon-svg {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentColor;
}
.wa-channel-icon.icon-svg {
    width: 3rem;
    height: 3rem;
}
.sticky-icon-btn .icon-svg {
    width: 18px;
    height: 18px;
}
.social-btn.brand .icon-svg {
    width: 1.25rem;
    height: 1.25rem;
}
.social-btn.action .icon-svg {
    width: 1.3rem;
    height: 1.3rem;
}
.social-btn.action.bg-iav .icon-svg {
    width: 1.5rem;
    height: 1.5rem;
}
#backToTopBtn .icon-svg {
    width: 1.1rem;
    height: 1.1rem;
}

/* =========================================
   BOX SUGGERIMENTI ARTICOLI (DINAMICO)
   ========================================= */
.suggested-pages-wrapper {
    margin-bottom: 35px;
    min-height: 180px; /* Riserva lo spazio per evitare CLS */
    opacity: 0; /* Lo rende invisibile all'inizio */
    pointer-events: none;
    transition: opacity 0.5s ease;
}
.suggested-pages-wrapper.loaded {
    opacity: 1; /* Appare dolcemente */
    pointer-events: auto;
}

.suggested-pages-title {
    color: var(--bav-blue, #004683);
    font-weight: 800;
    font-size: 1.3rem;
    margin-bottom: 18px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}
.suggested-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}
.suggested-card {
    background: #ffffff;
    border: 1px solid rgba(0, 70, 131, 0.1);
    border-left: 4px solid #3b5998;
    border-radius: 12px;
    padding: 18px 20px;
    text-decoration: none !important;
    color: #333333;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
}

.suggested-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 70, 131, 0.15);
    border-left-color: red; /* Il bordo sinistro diventa rosso all'hover */
}

.suggested-card h5 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    color: var(--bav-blue, #004683); /* Quando non evidenziato rimane blu originale */
    transition: color 0.3s ease; /* Rende il cambio di colore fluido */
}

/* Nuova regola: il testo diventa rosso solo quando la card è evidenziata */
.suggested-card:hover h5 {
    color: red;
}


/* =========================================
   BOX SUGGERIMENTI ARGOMENTI
   ========================================= */
.suggest-topic-wrapper {
    margin-bottom: 35px;
}
.suggest-topic-box {
    background: linear-gradient(135deg, var(--bav-blue, #004683) 0%, #002244 100%);
    border-radius: 16px;
    padding: 25px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 25px rgba(0, 70, 131, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    gap: 20px;
    position: relative;
    overflow: hidden;
}
.suggest-topic-box::before {
    content: '\f0eb'; /* Icona lampadina FontAwesome in background */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: -20px;
    top: -30px;
    font-size: 10rem;
    color: rgba(255, 255, 255, 0.03);
    pointer-events: none;
    transform: rotate(-15deg);
}
.suggest-topic-text {
    flex: 1;
    z-index: 1;
}
.suggest-topic-text h4 {
    color: #ffffff;
    font-weight: 800;
    font-size: 1.4rem;
    margin: 0 0 6px 0;
    letter-spacing: -0.5px;
}
.suggest-topic-text p {
    color: #d1e3f8;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}
.suggest-topic-btn {
    background-color: #FFD500;
    color: #002244  !important;
    font-weight: 800;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 50px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 231, 0, 0.3);
    z-index: 1;
}
.suggest-topic-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 255, 0, 0.4);
    background-color: #ffffff;
}

@media (max-width: 767px) {
    .suggest-topic-box {
        flex-direction: column;
        text-align: center;
        padding: 25px 20px;
    }
    .suggest-topic-btn {
        width: 100%;
        justify-content: center;
        font-size: 1.1rem;
    }
    .suggested-pages-title {
        font-size: 1.15rem;
    }
}

/* =========================================
   BANNER CANALE WHATSAPP (UI AVANZATA - SOLO MOBILE)
   ========================================= */
.wa-channel-banner {
    display: none; /* Nascosto su desktop */
    background: linear-gradient(145deg, #181a1f 0%, #22252a 100%);
    border: 1px solid rgba(37, 211, 102, 0.4); 
    border-radius: 16px;
    padding: 20px;
    margin: 15px auto 35px auto;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(37, 211, 102, 0.08);
    position: relative;
    overflow: hidden;
}

/* Layout Intestazione Banner */
.wa-header-row {
    display: flex; align-items: center; gap: 15px; margin-bottom: 15px;
}
.wa-channel-icon {
    filter: drop-shadow(0 0 10px rgba(37, 211, 102, 0.5));
}
.wa-channel-badge {
    display: inline-block; 
    background: rgba(37, 211, 102, 0.15); 
    color: #25D366; 
    border: 1px solid rgba(37, 211, 102, 0.3);
    font-size: 0.7rem; font-weight: 800; padding: 4px 10px;
    border-radius: 8px; margin-bottom: 6px; letter-spacing: 0.5px;
    vertical-align: middle;
}
.wa-channel-text h4 {
    color: #ffffff; font-weight: 800; font-size: 1.35rem; margin: 0; line-height: 1.2;
}
.wa-intro-text {
    color: #b0b3b8; font-size: 0.95rem; margin: 0 0 12px 0; font-weight: 500;
}
.wa-features-list {
    list-style: none; padding: 0; margin: 0 0 20px 0;
}
.wa-features-list li {
    display: flex; align-items: flex-start; gap: 12px;
    margin-bottom: 10px; color: #d1d5db; font-size: 0.95rem; line-height: 1.4;
}
.wa-features-list li span.emoji {
    font-size: 1.15rem; flex-shrink: 0; margin-top: -2px;
}
.wa-features-list li b { color: #fff; }

.wa-channel-btn {
    background-color: #25D366; color: #000 !important; font-weight: 700;
    text-decoration: none; padding: 15px 20px; border-radius: 50px;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; font-size: 1.15rem; z-index: 1; position: relative;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    transition: all 0.3s ease;
}
.wa-channel-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
    background-color: #2ce06d;
}

@media (max-width: 991px) {
    .wa-channel-banner { display: block; } 
}

/* --- STILI GENERALI FOOTER --- */
.footer-top-bar {
    background-color: var(--bav-blue, #004683);
    padding: 10px 0; 
    color: #ffffff;
    font-size: 1.1rem;
    border-top: 1px solid #fff; 
}

.footer-bottom-bar {
    background-color: #1a1a1a; 
    color: #cccccc;
    padding: 40px 0 60px 0;
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
}

/* --- NAVIGAZIONE --- */
.footer-top-link {
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 400; 
    margin: 0 6px;
    display: inline-block;
    transition: all 0.2s ease;
}
.footer-top-link:hover { color: #FFD500 !important; transform: scale(1.05); }
.footer-divider { color: rgba(255, 255, 255, 0.6); font-weight: 300; }

/* --- LEGALI --- */
.footer-bottom-link {
    color: #cccccc !important;
    text-decoration: none;
    margin: 0 6px;
    font-weight: 600;
    transition: color 0.2s;
}
.footer-bottom-link:hover { color: #FFD500 !important; text-decoration: underline !important; }

/* =========================================
   STILI ICONE SOCIAL
   ========================================= */
.social-btn {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; text-decoration: none !important;
    transition: transform 0.2s, filter 0.2s; 
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    cursor: pointer; border: none; outline: none;
    color: #fff !important; 
}
.social-btn:hover { transform: translateY(-3px); filter: brightness(1.1); box-shadow: 0 5px 12px rgba(0,0,0,0.3); }
.social-btn:active { transform: scale(0.95); }

/* --- COLORI UFFICIALI --- */
.bg-iav       { background-color: #FFD500; color: #002244 !important; border: 2px solid #004683; }
.bg-whatsapp  { background-color: #25D366; }
.bg-facebook  { background-color: #1877F2; }
.bg-telegram  { background-color: #0088cc; }
.bg-linkedin  { background-color: #0077b5; }
.bg-copy      { background-color: #555555; }
.bg-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.bg-tiktok    { background-color: #000000; }
.bg-youtube   { background-color: #FF0000; }

.share-area-desktop {
    background-color: rgba(255,255,255,0.05); 
    padding: 25px 15px; border-radius: 12px; margin-bottom: 35px; 
    border: 1px solid rgba(255,255,255,0.1); max-width: 850px; 
    margin-left: auto; margin-right: auto;
}

.icons-wrapper { 
    display: flex; justify-content: center; align-items: center;
    flex-wrap: nowrap; gap: 12px; padding-top: 12px; padding-bottom: 25px; 
    overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%;
}
.icons-wrapper::-webkit-scrollbar { display: none; }
.icons-wrapper { -ms-overflow-style: none; scrollbar-width: none; }
@media (min-width: 992px) { .icons-wrapper { overflow-x: visible; } }
.social-btn { flex-shrink: 0; }
.social-btn.action { width: 44px; height: 44px; font-size: 1.3rem; }
.social-btn.action.bg-iav { width: 50px; height: 50px; font-size: 1.5rem; }

.share-area-desktop .social-btn.action {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    transition: all 0.3s ease;
}
.share-area-desktop .social-btn.action.bg-whatsapp:hover { background-color: #25D366 !important; border-color: #25D366 !important; }
.share-area-desktop .social-btn.action.bg-telegram:hover { background-color: #0088cc !important; border-color: #0088cc !important; }
.share-area-desktop .social-btn.action.bg-facebook:hover { background-color: #1877F2 !important; border-color: #1877F2 !important; }
.share-area-desktop .social-btn.action.bg-copy:hover     { background-color: #555555 !important; border-color: #555555 !important; }
.share-area-desktop .social-btn.action.bg-iav:hover      { background-color: #FFD500 !important; color: #002244 !important; border-color: #FFD500 !important; }

.social-btn.brand {
    color: #ffffff !important; width: 44px; height: 44px; font-size: 1.25rem; border: none;
}
.social-btn.brand.whatsapp { background-color: #25D366; }
.social-btn.brand.facebook { background-color: #1877F2; }
.social-btn.brand.telegram { background-color: #0088cc; }
.social-btn.brand.instagram{ background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.social-btn.brand.tiktok   { background-color: #000000; }
.social-btn.brand.youtube  { background-color: #FF0000; }
.social-btn.brand.linkedin { background-color: #0077b5; }
.social-btn.brand:hover { transform: translateY(-6px) scale(1.1); filter: brightness(1.15); box-shadow: 0 10px 20px rgba(0,0,0,0.5); }

/* =========================================
   BARRA FISSA MOBILE & SHARING FIX CLS
   ========================================= */

/* 1. Blocca istantaneamente l'area desktop su mobile per evitare "flash" di rendering */
@media (max-width: 991px) {
    .share-area-desktop {
        display: none !important;
    }
    
    /* MODIFICA: Rimosso il padding da html/body per evitare la fascia bianca */
    /* Lo spazio viene ora gestito all'interno della barra scura del footer */
    .footer-bottom-bar {
        padding-bottom: 125px !important; /* 60px originali + lo spazio per la barra fissa */
    }
    
    #backToTopBtn { 
        bottom: 90px !important; 
        right: 15px !important; 
    }
}

#sticky-footer-container {
    position: fixed; 
    bottom: 0; left: 0; width: 100%;
    /* Altezza fissa matematica (10px top + 42px btn + 15px bottom) = 67px. Evita ricalcoli */
    height: 67px; 
    background: rgba(255, 255, 255, 0.98); 
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 10000; 
    padding: 10px 4px 15px 4px; 
    border-top: 3px solid var(--bav-blue, #004683);
    display: flex; justify-content: space-evenly; align-items: center; flex-wrap: nowrap; gap: 0;
    /* Evita che il contenuto influenzi il layout esterno */
    contain: layout size; 
}


.sticky-icon-btn {
    flex: 0 0 auto; 
    width: 42px; height: 42px; 
    border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    color: #fff !important;
    
    /* RESET PER IL TAG <BUTTON> */
    border: none; 
    outline: none; 
    padding: 0; 
    
    box-shadow: 0 3px 8px rgba(0,0,0,0.15); 
    text-decoration: none !important; 
    cursor: pointer;
    /* Forza la dimensione per non farla dipendere dal font interno (FIX CLS) */
    contain: strict; 
}

/* Fissa la dimensione delle icone prima che venga scaricata la libreria */
.sticky-icon-btn .icon-svg {
    display: block;
    width: 18px;
    height: 18px;
}

.bg-share { background-color: #333333; }

.sticky-label {
    position: absolute; 
    top: -22px; left: 50%; 
    transform: translateX(-50%);
    /* Altezza e larghezza fisse per evitare shift al rendering del testo */
    height: 22px;
    line-height: 16px;
    background: #004683; color: #fff; font-size: 0.68rem; padding: 3px 15px;
    border-radius: 12px 12px 0 0; font-weight: 700; text-transform: uppercase; 
    letter-spacing: 0.5px; white-space: nowrap; box-shadow: 0 -2px 5px rgba(0,0,0,0.1); 
}

@media (max-width: 360px) {
    .sticky-icon-btn { width: 38px; height: 38px; }
}

@media (min-width: 992px) {
    #sticky-footer-container { display: none !important; }
    .social-btn.brand { width: 40px !important; height: 40px !important; }
}

/* --- TOAST & BACK TO TOP --- */
#snackbar {
  visibility: hidden; min-width: 250px; background-color: #333; color: #fff; text-align: center;
  border-radius: 50px; padding: 12px; position: fixed; z-index: 10001;
  left: 50%; bottom: 90px; transform: translateX(-50%); font-size: 14px; box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
#snackbar.show { visibility: visible; animation: fadein 0.5s, fadeout 0.5s 4s; }
@keyframes fadein { from {bottom: 0; opacity: 0;} to {bottom: 90px; opacity: 1;} }
@keyframes fadeout { from {bottom: 90px; opacity: 1;} to {bottom: 0; opacity: 0;} }

#backToTopBtn {
    display: none; position: fixed; bottom: 30px; right: 20px; z-index: 9990;
    border: none; outline: none; background-color: var(--bav-blue, #004683); color: white;
    width: 45px; height: 45px; border-radius: 50%; padding:0; line-height:0;
    align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,0.3); cursor: pointer;
}

@media (max-width: 767px) {
    .social-btn.brand { width: 36px !important; height: 36px !important; font-size: 1.05rem !important; margin: 0 1px; }
    .community-area .community-label { font-size: 0.95rem !important; }
}

