/* 1tv.promo — единый CSS (раньше был продублирован в head.php и style.css). Без внешних шрифтов. */
:root {
  /* Палитра в синих тонах Первого канала. Другой оттенок — меняйте только эти переменные. */
  --brand: #0b3d91;        /* фон верхней панели */
  --brand-ink: #fff;
  --accent: #1458c8;       /* кнопки, активные элементы */
  --accent-ink: #fff;
  --bg: #eef3fa; --surface: #fff; --ink: #0c1a33; --muted: #51617d; --line: #d3deee; --chip: #e0e9f6;
  --radius: 8px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --brand: #0a2150; --accent: #5b9bff; --accent-ink: #03112b;
          --bg: #09142a; --surface: #102040; --ink: #e7eefc; --muted: #98a9c7; --line: #1f3258; --chip: #17284a; }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
img { max-width: 100%; height: auto; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(100% - 2rem, 1200px); margin-inline: auto; }

.skip { position: absolute; left: .5rem; top: -4rem; background: var(--accent); color: var(--accent-ink); padding: .6rem 1rem; border-radius: var(--radius); z-index: 100; }
.skip:focus { top: .5rem; }

/* шапка */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--brand); color: var(--brand-ink); box-shadow: 0 4px 14px rgba(5, 20, 60, .18); }
.bar { display: flex; align-items: center; gap: 1.2rem; padding: .65rem 0; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; text-decoration: none; color: var(--brand-ink); }
.tally { width: .7rem; height: .7rem; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .22); }
.main-nav { display: flex; gap: .3rem; }
.main-nav a { color: var(--brand-ink); text-decoration: none; padding: .4rem .75rem; border-radius: var(--radius); font-weight: 600; opacity: .88; }
.main-nav a:hover { background: rgba(255, 255, 255, .14); opacity: 1; }
.search { display: flex; flex: 1 1 260px; max-width: 480px; margin-left: auto; gap: .4rem; }
.search .suggest { flex: 1; min-width: 0; position: relative; }
.search input, .filter, .cal-tools input, .cal-tools select, .cal-head select { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .8rem; }
.search button, .btn { font: inherit; font-weight: 600; color: var(--accent-ink); background: var(--accent); border: 0; border-radius: var(--radius); padding: .5rem 1.1rem; cursor: pointer; text-decoration: none; display: inline-block; }
.search button:hover, .btn:hover { filter: brightness(1.1); }
.btn-ghost { background: var(--chip); color: var(--ink); }
.site-header .search input { border-color: transparent; background: #fff; color: #0c1a33; }
.site-header .search button { background: #fff; color: var(--brand); }
.site-header :focus-visible { outline-color: #fff; }
.search-page { margin: 1rem 0 0; max-width: 560px; }

/* типографика */
h1 { font-size: clamp(1.55rem, 3.2vw, 2.15rem); line-height: 1.15; letter-spacing: -.02em; font-weight: 800; margin: 0 0 .6rem; }
h2 { font-size: 1.3rem; line-height: 1.25; letter-spacing: -.01em; font-weight: 700; margin: 2.2rem 0 .9rem; }
.intro { margin: 1.6rem 0 1rem; }
.lead { color: var(--muted); max-width: 62ch; margin: 0; }
.prose { max-width: 70ch; }
.prose p { margin: .8rem 0; }
.prose-page { margin-top: 1.6rem; }
.notice { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: .9rem 1.1rem; max-width: 70ch; }
.count, .page-no { font-size: .85rem; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: .4rem; }
.page-no { display: block; margin: .3rem 0 0; }

/* крошки */
.crumbs { margin: 1rem 0 0; font-size: .875rem; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: .5rem; opacity: .6; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs li:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* дни */
.days-title { font-size: .95rem; color: var(--muted); font-weight: 600; margin: 0 0 .5rem; letter-spacing: 0; }
.days ul { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.days a, .day-nav a { display: inline-block; padding: .35rem .9rem; border-radius: 999px; background: var(--chip); text-decoration: none; font-weight: 600; font-size: .92rem; }
.days a:hover, .day-nav a:hover { background: var(--line); }
.days a.is-today { background: var(--accent); color: var(--accent-ink); }
.day-nav { display: flex; gap: .5rem; margin: 0 0 1.2rem; }
.day-nav .to-right { margin-left: auto; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-head h2 { margin-right: auto; }
.section-head .filter { flex: 0 1 280px; }

/* сетка и карточки */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.4rem 1rem; }
.grid-shows { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { min-width: 0; }
.card-link { display: block; text-decoration: none; }
.thumb { display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: var(--chip); }
.thumb-wide { aspect-ratio: 696 / 310; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dur { position: absolute; right: .4rem; bottom: .4rem; padding: .08rem .4rem; border-radius: 4px; background: rgba(0, 0, 0, .78); color: #fff; font-size: .75rem; font-variant-numeric: tabular-nums; }
.card-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: .55rem; font-weight: 600; line-height: 1.3; }
.card-link:hover .card-title { text-decoration: underline; }
.card-meta { display: flex; flex-direction: column; gap: .1rem; margin-top: .25rem; font-size: .85rem; color: var(--muted); }
.card-show { font-weight: 600; }

/* страница передачи */
.show-head { display: grid; gap: 1.2rem; margin: 1.4rem 0 .5rem; }
.show-head-compact { margin-top: 1.4rem; }
.show-head-compact h1 a { text-decoration: none; }
.show-poster img { display: block; width: 100%; border-radius: var(--radius); }
.facts { display: grid; gap: .35rem; margin: 1.1rem 0 0; font-size: .95rem; }
.facts div { display: flex; gap: 1rem; }
.facts dt { flex: 0 0 7rem; color: var(--muted); }
.facts dd { margin: 0; }
@media (min-width: 760px) { .show-head:not(.show-head-compact) { grid-template-columns: minmax(240px, 360px) 1fr; gap: 1.8rem; } }

/* страница выпуска */
.player-wrap { margin-top: 1rem; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-start, .player-link { position: absolute; inset: 0; display: block; padding: 0; border: 0; background: none; cursor: pointer; }
.player-start img, .player-link img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; background: var(--accent); }
.play::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%); border-left: 24px solid #fff; border-top: 15px solid transparent; border-bottom: 15px solid transparent; }
.player-start:hover .play, .player-link:hover .play { filter: brightness(1.12); }
.player-note { position: absolute; inset: auto 0 0 0; padding: .6rem .9rem; background: rgba(0, 0, 0, .68); color: #fff; font-size: .9rem; }
.player-missing { display: grid; place-items: center; padding: 1rem; background: var(--surface); aspect-ratio: auto; min-height: 12rem; }
.video-info { margin-top: 1.2rem; }
.meta-line { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin: 0 0 .8rem; color: var(--muted); font-size: .95rem; }
.meta-line a { color: var(--ink); font-weight: 600; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ep-nav { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 1.5rem; }
.ep-nav a { display: block; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; font-weight: 600; line-height: 1.3; }
.ep-nav a:hover { border-color: var(--muted); }
.ep-nav span { display: block; margin-bottom: .2rem; font-size: .8rem; font-weight: 400; color: var(--muted); }
.ep-next { grid-column: 2; text-align: right; }
.more { margin: 1.4rem 0 0; }

/* пагинация */
.pager { margin: 2rem 0 .5rem; }
.pager ul { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.pager a, .pager-current, .pager-gap { display: inline-flex; align-items: center; justify-content: center; min-width: 2.6rem; height: 2.6rem; padding: 0 .8rem; border-radius: var(--radius); }
.pager a { background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.pager a:hover { border-color: var(--muted); }
.pager-current { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.pager-gap { color: var(--muted); min-width: 1.4rem; padding: 0; }

.ad-slot { margin: 1.6rem 0; min-height: 60px; }
.site-footer { margin-top: 3.5rem; padding: 1.6rem 0 2.4rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.site-footer p { margin: .4rem 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.site-footer a { text-underline-offset: 3px; }

@media (max-width: 640px) {
  .player-wrap { margin-inline: -1rem; }
  .player-wrap .player { border-radius: 0; }
  .search { max-width: none; flex-basis: 100%; }
  .ep-nav { grid-template-columns: 1fr; }
  .ep-next { grid-column: auto; text-align: left; }
  .grid, .grid-shows { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* подсказки поиска */
.suggest-list { position: absolute; left: 0; right: 0; top: calc(100% + .4rem); z-index: 40; margin: 0; padding: .35rem; list-style: none; max-height: min(70vh, 28rem); overflow: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(5, 20, 60, .25); text-align: left; }
.suggest-group { padding: .5rem .6rem .25rem; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.suggest-item a { display: flex; align-items: center; gap: .75rem; padding: .45rem .6rem; border-radius: 6px; text-decoration: none; line-height: 1.3; }
.suggest-item img { flex: 0 0 5.5rem; width: 5.5rem; aspect-ratio: 16 / 9; height: auto; object-fit: cover; border-radius: 6px; background: var(--chip); }
.suggest-txt { min-width: 0; flex: 1; }
.suggest-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.suggest-all a { display: block; }
.suggest-item.is-active a, .suggest-item a:hover { background: var(--chip); }
.suggest-item mark { background: none; color: var(--accent); font-weight: 700; }
.suggest-sub { display: block; margin-top: .1rem; font-size: .8rem; color: var(--muted); }
.suggest-all a { font-weight: 600; color: var(--accent); }
.suggest-empty { padding: .6rem; color: var(--muted); font-size: .92rem; }

/* чипы (дни, передачи за день) */
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.2rem; }
.chips a { display: inline-flex; gap: .4rem; align-items: center; padding: .35rem .85rem; border-radius: 999px; background: var(--chip); text-decoration: none; font-size: .92rem; font-weight: 600; }
.chips a span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.chips a:hover { background: var(--line); }
.chips a.is-on { background: var(--accent); color: var(--accent-ink); }
.chips a.is-on span { color: inherit; opacity: .85; }
.days a.to-calendar { background: none; border: 1px dashed var(--muted); }
.day-nav .day-cal { margin-inline: auto; }
.day-nav .to-right { margin-left: 0; }

/* календарь */
.cal-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .8rem; margin: 1rem 0 0; }
.cal-tools label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.cal-tools input, .cal-tools select { width: auto; min-width: 11rem; }
.cal-tools select { max-width: min(100%, 22rem); }
.cal-box { margin-top: 1.6rem; max-width: 760px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1rem 1.2rem; }
.cal-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cal-title { margin: 0 auto 0 .4rem; font-size: 1.35rem; }
.cal-head select { width: auto; padding: .4rem .6rem; }
.cal-step { display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: var(--radius); background: var(--chip); text-decoration: none; font-weight: 700; }
a.cal-step:hover { background: var(--line); }
.cal-step.is-off { opacity: .35; }
.cal-filter { margin: .8rem 0 0; color: var(--muted); font-size: .92rem; }
.cal { width: 100%; margin-top: .9rem; border-collapse: separate; border-spacing: .3rem; table-layout: fixed; }
.cal th { font-size: .78rem; font-weight: 600; color: var(--muted); padding-bottom: .2rem; }
.cal th.is-weekend { color: var(--accent); }
.cal td { padding: 0; }
.cal-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 3.6rem; border-radius: var(--radius); text-decoration: none; color: var(--muted); opacity: .6; }
.cal-day .d { font-weight: 600; font-size: 1rem; }
.cal-day .n { font-size: .72rem; font-weight: 700; }
.cal-day.has-videos { background: var(--chip); color: var(--ink); opacity: 1; }
.cal-day.has-videos .n { color: var(--accent); }
a.cal-day.has-videos:hover { background: var(--accent); color: var(--accent-ink); }
a.cal-day.has-videos:hover .n { color: inherit; }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--accent); opacity: 1; }
.cal-hint { margin: .8rem 0 0; color: var(--muted); font-size: .85rem; }
@media (max-width: 640px) {
  .main-nav { margin-left: auto; }
  .search { order: 3; }
  .cal-day { min-height: 3rem; }
  .cal-box { padding: .7rem .5rem 1rem; }
}

/* «Другие выпуски»: 8 карточек = 2 полных ряда по 4, либо 4 ряда по 2 */
.grid-related { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-related { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .grid-related { grid-template-columns: 1fr; } }
