/* ============================================
   Раздел «Питомцы-ТВ»: лента «/tv/» и страница материала
   Figma: BptoBWUPeESOr8CResnLtp «Питомцы ТВ» 7841:3056,
   «Материал в питомцы тв» 7841:3527
   Подключается ПОСЛЕ feed.css и перекрывает его там,
   где макет ТВ расходится с макетом ленты статей.
   ============================================ */

/* ---------- Hero раздела ТВ ---------- */

/* Кадры выпусков светлее редакционных фото — притеняем низ под текст
   (то же правило, что hero--story в blog-feed.css). */
.hero--tv .hero__card::before {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0) 60%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

/* Затемнение нужно только под текст фасада — на запущенном видео оно
   ложилось поверх плеера тёмной «дымкой» снизу. */
.hero--tv .hero__card:has(> .hero__player.is-playing)::before {
  content: none;
}

/* Live-бейдж «Скоро прямой эфир» в верхнем углу кадра */
.hero__live {
  align-items: center;
  color: var(--c-cream);
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  gap: 12px;
  left: 32px;
  letter-spacing: 0.04em;
  position: absolute;
  text-transform: uppercase;
  top: 32px;
  z-index: 2;
}

.hero__live-dot {
  background: #e04a2f;
  border-radius: 50%;
  display: inline-block;
  height: 10px;
  width: 10px;
}

/* Фасад плеера: обёртка фото + play по центру кадра.
   Обёртка сама становится слоем кадра (absolute на всю карточку) — иначе
   hero__photo, рассчитанный на absolute относительно hero__card, схлопнулся
   бы в нулевой бокс ссылки. Каскад: правило hero.css «.hero__card > *» даёт
   position: relative, наше идёт позже и перекрывает. */
.hero--tv .hero__player {
  display: block;
  inset: 0;
  position: absolute;
  z-index: 0;
}

.hero__play {
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease;
  z-index: 2;
}

.hero__play img {
  display: block;
  height: 96px;
  width: 96px;
}

.hero__player:hover .hero__play {
  transform: translate(-50%, -50%) scale(1.06);
}

/* Iframe, который фасад вставляет по клику, занимает весь кадр */
.hero__player iframe {
  border: 0;
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
  z-index: 3;
}

/* Мета выпуска: дата · время · ведущий — mono uppercase как в макете */
.hero--tv .hero__meta {
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.hero--tv .hero__meta-dot {
  background: rgba(255, 255, 255, 0.7);
}

/* Hero внутри блока «Крупный план» живёт в общей сетке 1840, а не 1856
   (то же правило, что hero--inline в blog-feed.css — файлы на страницу
   не пересекаются, поэтому дубль, а не общий модуль). */
.hero--inline {
  padding-top: 0;
}

/* «Крупный план»: у выпуска нет live-бейджа, и hero__content — единственный
   потоковый ребёнок flex-карточки со space-between → без прижима он уезжал
   на ВЕРХ кадра (заголовок ложился на превью). В вебинарном hero контент
   вниз оттесняет live-бейдж, здесь прижимаем явно. */
.tv-feature .hero__content {
  margin-top: auto;
}

.hero--inline > .container {
  padding-inline: var(--pad);
}

/* По обновлённой карте баннеров (7976:2497) длинного места 442×1416 больше
   нет — сайдбар вебинаров использует общий квадрат 442×442 из article-body.css
   (aspect-ratio), контекстный min-height ему противопоказан. */

/* ---------- Плашки раздела ---------- */

/* В ТВ надпись прямая, в ленте статей — курсив */
.feed-plate--tv {
  font-style: normal;
}

/* ---------- Карточка выпуска/вебинара (598×535) ---------- */

.feed-card--tv .feed-card__photo {
  height: 440px;
}

.feed-card--tv .feed-card__title {
  font-size: 25px;
}

/* Отступ меты не переопределяем: база (feed.css) прижимает её к низу карточки
   через margin-top: auto, чтобы «смотреть» стояло на одном уровне у всех
   карточек ряда. Прежнее margin-top: 8px дублировало базовое значение и
   ломало это выравнивание. */

/* Несколько бейджей рубрик в ряд; сами бейджи внутри контейнера — в потоке */
.feed-card__badges {
  display: flex;
  gap: 16px;
  left: 16px;
  position: absolute;
  top: 16px;
  z-index: 2; /* выше ссылки-накладки на фото — бейджи ведут в свои рубрики */
}

.feed-card__badges .feed-card__badge {
  left: auto;
  position: static;
  top: auto;
}

.feed-card--tv .feed-card__play {
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.feed-card--tv .feed-card__play img {
  display: block;
  height: 80px;
  width: 80px;
}

.feed-card--tv .feed-card__duration {
  background: var(--c-dark-blue);
  bottom: 16px;
  color: var(--c-cream);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  padding: 4px 10px;
  position: absolute;
  right: 16px;
}

.feed-card__air {
  color: var(--c-gray);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
}

/* Мета без даты эфира: «смотреть» прижимается вправо */
.feed-card--tv .feed-card__cta {
  margin-left: auto;
}

/* ---------- Раскладка грида выпусков: 442 + 1374 ----------
   В макете карточка спецпроекта 442 слева, грид 1220 прижат к левому краю
   своей колонки 1374 (справа воздух 154 — зеркально блоку вебинаров). */

.feed--tv .feed-layout {
  grid-template-columns: minmax(0, 442fr) minmax(0, 1374fr);
}

.feed--tv .feed-side--left {
  grid-column: 1;
}

/* grid-column 2 держит грид в широкой колонке и на страницах пагинации,
   где карточки спецпроекта нет. Воздух справа (154 из макета) — в процентах,
   как у вебинаров: фикс-ширина раздувала пустоту на экранах шире 1920. */
.feed--tv .feed-main {
  grid-column: 2;
  padding-right: calc(154 / 1374 * 100%);
  width: 100%;
}

/* ---------- Блок «Прошедшие вебинары» ---------- */

/* Без max-width: единственная зажатая секция на резиновой странице съезжала
   относительно соседей на экранах шире 1920 (баг-лист 12.08, «при отдалении
   блок уходит влево») — все секции ленты тянутся одинаково, поля var(--pad). */
.tv-webinars {
  padding: 80px var(--pad) 0;
}

.tv-webinars__layout {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1374fr) minmax(0, 442fr);
}

/* В макете грид 1220 прижат к правому краю колонки 1374, слева воздух 154.
   Воздух — в процентах, а не фикс-шириной грида: на экранах шире 1920
   фикс-1220 в растущей колонке раздувал пустоту (баг-лист 12.08). */
.tv-webinars__main {
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-width: 0;
  padding-left: calc(154 / 1374 * 100%);
  width: 100%;
}

.tv-webinars__grid {
  display: grid;
  gap: 80px 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ---------- Блок «Крупный план» ---------- */

.tv-feature {
  padding-top: 80px;
}

.tv-feature .feed-plate--tv {
  border-bottom: 0;
  padding-bottom: 24px;
}

/* ---------- Карточка спецпроекта в ленте ---------- */

.tv-special {
  display: flex;
  flex-direction: column;
  position: relative;
}

.tv-special__photo {
  display: block;
  height: 440px;
  object-fit: cover;
  width: 100%;
}

/* Ссылка на спецпроект растянута на карточку (кликается фото);
   бейдж и тёмный блок анонса лежат выше и живут своей жизнью */
.tv-special__link {
  inset: 0;
  position: absolute;
  z-index: 1;
}

.tv-special__badge {
  left: 16px;
  position: absolute;
  top: 16px;
  z-index: 2;
}

.tv-special__content {
  background: var(--c-dark-gray);
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  gap: 24px;
  padding: 52px 40px;
  position: relative;
  z-index: 2;
}

.tv-special__title-link {
  color: inherit;
}

.tv-special__title {
  color: var(--c-cream);
  font-family: var(--font-serif);
  font-size: 44px;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.04;
}

.tv-special__text {
  color: var(--c-white);
  font-family: var(--font-serif-text);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.35;
}

.tv-special__btn {
  border-color: rgba(239, 237, 232, 0.3);
  margin-top: auto;
  align-self: flex-start;
}

/* У этой кнопки светлая стрелка-картинка — кремовая инверсия ghost сделала бы
   её невидимой. Ховер по варианту «ПЕРЕЙТИ» кита: мягкая подсветка рамки. */
.tv-special__btn:hover {
  background: rgba(239, 237, 232, 0.08);
  border-color: rgba(239, 237, 232, 0.55);
  color: var(--c-cream);
}

/* ---------- Секция «Вертикаль» ---------- */

.tv-vertical {
  background: var(--c-dark-gray);
  margin-top: 80px;
  padding-block: 80px;
}

.tv-vertical__head {
  align-items: flex-end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.tv-vertical__plate {
  border-color: rgba(239, 237, 232, 0.2);
  border-bottom: 0;
  color: var(--c-cream);
  flex: 1 0 0;
  padding-bottom: 0;
}

.tv-vertical__nav {
  display: flex;
  gap: 16px;
}

.tv-vertical__arrow {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
  transition: opacity 0.2s ease;
}

/* Hover стрелок по «Arrow button set» кита — как у принятой карусели спецпроектов */
.tv-vertical__arrow:hover {
  opacity: 0.6;
}

.tv-vertical__arrow img {
  display: block;
  height: 24px;
  width: 40px;
}

.tv-vertical__track {
  display: flex;
  gap: 24px;
  margin-top: 40px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.tv-vertical__track::-webkit-scrollbar {
  display: none;
}

.tv-vertical__card {
  aspect-ratio: 286 / 533;
  display: flex;
  flex: 0 0 calc((100% - 24px * 5) / 6);
  min-width: 220px;
  overflow: hidden;
  position: relative;
  scroll-snap-align: start;
}

/* Затемнение — на всю высоту карточки, как в макете (плашка 7840:2896
   растянута на 533px): на короткой высоте текстового низа градиент не успевал
   набрать плотность, и заголовок терялся на светлых обложках. */
.tv-vertical__card::after {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
  content: '';
  inset: 0;
  position: absolute;
  z-index: 0;
}

.tv-vertical__photo {
  height: 100%;
  left: 0;
  object-fit: cover;
  position: absolute;
  top: 0;
  width: 100%;
}

.tv-vertical__play {
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.tv-vertical__play img {
  display: block;
  height: 56px;
  width: 56px;
}

.tv-vertical__bottom {
  align-items: flex-end;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: auto;
  padding: 32px 16px 24px;
  position: relative;
  width: 100%;
  z-index: 1;
}

.tv-vertical__title {
  color: var(--c-cream);
  font-family: var(--font-serif-text);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.35;
  min-width: 0;
}

/* Хронометраж — бейдж на тёмно-синей подложке, как в макете (7840:2898):
   высота 17, скругление 4, JetBrains Mono Italic 9, белый. */
.tv-vertical__duration {
  align-items: center;
  background: var(--c-dark-blue);
  border-radius: 4px;
  color: #fff;
  display: flex;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: italic;
  font-weight: 400;
  height: 17px;
  padding: 0 8px;
}

/* ---------- Секция регистрации на вебинар (страница анонса) ---------- */

.tv-register {
  background: var(--c-dark-gray);
  padding: 80px 0;
}

.tv-register__inner {
  align-items: start;
  display: grid;
  gap: 40px 120px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.tv-register__title {
  color: var(--c-cream);
  font-family: var(--font-serif);
  font-size: clamp(34px, 2.92vw, 56px);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.04;
}

.tv-register__text {
  color: var(--c-white);
  font-family: var(--font-sans);
  font-size: 20px;
  letter-spacing: -0.02em;
  line-height: 1.4;
  margin-top: 24px;
}

.tv-register__form {
  display: flex;
  flex-direction: column;
}

.tv-register__label {
  display: block;
}

.tv-register__input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(239, 237, 232, 0.4);
  color: var(--c-cream);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 12px 0;
  text-transform: uppercase;
  width: 100%;
}

.tv-register__input::placeholder {
  color: rgba(239, 237, 232, 0.5);
}

.tv-register__input:focus {
  border-bottom-color: var(--c-terracotta-dark);
  outline: none;
}

.tv-register__btn {
  align-self: flex-start;
  margin-top: 32px;
}

.tv-register__note {
  color: rgba(239, 237, 232, 0.4);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  margin-top: 24px;
  text-transform: uppercase;
}

.tv-register .form-message {
  color: var(--c-cream);
  font-family: var(--font-sans);
  font-size: 16px;
  margin-top: 16px;
}

/* ---------- Адаптив ---------- */

@media (max-width: 1660px) {
  .tv-special__title {
    font-size: 34px;
  }
}

@media (max-width: 1280px) {
  .feed-card--tv .feed-card__photo {
    height: 380px;
  }

  .feed-card--tv .feed-card__play img {
    height: 64px;
    width: 64px;
  }

  .tv-special__content {
    padding: 40px 32px;
  }

  .tv-vertical__card {
    flex-basis: calc((100% - 24px * 3) / 4);
  }
}

/* Планшет: колонки складываются (общий брейкпоинт проекта) */
@media (max-width: 1100px) {
  .tv-webinars__layout {
    display: flex;
    flex-direction: column;
  }

  .tv-webinars__main {
    padding-left: 0;
  }

  .feed--tv .feed-layout {
    display: flex;
    flex-direction: column;
  }

  .feed--tv .feed-main {
    padding-right: 0;
  }

  .tv-register__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .tv-vertical__card {
    flex-basis: calc((100% - 24px * 2) / 3);
  }
}

@media (max-width: 768px) {
  .tv-webinars {
    padding-top: 48px;
  }

  .tv-webinars__grid {
    gap: 48px 24px;
    grid-template-columns: minmax(0, 1fr);
  }

  .feed-card--tv .feed-card__photo {
    height: 300px;
  }

  .feed-card--tv .feed-card__title {
    font-size: 22px;
  }

  .tv-feature {
    padding-top: 48px;
  }

  .tv-vertical {
    margin-top: 48px;
    padding-block: 48px;
  }

  .tv-vertical__card {
    flex-basis: calc((100% - 24px) / 2);
  }

  .tv-register {
    padding: 48px 0;
  }

  .tv-register__text {
    font-size: 18px;
  }

  .hero__live {
    left: 16px;
    top: 16px;
  }

  .hero__play img {
    height: 64px;
    width: 64px;
  }

  /* «Крупный план» на мобилке — горизонтальный видеокадр (юзер 14.08):
     базовый hero давал вертикальную карточку 327×702, и кадр 16:9 кропился
     до узкой полосы. Кадр = фасад 16:9 в потоке, текст уходит ПОД кадр
     тёмным по крему (как у карточек выпусков). */
  .tv-feature .hero__card {
    aspect-ratio: auto; /* перебить вертикальные 327/702 из hero.css@560 */
    min-height: 0;
    padding: 0;
  }

  .tv-feature .hero__card::before {
    content: none; /* градиент-затемнение был под белый текст на фото */
  }

  .tv-feature .hero__player {
    aspect-ratio: 16 / 9;
    inset: auto;
    position: relative;
    width: 100%;
  }

  .tv-feature .hero__content {
    margin-top: 16px;
  }

  .tv-feature .hero__title {
    color: var(--c-black);
  }

  .tv-feature .hero__tags {
    color: var(--c-gray);
  }

  .tv-feature .hero--tv .hero__meta,
  .tv-feature .hero__meta {
    color: var(--c-gray);
  }

  .tv-feature .hero__meta-dot {
    background: var(--c-gray);
  }

  /* Текст под кадром видео не мешает — при запуске его не прячем,
     иначе карточка скачком сжимается. */
  .tv-feature .hero__card:has(> .hero__player.is-playing) > .hero__content {
    display: flex;
  }
}

@media (max-width: 560px) {
  .tv-vertical__card {
    flex-basis: 80%;
  }

  .tv-register__btn {
    align-self: stretch;
    justify-content: center;
    width: 100%;
  }
}

/* Бейдж рубрики лежит поверх фото карточки спецпроекта — цвет должен быть
   светлым, как у всех бейджей на изображении. Своего значения у него не было,
   и он наследовал тёмный текст секции. */
.tv-special__badge {
  color: var(--c-cream);
}
