/* =========================================================
   videos.css
   1) Componente de video de YouTube (se usa en varias páginas)
   2) Estilos propios de la página videos.html
   ========================================================= */

/* ---------- 1) COMPONENTE: VIDEO DE YOUTUBE ---------- */
.yt-marco {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--r-sm);
    background: var(--bg-dark);
    box-shadow: var(--sh-md);
}

.yt-marco iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.yt-lite {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    cursor: pointer;
    background: var(--bg-dark);
}

.yt-lite img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease, filter .4s ease;
}

/* Velo oscuro suave para que el botón resalte */
.yt-lite::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 30, 21, .45), rgba(15, 30, 21, .05) 60%);
    transition: opacity .4s ease;
}

.yt-play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 8px 26px rgba(0, 0, 0, .25);
    transform: translate(-50%, -50%);
    transition: transform .3s ease, background .3s ease;
    overflow: hidden;
    /* Color del brillo plateado que cruza el botón */
    --brillo: rgba(220, 226, 232, .6);
}

/* Brillo animado que barre el botón (solo animación, no cambia el color) */
.yt-play::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(
            115deg,
            transparent 35%,
            var(--brillo) 50%,
            transparent 65%
        );
    background-repeat: no-repeat;
    background-size: 40% 140%;
    background-position: -150% 50%;
    animation: shine-sweep 2.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shine-sweep {
    0%, 25%   { background-position: -150% 50%; }
    75%, 100% { background-position: 160% 50%; }
}

/* Al pasar el mouse el botón se oscurece y el brillo se intensifica */
.yt-lite:hover .yt-play,
.yt-lite:focus-visible .yt-play,
.vd-gal__item:hover .yt-play,
.vd-gal__item:focus-visible .yt-play { --brillo: rgba(235, 239, 243, .75); }

.yt-play::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 54%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #fff;
    transition: border-color .3s ease;
}

.yt-lite:hover img,
.yt-lite:focus-visible img { transform: scale(1.04); }

.yt-lite:hover .yt-play,
.yt-lite:focus-visible .yt-play {
    background: var(--primary-h);
    transform: translate(-50%, -50%) scale(1.08);
}

.yt-lite:hover .yt-play::after,
.yt-lite:focus-visible .yt-play::after { border-left-color: #fff; }

.yt-lite:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: -3px;
}

/* Versión pequeña del botón (tarjetas) */
.yt-marco--sm .yt-play { width: 58px; height: 58px; }
.yt-marco--sm .yt-play::after { border-width: 10px 0 10px 16px; }


/* ---------- 2) PÁGINA DE VIDEOS ---------- */
.vd-sec {
    padding: var(--sec-pad-y) var(--sec-pad-x);
}

.vd-wrap {
    max-width: 1180px;
    margin: 0 auto;
}

.vd-eyebrow {
    display: block;
    font-family: var(--font-texto);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: normal;
    text-transform: none;
    color: var(--accent);
    margin-bottom: 14px;
}

/* Video destacado: video + texto lado a lado */
.vd-destacado {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 56px;
    align-items: center;
}

/* Versión más ancha: video y texto más grandes */
.vd-destacado--ancho {
    max-width: 1200px;
    grid-template-columns: 2.2fr 1fr;
    gap: 48px;
}

.vd-destacado--ancho .sec-heading { font-size: 38px; }
.vd-destacado--ancho .sec-body { font-size: 16px; }

/* Para videos con franjas negras arriba y abajo (formato cine):
   el marco usa la proporción real de la imagen y recorta las franjas.
   Al reproducir vuelve a 16:9 para que se vean los controles de YouTube. */
.yt-marco--cine { aspect-ratio: 1280 / 586; }
.yt-marco--cine:has(iframe) { aspect-ratio: 16 / 9; }

.vd-destacado--inv { grid-template-columns: 1fr 1.55fr; }
.vd-destacado--inv .yt-marco { order: 2; }

.vd-destacado .sec-heading { 
    margin-bottom: 20px; 
}

.vd-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.vd-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    font-family: var(--font-texto);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: var(--bg-green);
    border-radius: 999px;
}

.vd-sec--verde .vd-chip { background: #fff; }

.vd-acciones { margin-top: 28px; }

/* Encabezado centrado de una serie */
.vd-head {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 48px;
}

.vd-head .sec-body { margin: 0 auto; }

/* Serie de videos (tarjetas) */
.vd-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.vd-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--sh-md);
    transition: transform .3s ease, box-shadow .3s ease;
}

.vd-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--sh-lg);
}

.vd-card .yt-marco {
    border-radius: 0;
    box-shadow: none;
}

.vd-card__cuerpo { padding: 20px 22px 24px; }

.vd-card__dia {
    font-family: var(--font-texto);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    color: var(--accent);
}

.vd-card h3 {
    margin: 6px 0 0;
    font-family: var(--font-titulo);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
}

/* Llamado al canal */
.vd-canal {
    background: var(--bg-dark);
    padding: 90px var(--sec-pad-x);
    text-align: center;
}

.vd-canal .vd-eyebrow { color: #7fd6a2; }

.vd-canal .sec-body { margin: 0 auto; }

.vd-canal__btns {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-top: 32px;
}

.vd-canal .btn-prim { background: var(--accent); }
.vd-canal .btn-prim:hover { background: #22894b; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
    .vd-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .vd-destacado,
    .vd-destacado--inv {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .vd-destacado--inv .yt-marco { order: 0; }
}

@media (max-width: 768px) {
    .vd-sec { padding: 70px 20px; }
    .vd-canal { padding: 70px 20px; }
    .vd-grid { grid-template-columns: 1fr; }
    .vd-destacado .sec-heading,
    .vd-destacado--ancho .sec-heading { font-size: 28px; }
    .vd-destacado--ancho .sec-body { font-size: 16px; }
    .yt-play { width: 62px; height: 62px; }
    .yt-play::after { border-width: 10px 0 10px 17px; }
}

@media (prefers-reduced-motion: reduce) {
    .yt-lite img,
    .yt-play,
    .vd-card { transition: none; }
    .yt-play::before { animation: none; }
}


/* ---------- GALERÍA ---------- */
/* Fondo de la sección galería (cambia el color aquí) */
#galeria {
    background: var(--bg-soft);
}

.vd-filtros {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 36px;
}

.vd-filtro {
    padding: 8px 18px;
    border-radius: 100px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-texto);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s;
}

.vd-filtro:hover { border-color: var(--primary); color: var(--primary); }

.vd-filtro.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* 3 por fila; la última fila queda centrada aunque esté incompleta */
.vd-gal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 32px 24px;
}

.vd-gal__item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-texto);
    flex: 0 1 calc((100% - 48px) / 3);
}

.vd-gal__item[hidden] { display: none; }

.vd-gal__img {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    margin-bottom: 8px;
    border-radius: var(--r-sm);
    background: var(--bg-dark);
    box-shadow: var(--sh-sm);
}

.vd-gal__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.vd-gal__img .yt-play {
    width: 50px;
    height: 50px;
    opacity: .92;
}

.vd-gal__img .yt-play::after { border-width: 9px 0 9px 14px; }

.vd-gal__tag {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    color: var(--accent);
    font-family: var(--font-texto);
}

.vd-gal__titulo {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
    transition: color .25s;
}

.vd-gal__item:hover .vd-gal__img img,
.vd-gal__item:focus-visible .vd-gal__img img { transform: scale(1.05); }

.vd-gal__item:hover .yt-play,
.vd-gal__item:focus-visible .yt-play { background: var(--primary-h); }

.vd-gal__item:hover .yt-play::after,
.vd-gal__item:focus-visible .yt-play::after { border-left-color: #fff; }

.vd-gal__item:hover .vd-gal__titulo { color: var(--primary); }

.vd-gal__item:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: var(--r-sm); }

/* ---------- REPRODUCTOR EMERGENTE ---------- */
.vd-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.vd-modal[hidden] { display: none; }

.vd-modal__fondo {
    position: absolute;
    inset: 0;
    background: rgba(8, 20, 12, .88);
    animation: vdFade .25s ease;
}

.vd-modal__caja {
    position: relative;
    width: 100%;
    max-width: 1000px;
    animation: vdSube .3s ease;
}

.vd-modal__video {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--r-md);
    background: #000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.vd-modal__video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.vd-modal__titulo {
    margin-top: 14px;
    font-family: var(--font-texto);
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.vd-modal__cerrar {
    position: absolute;
    top: -52px;
    right: 0;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: background .25s;
}

.vd-modal__cerrar:hover { background: rgba(255, 255, 255, .25); }

body.vd-modal-abierto { overflow: hidden; }

@keyframes vdFade { from { opacity: 0; } }
@keyframes vdSube { from { opacity: 0; transform: translateY(16px); } }

@media (max-width: 768px) {
    .vd-gal { gap: 22px 14px; }
    .vd-gal__item { flex-basis: calc((100% - 14px) / 2); }
    .vd-gal__titulo { font-size: 14px; }
    .vd-modal { padding: 16px; }
}

@media (max-width: 480px) {
    .vd-gal__item { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .vd-modal__fondo,
    .vd-modal__caja { animation: none; }
    .vd-gal__img img { transition: none; }
}