/* ===========================================================================
   Блок телеканалов на главной (см. site/tv/home-block.mjs)

   Отдельный файл, а не часть styles.css: главную правят и другие руки, и
   стили телепрограммы не должны встречаться с ними в одном файле. Классы с
   префиксом `tvh-` по той же причине.
   =========================================================================== */
.tvh { padding: 44px 0 8px; }
.tvh-top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.tvh-top h2 { margin: 0 0 14px; font-size: 26px; }
.tvh-all { color: var(--brand-accent); text-decoration: none; font-size: 14px; white-space: nowrap; }
.tvh-all:hover { text-decoration: underline; }

/* Полосы прокрутки: стрелки снаружи, чтобы не уезжали вместе с содержимым. */
.tvh-chips-wrap, .tvh-rail-wrap { display: flex; align-items: center; gap: 6px; }
.tvh-chips-wrap { margin-bottom: 16px; }
.tvh-chips, .tvh-rail { display: flex; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; flex: 1; }
.tvh-chips::-webkit-scrollbar, .tvh-rail::-webkit-scrollbar { display: none; }
.tvh-chips { gap: 8px; }
.tvh-rail { gap: 14px; padding-bottom: 6px; }

.tvh-chip {
  flex: none; padding: 7px 14px; font-size: 14px; white-space: nowrap;
  color: var(--ink); text-decoration: none;
  border: 1px solid var(--line-strong); border-radius: 999px;
}
.tvh-chip:hover { border-color: var(--brand-accent); }
.tvh-chip.is-cur { border-color: var(--brand-accent); color: var(--brand-accent); }

.tvh-arrow {
  flex: none; width: 32px; height: 40px; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); border-radius: 10px; color: var(--ink);
}
.tvh-arrow svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tvh-arrow:hover:not(:disabled) { border-color: var(--brand-accent); color: var(--brand-accent); }
.tvh-arrow:disabled { opacity: .25; cursor: default; }

/* --- Карточка канала ------------------------------------------------------- */
.tvh-card {
  position: relative; flex: none; width: 260px; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px;
}
.tvh-card:hover { border-color: var(--line-strong); }

/* Плитка целиком — ссылка, растянутая поверх карточки. Вложенные ссылки в
   HTML недопустимы, поэтому «Программа передач» поднята над ней z-index-ом. */
.tvh-hit { position: absolute; inset: 0; z-index: 1; border-radius: 14px; }

.tvh-head { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* Окантовка логотипа канала.
   Логотипы приходят НЕПРОЗРАЧНЫМИ, со своим фоном, и фон этот бывает любой:
   у «2х2» чёрный квадрат, у большинства белый. Без границы чёрный логотип
   сливается с тёмной страницей, а белый — с белой плашкой в дашборде.
   Поэтому цвет средне-серый, а не белый с прозрачностью: белая рамка видна на
   чёрном логотипе и исчезает на белом, серая читается на обоих. */
.tvh-logo { width: 48px; height: 48px; object-fit: contain; border-radius: 10px;
            background: #fff1; flex: none; border: 1px solid rgba(150, 158, 178, .55); }
.tvh-logo-stub { display: inline-flex; align-items: center; justify-content: center;
                 font-weight: 700; font-size: 15px; color: var(--muted);
                 background: var(--bg-card-2); border: 1px solid var(--line); }
.tvh-name { font-weight: 600; font-size: 15px; min-width: 0;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvh-num { color: var(--muted); font-weight: 500; margin-inline-end: 6px; }

/* Место под плеер: кнопка появляется на наведении и пока только обозначает
   намерение — играть нечего, каталог ОТТ ещё не переехал. Когда переедет,
   сюда встанет запуск потока без правки разметки. */
.tvh-play {
  position: absolute; inset-block-start: 14px; inset-inline-end: 14px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; pointer-events: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-accent); color: #fff; opacity: 0; transition: opacity .15s;
}
.tvh-play svg { fill: currentColor; margin-inline-start: 2px; }
.tvh-card:hover .tvh-play { opacity: 1; }

.tvh-live { display: flex; flex-direction: column; gap: 6px; min-height: 42px; }
.tvh-live-title { font-size: 14px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tvh-live-empty { color: var(--muted); font-size: 13px; }
.tvh-bar { display: block; height: 3px; border-radius: 3px; background: var(--line-strong); }
.tvh-bar span { display: block; height: 100%; border-radius: 3px; background: var(--brand-accent); }

.tvh-next { display: flex; flex-direction: column; gap: 3px; min-height: 40px;
            padding-top: 8px; border-top: 1px solid var(--line); }
.tvh-next-when { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.tvh-next-title { font-size: 13px; color: var(--muted); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

.tvh-more {
  position: relative; z-index: 2; margin-top: auto; padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  color: var(--muted); text-decoration: none; font-size: 13px;
}
.tvh-more svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tvh-more:hover { color: var(--brand-accent); }

@media (max-width: 767px) {
  /* Пальцем лента листается сама — кнопки только отнимают ширину. */
  .tvh-arrow { display: none; }
  .tvh { padding-top: 32px; }
  .tvh-top h2 { font-size: 22px; }
  .tvh-card { width: 230px; }
  .tvh-chip { min-height: 40px; display: inline-flex; align-items: center; }
}
