/* /videos. EE design system rev 3 (DESIGN.md): paper canvas, DM Sans, EE blue for links and focus. The thumbnails carry the page. */
:root {
  --ee-bg: #F5F3EE;
  --ee-surface: #FFFFFF;
  --ee-text: #14243A;
  --ee-muted: #526174;
  --ee-line: #DDD9D0;
  --ee-primary: #0052FF;
  --vp-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --vp-enter: cubic-bezier(.22, 1, .36, 1);
  /* Same box as the shared header, so the page lines up under the logo. */
  --vp-box: min(1180px, calc(100% - 40px));
  --vp-gutter: 20px;
  /* The shared header and footer read these; this page sets them to DM Sans. */
  --ee-public-display: var(--vp-sans);
  --ee-public-body: var(--vp-sans);
}
* { box-sizing: border-box; }
html { overflow-x: clip; }
body {
  margin: 0;
  background: var(--ee-bg);
  color: var(--ee-text);
  font: 400 20px/1.5 var(--vp-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--ee-primary); text-underline-offset: 4px; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
main :focus-visible, .vp-player :focus-visible { outline: 3px solid rgba(0, 82, 255, .4); outline-offset: 3px; }
.vp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.vp-skip { position: absolute; left: -999px; top: 8px; padding: 10px 14px; border-radius: 10px; background: var(--ee-surface); color: var(--ee-text); }
.vp-skip:focus { left: 8px; }

/* Page name and the one search box. */
.vp-bar { display: flex; align-items: center; gap: 24px; width: var(--vp-box); margin: 0 auto; padding-top: 24px; }
.vp-bar h1 { font-size: 28px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
.vp-bar input {
  flex: 1 1 auto; min-width: 0; max-width: 560px; min-height: 52px; padding: 0 16px;
  border: 1px solid var(--ee-line); border-radius: 10px; background: var(--ee-surface); font-size: 18px;
}
.vp-bar input:focus-visible { outline: 3px solid rgba(0, 82, 255, .4); outline-offset: 0; border-color: var(--ee-primary); }

/* The wall: one row per topic, a wrapping grid on wide screens. */
.vp-wall { width: var(--vp-box); margin: 0 auto; }
/* Reserve space only while the list loads, so the empty state sits right under the search box. */
.vp-wall[aria-busy="true"] { min-height: 70vh; }
.vp-row { margin-top: 32px; }
.vp-row h2 { font-size: 20px; line-height: 1.3; font-weight: 600; }
.vp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 20px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.vp-card { min-width: 0; }
.vp-card h3 {
  margin-top: 10px; font-size: 20px; line-height: 1.3; font-weight: 600;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.vp-channel { margin-top: 2px; color: var(--ee-muted); font-size: 18px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Click-to-load facade. Photos keep square corners (DESIGN.md). */
.vp-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; background: #E9E5DC; cursor: pointer; overflow: hidden; }
.vp-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .22s var(--vp-enter); }
.vp-thumb:hover img { transform: scale(1.03); }
.vp-card:has(.vp-thumb:hover) h3 { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.vp-thumb:focus-visible { outline-offset: 2px; }
.vp-dur {
  position: absolute; right: 8px; bottom: 8px;
  padding: 1px 6px; border-radius: 6px;
  background: rgba(20, 36, 58, .88); color: #FFFFFF;
  font-size: 15px; font-weight: 500; line-height: 1.5; font-variant-numeric: tabular-nums;
}

.vp-btn {
  min-height: 52px; padding: 0 20px;
  border: 1px solid var(--ee-line); border-radius: 10px;
  background: var(--ee-surface); color: var(--ee-text);
  font-weight: 500; cursor: pointer;
  transition: border-color .12s var(--vp-enter);
}
.vp-btn:hover { border-color: var(--ee-text); }

.vp-empty { display: flex; align-items: center; gap: 16px; width: var(--vp-box); margin: 0 auto; padding-top: 32px; color: var(--ee-muted); }
.vp-error { padding-top: 32px; color: var(--ee-muted); }

.vp-note { display: flex; flex-wrap: wrap; gap: 8px 24px; width: var(--vp-box); margin: 64px auto 0; padding: 24px 0 64px; border-top: 1px solid var(--ee-line); color: var(--ee-muted); }

/* Player dialog. */
.vp-frame { position: relative; aspect-ratio: 16 / 9; background: #0B0F1A; overflow: hidden; }
.vp-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vp-player {
  /* Wide enough to watch, short enough that title, video and link fit one screen. */
  width: min(1120px, calc(100vw - 32px), calc((100vh - 200px) * 16 / 9));
  width: min(1120px, calc(100vw - 32px), calc((100dvh - 200px) * 16 / 9));
  min-width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0; border: 0; border-radius: 20px;
  background: var(--ee-surface); color: var(--ee-text);
  overflow: auto;
}
.vp-player::backdrop { background: rgba(11, 15, 26, .78); }
.vp-player[open] { animation: vp-in .22s var(--vp-enter); }
.vp-player__head, .vp-player__foot { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 12px 12px 24px; }
.vp-player__head h2 { font-size: 20px; line-height: 1.3; font-weight: 600; }
.vp-player__foot { padding: 14px 24px 18px; }
.vp-player__foot .vp-channel { margin: 0; }
.vp-player__foot a { flex: none; }
@keyframes vp-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* Phones and small tablets: each topic row scrolls sideways (one screen per row, no endless scroll); the next video peeks. */
@media (max-width: 767px) {
  body { font-size: 18px; }
  .vp-card h3 { font-size: 18px; }
  .vp-bar { gap: 16px; padding-top: 16px; }
  .vp-bar h1 { font-size: 24px; }
  .vp-wall { width: 100%; }
  .vp-row { margin-top: 24px; }
  .vp-row h2 { padding: 0 var(--vp-gutter); }
  .vp-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(74vw, 300px);
    gap: 16px;
    padding: 0 var(--vp-gutter) 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--vp-gutter);
    scrollbar-width: none;
  }
  .vp-grid::-webkit-scrollbar { display: none; }
  .vp-card { scroll-snap-align: start; }
  .vp-note { margin-top: 40px; }
  .vp-player { width: 100vw; max-width: 100vw; min-width: 0; max-height: 100dvh; border-radius: 0; margin: auto 0; }
  .vp-player__head { padding: 8px 8px 8px 20px; }
  .vp-player__head h2 { font-size: 18px; }
  .vp-player__foot { flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 20px 20px; }
}
@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
  .vp-grid { scroll-behavior: smooth; }
}
