/* Eturnal Rest -- videos page. Uses tokens.css + base.css; no parallel design
   system. Grid + card + click-to-load embed only. */

/* ---- grid ---- */
.video-grid {
  list-style: none;
  margin: 0;
  padding: var(--space-6) 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

/* ---- card ---- */
.video-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--dur-2) var(--ease);
}
.video-card:hover {
  box-shadow: var(--shadow-md);
}

/* ---- thumbnail button ---- */
.video-card__thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--blue-950);
  cursor: pointer;
  /* aspect-ratio keeps the 16:9 shape even before the image loads */
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.video-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--dur-2) var(--ease);
}
.video-card__thumb:hover .video-card__img {
  opacity: 0.85;
}
.video-card__thumb:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---- play button overlay ---- */
.video-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  /* subtle scale-up on hover via the parent button */
  transition: transform var(--dur-2) var(--ease-out);
}
.video-card__thumb:hover .video-card__play {
  transform: scale(1.12);
}

/* ---- embed (replaces the thumb on click) ---- */
.video-card__embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.video-card__embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ---- card body ---- */
.video-card__body {
  padding: var(--space-4) var(--space-5) var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.video-card__title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--blue-900);
  line-height: 1.3;
  margin: 0;
}
.video-card__desc {
  font-size: var(--fs-meta);
  line-height: 1.5;
  margin: 0;
  flex: 1;
}
.video-card__meta {
  font-size: 0.82rem;
  color: var(--ink-4);
  margin: 0;
}

/* ---- empty state ---- */
.video-empty {
  padding: var(--space-7) 0;
}

/* ---- channel CTA ---- */
.video-channel-cta {
  border-top: 1px solid var(--line);
  padding-top: var(--space-5);
}

/* ---- responsive ---- */
@media (max-width: 900px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
}
