/* ===========================================================
   VÍDEOS — rejillas de vídeos, shorts, directos y listas
   Se usa en videos.html y en la sección "Últimos vídeos" del home.
   Estilo Olicartoons: bordes negros, sombras duras y colorines.
   =========================================================== */

/* ----------------------------- pestañas ----------------------------- */
.yt-tabs {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  margin: 0 auto 34px;
}
.yt-tab {
  font-family: var(--font-display); font-weight: 800; font-size: 1rem;
  padding: 11px 22px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--negro); background: #fff; color: var(--negro);
  box-shadow: 4px 4px 0 var(--negro);
  transition: transform var(--transicion), box-shadow var(--transicion), background .2s, color .2s;
}
.yt-tab:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--negro); }
.yt-tab.on { background: var(--rojo); color: #fff; }
.yt-tab.on:hover { transform: none; box-shadow: 4px 4px 0 var(--negro); }
.yt-tab__ico { margin-right: 7px; }

/* ----------------------------- rejillas ----------------------------- */
.yt-grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}
.yt-grid--shorts { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.yt-grid--listas { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* --------------------------- tarjeta vídeo --------------------------- */
.yt-card, .yt-list {
  display: flex; flex-direction: column; text-align: left; gap: 0;
  padding: 0; cursor: pointer; font: inherit; color: inherit;
  background: #fff; border: 2px solid var(--negro); border-radius: var(--radio-sm);
  box-shadow: 5px 5px 0 var(--negro); overflow: hidden;
  transition: transform var(--transicion), box-shadow var(--transicion);
}
.yt-card:hover, .yt-list:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--negro); }
.yt-card:active, .yt-list:active { transform: translate(0, 0); box-shadow: 3px 3px 0 var(--negro); }

.yt-card__thumb {
  position: relative; display: block; aspect-ratio: 16 / 9; background: #0d0d14;
  border-bottom: 2px solid var(--negro); overflow: hidden;
}
.yt-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s ease; }
.yt-card:hover .yt-card__thumb img { transform: scale(1.06); }
.yt-card__play {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 1.5rem; color: #fff; opacity: 0; transition: opacity .25s ease;
  background: rgba(12, 12, 20, .42); text-shadow: 0 3px 10px rgba(0, 0, 0, .6);
}
.yt-card:hover .yt-card__play, .yt-card:focus-visible .yt-card__play { opacity: 1; }

.yt-card__body { display: block; padding: 13px 15px 15px; }
.yt-card__title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-family: var(--font-display); font-weight: 800; font-size: 1rem; line-height: 1.25;
}
.yt-card__meta { display: block; margin-top: 6px; font-size: .82rem; color: #6b7280; font-weight: 600; }

/* shorts: miniatura vertical */
.yt-card--vert .yt-card__thumb { aspect-ratio: 9 / 16; }
.yt-card--vert .yt-card__thumb img { transform: scale(1.75); }
.yt-card--vert:hover .yt-card__thumb img { transform: scale(1.85); }
.yt-card--vert .yt-card__title { font-size: .92rem; -webkit-line-clamp: 3; }

/* --------------------------- tarjeta lista --------------------------- */
.yt-list__thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #0d0d14; border-bottom: 2px solid var(--negro); }
.yt-list__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-list__n {
  position: absolute; right: 8px; bottom: 8px; background: rgba(12, 12, 20, .85); color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: .78rem; padding: 4px 10px; border-radius: 999px;
}
.yt-list__title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  padding: 12px 14px 14px; font-family: var(--font-display); font-weight: 800; font-size: .98rem; line-height: 1.25;
}

/* ------------------------ estados y avisos ------------------------ */
.yt-estado { text-align: center; color: #6b7280; font-weight: 700; padding: 34px 0; }
.yt-esqueleto {
  border: 2px solid var(--negro); border-radius: var(--radio-sm); background: #eef1f7;
  aspect-ratio: 16 / 9; box-shadow: 5px 5px 0 var(--negro);
  animation: yt-latido 1.1s ease-in-out infinite alternate;
}
.yt-grid--shorts .yt-esqueleto { aspect-ratio: 9 / 16; }
@keyframes yt-latido { from { opacity: .55; } to { opacity: 1; } }

.yt-volver {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; cursor: pointer;
  font-family: var(--font-display); font-weight: 800; background: #fff; color: var(--negro);
  border: 2px solid var(--negro); border-radius: 999px; padding: 8px 18px; box-shadow: 3px 3px 0 var(--negro);
}
.yt-volver:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--negro); }

.yt-embed {
  position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden;
  border: 2px solid var(--negro); border-radius: var(--radio-sm); box-shadow: 6px 6px 0 var(--negro);
}
.yt-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* --------------------------- destacado home --------------------------- */
.yt-destacado { display: grid; grid-template-columns: 1.35fr 1fr; gap: 26px; align-items: stretch; }
.yt-destacado__lista { display: flex; flex-direction: column; gap: 14px; }
.yt-mini {
  display: grid; grid-template-columns: 132px 1fr; gap: 12px; align-items: center; text-align: left;
  padding: 0; cursor: pointer; font: inherit; color: inherit; background: #fff;
  border: 2px solid var(--negro); border-radius: var(--radio-sm); box-shadow: 4px 4px 0 var(--negro); overflow: hidden;
  transition: transform var(--transicion), box-shadow var(--transicion);
}
.yt-mini:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--negro); }
.yt-mini__thumb { aspect-ratio: 16 / 9; background: #0d0d14; border-right: 2px solid var(--negro); }
.yt-mini__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-mini__body { padding: 8px 12px 8px 0; }
.yt-mini__title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-family: var(--font-display); font-weight: 800; font-size: .95rem; line-height: 1.22;
}
.yt-mini__meta { display: block; margin-top: 4px; font-size: .78rem; color: #6b7280; font-weight: 600; }

.yt-fila { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.yt-sub {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; margin: 42px 0 18px;
}
.yt-sub::before, .yt-sub::after { content: ""; height: 2px; flex: 1; background: repeating-linear-gradient(90deg, var(--negro) 0 8px, transparent 8px 16px); opacity: .35; }

/* ------------------------------ modal ------------------------------ */
.yt-modal {
  position: fixed; inset: 0; z-index: 4000; display: none; place-items: center;
  background: rgba(8, 8, 16, .82); padding: 20px; backdrop-filter: blur(3px);
}
.yt-modal.abierto { display: grid; }
.yt-modal__caja { position: relative; width: min(980px, 100%); }
.yt-modal__caja.es-vertical { width: min(420px, 100%); }
.yt-modal__marco {
  position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden;
  border: 3px solid #fff; border-radius: var(--radio-sm); box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}
.yt-modal__caja.es-vertical .yt-modal__marco { aspect-ratio: 9 / 16; }
.yt-modal__marco iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-modal__x {
  position: absolute; top: -14px; right: -14px; z-index: 2; width: 42px; height: 42px; border-radius: 50%;
  background: var(--rojo); color: #fff; border: 3px solid #fff; font-size: 1.1rem; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}
.yt-modal__x:hover { transform: scale(1.08); }

/* ------------------------------ móvil ------------------------------ */
@media (max-width: 900px) {
  .yt-destacado { grid-template-columns: 1fr; }
  .yt-destacado__lista { flex-direction: column; }
}
@media (max-width: 560px) {
  .yt-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .yt-grid--shorts { grid-template-columns: repeat(2, 1fr); }
  .yt-mini { grid-template-columns: 112px 1fr; }
  .yt-modal__x { top: -10px; right: -6px; width: 38px; height: 38px; }
}
