/* ------------------------------------------------------------------ */
/* Encabezado con resplandor (mismo lenguaje que contacto/tienda)       */
/* ------------------------------------------------------------------ */

.page-header--glow {
  position: relative;
  overflow: hidden;
}

.page-header__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(520px circle at 85% 0%, rgba(var(--color-primary-rgb), 0.12), transparent 60%);
  pointer-events: none;
}

.page-header--glow .container {
  position: relative;
  z-index: 1;
}

.page-header__desc {
  max-width: 60ch;
  color: var(--color-text-muted);
  margin-top: var(--space-3);
}

/* ------------------------------------------------------------------ */
/* Chart Top 20 — lista de posiciones (no grid de tarjetas): el ranking */
/* se lee mejor como lista ordenada, con el numero de posicion como     */
/* protagonista, al estilo de un conteo musical.                       */
/* ------------------------------------------------------------------ */

.video-chart {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--color-border);
}

.video-row {
  display: grid;
  grid-template-columns: 40px 88px 1fr auto;
  align-items: center;
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--duration-fast) var(--ease-standard);
}

.video-row:hover {
  background: var(--color-bg-elevated);
}

.video-row__rank {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-xl);
  color: var(--color-metal-dark);
  text-align: center;
}

.video-row--top1 .video-row__rank {
  color: #ffd166;
  font-size: var(--fs-2xl);
}

.video-row--top2 .video-row__rank {
  color: #cfd4de;
  font-size: var(--fs-2xl);
}

.video-row--top3 .video-row__rank {
  color: #d99a6c;
  font-size: var(--fs-2xl);
}

.video-row__thumb {
  position: relative;
  width: 88px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated-2);
  flex-shrink: 0;
}

.video-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-standard);
}

.video-row__thumb:hover img {
  transform: scale(1.08);
}

.video-row__play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 7, 0.35);
  color: var(--color-white);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-standard);
}

.video-row__thumb:hover .video-row__play-icon {
  opacity: 1;
}

.video-row__play-icon .icon-play {
  width: 22px;
  height: 22px;
  font-size: 1.3em;
}

.video-row__body {
  min-width: 0;
}

.video-row__title {
  font-size: var(--fs-md);
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.video-row__desc {
  margin-top: var(--space-1);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-row__votes {
  display: none;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  padding-inline: var(--space-3);
}

.video-row__votes-count {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-lg);
  color: var(--color-white);
}

.video-row__votes-label {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.video-row__vote-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(var(--color-primary-rgb), 0.4);
  background: transparent;
  color: var(--color-primary);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: background var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard),
    transform var(--duration-fast) var(--ease-standard);
}

.video-row__vote-btn:hover:not(:disabled) {
  background: var(--gradient-primary);
  color: var(--color-white);
  transform: translateY(-2px);
}

.video-row__vote-btn.is-voted {
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}

.video-row__vote-btn:disabled:not(.is-voted) {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 479px) {
  .video-row {
    grid-template-columns: 28px 72px 1fr;
    grid-template-areas: "rank thumb body" "rank thumb votes";
  }

  .video-row__rank { grid-area: rank; }
  .video-row__thumb { grid-area: thumb; width: 72px; }
  .video-row__body { grid-area: body; }
  .video-row__votes { grid-area: votes; }

  .video-row__vote-btn {
    grid-area: votes;
    justify-self: end;
  }

  .video-row__desc {
    display: none;
  }
}

@media (min-width: 480px) {
  .video-row {
    grid-template-columns: 40px 120px 1fr auto auto;
  }

  .video-row__thumb {
    width: 120px;
  }

  .video-row__votes {
    display: flex;
  }
}

/* ------------------------------------------------------------------ */
/* Modal de reproduccion (embed de YouTube)                             */
/* ------------------------------------------------------------------ */

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-base) var(--ease-standard),
    visibility 0s linear var(--duration-base);
}

.video-modal--open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--duration-base) var(--ease-standard);
}

.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 7, 0.9);
}

.video-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
}

.video-modal__close {
  position: absolute;
  top: -44px;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-round);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  color: var(--color-white);
  font-size: 1.4rem;
  line-height: 1;
}

.video-modal__close:hover {
  background: var(--color-bg-elevated-2);
}

.video-modal__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg-elevated);
  box-shadow: var(--shadow-lg);
}

.video-modal__frame iframe,
.video-modal__frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

/* ------------------------------------------------------------------ */
/* Vista previa del home: mismo componente .video-row en una tarjeta    */
/* contenedora, con solo el Top 5 y un CTA al Top 20 completo.          */
/* ------------------------------------------------------------------ */

.videos-preview {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg-elevated);
}

.videos-preview .video-chart {
  border-top: none;
}

.videos-preview .video-row {
  padding-inline: var(--space-5);
}

.videos-preview .video-row:last-child {
  border-bottom: none;
}
