/* videos.css */

/* Contenedor principal */
.videos-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 34px 20px 110px; /* el pie es fijo (~70px): solo se deja ese hueco, para no obligar a hacer scroll */
    text-align: center;
}

/* Título y subtítulo (como galería) */
.videos-page h1 {
    font-family: 'Cinzel', serif;
    line-height: 1.15;
    font-size: clamp(30px, 8.5vw, 48px);
    color: #f5df25;
    margin-bottom: 10px;
}

.videos-page p {
    font-size: 20px;
    font-size: clamp(16px, 4.6vw, 20px);
    color: #fff;
    margin-bottom: 22px;
    display: block;
}

/* VIDEO DESTACADO */
.video-destacado {
    position: relative;
    /* El tamaño depende del ALTO de la ventana para que título + destacado + 2 filas de miniaturas
       quepan sin scroll en un PC (en móvil y tablet mandan las reglas de abajo). */
    width: clamp(260px, calc((100vh - 590px) * 16 / 9), 460px);
    max-width: 90%;
    margin: 0 auto 26px auto;
    cursor: pointer;
    border: 5px solid #f5df25;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;          /* no se encoge si la imagen falla */
    background: #000;
    transition: transform 0.3s ease;
}
.video-destacado img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;   /* si la foto es más alta que 16:9, se conservan las caras */
    display: block;
}
.video-destacado:hover {
    transform: scale(1.05);
}

/* ICONO PLAY DESTACADO */
.video-destacado .play-grande {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: #f5df25;
    pointer-events: none;
}

/* AÑO DEL VIDEO DESTACADO */
.video-destacado .video-year {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    font-size: 1.5rem;
    color: #f5df25;
    padding: 6px 0;
    text-align: center;
    width: 100%;
    white-space: normal;
}

/* DURACIÓN DESTACADO */
.video-destacado .video-duration {
    position: absolute;
    top: 6px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    padding: 3px 6px;
    font-size: 1rem;
    border-radius: 6px;
}

/* GRID */
.video-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    justify-items: center;
    margin-bottom: 0;
}

/* VIDEO THUMB */
.video-thumb {
    position: relative;
    width: 100%;
    max-width: 180px;
    aspect-ratio: 16 / 9;
    cursor: pointer;
    border: 3px solid #f5df25;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.video-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(245,223,37,0.6);
}

/* ICONO PLAY */
.video-thumb .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #f5df25;
    pointer-events: none;
}

/* AÑO DEL VIDEO MINIATURA */
.video-thumb .video-year {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    font-size: 1rem;
    color: #f5df25;
    padding: 4px 0;
    text-align: center;
    width: 100%;
    white-space: normal;
}

/* DURACIÓN MINIATURA */
.video-thumb .video-duration {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.7);
    padding: 2px 5px;
    font-size: 0.9rem;
    border-radius: 6px;
}

/* MODAL */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.video-modal.show {
    display: flex;
}
.video-modal video {
    max-width: 80%;
    max-height: 80%;
    border: 5px solid #f5df25;
    border-radius: 12px;
    background: #000;
}
.video-modal .close,
.video-modal .prev,
.video-modal .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(245,223,37,0.8);
    border: none;
    padding: 10px 15px;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 8px;
    color: #000;
    font-weight: bold;
    transition: background 0.2s;
}
.video-modal .close {
    top: 20px;
    right: 30px;
    transform: none;
}
.video-modal .prev { left: 20px; }
.video-modal .next { right: 20px; }
.video-modal button:hover { background: rgba(245,223,37,1); }

/* RESPONSIVE */
@media screen and (max-width: 1100px) { .video-grid { grid-template-columns: repeat(4, 1fr); } }
@media screen and (max-width: 768px) { .video-grid { grid-template-columns: repeat(2, 1fr); } .video-destacado { width: 90%; } }
@media screen and (max-width: 480px) { .video-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } .video-destacado { width: 100%; } }
@media screen and (max-width: 340px) { .video-grid { grid-template-columns: 1fr; } }

/* ===== RESPONSIVE (añadido) ===== */
@media screen and (max-width: 600px) {
    .videos-page { padding: 30px 12px 150px; }
    .video-thumb { max-width: none; }                       /* aprovechan el ancho de su columna */
    .video-destacado .play-grande { font-size: 2.2rem; }
    .video-destacado .video-year { font-size: 1.2rem; }
    .video-modal video { max-width: 94%; max-height: 70%; }
    .video-modal .prev, .video-modal .next { top: auto; bottom: 18px; transform: none; }
    .video-modal .prev { left: 20px; } .video-modal .next { right: 20px; }
    .video-modal .close { top: 12px; right: 12px; }
}
@media (hover: none) {
    .video-destacado:hover, .video-thumb:hover { transform: none; }
}
/* Las miniaturas son <button> (accesibles con teclado): se anula el estilo por defecto del botón */
button.video-destacado, button.video-thumb {
    -webkit-appearance: none; appearance: none;
    font: inherit; color: inherit; text-align: center;
    padding: 0; background: none; display: block;
}
button.video-destacado:focus-visible, button.video-thumb:focus-visible {
    outline: 3px solid #fff; outline-offset: 3px;
}
.video-modal button:focus-visible { outline: 3px solid #fff; }

/* Si el fotograma se saca del propio vídeo (la imagen no existe), ocupa la tarjeta entera */
.video-destacado video, .video-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }