/* 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;
}

.index-source::before {
    content: "";
    background-image: url("/asset/img/gl/hand-pointer-2.svg");
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: calc(4 / 16 * 1rem);
    background-repeat: no-repeat;
    background-size: contain;
    flex-shrink: 0;
}

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

.toc-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    column-width: 150px;
    column-gap: var(--space-md);
}

.toc-list li {
    break-inside: avoid;
    margin-bottom: var(--space-sm);
}

.toc-list a {
    display: block;
    text-decoration: none;
    font-weight: var(--fw-bold);
    white-space: nowrap;
    background-color: #FFFFFF;
    color: #000000;
    padding: calc(4 / 16 * 1rem) calc(6 / 16 * 1rem);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-z2);
}

.toc-list a:hover {
    background-color: #EDEDED;
    color: #000000;
}

/* 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 {
    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: #222222 !important;
}

html[data-theme="dark"] .index-item h2 {
    color: #FFFF00;
    font-weight: var(--fw-normal);
}

html[data-theme="dark"] .index-source {
    color: #ff7777;
}

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

html[data-theme="dark"] .toc-list a {
    background-color: #000000;
    color: #ffffff;
    font-weight: var(--fw-normal);
}

.video-grid {
    max-width: 56.25rem;
    width: 100%;
    margin: 0 auto;
    display: block;
    gap: 0.9375rem;
    position: relative;
    column-count: 3;
    column-gap: 0.9375rem;
    padding: var(--space-xs) var(--space-md);
}

.video-section-title {
    max-width: 56.25rem;
    margin: 0 auto var(--space-md) auto;
    padding-left: 2.2rem;
    color: var(--color-section-title);
    font-size: 1.1rem;
    text-transform: uppercase;
    position: relative;
    display: flex;
    align-items: center;
    font-weight: 800;
    letter-spacing: 0.05rem;
    line-height: 1.2;
}

.video-section-title::before {
    content: "";
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.1rem;
    height: 1.1rem;
    background-color: red;
    border: 2px solid #FFFFFF;
    border-radius: 50%;
    box-sizing: border-box;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.video-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--color-not-white);
    background-color: var(--color-video-card-bg);
    break-inside: avoid;
    margin-bottom: 0.9375rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-z2);
    border: 0.125rem solid black;
}

.video-card:hover {
    transform: scale(var(--transform-scale-sm-plus));
}

.video-card:has(.video-synopsis-wrapper.is-unfolded) {
    height: auto !important;
    align-self: start !important;
}

.video-thumbnail-container {
    position: relative;
    padding-top: 56.25%;
    height: 0;
    overflow: hidden;
    flex-shrink: 0;
    background-color: var(--color-video-thumbnail-container-bg);
}

.video-thumbnail-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2.8125rem;
    height: 2.8125rem;
    background-color: rgba(255, 0, 0, 0.45);
    border-radius: 50%;
    z-index: 10;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.play-icon-overlay::before {
    content: "\25B6";
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    color: var(--color-not-white);
    font-size: 1.25rem;
}

.video-info {
    background-color: var(--color-video-info-bg);
    border-top: none;
    padding: var(--space-xs) var(--space-sm) var(--space-sm) var(--space-sm);
    flex-grow: 1;
    margin-top: -0.0625rem;
}

.video-info h3 {
    margin-top: 0;
    margin-bottom: var(--space-sm);
    line-height: 1.2;
    color: var(--color-video-info-h3);
    font-size: var(--font-size-video-info-h3);
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-badges {
    display: flex;
    gap: 0.5rem;
}

.video-badge {
    padding: 0 0.3125rem;
    border-radius: var(--radius-sm);
    background-color: var(--color-not-white);
    color: var(--color-video-badge-text);
    text-transform: uppercase;
    line-height: 1;
    height: 1.5rem;
    font-size: var(--font-size-video-badge) !important;
    font-weight: var(--fw-bold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0 !important;
    border: 0.125rem solid var(--color-video-badge-audio-langue-border);
    z-index: 10;
    vertical-align: middle;
    white-space: nowrap;
}

.duration-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background-color: rgba(0, 0, 0, 0.75);
    color: var(--color-video-duration-badge);
    border: 0.0625rem solid var(--color-video-duration-badge-border);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.video-badge-icon {
    width: 1.875rem;
    height: 1.875rem;
    margin-right: -0.5rem;
    transform: translateX(-0.5625rem);
}

.video-badge-audio-langue {
    background-color: #016f29;
}

.video-badge-subtitles {
    background-color: var(--color-video-badge-subtitles-bg);
}

.video-badge-age-restriction {
    background-color: #7c2600;
}

.video-synopsis-wrapper {
    max-height: 6.4375rem;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    position: relative;
    margin-bottom: var(--space-xs, 0.3125rem);
    -webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
}

.video-synopsis-wrapper::after {
    display: none !important;
}

.video-synopsis-wrapper.is-unfolded {
    max-height: unset !important;
    overflow: visible !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
}

.video-synopsis-content,
.video-synopsis-content p {
    color: #000000;
    font-size: 1rem !important;
    margin: 0 !important;
    padding: 0 !important;
}

.video-expand-btn {
    display: block;
    width: 100%;
    margin: var(--space-xs) auto var(--space-sm) auto;
    text-align: center;
    padding: 0.25rem 0;
    background-color: transparent;
    color: black;
    border: none;
    cursor: pointer;
    font-size: var(--font-size-video-btn-read-more);
    font-weight: var(--fw-bold);
    text-decoration: none;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.video-expand-btn:hover {
    transform: scale(var(--transform-scale-md));
}

.video-expand-btn::after {
    content: "\25BC";
    display: inline-block;
    margin-left: var(--space-sm);
    font-size: var(--font-size-video-btn-read-more-triangle);
    transition: none;
}

.video-expand-btn.is-collapsed::after {
    content: "\25B2";
}

@media (max-width: 71.25rem) {
    .video-grid {
        column-count: 2;
    }
}

@media (max-width: 48.4375rem) {
    .video-grid {
        column-count: 1;
    }
}

/* Ajustements pour petits écrans (635px et moins) */
@media (max-width: 39.6875rem) {
    .video-badges {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .video-badge {
        font-size: 0.75rem !important;
        height: 1.25rem;
        padding: 0 0.25rem;
    }

    .video-badge-icon {
        width: 1.375rem;
        height: 1.375rem;
        margin-right: -0.375rem;
        transform: translateX(-0.375rem);
    }
}

html[data-theme="dark"] .video-section-title {
    color: var(--color-dark-mode-video-section-title);
    font-weight: normal;
}

html[data-theme="dark"] .video-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--color-not-white);
    background-color: #222222;
    break-inside: avoid;
    margin-bottom: 0.9375rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-z2);
    border: 0.125rem solid #8c8b8b;
}

html[data-theme="dark"] .video-expand-btn {
    color: #FFFFFF;
    font-weight: normal;
}

html[data-theme="dark"] .video-info {
    background-color: #222222 !important;
}

html[data-theme="dark"] .video-synopsis-content,
html[data-theme="dark"] .video-synopsis-content p {
    color: var(--color-texte-dark-mode) !important;
}

html[data-theme="dark"] .video-info h3 {
    color: #90EE90;
    font-weight: var(--fw-normal);
}

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

html[data-theme="dark"] .page-title-icon {
    filter: none !important;
}

html[data-theme="dark"] .video-card,
html[data-theme="dark"] .video-info {
    background-color: #000000 !important;
}

html[data-theme="dark"] .video-synopsis-wrapper {
    background-color: #000000 !important;
    -webkit-mask-image: linear-gradient(to bottom, #000 20%, rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(to bottom, #000 20%, rgba(0, 0, 0, 0) 100%);
}