/* Список фільмів /film/: обкладинки з вертикальних фільмів, фільм угорі, що змінюється, добірки рядками і пошук. Поверх pack.css і scrolly.css.
   Кольори і шрифти лише з токенів PixelKit; рамка тільки довкола кадру, як у самого фільму. */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main.watch.tube { max-width: 1240px; padding-left: 24px; padding-right: 24px; }
.tube > *, .tube section > * { margin-left: 0 !important; }
.tube h1 { margin: 0; }
.tube-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.tube-search { flex: 1 1 280px; max-width: 520px; margin: 0 0 0 auto; }
.tube-search input { width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px 14px; font: 15px/1.2 var(--pk-mono); color: var(--pk-ink); background: var(--pk-card); border: 1px solid var(--pk-rule); border-radius: 0; }
.tube-search input:focus-visible { outline: 2px solid var(--pk-blue); outline-offset: 1px; }
.tube-lead { margin: 28px 0 0; font-size: 17px; color: var(--pk-muted); }

/* a frame: poster, the moving preview over it, length and draft mark in the corners */
.thumb { position: relative; display: block; aspect-ratio: 432 / 536; overflow: hidden; background: var(--pk-card); border: 1px solid var(--pk-rule); }
.thumb img, .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb img.ico { inset: 30% 25%; width: 50%; height: auto; object-fit: contain; }
.thumb video { opacity: 0; transition: opacity .25s; }
.thumb.on video { opacity: 1; }
.thumb .dur, .thumb .badge { position: absolute; z-index: 1; font: 500 12px/1 var(--pk-mono); padding: 4px 6px; background: var(--pk-ink); color: var(--pk-paper); }
.thumb .dur { right: 6px; bottom: 6px; }
.thumb .badge { left: 6px; top: 6px; background: var(--pk-paper); color: var(--pk-ink); border: 1px solid var(--pk-ink); }

/* the film on top */
.spot { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 560px); gap: 32px; align-items: center; margin-top: 32px; }
.spot .thumb { border-color: var(--pk-ink); }
.spot-txt h2 { margin: 6px 0 12px; font: 700 34px/1.15 var(--pk-mono); }
.spot-txt h2 a { color: var(--pk-ink); text-decoration: none; }
.spot-txt h2 a:hover { text-decoration: underline; text-underline-offset: 5px; }
.spot-p { margin: 0; font: 500 13px/1.3 var(--pk-mono); color: var(--pk-muted); }
.spot-l { margin: 0 0 20px; font-size: 17px; line-height: 1.5; }
.spot-go { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; font: 500 15px/1 var(--pk-mono); color: var(--pk-paper); background: var(--pk-ink); text-decoration: none; }
.spot-go:hover, .spot-go:focus-visible { background: var(--pk-blue); }
.spot-nav { margin: 14px 0 0; }
.spot-nav .ghost { min-height: 44px; }
.spot.swap .spot-txt, .spot.swap .thumb img { animation: tube-in .35s ease-out; }
@keyframes tube-in { from { opacity: 0; } to { opacity: 1; } }

/* shelves: one row that scrolls sideways, like a playlist; search results as a grid */
.tube .shelf { margin-top: 44px; padding-top: 0; min-height: 0; }
.shelf-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 14px; }
.tube .shelf-h h2 { margin: 0; font: 700 24px/1.2 var(--pk-mono); }
.shelf-h .n { font: 13px/1 var(--pk-mono); color: var(--pk-muted); }
.shelf-h .more { margin-left: auto; font: 500 14px/1 var(--pk-mono); }
.shelf-row, .shelf-grid { list-style: none; margin: 0; padding: 0; }
.shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 10px; scrollbar-width: thin; }
.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px 16px; }
.tube-card { scroll-snap-align: start; min-width: 0; }
.tube-card a { display: block; color: var(--pk-ink); text-decoration: none; }
.tube-card .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 8px; font: 500 15px/1.3 var(--pk-sans); }
.tube-card a:hover .t, .tube-card a:focus-visible .t { text-decoration: underline; text-underline-offset: 3px; }
.tube-card a:hover .thumb, .tube-card a:focus-visible .thumb { border-color: var(--pk-ink); }
.tube-card a:focus-visible { outline: 2px solid var(--pk-blue); outline-offset: 3px; }
.tube-card .m { display: block; margin-top: 4px; font: 12px/1.3 var(--pk-mono); color: var(--pk-muted); }
.tube footer { margin-top: 64px; }

/* phone: the shelves bleed to the screen edge and show two and a half frames, the film on top sits beside its text */
@media (max-width: 640px) {
  main.watch.tube { padding-left: 16px; padding-right: 16px; }
  .tube-search { flex-basis: 100%; max-width: none; margin: 0; }
  .spot { grid-template-columns: 42% minmax(0, 1fr); gap: 16px; margin-top: 20px; align-items: start; }
  .spot-txt h2 { font-size: 21px; }
  .spot-l { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 14px; }
  .spot-go { padding: 0 14px; }
  .spot-nav .ghost { min-height: 40px; padding: 6px 10px; }
  .tube-lead { font-size: 15px; }
  .tube .shelf { margin-top: 32px; }
  .tube .shelf-h h2 { font-size: 20px; }
  .tube .shelf .shelf-row { grid-auto-columns: 38vw; gap: 12px; margin: 0 -16px !important; padding: 0 16px 8px; scroll-padding: 0 16px; }
  .shelf-grid { grid-template-columns: 1fr 1fr; gap: 20px 12px; }
}
@media (prefers-reduced-motion: reduce) { .spot.swap .spot-txt, .spot.swap .thumb img { animation: none; } .thumb video { transition: none; } }
.tube [hidden] { display: none !important; }
