/* ========================================
   ЕДИНАЯ ЦВЕТОВАЯ ПОВЕРХНОСТЬ САЙТА
   ======================================== */

:root {
  --site-background: #0b1b34;
  --site-surface: #172a47;
  --site-card: #263750;
  --site-card-hover: #2c405d;
  --site-text: #ffffff;
  --site-muted: rgba(255, 255, 255, 0.65);
  --site-line: rgba(255, 255, 255, 0.11);
  --site-accent: #ef3340;
}

html {
  background: var(--site-background);
}

body {
  margin: 0;
  color: var(--site-text);
}

.news-main {
  background: transparent;
}

/* ========================================
   MAIN
   ======================================== */

.news-main,
.news-main *,
.news-main *::before,
.news-main *::after {
  box-sizing: border-box;
}

.news-main {
  position: relative;
  width: 100%;
  min-width: 0;
  padding:
    28px max(20px, env(safe-area-inset-right))
    72px max(20px, env(safe-area-inset-left));
  overflow: hidden;
  color: var(--site-text);
}

.news-main::before,
.news-main::after {
  position: absolute;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.news-main::before {
  top: 7%;
  right: -190px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(113, 164, 238, 0.1);
  background: radial-gradient(circle at 35% 30%, rgba(74, 133, 218, 0.13), transparent 68%);
}

.news-main::after {
  bottom: 3%;
  left: -140px;
  width: 290px;
  height: 290px;
  border: 1px solid rgba(255, 255, 255, 0.055);
}

.news-main img,
.news-main video {
  max-width: 100%;
}

/* ========================================
   ОБЩАЯ ПАНЕЛЬ
   ======================================== */

.news-board {
  position: relative;
  z-index: 1;
  width: min(100%, 1500px);
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 26px 70px rgba(0, 0, 0, 0.2);
}

/* ========================================
   РУБРИКИ
   ======================================== */

.category-nav {
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.category-nav::after {
  display: block;
  width: calc(100% - 32px);
  height: 1px;
  margin-inline: auto;
  background: var(--site-line);
  content: "";
}

.category-nav__scroll {
  display: flex;
  width: 100%;
  min-width: max-content;
  gap: 7px;
  align-items: center;
  padding: 14px 16px;
}

.category-nav__link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.category-nav__link:hover,
.category-nav__link.is-active {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* ========================================
   ОБЩАЯ СЕТКА
   ======================================== */

.news-layout {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 16px;
  align-items: stretch;
  margin: 0;
  padding: 16px;
}

.teaser-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(330px, auto);
  gap: 16px;
}

.teaser--large {
  grid-column: span 2;
}

/* ========================================
   ОБЩИЙ СТИЛЬ ТИЗЕРА
   ======================================== */

.teaser {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100%;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--site-line);
  border-radius: 17px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.045), transparent 42%),
    var(--site-card);
  color: var(--site-text);
  text-decoration: none;
  isolation: isolate;
  transition:
    border-color 0.25s ease,
    background-color 0.25s ease,
    box-shadow 0.25s ease,
    opacity 0.25s ease,
    transform 0.25s ease;
}

.teaser__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  flex: 0 0 auto;
  background: #122541;
}

.teaser__media img,
.teaser__media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    filter 0.4s ease,
    transform 0.5s cubic-bezier(0.2, 0.65, 0.3, 1);
}

.teaser__content {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 15px 16px 17px;
}

.teaser__source {
  display: flex;
  min-width: 0;
  gap: 6px;
  align-items: center;
  margin-bottom: 9px;
  overflow: hidden;
  color: var(--site-muted);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.teaser__source > span:not(.teaser__source-icon) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.teaser__source-icon {
  display: grid;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background:
    radial-gradient(circle at 34% 26%, #ffffff 0 18%, #e8f1ff 46%, #b9ccea 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    0 4px 10px rgba(0, 0, 0, 0.24);
  color: #132a4a;
  font-size: 12px;
  font-weight: 900;
}

.teaser__title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #ffffff;
  font-size: clamp(17px, 1.25vw, 21px);
  font-weight: 780;
  line-height: 1.24;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.teaser__disclaimer {
  margin: auto 0 0;
  padding-top: 13px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  line-height: 1.4;
}

/* ========================================
   БОЛЬШОЙ ТИЗЕР
   ======================================== */

.teaser--large {
  justify-content: flex-end;
  background: #14243c;
}

.teaser--large .teaser__media {
  position: absolute;
  z-index: -3;
  inset: 0;
  height: 100%;
  aspect-ratio: auto;
}

.teaser__overlay {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(
      to top,
      rgba(4, 11, 23, 0.96) 0%,
      rgba(4, 11, 23, 0.72) 37%,
      rgba(4, 11, 23, 0.12) 76%
    );
}

.teaser--large .teaser__content {
  justify-content: flex-end;
  padding: 26px 24px 24px;
}

.teaser--large .teaser__source {
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
}

.teaser--large .teaser__title {
  max-width: 93%;
  font-size: clamp(23px, 2vw, 32px);
  line-height: 1.18;
  -webkit-line-clamp: 3;
}

.teaser--large .teaser__disclaimer {
  margin-top: 12px;
  padding-top: 0;
  color: rgba(255, 255, 255, 0.6);
}

/* ========================================
   LABELS
   ======================================== */

.teaser__badge,
.teaser__video-label {
  position: absolute;
  z-index: 2;
  top: 11px;
  left: 11px;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(227, 25, 46, 0.94);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  backdrop-filter: blur(7px);
}

.teaser__video-label {
  top: auto;
  bottom: 11px;
  background: rgba(5, 13, 27, 0.82);
}

/* ========================================
   ПРАВАЯ КОЛОНКА
   ======================================== */

.teaser-sidebar {
  display: grid;
  min-width: 0;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/*
 * Правая карточка имеет тот же фон, радиус,
 * границу и hover, что и остальные тизеры.
 */
.teaser--sidebar {
  min-height: 0;
}

.teaser--sidebar .teaser__media {
  aspect-ratio: 16 / 9;
}

.teaser--sidebar .teaser__content {
  padding: 14px 15px 16px;
}

.teaser--sidebar .teaser__title {
  font-size: 17px;
}

/* ========================================
   ФОКУСИРОВКА МЫШИ
   ======================================== */

@media (hover: hover) and (pointer: fine) {
  .news-layout:has(.teaser:hover) .teaser:not(:hover) {
    opacity: 0.72;
  }

  .teaser:hover {
    z-index: 4;
    border-color: rgba(126, 181, 255, 0.52);
    background: var(--site-card-hover);
    transform: translateY(-5px);
    box-shadow:
      0 20px 42px rgba(0, 0, 0, 0.35),
      0 0 0 2px rgba(94, 157, 255, 0.1);
  }

  .teaser:hover .teaser__media img,
  .teaser:hover .teaser__media video {
    filter: brightness(1.07) saturate(1.08);
    transform: scale(1.045);
  }
}

.teaser:focus-visible,
.category-nav__link:focus-visible {
  outline: 3px solid #72adff;
  outline-offset: 3px;
}

/* ========================================
   ПЛАНШЕТ
   ======================================== */

@media (max-width: 900px) {
  .news-board {
    border-radius: 18px;
  }

  .news-layout {
    display: block;
    padding: 15px;
  }

  .teaser-sidebar {
    display: none;
  }

  .teaser-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
  }

  .teaser--large {
    min-height: 430px;
    grid-column: 1 / -1;
  }

  .teaser--small {
    min-height: 355px;
  }

  .teaser__title {
    font-size: clamp(18px, 2.3vw, 22px);
  }

  .teaser--large .teaser__title {
    font-size: clamp(25px, 3.5vw, 32px);
  }
}

/* ========================================
   СМАРТФОН
   ======================================== */

@media (max-width: 720px) {
  .news-main {
    padding:
      14px max(12px, env(safe-area-inset-right))
      42px max(12px, env(safe-area-inset-left));
  }

  .news-main::before,
  .news-main::after {
    display: none;
  }

  .news-board {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  /*
   * Рубрики на смартфоне полностью скрыты.
   */
  .category-nav {
    display: none;
  }

  .news-layout {
    display: block;
    padding: 0;
  }

  .teaser-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .teaser,
  .teaser--large,
  .teaser--small {
    min-height: 0;
    grid-column: auto;
  }

  .teaser__media {
    aspect-ratio: 16 / 9;
  }

  /*
   * На смартфоне большой тизер становится
   * обычной вертикальной карточкой.
   */
  .teaser--large {
    display: flex;
    background: var(--site-card);
  }

  .teaser--large .teaser__media {
    position: relative;
    z-index: auto;
    inset: auto;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .teaser--large .teaser__overlay {
    display: none;
  }

  .teaser--large .teaser__content,
  .teaser__content {
    padding: 15px 15px 17px;
  }

  .teaser__title,
  .teaser--large .teaser__title {
    max-width: none;
    font-size: clamp(19px, 5.3vw, 23px);
    line-height: 1.23;
  }

  .teaser--large .teaser__source {
    color: var(--site-muted);
    font-size: 12px;
  }

  .teaser--large .teaser__disclaimer {
    margin-top: auto;
    padding-top: 13px;
    color: rgba(255, 255, 255, 0.48);
  }

  .teaser__disclaimer {
    font-size: 10px;
  }
}

@media (max-width: 360px) {
  .news-main {
    padding-right: 11px;
    padding-left: 11px;
  }

  .teaser__content,
  .teaser--large .teaser__content {
    padding-right: 13px;
    padding-left: 13px;
  }
}

/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  .teaser,
  .teaser__media img,
  .teaser__media video,
  .category-nav__link {
    transition: none;
  }
}
