/* Estilos para la sección de vídeos */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.video-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.video-container-yt {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* Relación de aspecto 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin: 0 auto; /* Centrar el video */
}

.video-container-yt iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-title {
    margin-top: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.2rem;
}

.video-alt {
    text-align: center;
    font-size: 0.9rem;
    margin-top: 0;
}

.video-alt a {
    color: var(--color-accent);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.video-alt a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.video-container-yt {
  position: relative;
  width: 100%;
  /* Si puedes, usa aspect-ratio (mejor que padding-bottom) */
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,.2);
  margin: 0 auto;
}

/* Si quieres mantener el hack del padding-bottom, comenta el aspect-ratio
   y descomenta la línea de abajo. El resto funciona igual. */
/* .video-container-yt { padding-bottom: 56.25%; height: 0; } */

.video-container-yt iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 1; /* debajo del overlay */
}

/* Overlay encima del iframe */
.video-container-yt .yt-overlays {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none; /* no bloquea clics */
  /* Dos fondos: uno desde arriba y otro desde abajo */
  background:
    linear-gradient(to bottom, rgba(0,0,0,.95) 0%, rgba(0,0,0,0) 100%) top/100% 20% no-repeat,
    linear-gradient(to top,    rgba(0,0,0,.95) 0%, rgba(0,0,0,0) 100%) bottom/100% 12% no-repeat;
  border-radius: 8px;
}

/* Ajustes por dispositivo */
@media (max-width: 1024px) {
  .video-container-yt .yt-overlays {
    background-size: 100% 18%, 100% 14%;
  }
}
@media (max-width: 768px) {
  .video-container-yt .yt-overlays {
    background-size: 100% 20%, 100% 18%;
  }
}
@media (max-width: 480px) {
  .video-container-yt .yt-overlays {
    background-size: 100% 22%, 100% 20%;
  }
}
