/* ============================================================
   VIDEOTECA – Estilos de videos.php
   ============================================================ */

:root {
    --yt-cyan: #00f2ff;
    --yt-radius: 6px;
    --yt-bg: #050505;
}

.video-section {
    background: var(--yt-bg);
    border-radius: var(--yt-radius);
    padding: 2rem;
    margin-bottom: 3rem;
}

.video-section__title {
    color: var(--h1);
    margin-bottom: 0.5rem;
}

.video-section__desc {
    color: var(--text);
    margin-bottom: 1.5rem;
    max-width: 100%;
}

/* ── Card base (thumbnail + overlay + caption) ── */
.yt-card {
    position: relative;
    cursor: pointer;
    border-radius: var(--yt-radius);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
    background: #0d0d0d;
}

.yt-card:hover,
.yt-card:focus-visible {
    border-color: var(--yt-cyan);
    box-shadow: 0 0 14px rgba(0, 242, 255, 0.35);
    transform: translateY(-2px);
    outline: none;
}

.yt-card__thumb {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    background: #111;
    transition: opacity 0.3s ease;
    opacity: 0.85;
}

.yt-card:hover .yt-card__thumb {
    opacity: 1;
}

.yt-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.25s ease;
}

.yt-card:hover .yt-card__overlay {
    background: rgba(0, 0, 0, 0.15);
}

.yt-play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: rgba(0, 0, 0, 0.65);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    color: #fff;
    font-size: 1.4rem;
    padding-left: 4px;
    transition: background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.yt-card:hover .yt-play-btn {
    background: rgba(0, 242, 255, 0.2);
    border-color: var(--yt-cyan);
    transform: scale(1.1);
}

.yt-play-btn--sm {
    width: 38px;
    height: 38px;
    font-size: 1rem;
}

.yt-card__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.4rem 0.6rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: #e8e8e8;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.3;
    margin: 0;
}

/* ── LAYOUT_A – Hero Spotlight ── */
.vl-a {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.25rem;
    align-items: start;
}

.vl-a__hero {
    width: 100%;
}

.vl-a__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 480px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

.vl-a__list::-webkit-scrollbar {
    width: 4px;
}

.vl-a__list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.yt-card--hero .yt-card__caption {
    font-size: 0.85rem;
}

.yt-card--list {
    display: grid;
    grid-template-columns: 140px 1fr;
    height: 80px;
    align-items: center;
}

.yt-card--list .yt-card__thumb {
    width: 140px;
    height: 80px;
    aspect-ratio: unset;
    object-fit: cover;
}

.yt-card--list .yt-card__overlay {
    width: 140px;
}

.yt-card--list .yt-card__caption {
    position: static;
    background: none;
    padding: 0.5rem;
    color: #ccc;
    font-size: 0.75rem;
    align-self: center;
}

/* ── LAYOUT_B – Comparison Grid (2 cols) ── */
.vl-b {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.vl-b>.yt-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 0.5rem);
}

/* ── LAYOUT_C – Historical Archive (3-4 cols) ── */
.vl-c {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.yt-card--compact .yt-card__caption {
    font-size: 0.72rem;
}

/* ============================================================
   MODAL DE VIDEO (Teatro)
   ============================================================ */
#video-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#video-modal[hidden] {
    display: none;
}

#video-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    cursor: pointer;
}

#video-modal__inner {
    position: relative;
    z-index: 1;
    width: min(96vw, calc((96vh - 110px) * (16 / 9)));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

#video-modal__frame-wrap {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(0, 242, 255, 0.25);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.9);
}

#video-modal__iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

#video-modal__close {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.75rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    z-index: 2;
    line-height: 1;
}

#video-modal__close:hover {
    opacity: 1;
}

.video-modal__title {
    color: #ccc;
    font-size: 0.875rem;
    text-align: center;
    margin: 0;
}

.video-modal__nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.video-modal__nav-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.25rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.video-modal__nav-btn:hover {
    background: rgba(0, 242, 255, 0.15);
    border-color: var(--yt-cyan);
}

.video-modal__nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.video-modal__counter {
    color: #888;
    font-size: 0.8rem;
    min-width: 60px;
    text-align: center;
}

/* ============================================================
   RESPONSIVE – Videoteca
   ============================================================ */

@media (max-width: 1000px) {
    .vl-c {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .vl-a {
        grid-template-columns: 1fr;
    }

    .vl-a__list {
        flex-direction: row;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 0.5rem;
    }

    .vl-a__list li {
        flex-shrink: 0;
        width: 200px;
    }

    .yt-card--list {
        display: block;
        height: auto;
    }

    .yt-card--list .yt-card__thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    .yt-card--list .yt-card__overlay {
        width: 100%;
    }

    .yt-card--list .yt-card__caption {
        position: absolute;
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
        padding: 0.4rem 0.5rem;
    }

    .vl-c {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .vl-c {
        grid-template-columns: repeat(1, 1fr);
    }
}

@media (max-width: 600px) {
    .video-section {
        padding: 1.25rem 1rem;
    }

    .vl-a {
        grid-template-columns: 1fr;
    }

    .vl-a__list {
        flex-direction: column;
        max-height: none;
        overflow-x: visible;
        gap: 0.75rem;
    }

    .vl-a__list li {
        width: 100%;
    }

    .vl-b {
        grid-template-columns: 1fr;
    }

    .vl-b>.yt-card:last-child:nth-child(odd) {
        grid-column: auto;
        justify-self: auto;
        width: 100%;
    }

    .vl-c {
        grid-template-columns: 1fr;
    }
}