/* News section styles — ДивёрсИИ */
.news-main {
  padding: 140px 0 120px;
  min-height: 60vh;
}

/* Контейнер по ширине рабочей сетки сайта (как header-inner) */
.news-container {
  width: min(calc(100% - (var(--page-gutter) * 2)), var(--content-width));
  margin: 0 auto;
}

/* Узкая колонка для текста статьи */
.news-container--article {
  width: min(760px, calc(100% - (var(--page-gutter) * 2)));
}

.news-eyebrow {
  font-family: "Onest", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #FF692A;
  margin: 0 0 18px;
}

.news-title {
  font-family: "Onest", sans-serif;
  font-size: clamp(34px, 4.6vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: #f5f3ef;
  margin: 0 0 20px;
}

.news-lead {
  font-family: "Onest", sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: rgba(245, 243, 239, 0.72);
  margin: 0 0 40px;
  max-width: 640px;
}

/* Центрирование заголовка и подзаголовка на странице списка */
.news-header {
  text-align: center;
  margin-bottom: 56px;
}

.news-header .news-lead {
  margin-left: auto;
  margin-right: auto;
}

/* Переключатель тематик списка */
.news-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 30px;
}

.news-tab {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(245, 243, 239, 0.72);
  cursor: pointer;
  font-family: "Onest", sans-serif;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  min-height: 44px;
  padding: 0 18px;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.news-tab:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: #f5f3ef;
  transform: translateY(-1px);
}

.news-tab.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--orange-deep), var(--orange-bright) 58%, var(--orange-red));
  box-shadow:
    0 10px 30px rgba(238, 72, 18, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  color: #fff;
}

.news-tab.is-active:hover {
  filter: brightness(1.08) saturate(1.06);
  box-shadow:
    0 14px 38px rgba(245, 78, 20, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.news-tab:active {
  transform: translateY(0);
}

.news-tab:focus-visible {
  outline: 2px solid #f5f3ef;
  outline-offset: 3px;
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
  font-family: "Onest", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 48px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.news-meta .news-category {
  color: #FF692A;
}

/* Article body */
.news-article h2 {
  font-family: "Onest", sans-serif;
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #f5f3ef;
  margin: 48px 0 16px;
}

.news-article p {
  font-family: "Onest", sans-serif;
  font-size: 16.5px;
  line-height: 1.75;
  color: rgba(245, 243, 239, 0.82);
  margin: 0 0 20px;
}

.news-article strong {
  color: #f5f3ef;
  font-weight: 600;
}

/* H3 внутри статьи */
.news-article h3 {
  font-family: "Onest", sans-serif;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: #f5f3ef;
  margin: 32px 0 12px;
}

/* Списки */
.news-article ul,
.news-article ol {
  font-family: "Onest", sans-serif;
  font-size: 16.5px;
  line-height: 1.75;
  color: rgba(245, 243, 239, 0.82);
  margin: 0 0 20px;
  padding-left: 24px;
}

.news-article ul li,
.news-article ol li {
  margin-bottom: 8px;
}

.news-article ul li::marker {
  color: #FF692A;
}

.news-article ol li::marker {
  color: #FF692A;
  font-weight: 600;
}

/* Таблицы */
.news-table-wrap {
  overflow-x: auto;
  margin: 28px 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.news-article table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Onest", sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
}

.news-article thead th {
  background: rgba(255, 255, 255, 0.07);
  color: #f5f3ef;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  white-space: nowrap;
}

.news-article tbody td {
  padding: 12px 16px;
  color: rgba(245, 243, 239, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  vertical-align: top;
}

.news-article tbody tr:last-child td {
  border-bottom: none;
}

.news-article tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Цитаты */
.news-article blockquote {
  margin: 28px 0;
  padding: 20px 24px;
  border-left: 3px solid #FF692A;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0 12px 12px 0;
  font-family: "Onest", sans-serif;
  font-size: 16.5px;
  line-height: 1.7;
  color: rgba(245, 243, 239, 0.88);
}

.news-article blockquote p {
  margin: 0;
}

/* FAQ-блок */
.news-faq {
  margin: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.news-faq h3 {
  font-family: "Onest", sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #f5f3ef;
  margin: 0;
  padding: 18px 0 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.news-faq h3:first-child {
  border-top: none;
  padding-top: 0;
}

.news-faq p {
  font-family: "Onest", sans-serif;
  font-size: 15.5px;
  line-height: 1.7;
  color: rgba(245, 243, 239, 0.72);
  margin: 0 0 4px;
  padding-bottom: 18px;
}

/* Code / pre */
.news-article code {
  font-family: "Fira Code", "Cascadia Code", monospace;
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.08);
  color: #FF692A;
  padding: 2px 6px;
  border-radius: 5px;
}

.news-article pre {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 24px 0;
}

.news-article pre code {
  background: none;
  padding: 0;
  color: rgba(245, 243, 239, 0.88);
  font-size: 14px;
  line-height: 1.6;
}

/* Подпись к изображению */
.news-article figcaption,
.news-img-caption {
  font-family: "Onest", sans-serif;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin: -20px 0 32px;
  padding: 0 16px;
}

/* Ссылки внутри статьи */
.news-article a {
  color: #FF692A;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

.news-article a:hover {
  opacity: 0.8;
}

/* Автор и дата обновления в мета */
.news-author {
  color: rgba(245, 243, 239, 0.6);
}

.news-updated {
  color: var(--muted);
  font-size: 12px;
}

/* Изображения в статье */
.news-article img,
.news-hero-image {
  width: 100%;
  height: auto;
  border-radius: 16px;
  margin: 32px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.news-hero-image {
  margin: 0 0 40px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.news-inline-figure {
  margin: 40px 0;
}

.news-inline-figure .news-inline-image {
  margin: 0;
}

.news-inline-figure figcaption {
  margin: 12px 0 0;
  padding: 0;
  text-align: left;
}

/* Placeholder для изображений */
.news-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  margin: 32px 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: "Onest", sans-serif;
  font-size: 14px;
}

/* CTA block — яркая продуктовая секция ДивёрсИИ */
.news-cta {
  margin-top: 64px;
  padding: 48px 44px;
  border-radius: 24px;
  /* Цельный мягкий оранжевый фон: layered radial + мягкий linear,
     без жёсткой вертикальной границы по центру */
  background:
    radial-gradient(120% 160% at 18% 0%, rgba(255, 214, 170, 0.55) 0%, rgba(255, 214, 170, 0) 55%),
    radial-gradient(130% 170% at 88% 100%, rgba(255, 120, 60, 0.5) 0%, rgba(255, 120, 60, 0) 60%),
    linear-gradient(135deg, #FF692A 0%, #FF692A 100%);
  position: relative;
  overflow: visible;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 32px;
  align-items: center;
}

.news-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 90% at 50% 40%, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.news-cta-content {
  position: relative;
  z-index: 2;
}

.news-cta-title {
  font-family: "Onest", sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0a0a0a;
  margin: 0 0 12px;
}

.news-cta-text {
  font-family: "Onest", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(10, 10, 10, 0.8);
  margin: 0 0 26px;
  max-width: 420px;
}

.news-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  background: #0a0a0a;
  color: #f5f3ef;
  font-family: "Onest", sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.25s ease, background 0.25s ease;
}

.news-cta-button:hover {
  background: #1a1a1a;
  transform: translateY(-2px);
}

/* Визуальная композиция: доминирующий центральный экран + два задних превью.
   Композиция повторяет hero: глубина за счёт ярусов, масштаба и мягких теней. */
.news-cta-visual {
  position: relative;
  z-index: 1;
  height: 340px;
  overflow: visible;
}

.news-cta-screen {
  position: absolute;
  margin: 0;
  padding: 0;
  border-radius: 14px;
  overflow: visible;
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
  cursor: pointer;
  transition: transform 0.35s ease, opacity 0.35s ease;
  will-change: transform;
}

.news-cta-screen img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border: none;
  outline: none;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  background: transparent;
  border-radius: 14px;
  pointer-events: none;
}

/* Центральный экран — доминирующий, самый крупный, на переднем плане */
.news-cta-screen--main {
  left: 50%;
  top: 50%;
  width: 92%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

/* Задние экраны — меньше центрального, расположены позади него.
   Верхний (left) — выше и левее, нижний (right) — справа снизу.
   Центральный перекрывает их, но не скрывает полностью:
   видимая часть остаётся кликабельной. */
.news-cta-screen--left {
  left: -10%;
  top: calc(-16% + 25px);
  width: 62%;
  transform: rotate(-8deg) scale(0.94);
  z-index: 2;
  opacity: 0.92;
}

.news-cta-screen--right {
  right: -10%;
  bottom: calc(-16% + 25px);
  width: 62%;
  transform: rotate(8deg) scale(0.94);
  z-index: 2;
  opacity: 0.92;
}

/* Hover: экран поднимается и выходит на передний план (как в hero) */
.news-cta-screen:hover,
.news-cta-screen:focus-visible {
  z-index: 6;
  opacity: 1;
  outline: none;
}

.news-cta-screen--main:hover,
.news-cta-screen--main:focus-visible {
  transform: translate(-50%, -50%) translateY(-8px) scale(1.02);
}

.news-cta-screen--left:hover,
.news-cta-screen--left:focus-visible {
  transform: rotate(-8deg) scale(0.95) translateY(-8px);
}

.news-cta-screen--right:hover,
.news-cta-screen--right:focus-visible {
  transform: rotate(8deg) scale(0.95) translateY(-8px);
}

/* Lightbox — полноэкранный просмотр изображения */
.cta-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 8, 8, 0.82);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.cta-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cta-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform 0.25s ease;
}

.cta-lightbox.is-open img {
  transform: scale(1);
}

.cta-lightbox-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(20, 20, 20, 0.6);
  color: #f5f3ef;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.cta-lightbox-close:hover {
  background: rgba(40, 40, 40, 0.85);
  transform: scale(1.06);
}

body.cta-lightbox-locked {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .news-cta-screen,
  .cta-lightbox,
  .cta-lightbox img,
  .cta-lightbox-close,
  .news-tab,
  .news-card {
    transition: none;
  }
}

/* News index — card grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-top: 0;
}

.news-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  overflow: hidden;
}

.news-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.news-card-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
}

/* Изображение/placeholder внутри карточки: прилегает к верхнему краю,
   без лишнего отступа, двойной рамки и с верхними углами карточки */
.news-card .news-card-image,
.news-card .news-image-placeholder {
  margin: 0;
  border: 0;
  border-radius: 20px 20px 0 0;
}

.news-card-content {
  padding: 24px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.news-card-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  font-family: "Onest", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.news-card-meta .news-category {
  color: #FF692A;
}

.news-card-title {
  font-family: "Onest", sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #f5f3ef;
  margin: 0;
}

.news-card-excerpt {
  font-family: "Onest", sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(245, 243, 239, 0.66);
  margin: 0;
  flex: 1;
}

.news-card-more {
  font-family: "Onest", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #FF692A;
}

.news-back {
  display: inline-block;
  margin-bottom: 32px;
  font-family: "Onest", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.news-back:hover {
  color: #f5f3ef;
}

/* Tablet: визуал наверх, текст вниз */
@media (max-width: 900px) {
  .news-cta {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 40px 32px;
  }
  .news-cta-visual {
    order: -1;
    height: 240px;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
  }
  .news-cta-content {
    text-align: center;
  }
  .news-cta-text {
    margin-left: auto;
    margin-right: auto;
  }
}

/* Mobile: визуал сверху, текст по центру */
@media (max-width: 720px) {
  .news-main {
    padding: 110px 0 80px;
  }
  .news-cta {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 32px 24px 36px;
  }
  .news-cta-visual {
    order: -1;
    height: 220px;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
  }
  .news-cta-screen--main {
    width: 82%;
  }
  .news-cta-screen--left,
  .news-cta-screen--right {
    width: 46%;
  }
  .news-cta-screen--left {
    left: 0;
    top: -8%;
  }
  .news-cta-screen--right {
    right: 0;
    bottom: -8%;
  }
  .news-cta-content {
    text-align: center;
  }
  .news-cta-title {
    font-size: 23px;
  }
  .news-cta-text {
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
  }
  .news-grid {
    grid-template-columns: 1fr;
  }
  .news-tabs {
    justify-content: flex-start;
    flex-wrap: nowrap;
    margin-left: calc(var(--page-gutter) * -1);
    margin-right: calc(var(--page-gutter) * -1);
    overflow-x: auto;
    padding: 0 var(--page-gutter) 4px;
    scrollbar-width: thin;
  }
  .news-tab {
    flex: 0 0 auto;
  }
}
