/* ─────────────────────────────────────────────────────────────────────────
   Новости — page-specific styles
   Figma nodes: 302-5930 (список), 302-6083 (детальная)
   Базовые переменные, хедер, футер — в home/styles.css
───────────────────────────────────────────────────────────────────────── */

/* ──────────────────────────────────────────────────────────────────────
   BREADCRUMB (общий паттерн)
────────────────────────────────────────────────────────────────────── */
.page-crumb-wrap {
  padding: 20px var(--px) 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: Arial, sans-serif;
  font-size: 12px;
  line-height: 18px;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--text-muted); transition: color 0.2s; }
.breadcrumb a:hover { color: #fff; }

.breadcrumb-sep {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--text-muted);
  flex-shrink: 0;
}

.breadcrumb-current { color: #fff; }

/* ══════════════════════════════════════════════════════════════════════
   NEWS LIST PAGE
══════════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────────────
   PAGE HERO (listing)
────────────────────────────────────────────────────────────────────── */
.news-hero {
  padding: 40px var(--px) 48px;
}

.news-page-title {
  font-family: 'Play', Arial, sans-serif;
  font-size: clamp(36px, 4.5vw, 64px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.06;
  color: #fff;
}

/* ──────────────────────────────────────────────────────────────────────
   CATEGORY FILTER TABS
────────────────────────────────────────────────────────────────────── */
.news-tabs-section {
  padding: 0 var(--px) 40px;
}

.news-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.news-tab {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border-radius: 5px;
  font-family: Arial, sans-serif;
  font-size: 15px;
  line-height: 24px;
  color: #fff;
  text-decoration: none;
  border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
  white-space: nowrap;
}

.news-tab--inactive { border-color: #56718F; }
.news-tab--inactive:hover { border-color: #fff; }
.news-tab--active { background: var(--accent); border-color: var(--accent); }

/* ──────────────────────────────────────────────────────────────────────
   NEWS GRID (listing)
────────────────────────────────────────────────────────────────────── */
.news-body {
  padding: 0 var(--px) 80px;
}

.news-grid-page {
  row-gap: 48px;
  margin-bottom: 48px;
}

/* ──────────────────────────────────────────────────────────────────────
   PAGINATION
────────────────────────────────────────────────────────────────────── */
.news-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.news-page-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 8px 16px;
  border-radius: 5px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 20px;
  color: #fff;
  text-decoration: none;
  border: 1px solid #56718F;
  min-width: 40px;
  transition: border-color 0.2s;
}

.news-page-btn:hover { border-color: #fff; }

.news-page-btn--active {
  border-color: var(--accent);
  color: var(--accent);
  pointer-events: none;
}

.news-page-btn--arrow svg { width: 8px; height: 12px; }

/* ══════════════════════════════════════════════════════════════════════
   NEWS DETAIL PAGE
══════════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────────────
   HERO — обложка слева, заголовок справа (выравнивание по верхнему краю)
────────────────────────────────────────────────────────────────────── */
.nd-hero {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 40px;
  align-items: start;
  padding: 32px var(--px) 0;
}

/* Левая колонка — обложка */
.nd-hero__cover {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, #2C3B4C 0%, #1C202D 100%);
  flex-shrink: 0;
}

.nd-hero__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nd-hero__cover-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2C3B4C 0%, #1C202D 100%);
}

/* Правая колонка — мета + заголовок */
.nd-hero__info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nd-hero__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nd-hero__category {
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 4px 10px;
  border-radius: 3px;
}

.nd-hero__datetime {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
}

.nd-hero__dt-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.nd-hero__dt-item svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.nd-hero__title {
  overflow-wrap: anywhere;
  font-family: 'Play', Arial, sans-serif;
  font-size: clamp(22px, 3vw, 46px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #fff;
}

/* ──────────────────────────────────────────────────────────────────────
   ЛИД-БЛОК — краткое описание, обрамлённое горизонтальными линиями
────────────────────────────────────────────────────────────────────── */
.nd-lead-wrap {
  margin: 32px var(--px) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
}

.nd-lead {
  font-family: Arial, sans-serif;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.65;
  color: #fff;
  margin: 0;
}

/* ──────────────────────────────────────────────────────────────────────
   ОСНОВНОЙ КОНТЕНТ
────────────────────────────────────────────────────────────────────── */
.nd-body {
  padding: 36px var(--px) 60px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.nd-content {
  width: 100%;
  /* тело новости — произвольный HTML из редактора, ссылки бывают длинные */
  overflow-wrap: anywhere;
}

.nd-content h2 {
  font-family: 'Play', Arial, sans-serif;
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 400;
  color: #fff;
  margin-top: 40px;
  margin-bottom: 16px;
  line-height: 1.2;
}

.nd-content h3 {
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-top: 28px;
  margin-bottom: 12px;
}

.nd-content p {
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 26px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.nd-content p:last-child { margin-bottom: 0; }

.nd-content strong { color: #fff; font-weight: 700; }

.nd-content a {
  color: var(--accent);
  text-decoration: underline;
  transition: opacity 0.2s;
}
.nd-content a:hover { opacity: 0.8; }

.nd-content ul,
.nd-content ol {
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 26px;
  color: var(--text-light);
  padding-left: 24px;
  margin-bottom: 16px;
}
.nd-content ul { list-style: disc; }
.nd-content ol { list-style: decimal; }
.nd-content li { margin-bottom: 8px; }

.nd-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 24px 0;
  padding: 12px 20px;
  background: rgba(255,131,104,0.06);
  border-radius: 0 4px 4px 0;
}

.nd-content blockquote p { color: var(--text-light); margin-bottom: 0; }

.nd-content img {
  max-width: 100%;
  width: auto;      /* естественная ширина, не растягивается */
  height: auto;     /* пропорции не ломаются при масштабировании */
  display: block;
  border-radius: 8px;
  margin: 8px 0;
}

/* ── CKEditor 5: figure.image ─────────────────────────────────────── */
/* figure.image_resized имеет inline style="width:X%" от редактора   */
.nd-content figure.image {
  max-width: 100%;
  margin: 16px 0;
  display: table; /* сжимается по содержимому, не растягивается */
}

/* img внутри figure заполняет ровно тот размер, что выставил CKEditor */
.nd-content figure.image img {
  width: 100%;
  height: auto;
  display: block;
  max-width: 100%;
  border-radius: 8px;
}

/* Выравнивание — классы от CKEditor 5 */
.nd-content figure.image-style-align-center {
  margin-left: auto;
  margin-right: auto;
}

.nd-content figure.image-style-align-left {
  float: left;
  margin-right: 20px;
  margin-bottom: 8px;
}

.nd-content figure.image-style-align-right {
  float: right;
  margin-left: 20px;
  margin-bottom: 8px;
}

/* Сброс float после плавающих картинок */
.nd-content p {
  clear: none;
}

.nd-content figure figcaption {
  font-family: Arial, sans-serif;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
}

/* Галерея */
.nd-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.nd-gallery img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

/* ──────────────────────────────────────────────────────────────────────
   КНОПКА НАЗАД К СПИСКУ
────────────────────────────────────────────────────────────────────── */
.nd-back-wrap {
  padding: 0 var(--px) 48px;
}

.nd-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 10px 24px;
  transition: background 0.2s, color 0.2s;
}

.nd-back-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* ──────────────────────────────────────────────────────────────────────
   ДРУГИЕ НОВОСТИ
────────────────────────────────────────────────────────────────────── */
.nd-other {
  padding: 0 var(--px) 80px;
  border-top: 1px solid var(--border);
  padding-top: 48px;
}

.nd-other__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.nd-other__title {
  font-family: 'Play', Arial, sans-serif;
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 400;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0;
}

.nd-other__all {
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.nd-other__all:hover { color: #fff; }

/* Точки карусели «Другие новости» — только мобайл.
   Явное правило, потому что .news-pagination в этом файле — это постраничная
   навигация списка, она на десктопе видна, и общий скрывающий стиль
   из home/styles.css перебивается. */
.nd-other__dots { display: none; }

/* ──────────────────────────────────────────────────────────────────────
   RESPONSIVE — TABLET (≤1024px)
────────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .news-grid-page,
  .nd-other__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nd-hero {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .nd-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ──────────────────────────────────────────────────────────────────────
   RESPONSIVE — MOBILE (≤768px)
────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Размеры сняты с макета Figma «Моб / Пресс-центр / Новости» (302-8309) */

  .page-crumb-wrap { padding-top: 32px; }
  .breadcrumb { gap: 12px; }

  .news-hero { padding: 32px var(--px) 48px; }
  .news-page-title {
    font-size: 32px;
    line-height: 40px;
    letter-spacing: -0.02em;
  }

  .news-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .news-tab { padding: 8px 16px; font-size: 14px; }

  /* ── Список новостей — вертикальный стек ───────────────────────────
     home/styles.css на ≤768 делает из .news-grid горизонтальную карусель:
     это нужно блоку новостей на главной, но класс общий, и страница
     списка тоже становилась свайпом. Здесь карусель отменяется. */
  .news-grid-page {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    overflow-x: visible;
    scroll-snap-type: none;
    margin-bottom: 36px;
  }
  .news-grid-page .news-card {
    flex: none;
    width: 100%;
    scroll-snap-align: none;
  }

  .news-body { padding: 0 var(--px) 50px; }

  /* ── Карточка новости ──────────────────────────────────────────────
     Одинаковая в списке и в блоке «Другие новости» на детальной
     (Figma 302-8309 и 302-6199): обложка 320×207 (aspect 412/267 уже
     совпадает), затем блок-градиент. Различается только раскладка:
     список — вертикальный стек, «Другие новости» — карусель. */
  .news-grid-page .news-card-img,
  .nd-other__grid .news-card-img { margin-bottom: 12px; }

  .news-grid-page .news-card-body,
  .nd-other__grid .news-card-body {
    gap: 0;
    padding: 8px 24px 15px;
  }
  .news-grid-page .news-card-date,
  .nd-other__grid .news-card-date {
    font-size: 10px;
    line-height: 14px;
  }
  .news-grid-page .news-card-title,
  .nd-other__grid .news-card-title {
    font-size: 20px;
    line-height: 22px;
  }
  /* В макете анонс показан целиком, без обрезки в 5 строк */
  .news-grid-page .news-card-excerpt,
  .nd-other__grid .news-card-excerpt {
    display: block;
    flex: none;
    overflow: visible;
    margin-top: 24px;
    font-size: 14px;
    line-height: 18px;
  }
  .news-grid-page .news-card-footer,
  .nd-other__grid .news-card-footer { padding-top: 10px; }
  .news-grid-page .btn-read,
  .nd-other__grid .btn-read {
    box-sizing: border-box;
    height: 30px;
    padding: 0 24px;
    gap: 8px;
    font-size: 14px;
    line-height: 20px;
    color: #fff;
    border-color: #56718F;
  }

  .nd-other__dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 26px 0 12px;
  }

  /* ── Пагинация ───────────────────────────────────────────────────────
     home/styles.css на ≤768 использует .news-pagination как контейнер точек
     карусели на главной (по центру, padding сверху) — здесь это сбрасывается. */
  .news-body .news-pagination {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px;
    padding: 0;
  }
  .news-page-btn {
    box-sizing: border-box;
    height: 36px;
    min-width: 40px;
    padding: 0 8px;
  }

  /* Hero детальной: вертикально (обложка сверху, заголовок снизу) */
  .nd-hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 24px;
  }

  .nd-hero__cover { aspect-ratio: 16 / 9; }

  .nd-hero__title { font-size: clamp(22px, 6vw, 36px); }

  .nd-lead-wrap { margin-top: 24px; padding: 24px 0; }

  .nd-body { padding: 32px var(--px) 48px; gap: 28px; }

  .nd-gallery { grid-template-columns: 1fr 1fr; }

  /* ── «Другие новости» (Figma 302-6232) ─────────────────────────────
     Шапка — полоса 72px на всю ширину экрана с разделителем снизу,
     «Все новости» — кнопка с рамкой, а не текстовая ссылка. */
  .nd-other {
    padding: 0 var(--px) 50px;
    border-top-color: #56718F;
  }

  .nd-other__head {
    align-items: center;
    gap: 12px;
    /* отрицательные поля — чтобы разделитель шёл от края до края */
    margin: 0 calc(var(--px) * -1) 32px;
    padding: 16px var(--px);
    border-bottom: 1px solid #56718F;
  }

  .nd-other__title {
    font-size: 20px;
    line-height: 30px;
    letter-spacing: -0.005em;
  }

  .nd-other__all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    height: 40px;
    padding: 0 16px;
    border: 1px solid #56718F;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    line-height: 20px;
  }
  /* в макете шеврон — иконка 16×16; текстовый «›» подгоняем по месту */
  .nd-other__all span {
    display: inline-block;
    width: 16px;
    font-size: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .nd-gallery { grid-template-columns: 1fr; }
}
