/* 23.10.2026: общая страница /video-tvprog в новом дизайне (templates/tv_main.php, tv_main_panel.php).
   Цвета, шрифт, вкладки дней, чипы, переключатель, панель «Фильтры» и кнопки - из tv-channel.css (страница в .tvc) */

.tvm .tvc-sub { margin-bottom: 16px; }
.tvm .tvc-sub b { color: var(--tvc-text); }
.tvm .tvc-days { margin-top: 4px; }
/* «Сегодня» заметно и когда выбран другой день - зелёная рамка и текст, как у активной вкладки */
.tvm .tvc-day.is-today:not(.is-active) { border-color: var(--tvc-green); color: var(--tvc-green); font-weight: 700; }
.tvm .tvc-filters { flex-wrap: wrap; }
.tvm .tvc-switch-label { margin-left: auto; }

.tvm-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 6px 0 12px; }
.tvm-sec-h h2 { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 800; }
.tvm .tvm-sec-h a { font-size: 14px; text-decoration: none; white-space: nowrap; }

/* плитка логотипа */
.tvm-tile { width: 36px; height: 36px; border-radius: 9px; background: #f6f7f9; border: 1px solid var(--tvc-line); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.tvm-tile img { max-width: 28px; max-height: 22px; width: auto; height: auto; object-fit: contain; }
/* 23.10.2026: логотипы в карточках матчей крупнее (были 22x16 - не читались) */
.tvm-tile-s { width: 40px; height: 40px; border-radius: 10px; }
.tvm-tile-s img { max-width: 32px; max-height: 26px; }

/* матчи в прямом эфире сегодня: большая карточка + две справа, лента */
.tvm-live { margin-bottom: 24px; }
.tvm-hero-row { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.tvm-hero { background: #16181d; color: #fff; border-radius: 18px; padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tvm-hero-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: #c9ccd3; }
.tvm-soon { background: #2a2e37; color: #fff; font-weight: 700; font-size: 12px; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.tvm-hero-ch { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; }
.tvm-hero-ch .tvm-tile { width: 44px; height: 44px; border-radius: 10px; background: #fff; border-color: #fff; }
.tvm-hero-ch .tvm-tile img { max-width: 36px; max-height: 28px; }
.tvm-hero-league { margin-left: auto; }
.tvm-hero-title { font-size: 30px; line-height: 1.15; font-weight: 800; }
.tvm-hero-bar { height: 6px; border-radius: 6px; background: #343944; overflow: hidden; }
.tvm-hero-bar i { display: block; height: 100%; background: var(--tvc-red); }
.tvm-hero-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.tvm .tvm-btn-dark { display: inline-block; background: #2a2e37; color: #fff; font-weight: 600; font-size: 15px; padding: 12px 18px; border-radius: 12px; text-decoration: none; }
.tvm-hero-side { display: grid; gap: 12px; min-width: 0; }
.tvm-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, calc((100% - 36px) / 4)); gap: 12px; overflow-x: auto; margin-top: 12px; padding-bottom: 6px; scrollbar-width: thin; }

@media (pointer: fine) { .tvm-strip { cursor: grab; } .tvm-strip.is-dragging { cursor: grabbing; user-select: none; } .tvm-strip.is-dragging .tvm-lc { pointer-events: none; } }
.tvm .tvm-lc { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px 14px; border: 1px solid var(--tvc-line); border-radius: 14px; background: #fff; color: var(--tvc-text); text-decoration: none; }
.tvm .tvm-lc:hover { border-color: var(--tvc-border); }
.tvm .tvm-lc.is-now { background: #16181d; border-color: #16181d; color: #fff; }
.tvm-lc-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tvc-muted); }
.tvm-lc.is-now .tvm-lc-top { color: #c9ccd3; }
.tvm-lc-time { font-weight: 800; color: var(--tvc-text); font-variant-numeric: tabular-nums; }
.tvm-lc.is-now .tvm-lc-time { color: #fff; }
.tvm-lc-ch { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvm-lc-top .tvm-tile { margin-left: auto; }
.tvm-lc-title { font-size: 15px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tvm-lc-league { font-size: 12px; color: var(--tvc-muted); }
.tvm-lc.is-now .tvm-lc-league { color: #c9ccd3; }
.tvm-lc-cta { margin-top: auto; font-size: 13px; font-weight: 700; color: var(--tvc-green); }
.tvm-lc.is-now .tvm-lc-cta { color: #6fd39a; }
.tvm-night { margin-left: 4px; font-size: 11px; font-weight: 400; color: var(--tvc-muted); }

/* каналы: поиск и сетка */
.tvm-nav-sec { margin: 28px 0 8px; }
.tvm-search { display: flex; align-items: center; gap: 10px; max-width: 420px; min-height: 46px; padding: 0 14px; margin: 8px 0 16px; border: 1px solid var(--tvc-border); border-radius: 12px; background: #fff; }
.tvm-search input { font: inherit; font-size: 15px; flex: 1; min-width: 0; height: 44px; margin: 0; padding: 0; border: 0; outline: none; box-shadow: none; background: transparent; }
.tvm-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tvm .tvm-nav a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 10px; border: 1px solid var(--tvc-line); border-radius: 12px; color: var(--tvc-text); text-decoration: none; font-size: 13px; font-weight: 700; line-height: 1.2; }
.tvm .tvm-nav a:hover { border-color: var(--tvc-border); background: #fafbfc; }
.tvm .tvm-nav a[hidden] { display: none; }
.tvm-nav-logo { width: 34px; height: 26px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.tvm-nav-logo img { max-width: 34px; max-height: 22px; width: auto; height: auto; object-fit: contain; }
.tvm-nav-name { display: flex; flex-direction: column; min-width: 0; }
.tvm-nav-name small { font-size: 11px; font-weight: 400; color: var(--tvc-muted); }
.tvm-search-empty { margin: -6px 0 16px; font-size: 14px; color: var(--tvc-muted); }

/* программа каналов */
.tvm-panels.is-loading { opacity: .5; }
.tvm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.tvm-empty { padding: 18px 0; font-size: 15px; color: var(--tvc-muted); }
.tvm-ch { border: 1px solid var(--tvc-line); border-radius: 16px; overflow: hidden; background: #fff; }
.tvm-ch[hidden] { display: none; }
.tvm-ch-h { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #fafbfc; border-bottom: 1px solid var(--tvc-line); }
.tvm-ch-h .tvm-tile { width: 40px; height: 40px; background: #fff; }
.tvm-ch-h h3 { margin: 0; font-size: 17px; line-height: 1.2; font-weight: 800; }
.tvm .tvm-ch-h h3 a { color: var(--tvc-text); text-decoration: none; }
.tvm .tvm-ch-h h3 a:hover { color: var(--tvc-link); }
.tvm .tvm-week { margin-left: auto; font-size: 13px; text-decoration: none; white-space: nowrap; }

.tvm-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; column-gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--tvc-line); font-size: 14px; line-height: 1.35; }
.tvm-tm { font-weight: 700; font-variant-numeric: tabular-nums; }
.tvm .tvm-ttl a { color: var(--tvc-text); text-decoration: none; font-weight: 600; }
.tvm .tvm-ttl a:hover { color: var(--tvc-link); }
.tvm-tag { margin-left: 6px; padding: 1px 6px; border-radius: 4px; font-size: 12px; font-weight: 700; color: #1f7a43; background: #e6f4ec; white-space: nowrap; }
.tvm-tag.is-replay { color: var(--tvc-muted); background: transparent; font-weight: 400; padding: 0; }
.tvm .tvm-cta { font-size: 13px; font-weight: 700; color: var(--tvc-green); text-decoration: none; white-space: nowrap; }
.tvm-row.is-now { background: #fff1f1; }
.tvm-row.is-now .tvm-ttl { font-weight: 700; }
.tvm-row.is-past { color: var(--tvc-muted); }
.tvm-bar { grid-column: 2; display: block; height: 3px; margin-top: 6px; border-radius: 3px; background: #f3d2d2; overflow: hidden; }
.tvm-bar i { display: block; height: 100%; background: var(--tvc-red); }
.tvm-bar.is-replay { background: var(--tvc-line); }
.tvm-bar.is-replay i { background: #a3a9b4; }

/* свёрнутые строки: прошедшие сверху, остаток дня снизу; с фильтром видны все подходящие */
.tvm-row.x-before, .tvm-row.x-after { display: none; }
.tvm-ch.past-open .tvm-row.x-before, .tvm-ch.is-open .tvm-row.x-after { display: grid; }
.tvm-ch.past-open .tvm-toggle-past { display: none; }
.tvm-toggle { font: inherit; display: block; width: 100%; padding: 11px 16px; margin: 0; border: 0; background: #fff; color: var(--tvc-link); font-size: 14px; text-align: left; cursor: pointer; }
.tvm-toggle-past { color: var(--tvc-muted); background: #fafbfc; border-bottom: 1px solid var(--tvc-line); }
.tvm-ch.is-open .tvm-toggle-after .o, .tvm-ch:not(.is-open) .tvm-toggle-after .c { display: none; }
.tvm-panel.is-filtered .tvm-row, .tvm-ch.is-narrow .tvm-row { display: grid; }
.tvm-panel.is-filtered .tvm-row.is-off, .tvm-ch.is-narrow .tvm-row.is-off { display: none; }
.tvm-panel.is-filtered .tvm-toggle, .tvm-ch.is-narrow .tvm-toggle { display: none; }

.tvm .tvc-allonline { margin-top: 18px; }

@media screen and (max-width: 900px) {
    .tvm-grid { grid-template-columns: minmax(0, 1fr); }
    .tvm-hero-row { grid-template-columns: minmax(0, 1fr); }
    .tvm-hero-side { display: none; }
    .tvm-strip { grid-auto-columns: 78%; }
}
@media screen and (max-width: 767px) {
    .tvm .tvc-h1 { font-size: 22px; text-align: left; }
    /* 23.10.2026: заголовки и подписи не у самого края экрана (как логотип на странице канала) */
    .tvm .tvc-h1, .tvm .tvc-sub, .tvm-sec-h { padding-left: 10px; padding-right: 10px; }
    .tvm-sec-h { flex-direction: column; align-items: flex-start; gap: 4px; }
    .tvm-sec-h h2 { font-size: 18px; }
    .tvm-hero { padding: 18px; }
    .tvm-hero-title { font-size: 24px; }
    .tvm-hero-league { margin-left: 0; }
    .tvm-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tvm-row { grid-template-columns: 46px minmax(0, 1fr); padding: 10px 12px; }
    .tvm-row .tvm-cta { grid-column: 2; justify-self: start; margin-top: 4px; }
    .tvm-ch-h { padding: 10px 12px; }
    .tvm .tvm-ch-h h3 { text-align: left; } /* общий стиль сайта центрирует h3 на мобильных */
    .tvm .tvm-week { font-size: 12px; }
}
@media (prefers-reduced-motion: no-preference) { .tvm .tvm-nav a, .tvm .tvm-lc { transition: border-color .15s, background-color .15s; } }
.tvm .tvm-nav a:focus-visible, .tvm .tvm-lc:focus-visible, .tvm-toggle:focus-visible { outline: 2px solid var(--tvc-link); outline-offset: 2px; }
