/* Scott Wagner — TV gallery.
 *
 * Grid of Vimeo videos with thumbnail + title + duration. Click any tile
 * → full-screen modal with an autoplay Vimeo iframe. Data comes from
 * /data/videos.json (scraped from the public Vimeo v2 API at build time).
 *
 * Visual tone matches About/Brokers — dark page, Bondi accents, Montserrat. */

body.tv-page {
  background: #0a141a;
  color: #fff;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, sans-serif;
  padding-top: calc(var(--ticker-h) * 2);
  padding-bottom: var(--bottom-stack-h);
  min-height: 100vh;
}

/* ────────────────────────────────────────────────────────────
 * HEADER
 * ──────────────────────────────────────────────────────────── */
.tv {
  max-width: 1400px;
  margin: 0 auto;
  padding: 64px 28px 80px;
}
.tv__header {
  text-align: center;
  margin: 0 auto 40px;
  max-width: 720px;
}
.tv__kicker {
  margin: 0 0 14px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--bondi);
}
.tv__title {
  margin: 0 0 18px;
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: clamp(40px, 6vw, 72px);
  letter-spacing: -0.02em;
  line-height: 1;
  color: #fff;
}
.tv__lede {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: rgba(255,255,255,0.72);
}

/* ────────────────────────────────────────────────────────────
 * CONTROLS — search + count
 * ──────────────────────────────────────────────────────────── */
.tv__controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 28px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  flex-wrap: wrap;
}
.tv__search {
  display: flex; align-items: center; gap: 10px;
  flex: 1;
  min-width: 260px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: rgba(255,255,255,0.6);
  transition: border-color 0.15s;
}
.tv__search:focus-within {
  border-color: var(--bondi);
  color: rgba(255,255,255,0.9);
}
.tv__search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
}
.tv__search input::placeholder { color: rgba(255,255,255,0.4); }
.tv__count {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}

/* ────────────────────────────────────────────────────────────
 * GRID
 * ──────────────────────────────────────────────────────────── */
.tv__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
@media (max-width: 1100px) { .tv__grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 780px)  { .tv__grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (max-width: 520px)  { .tv__grid { grid-template-columns: 1fr; gap: 12px; } }

.tv-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.18s, transform 0.18s, background-color 0.18s;
  text-align: left;
  padding: 0;
  font-family: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.tv-card:hover {
  border-color: var(--bondi);
  background: rgba(0,127,134,0.06);
  transform: translateY(-2px);
}
.tv-card:focus-visible {
  outline: 2px solid var(--bondi);
  outline-offset: 2px;
}
.tv-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.tv-card__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.tv-card:hover .tv-card__thumb img { transform: scale(1.04); }
.tv-card__play {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.5) 100%);
  opacity: 0.85;
  transition: opacity 0.18s;
}
.tv-card:hover .tv-card__play { opacity: 1; }
.tv-card__play svg {
  width: 54px; height: 54px;
  fill: rgba(255,255,255,0.95);
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
  transition: transform 0.18s;
}
.tv-card:hover .tv-card__play svg { transform: scale(1.08); }
.tv-card__duration {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.tv-card__body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex; flex-direction: column;
}
.tv-card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  /* Clamp to 2 lines so cards stay even-height */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ────────────────────────────────────────────────────────────
 * EMPTY + FOOTER
 * ──────────────────────────────────────────────────────────── */
.tv__empty {
  text-align: center;
  margin: 60px 0;
  font-size: 14px;
  color: rgba(255,255,255,0.5);
}
.tv__footnote {
  margin: 56px auto 0;
  max-width: 620px;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  line-height: 1.55;
}

/* ────────────────────────────────────────────────────────────
 * MODAL PLAYER — opens on tile click
 * ──────────────────────────────────────────────────────────── */
.tv-modal {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 28px;
  animation: tv-fade-in 0.18s ease-out;
}
@keyframes tv-fade-in { from { opacity: 0; } to { opacity: 1; } }
.tv-modal__frame {
  position: relative;
  width: 100%;
  max-width: 1200px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 80px rgba(0,0,0,0.6);
}
.tv-modal__frame iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.tv-modal__close {
  position: absolute;
  top: -44px; right: 0;
  width: 36px; height: 36px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  color: #fff;
  font-size: 22px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background-color 0.15s, border-color 0.15s;
}
.tv-modal__close:hover {
  background: var(--bondi);
  border-color: var(--bondi);
}
.tv-modal__caption {
  position: absolute;
  left: 0; right: 0; bottom: -42px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.78);
}
@media (max-width: 720px) {
  .tv-modal { padding: 50px 16px 80px; }
  .tv-modal__close { top: 8px; right: 8px; }
  .tv-modal__caption { font-size: 12px; bottom: -36px; }
}
