/* ─────────────────────────────────────────────────────────────────────────
   Новости — 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 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

/* ──────────────────────────────────────────────────────────────────────
   NEWS CARD — обрезанный верхний правый угол
────────────────────────────────────────────────────────────────────── */
.ncard {
  display: flex;
  flex-direction: column;
  background: #292937;
  text-decoration: none;
  color: inherit;
  clip-path: polygon(0 0, calc(100% - 32px) 0, 100% 32px, 100% 100%, 0 100%);
  transition: filter 0.2s;
}

.ncard:hover { filter: brightness(1.1); }

.ncard__img {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #2C3B4C 0%, #1C202D 100%);
}

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

/* Треугольник-срез верхнего правого угла */
.ncard__corner {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 32px 32px 0;
  border-color: transparent var(--bg) transparent transparent;
  z-index: 1;
  pointer-events: none;
}

.ncard__category {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 3px 8px;
  border-radius: 3px;
  z-index: 1;
}

.ncard__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.ncard__date {
  font-family: 'Play', Arial, sans-serif;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: -0.005em;
  text-align: right;
}

.ncard__title {
  font-family: 'Play', Arial, sans-serif;
  font-size: clamp(15px, 1.4vw, 20px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.005em;
  color: var(--text-light);
  flex: 1;
}

.ncard__excerpt {
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ncard__footer { padding: 0 20px 20px; }

.ncard__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: Arial, sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-light);
  border: 1px solid var(--text-muted);
  border-radius: 5px;
  padding: 8px 16px;
  transition: border-color 0.2s, color 0.2s;
}

.ncard:hover .ncard__btn {
  border-color: var(--accent);
  color: #fff;
}

/* ──────────────────────────────────────────────────────────────────────
   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 {
  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%;
}

.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; }

/* ──────────────────────────────────────────────────────────────────────
   RESPONSIVE — TABLET (≤1024px)
────────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .news-grid-page {
    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) {
  .news-hero { padding: 24px var(--px) 32px; }

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

  .news-grid-page {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* 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; }

  .nd-other { padding-top: 32px; padding-bottom: 56px; }

  .nd-other__head { flex-wrap: wrap; }

  .news-pagination { flex-wrap: wrap; }
}

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