/* Videoteca Styles v4 - Consolidated */

/* GRID DE VIDEOS PARA SHORTCODE Y WIDGETS */
.videoteca-grid-yt {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px 20px;
    margin-top: 2em;
}
.videoteca-card-yt {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}
.videoteca-card-yt .thumbnail-link {
    display: block;
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background-color: #eee;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease-out;
}
.videoteca-card-yt .thumbnail-link:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.videoteca-card-yt .thumbnail-link img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    border: none;
    transition: transform 0.3s ease-out;
}
.videoteca-card-yt .thumbnail-link:hover img {
    transform: scale(1.05);
}
.videoteca-card-yt .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    font-size: 50px;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 75px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}
.videoteca-card-yt .thumbnail-link:hover .play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.videoteca-card-yt .meta-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.videoteca-card-yt .author-avatar img {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}
.videoteca-card-yt .title-meta {
    flex: 1;
}
.videoteca-card-yt .video-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.videoteca-card-yt .video-title a {
    text-decoration: none;
    color: inherit;
}
.videoteca-card-yt .video-metadata {
    font-size: 0.85rem;
    color: #606060;
}
.videoteca-card-yt .video-metadata a {
    text-decoration: none;
    color: #606060;
    transition: color 0.2s ease;
}
.videoteca-card-yt .video-metadata a:hover {
    color: #000;
}

/* PAGINACIÓN PARA EL GRID */
.videoteca-pagination {
    margin-top: 2em;
    text-align: center;
}
.videoteca-pagination .page-numbers {
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
}
.videoteca-pagination .page-numbers.current, .videoteca-pagination .page-numbers:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}

/* --- ESTILOS PARA LA PLANTILLA SINGLE-VIDEO.PHP --- */

/* Oculta la cabecera de página por defecto del tema si no se marca la opción en el post */
body.single-video #page-header {
    display: none !important;
}

/* Ajustes para que el contenido ocupe el ancho completo */
body.single-video div#page-content-wrapper {
    width: 100% !important;
    padding: 0 !important;
    max-width: unset !important;
}

/* Sección superior con fondo oscuro */
body.single-video .videoteca-top-section {
    background-color: #002a28; /* Verde oscuro del sitio */
    color: #ffffff;
    padding: 9rem 15px 3em 15px;
    margin-top: -45px; /* Compensa el margen por defecto del contenedor principal del tema */
}

/* Contenedor para centrar el reproductor y el título */
body.single-video .videoteca-player-and-header-wrap {
    max-width: 1200px;
    margin: 0 auto;
}

/* El wrapper general del reproductor (común para shortcode y single) */
.videoteca-player-wrapper {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5em;
    max-width: 100%;
}
.videoteca-player-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Borde sutil para el reproductor en la página single */
body.single-video .video-container-single .videoteca-player-wrapper {
    border: 1px solid #ffffff20;
}

/* Estilo para el encabezado (título y metas) debajo del reproductor */
body.single-video .videoteca-header-below-player {
    padding: 1.5em 0 1em 0;
    margin-bottom: 0;
    border-bottom: 1px solid #ffffff20; /* Borde sutil para separar */
}

body.single-video .videoteca-header-below-player .entry-title {
    font-size: 2em;
    font-weight: 700;
    margin: 0 0 0.5em 0;
    line-height: 1.3;
    color: #F1DB9E; /* Color dorado para el título */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Contenedor para los metadatos (autor, fecha) */
body.single-video .videoteca-meta-below-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* Para que se ajuste en móviles */
    gap: 10px 20px;
    font-size: 0.9em;
    color: #e0e0e0; /* Color de texto más suave para las metas */
}

body.single-video .videoteca-meta-below-title .author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.single-video .videoteca-meta-below-title .author-info img {
    border-radius: 50%;
    border: 2px solid #ffffff50;
}

body.single-video .videoteca-meta-below-title .author-info a {
    font-weight: bold;
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s ease;
}

body.single-video .videoteca-meta-below-title .author-info a:hover {
    color: #F1DB9E;
}

/* Contenedor para la descripción y contenido adicional (fondo blanco) */
body.single-video .videoteca-description-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5em 15px;
}

/* Limitamos el ancho del texto para mejorar la legibilidad */
body.single-video .videoteca-description {
    max-width: 800px;
    margin: 0 auto 2.5em auto; /* Centramos el bloque de texto */
    line-height: 1.7;
}

/* --- NUEVOS ESTILOS PARA EL WIDGET DE LISTA --- */

.videoteca-list-widget {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Espacio entre los videos de la lista */
}

.videoteca-list-item {
    display: flex;
    align-items: center; /* Alinea imagen y texto verticalmente */
    gap: 15px; /* Espacio entre la imagen y el texto */
    text-decoration: none;
    color: inherit;
}

.videoteca-list-item:hover .video-title {
    color: #0056b3; /* Cambia el color del título al pasar el mouse */
}

.videoteca-list-item img {
    width: 70px; /* Ancho fijo para la miniatura */
    height: 70px; /* Alto fijo para la miniatura */
    object-fit: cover; /* Asegura que la imagen cubra el espacio sin deformarse */
    border-radius: 5px; /* Bordes redondeados sutiles */
    flex-shrink: 0; /* Evita que la imagen se encoja */
}

.videoteca-list-item .video-info {
    display: flex;
    flex-direction: column;
}

.videoteca-list-item .video-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 4px 0;
    transition: color 0.2s ease-out;
}

.videoteca-list-item .video-date {
    font-size: 0.85rem;
    color: #6c757d; /* Color gris para la fecha */
}