/* Conteneur de la définition */
.index-item {
    padding: var(--space-lg);
    /* 8px = 0.5rem */
    border-left: calc(8 / 16 * 1rem) solid var(--color-index-item);
    margin-bottom: var(--space-md);
    background-color: var(--source-color-white-transparent) !important;
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
    box-shadow: var(--shadow-z2);
}

/* Titre du Terme */
.index-item h2 {
    color: var(--color-index-item-h2);
    font-weight: var(--fw-bold);
    margin-top: 0;
    /* 1.4rem = 22.4px */
    font-size: calc(22.4 / 16 * 1rem);
}

/* Source/Lien (discret) */
.index-source {
    display: inline-flex;
    align-items: center;
    font-size: var(--font-size-veganism-index-source);
    color: var(--color-index-source);
    text-decoration: underline;
}

/* NOUVEAU : Insertion de l'icône de main */
.index-source::before {
    content: "";
    background-image: url("/asset/img/gl/hand-pointer-2.svg");
    display: inline-block;
    width: 1em;
    height: 1em;
    /* 4px = 0.25rem */
    margin-right: calc(4 / 16 * 1rem);
    background-repeat: no-repeat;
    background-size: contain;
    flex-shrink: 0;
}

.index-source:hover {
    font-weight: var(--fw-bold);
}

/* ================================================================= */
/* STYLES DE LA TABLE DES MATIÈRES (TOC) - AFFICHAGE LINÉAIRE */
/* ================================================================= */

.toc-container {
    width: 100%;
    margin: var(--space-md) 0 var(--space-lg) 0;
    padding: var(--space-md) var(--space-md);
    background-color: var(--source-color-accent-two-very-light);
    border: calc(1 / 16 * 1rem) solid var(--color-veganism-top-container-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-z2);
}

/* Titre de la TOC */
.toc-container h2 {
    /* 1.4rem = 22.4px */
    font-size: calc(22.4 / 16 * 1rem);
    font-weight: var(--fw-bold);
    color: black;
    padding-bottom: var(--space-xs);
    margin-top: 0;
    margin-bottom: var(--space-sm);
    text-align: center;
}

/* Liste des liens */
.toc-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    font-size: var(--font-size-veganism-toc-list);

    justify-content: center;
    gap: var(--space-sm) var(--space-md);
}

.toc-list li {
    margin: 0;
}

/* Le style du Lien (a) devient le "Bouton Mince" */
.toc-list a {
    display: inline-block;
    text-decoration: none;
    font-weight: var(--fw-bold);
    white-space: nowrap;
    background-color: white;
    color: #000000;
    /* 6px = 0.375rem */
    padding: 0 calc(6 / 16 * 1rem);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-z2);
}

/* Effet de survol */
.toc-list a:hover {
    background-color: var(--source-color-gray-very-light);
    color: black;
}

/* Annule la marge sous la dernière définition */
.index-item:last-of-type {
    margin-bottom: 0 !important;
}

/* ================================================= */
/* === MODE SOMBRE === */
/* ================================================= */
html[data-theme="dark"] .index-item {
    /* 8px = 0.5rem */
    border-left: calc(8 / 16 * 1rem) solid var(--color-index-item);
    border-top: calc(2 / 16 * 1rem) solid var(--color-index-item);
    border-right: calc(2 / 16 * 1rem) solid var(--color-index-item);
    border-bottom: calc(2 / 16 * 1rem) solid var(--color-index-item);
    background-color: black !important;
}

html[data-theme="dark"] .index-item h2 {
    color: #aaaaaa;
    font-weight: var(--fw-normal);
    margin-top: 0;
    /* 1.4rem = 22.4px */
    font-size: calc(22.4 / 16 * 1rem);
}

html[data-theme="dark"] .index-source {
    display: inline-flex;
    align-items: center;
    font-size: var(--font-size-veganism-index-source);
    color: #ff7777;
    text-decoration: underline;
}

html[data-theme="dark"] .index-source::before {
    background-image: url("/asset/img/gl/hand-pointer-2-dark.svg");
}

html[data-theme="dark"] .toc-container h2 {
    /* 1.4rem = 22.4px */
    font-weight: var(--fw-normal);
    color: #dfc778;
}

html[data-theme="dark"] .toc-list a {
    background-color: #939393;
    color: #000000;
}

html[data-theme="dark"] .toc-container {
    background-color: #1e1e1e;
    border: none;
}