/* === VIDEOTECA === */
.yt-grid {
  padding: 4rem 0;
  background: var(--color-bg, #f9f9f9);
}

.yt-grid .wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.yt-grid h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 2rem;
}

.yt-cards {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 0;
  margin: 0;
}

.yt-card {
  text-align: left;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.yt-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}

.yt-card img {
  width: 100%;
  display: block;
  border-bottom: 3px solid #4A6B47;
}

.yt-title {
  font-weight: 600;
  margin: 0.75rem 1rem 0;
  font-size: 1rem;
}

.yt-date {
  display: block;
  margin: 0.25rem 1rem 1rem;
  font-size: 0.9rem;
  color: #666;
}

/* --- Paginación --- */
.yt-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.yt-pager button {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.yt-pager button:hover {
  background: #4A6B47;
  border-color: #4A6B47;
  color: #fff;
}

.yt-pager button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.yt-pages {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
}

.yt-pages button.is-active {
  background: #4A6B47;
  border-color: #4A6B47;
  color: #fff;
}

/* --- Modal --- */
.yt-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.yt-modal.is-open {
  display: flex;
}

.yt-modal_backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.yt-modal_dialog {
  position: relative;
  max-width: 900px;
  width: 90%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  z-index: 10;
}

.yt-modal_close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  z-index: 20;
}

.yt-player iframe {
  width: 100%;
  aspect-ratio: 16/9;
  display: block;
}

/* Fijar alto uniforme de las miniaturas */
.yt-card img {
  width: 100%;
  height: 180px;              /* <- Ajusta si quieres más o menos alto */
  object-fit: cover;
  border-bottom: 3px solid #4A6B47;
  display: block;
}

/* Mantener siempre 4 por fila hasta tablet horizontal */
@media (min-width: 992px) {
  .yt-cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* En pantallas medianas, 2 por fila */
@media (max-width: 991px) and (min-width: 600px) {
  .yt-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 🔧 En móvil, 1 por fila */
@media (max-width: 599px) {
  .yt-cards {
    grid-template-columns: 1fr;
  }
}

.yt-modal.is-open {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

