/* Цвета и размеры темы */
:root {
    --brand: #0A6FB0;
    --brand-dark: #085A8F;
    --brand-soft: #EAF3FA;
    --ink: #16202B;
    --muted: #5B6878;
    --line: #E3E8EE;
    --bg: #F3F5F8;
    --surface: #FFFFFF;
    --rating-bg: #FFF1DC;
    --rating-fg: #7A4300;
    --live: #D92D20;
    --radius: 14px;
}

* {
    box-sizing: border-box;
}
html, body {
    margin: 0;
    color: var(--ink);
    font-family: Manrope, Arial, sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.4;
    background: var(--bg);
}

img {
    max-width: 100%;
    height: auto;
}

h1 {
    margin: 0;
    font-size: 32px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.5px;
}
h2 {
    font-size: 22px;
    line-height: 1.2;
    font-weight: 800;
    margin: 28px 0 14px;
}

a {
    color: #0A5F96;
}
a:hover {
    color: #074A75;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}
.button:hover {
    background: var(--brand-dark);
    color: #fff;
}


/* Шапка */

.site-header {
    background: var(--brand);
    color: #fff;
}
.site-header__inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 8px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 20px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
}
.site-logo:hover {
    color: #fff;
}
.site-logo__text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}
.site-logo__name {
    display: flex;
    align-items: center;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .8px;
    line-height: 1;
}
/* «TV» в бело-голубой плашке */
.site-logo__tv {
    padding: 3px 6px 2px;
    border-radius: 6px;
    background: linear-gradient(180deg, #FFFFFF 0%, #D6EEFF 100%);
    color: var(--brand);
    font-size: 18px;
    letter-spacing: .5px;
}
.site-logo__dash {
    margin: 0 3px;
    color: rgba(255,255,255,.6);
    letter-spacing: 0;
}
.site-logo__ru {
    margin-left: 2px;
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,.7);
}
.site-logo__tagline {
    margin-top: 5px;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: rgba(255,255,255,.78);
}

.site-header__burger {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: rgba(255,255,255,.18);
    color: #fff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
}

.site-nav {
    flex: 1 1 auto;
}
.site-nav__list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-nav__list a {
    display: block;
    padding: 9px 10px;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    white-space: nowrap;
    font-weight: 600;
    text-decoration: none;
    transition: background 150ms;
}
.site-nav__list a:hover,
.site-nav__list .current-menu-item > a {
    background: rgba(255,255,255,.18);
    color: #fff;
}
.site-nav__list .current-menu-item > a {
    font-weight: 800;
}

.site-header__tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.site-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 200px;
    height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    background: #fff;
    color: var(--muted);
}
.site-search input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 14px;
    color: var(--ink);
}

.tz-button {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.45);
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.tz-button:hover {
    background: rgba(255,255,255,.12);
}


/* Каркас страницы */

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
}

.layout {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px;
    padding: 24px 0 8px;
}
.layout__main {
    flex: 999 1 640px;
    min-width: 0;
}
.layout__side {
    flex: 1 1 300px;
    max-width: 300px;
}
.layout__sticky {
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-head {
    margin-bottom: 20px;
}
.page-head p {
    margin: 6px 0 0;
    color: var(--muted);
}
.page-head--center {
    text-align: center;
    padding: 60px 0;
}
.page-head--center p {
    margin-top: 12px;
}


/* Реклама */

.ad {
    margin: 0 0 20px;
    text-align: center;
    overflow: hidden;
}
.ad--horizontal {
    min-height: 90px;
}
.ad--vertical {
    min-height: 600px;
    margin: 0;
}
.ad--empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 12px;
    border: 1px dashed #B9C4D0;
    border-radius: 12px;
    background: #E9EDF2;
    color: var(--muted);
    font-size: 13px;
}
.ad--empty span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}


/* Карточки каналов (главная, «Сейчас в эфире») */

.channels {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
    width: 100%;
}

.channels__item {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 16px;
    border-radius: var(--radius);
    min-width: 0;
}

.channel {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    font-weight: 800;
    text-decoration: none;
    color: var(--ink);
}
.channel:hover {
    color: var(--brand);
}
.channel img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 10px;
}


/* Список передач */

.events {
    display: flex;
    flex-direction: column;
    margin: 12px 0;
    gap: 2px;
}

.events .image {
    margin: 0 -16px 8px;
    width: calc(100% + 32px);
    max-width: unset;
}

.events__item {
	display: flex;
	gap: 10px;
    padding: 9px 8px;
    border-radius: 10px;
}
.events__item > strong {
    width: 44px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.events__item.active {
    background: var(--brand-soft);
}
.events__item.active > strong {
    color: var(--brand);
}
.events__item a {
    color: var(--ink);
    text-decoration: none;
}
.events__item a:hover {
    color: var(--brand);
    text-decoration: underline;
}
.events__item.active .event-name > a {
    font-weight: 800;
}

.event-name {
	flex: auto;
    position: relative;
    min-width: 0;
}

.progress {
    display: none;
    position: relative;
    height: 4px;
    margin-top: 8px;
    border-radius: 2px;
    background-color: #DCE6F0;
    overflow: hidden;
}
.progress-bar {
	background: var(--brand);
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    transition: width .4s;
    width: 0;
}

.events__item.active .progress {
    display: block;
}


/* Даты */

.nav-dates {
    margin: 16px 0;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    overflow-x: auto;
}
.nav-dates-container {
    display: flex;
    gap: 4px;
    white-space: nowrap;
}
.nav-dates .link-date {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 9px;
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    flex-shrink: 0;
}
.nav-dates span {
    color: var(--muted);
}
.nav-dates .weekend {
    color: #B42318;
}
.nav-dates .link-date:hover {
    background: var(--bg);
}
.nav-dates .link-date.active,
.nav-dates .link-date.active span,
.nav-dates .link-date.active span.weekend {
    background: var(--brand);
    color: #fff;
}


/* Страница канала */

.channel__head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 12px;
}
.channel__head img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 12px;
    background: var(--surface);
}
.channel__head h1 {
    font-size: 28px;
}


/* Страница передачи */

.programma {
    display: flex;
    gap: 24px;
    margin: 20px 0;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.programma__side {
    width: 300px;
    flex-shrink: 0;
}

.programma__side img {
    border-radius: 10px;
}

.programma__content {
    flex: 1;
    min-width: 0;
}

.programma__content p {
    font-size: 16px;
    line-height: 1.55;
}

.credits__item {
    display: flex;
    gap: 12px;
    margin: 8px 0;
    font-size: 14px;
}
.credits__item strong {
    display: block;
    width: 130px;
    flex-shrink: 0;
    color: var(--muted);
    font-weight: 600;
}
.credits__item span {
    display: block;
    flex: 1;
}

.genries {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}
.genries span {
    padding: 6px 12px;
    background: var(--brand-soft);
    border-radius: 20px;
    color: #0A5F96;
    font-size: 13px;
    font-weight: 700;
}
.genries span.pg {
    background: #EEF1F4;
    color: #3A4654;
}

.times {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}
.times .times__item {
    display: flex;
    flex-direction: column;
    text-align: center;
    background: var(--brand-soft);
    padding: 5px 10px;
    gap: 1px;
    border-radius: 8px;
    border: 1px solid #C9DCEB;
}
.times__item.passed { opacity: 0.5; }
.times__item.current {
    font-weight: bold;
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}


/* Тематические разделы: /seychas/, /filmy/, /serialy/, /sport/, /detyam/ */

.section-tabs,
.section-sort {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
}
.section-tabs {
    display: inline-flex;
    padding: 4px;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}
.section-tabs a {
    padding: 10px 18px;
    border-radius: 9px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}
.section-tabs a.active {
    background: var(--brand);
    color: #fff;
    font-weight: 700;
}
.section-sort a {
    color: #0A5F96;
}
.section-sort a.active {
    color: var(--ink);
    font-weight: bold;
    text-decoration: none;
}

.genre-filter a {
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.genre-filter a span {
    padding: 0;
    background: none;
    border-radius: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}
.genre-filter a.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.genre-filter a.active span {
    color: #DCEBF7;
}

.section-events {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
}
.section-event {
    align-items: flex-start;
}
.events__item.section-event.passed,
.events__item.section-event.older {
    opacity: .55;
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}
.event-channel {
    display: flex;
    align-items: center;
    gap: 5px;
}
.events__item .event-channel {
    color: var(--muted);
}
.event-channel img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}
.event-thumb {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}
.badge--live {
    background: var(--live);
    color: #fff;
}
.badge--premiere {
    background: #EFE7FF;
    color: #5B2DB3;
}
.badge--rating {
    background: var(--rating-bg);
    color: var(--rating-fg);
}


/* Поиск */

.search-channels {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.search-channels .channel {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    font-size: 15px;
}
.search-results {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}
.search-results__item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #EDF1F5;
    color: var(--ink);
    text-decoration: none;
}
.search-results__item span {
    color: var(--muted);
    font-size: 13px;
}


/* Подвал */

.site-footer {
    margin-top: 32px;
    background: var(--ink);
    color: #C9D2DC;
    font-size: 14px;
}
.site-footer__inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px 40px;
}
.site-footer__about {
    flex: 1 1 260px;
}
.site-footer__about p {
    margin: 10px 0 0;
}
.site-footer__list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-footer a {
    color: #C9D2DC;
}
.site-footer a:hover,
.site-footer .site-logo {
    color: #fff;
}
.site-footer__tz-button {
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}
.site-footer__copy {
    flex-basis: 100%;
    color: #8A97A6;
}


/* Выбор часового пояса */

.tz-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}
.tz-modal[hidden] {
    display: none;
}
.tz-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(22,32,43,.55);
}
.tz-modal__panel {
    position: relative;
    width: 480px;
    max-width: 100%;
    max-height: 100%;
    overflow-y: auto;
    padding: 24px;
    border-radius: 18px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
/* На невысоких экранах окно прокручивается, а не сжимает кнопки */
.tz-modal__panel > * {
    flex-shrink: 0;
}
.tz-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.tz-modal__head h2 {
    margin: 0;
}
.tz-modal__head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}
.tz-modal__close {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 0;
    border-radius: 10px;
    background: var(--bg);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.tz-modal__detect {
    height: 44px;
    border: 1px solid var(--brand);
    border-radius: 10px;
    background: var(--brand-soft);
    color: #0A5F96;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}
.tz-modal__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.tz-item {
    min-height: 52px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    font: inherit;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
    color: var(--ink);
}
.tz-item strong {
    font-size: 14px;
}
.tz-item span {
    font-size: 12px;
    color: var(--muted);
}
.tz-item:hover {
    border-color: var(--brand);
}
.tz-item.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.tz-item.is-active span {
    color: #DCEBF7;
}
.tz-modal__example {
    margin: 0;
    padding: 12px;
    border-radius: 10px;
    background: var(--bg);
    font-size: 13px;
    color: #3A4654;
}
.tz-modal__remember {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.tz-modal__remember input {
    width: 18px;
    height: 18px;
    accent-color: var(--brand);
}
.tz-modal__save {
    height: 48px;
    border: 0;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}
.tz-modal__save:hover {
    background: var(--brand-dark);
}
body.tz-modal-open {
    overflow: hidden;
}


/* Кнопка «Наверх» */

.scroll-up {
    position: fixed;
    right: 24px;
    bottom: -500px;
    z-index: 10;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    background: rgba(22,32,43,.75);
    color: #fff;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: bottom .4s;
}
.scroll-up.active {
    bottom: 24px;
}
