/* Video gallery — standalone AfCHPR-style */

:root {
    --vg-primary: #1f6529;
    --vg-primary-dark: #1a5632;
    --vg-secondary: #9f2241;
    --vg-text: #ffffff;
    --vg-muted: rgba(255, 255, 255, 0.55);
    --vg-radius: 4px;
    --vg-font: "Open Sans", Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--vg-font);
    background: #f5f5f5;
    color: #212121;
}

.vg-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.vg-heading {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--vg-primary);
}

.vg-gallery {
    background: var(--vg-primary-dark);
    border: 1px solid var(--vg-primary);
    padding: 20px;
}

.vg-gallery--empty,
.vg-gallery--loading,
.vg-gallery--error {
    background: #fff;
    border: 1px solid #eee;
    padding: 24px;
    text-align: center;
}

.vg-gallery__notice {
    margin: 0 0 8px;
    font-weight: 600;
    color: #212121;
}

.vg-gallery__hint {
    margin: 0;
    font-size: 13px;
    color: #515151;
}

.vg-gallery__layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.vg-gallery__player-col {
    flex: 1 1 0;
    min-width: 0;
}

.vg-gallery__player-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--vg-radius);
    overflow: hidden;
}

.vg-gallery__player-target {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.vg-gallery__player-target iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: none;
}

.vg-gallery__now-playing {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
}

.vg-gallery__now-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--vg-secondary);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 2px;
}

.vg-gallery__now-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--vg-text);
}

.vg-gallery__list-col {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.vg-gallery__list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    padding: 0 4px;
}

.vg-gallery__list-title {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

.vg-gallery__badge {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--vg-text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2px 8px;
    white-space: nowrap;
}

.vg-gallery__scroll {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.vg-gallery__scroll::-webkit-scrollbar {
    width: 4px;
}

.vg-gallery__scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
}

.vg-gallery__items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vg-gallery__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--vg-radius);
    cursor: pointer;
    transition: background 0.15s ease;
    border: 1px solid transparent;
    background: transparent;
    color: var(--vg-text);
    text-align: left;
    font-family: inherit;
}

.vg-gallery__item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.vg-gallery__item.is-active {
    background: var(--vg-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.vg-gallery__item-index {
    font-size: 11px;
    color: var(--vg-muted);
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.vg-gallery__item.is-active .vg-gallery__item-index {
    color: var(--vg-secondary);
}

.vg-gallery__item-thumb {
    position: relative;
    width: 80px;
    height: 45px;
    border-radius: var(--vg-radius);
    overflow: hidden;
    flex-shrink: 0;
    background: #222;
}

.vg-gallery__item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vg-gallery__item-bars {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: center;
}

.vg-gallery__item.is-active .vg-gallery__item-bars {
    display: flex;
}

.vg-gallery__item-bars span {
    display: block;
    width: 3px;
    background: var(--vg-secondary);
    border-radius: 2px;
    animation: vg-bar-bounce 1s ease-in-out infinite;
}

.vg-gallery__item-bars span:nth-child(2) {
    animation-delay: 0.15s;
    margin: 0 2px;
}

.vg-gallery__item-bars span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes vg-bar-bounce {
    0%, 100% { height: 3px; }
    50% { height: 12px; }
}

.vg-gallery__item-info {
    flex: 1;
    min-width: 0;
}

.vg-gallery__item-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--vg-text);
}

.vg-gallery__item-date {
    display: block;
    font-size: 11px;
    color: var(--vg-muted);
    margin-top: 2px;
}

.vg-gallery__playlist-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--vg-radius);
    color: var(--vg-text);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.vg-gallery__playlist-link:hover {
    background: var(--vg-secondary);
    border-color: var(--vg-secondary);
    color: var(--vg-text);
    text-decoration: none;
}

.vg-gallery__channel {
    margin-top: 16px;
}

.vg-gallery__channel a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--vg-secondary);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    border-radius: var(--vg-radius);
}

.vg-gallery__channel a:hover {
    filter: brightness(1.05);
}

/* Empiler le lecteur et la liste uniquement sur les écrans de moins de 500 px. */
@media (max-width: 499.98px) {
    .vg-gallery__layout {
        flex-direction: column;
    }

    .vg-gallery__list-col {
        width: 100%;
    }

    .vg-gallery__scroll {
        max-height: 360px !important;
    }
}
