/* Stile per l'articolo */
.article-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: 8px;
}

/* Stile per l'Indice nella Sidebar */
.toc-link {
    display: block;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 2px solid transparent;
    padding: 10px;
    transition: all 0.2s;
    /* text-align: justify; */
}

.toc-link:hover,
.toc-link.active {
    color: #0d6efd;
    /* Colore Primary */
    border-left-color: #0d6efd;
}

/* Box Pubblicità (Placeholder grigio finché non hai AdSense) */
/* .ad-slot {
    background-color: #f8f9fa;
    border: 1px dashed #ccc;
    text-align: center;
    padding: 20px;
    margin: 2rem 0;
    color: #999;
    font-size: 0.8rem;
    min-height: 250px; 
    display: flex;
    align-items: center;
    justify-content: center;
} */

article p,
article li,
article blockquote,
article h1,
article h2,
article h3 {
    text-align: justify;
    line-height: 2;
}

/* Stile Card Navigazione */
.nav-card {
    display: block;
    height: 100%;
    padding: 1.5rem;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    /* Angoli più morbidi */
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    /* Ombra leggerissima iniziale */
}

/* Effetto Hover (Si alza e si colora) */
.nav-card:hover {
    transform: translateY(-5px);
    /* Si sposta in su */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    /* Ombra profonda */
    border-color: rgba(13, 110, 253, 0.3);
    /* Bordo azzurrino */
}

/* Testo "Precedente/Successivo" */
.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: #adb5bd;
    margin-bottom: 0.5rem;
    display: block;
}

/* Titolo dell'articolo */
.nav-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #212529;
    line-height: 1.3;
    transition: color 0.2s;
}

.nav-card:hover .nav-title {
    color: #0d6efd;
    /* Diventa blu al passaggio */
}

/* Animazione Frecce */
.nav-arrow {
    display: inline-block;
    transition: transform 0.2s;
}

.nav-card:hover .arrow-prev {
    transform: translateX(-5px);
}

.nav-card:hover .arrow-next {
    transform: translateX(5px);
}


/* --- STILE CITAZIONI (BLOCKQUOTE) --- */
.article-body blockquote {
    background-color: #f8f9fa;
    /* Sfondo grigio chiarissimo */
    border-left: 5px solid #0d6efd;
    /* Barra blu a sinistra */
    padding: 1rem;
    margin: 1rem 0;
    /* Spaziatura esterna */
    border-radius: 0 8px 8px 0;
    /* Angoli arrotondati solo a destra */
    font-style: italic;
    /* Corsivo */
    /* font-size: 1.1rem; */
    position: relative;
    /* Serve per l'icona opzionale */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    /* Ombra leggera */
}

/* Rimuove il margine dell'ultimo paragrafo dentro la citazione per evitare spazi vuoti */
.article-body blockquote p:last-child {
    margin-bottom: 0;
}



/* --- TABELLE MARKDOWN (Stile "Card" con Bordo Colorato) --- */

/* 1. STILE DEL CONTENITORE (Il box esterno arrotondato) */
/* Nota: Questo stile si applica al div 'table-responsive' creato dal JS */
.article-body .table-responsive {
    border-radius: 12px;
    /* Angoli arrotondati stile Bootstrap moderno */
    overflow: hidden;
    /* Fondamentale: ritaglia il contenuto negli angoli */
    border: 1px solid #dee2e6;
    /* Bordo sottile grigio attorno */
    border-left: 6px solid #0d6efd;
    /* BORDO SPESSO BLU A SINISTRA */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* Leggera ombreggiatura per profondità */
    margin-bottom: 2rem;
    background-color: #fff;
}

/* 2. STILE DELLA TABELLA INTERNA */
.article-body table {
    width: 100%;
    margin-bottom: 0;
    /* Rimuove margine per aderire al contenitore */
    color: #212529;
    border-collapse: collapse;
}

/* Celle (Intestazione e Dati) */
.article-body th,
.article-body td {
    padding: 1rem 0.75rem;
    /* Un po' più di spazio verticale per aria */
    vertical-align: middle;
    border-bottom: 1px solid #dee2e6;
    /* QUI AGGIUNGIAMO LA DIVISIONE COLONNE RICHIESTA */
    border-right: 1px solid #dee2e6;
}

/* Rimuove il bordo destro dall'ultima colonna per pulizia */
.article-body th:last-child,
.article-body td:last-child {
    border-right: none;
}

/* 3. INTESTAZIONE (Header) */
.article-body thead th {
    background-color: #f1f3f5;
    /* Grigio leggermente più scuro per stacco */
    border-bottom: 2px solid #dce4ec;
    /* Linea più marcata sotto i titoli */
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: #495057;
}

/* 4. EFFETTO ZEBRA E HOVER */
/* Righe pari con sfondo leggero */
.article-body tbody tr:nth-of-type(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Evidenzia la riga al passaggio del mouse con un azzurrino */
.article-body tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.08) !important;
}


/* Stile personalizzato: Verde Scuro su Celeste Chiaro */
code {
    color: var(--bs-success);
    /* Verde scuro, elegante e leggibile */
    background-color: #e0f2fe;
    /* Celeste chiaro, fresco e non invadente */
    padding: 0.2em 0.3em 0.1em 0.3em;
    /* Spaziatura più stretta per un look più compatto */
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1em;
    font-weight: bolder;
    /* Rende il testo leggermente in grassetto */
    border-left: var(--bs-primary) 2px solid;
    /* Linea verticale blu a sinistra per evidenziare il codice */
    border-bottom-left-radius: 0;
    /* Rimuove l'angolo arrotondato in basso a sinistra per un look più moderno */
    border-top-left-radius: 0;
    /* Rimuove l'angolo arrotondato in alto a sinistra per un look più moderno */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Ombra leggera per profondità visiva */
}

/* Protezione per i blocchi di codice grandi (più righe) */
pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    font-weight: normal;
}



/* Trasforma i normali link di testo in "Pillole" blu */
/* NOTA: il selettore :not esclude i popover e le immagini cliccabili */
.article-body p a:not([data-bs-toggle="popover"]),
.article-body li a:not([data-bs-toggle="popover"]) {
    display: inline-flex;
    align-items: center;
    background-color: #0d6efd;
    /* bg-primary di Bootstrap */
    color: #ffffff !important;
    /* text-white */
    padding: 0 0.6rem;
    border-radius: 50rem;
    /* Effetto rounded-pill */
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    /* Evita che la pillola si spezzi andando a capo */
    margin: 0 0.15rem;
}

/* Aggiunge la freccia a destra (usa FontAwesome in automatico) */
.article-body p a:not([data-bs-toggle="popover"])::after,
.article-body li a:not([data-bs-toggle="popover"])::after {
    content: '\f061';
    /* Codice Unicode per la freccia "fa-arrow-right" */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-left: 6px;
    font-size: 0.85em;
}

/* Effetto Hover quando passi il mouse */
.article-body p a:not([data-bs-toggle="popover"]):hover,
.article-body li a:not([data-bs-toggle="popover"]):hover {
    background-color: #0b5ed7;
    /* Blu leggermente più scuro */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    /* Piccola ombra */
    transform: translateY(-1px);
    /* Si solleva leggermente */
}