/* =========================================================================
   ТЕНвизор — раздел «Новости и статьи»
   Только на токенах styles.css (--green / --ink / --muted / --r-card ...).
   Своих цветов и шрифтов не заводим: подключается ПОСЛЕ styles.css.
   Раскладка: лента карточек (/news), страница статьи, хлебные крошки.
   ========================================================================= */

/* -------------------------------------------------------------------------
   ЛЕНТА КАРТОЧЕК (лендинг + /news)
   ------------------------------------------------------------------------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: clamp(36px, 4vw, 52px);
}
.news-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .news-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 719px)  { .news-grid--3 { grid-template-columns: minmax(0, 1fr); } }

.news-card {
  display: flex; flex-direction: column;
  background: var(--surface-2);
  border: 1px solid #ececec;
  border-radius: var(--r-card);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .25s ease, border-color .2s ease;
}
.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #e2e2e2; }
.news-card:focus-within { border-color: var(--green); }

.news-card__media {
  position: relative; display: block;
  aspect-ratio: 3 / 2; background: var(--green-soft);
  overflow: hidden;
}
.news-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s cubic-bezier(.22, 1, .36, 1);
}
.news-card:hover .news-card__media img { transform: scale(1.03); }

.news-card__body { display: flex; flex-direction: column; gap: 12px; padding: 26px; flex: 1; }
.news-card__top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.news-cat {
  display: inline-flex; align-items: center; height: 26px; padding: 0 12px;
  background: var(--green-soft); color: var(--green-700);
  border-radius: var(--r-pill);
  font: 600 12px/1 "Inter", system-ui, sans-serif; letter-spacing: .01em;
}
.news-date { color: var(--muted-2); font-size: 13px; }
.news-card h3 { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.22; }
.news-card h3 a { transition: color .15s ease; }
.news-card h3 a:hover { color: var(--green-700); }
.news-card p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.news-card__more {
  margin-top: auto; padding-top: 6px;
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--green-700); font-weight: 600; font-size: 15px;
}
.news-card__more svg { width: 16px; height: 16px; transition: transform .2s ease; }
.news-card:hover .news-card__more svg { transform: translateX(3px); }

/* первая карточка на /news — во всю ширину, горизонтально */
@media (min-width: 900px) {
  .news-card--wide { grid-column: 1 / -1; flex-direction: row; }
  .news-card--wide .news-card__media { flex: 0 0 46%; aspect-ratio: auto; }
  .news-card--wide .news-card__body { padding: clamp(28px, 3vw, 44px); justify-content: center; }
  .news-card--wide h3 { font-size: clamp(24px, 2.4vw, 32px); }
  .news-card--wide p { font-size: 16.5px; }
}

/* кнопка «все статьи» под лентой на лендинге */
.news-foot { margin-top: clamp(28px, 3vw, 40px); text-align: center; }

/* -------------------------------------------------------------------------
   СТРАНИЦА СТАТЬИ — шапка
   ------------------------------------------------------------------------- */
.inner--article { max-width: 860px; }

.art-head { text-align: left; }
.art-head .news-card__top { margin-bottom: 18px; }
.art-head h1 {
  font-family: "Exo 2", "Inter", system-ui, sans-serif;
  font-weight: 500; letter-spacing: -.03em; line-height: 1.1;
  font-size: clamp(30px, 4.4vw, 50px);
  text-wrap: balance;
}
.art-lead {
  margin-top: 20px; color: var(--muted);
  font-size: clamp(16px, 1.6vw, 19px); line-height: 1.6;
}
.art-meta {
  margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  color: var(--muted-2); font-size: 14px;
}
.art-meta span { display: inline-flex; align-items: center; gap: 7px; }
.art-meta svg { width: 15px; height: 15px; }

.art-cover {
  margin: clamp(28px, 3.5vw, 40px) 0 0;
  border-radius: var(--r-card); overflow: hidden;
  background: var(--green-soft); aspect-ratio: 3 / 2;
}
.art-cover img { width: 100%; height: 100%; object-fit: cover; }

/* -------------------------------------------------------------------------
   СТРАНИЦА СТАТЬИ — текст
   ------------------------------------------------------------------------- */
.art-body { margin-top: clamp(34px, 4vw, 46px); font-size: 17px; line-height: 1.72; color: #2a2a2a; }
.art-body > *:first-child { margin-top: 0; }

.art-body h2 {
  font-size: clamp(24px, 2.8vw, 34px); font-weight: 500;
  margin: clamp(48px, 5vw, 64px) 0 20px; padding-top: 26px;
  border-top: 1px solid var(--line); color: var(--ink);
  scroll-margin-top: 110px;
}
.art-body h3 {
  font-size: clamp(20px, 2.1vw, 25px); font-weight: 500;
  margin: clamp(34px, 3.6vw, 44px) 0 14px; color: var(--ink);
  scroll-margin-top: 110px;
}
.art-body h4 {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 18px; font-weight: 600; letter-spacing: -.01em;
  margin: 30px 0 12px; color: var(--ink);
  scroll-margin-top: 110px;
}
.art-body p { margin: 0 0 18px; }
.art-body strong { font-weight: 600; color: var(--ink); }
.art-body a { color: var(--green-700); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.art-body a:hover { color: var(--green); }

.art-body ul, .art-body ol { margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.art-body ul li { position: relative; padding-left: 26px; list-style: none; }
.art-body ul li::before {
  content: ""; position: absolute; left: 4px; top: 11px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
}
.art-body ol { counter-reset: art-ol; }
.art-body ol li { position: relative; padding-left: 34px; list-style: none; counter-increment: art-ol; }
.art-body ol li::before {
  content: counter(art-ol) "."; position: absolute; left: 0; top: 0;
  color: var(--green-700); font-weight: 600; font-size: 15px; line-height: 1.75;
}
.art-body li > ul, .art-body li > ol { margin: 10px 0 0; }

.art-body blockquote {
  margin: 26px 0; padding: 20px 24px;
  background: var(--green-soft); border-radius: var(--r-md);
  color: var(--ink); font-size: 16.5px;
}
.art-body blockquote p:last-child { margin-bottom: 0; }

/* таблицы: широкие прокручиваются внутри своей обёртки, страница не едет */
.art-table-wrap {
  margin: 26px 0 28px; overflow-x: auto;
  border: 1px solid #ececec; border-radius: var(--r-md);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.art-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.art-table th, .art-table td {
  padding: 14px 18px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line); line-height: 1.5;
}
.art-table thead th, .art-table tr:first-child th {
  background: var(--surface-2); color: var(--ink);
  font-weight: 600; font-size: 14px; white-space: nowrap;
  position: sticky; top: 0;
}
.art-table tbody tr:last-child td, .art-table tr:last-child td { border-bottom: 0; }
.art-table tbody tr:hover td { background: rgba(14, 165, 233, .035); }
.art-table td strong { color: var(--ink); }
/* -------------------------------------------------------------------------
   СТРАНИЦА СТАТЬИ — оглавление
   Селекторы с .art-body — оглавление лежит внутри текста статьи, и общие
   правила списков (.art-body ol) иначе перебивают сетку и маркеры.
   ------------------------------------------------------------------------- */
.art-body .art-toc {
  margin: 0 0 clamp(38px, 4vw, 52px);
  background: var(--surface-2); border: 1px solid #ececec;
  border-radius: var(--r-md); padding: 26px clamp(22px, 3vw, 30px);
}
.art-body .art-toc h2 {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 17px; font-weight: 600; letter-spacing: 0;
  margin: 0 0 16px; padding: 0; border: 0; color: var(--ink);
}
.art-body .art-toc ol {
  counter-reset: toc; list-style: none; margin: 0; padding: 0;
  display: grid; gap: 10px;
}
@media (min-width: 760px) { .art-body .art-toc ol { grid-template-columns: 1fr 1fr; gap: 10px 28px; } }
.art-body .art-toc li {
  counter-increment: toc; position: relative;
  padding-left: 30px; font-size: 15px; line-height: 1.5;
}
.art-body .art-toc li::before {
  content: counter(toc); position: absolute; left: 0; top: 1px;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--green-soft); color: var(--green-700);
  font: 600 11px/21px "Inter", system-ui, sans-serif; text-align: center;
}
.art-body .art-toc a { color: var(--ink); text-decoration: none; transition: color .15s ease; }
.art-body .art-toc a:hover { color: var(--green-700); text-decoration: underline; text-underline-offset: 3px; }

/* значки «да / нет / частично» в сравнительных таблицах.
   Свои, а не эмодзи: эмодзи-шрифт есть не на каждом устройстве. */
.art-body .mk {
  display: inline-flex; align-items: center; justify-content: center;
  width: 19px; height: 19px; border-radius: 50%; flex: none;
  margin-right: 7px; vertical-align: -4px;
  font: 700 11px/1 "Inter", system-ui, sans-serif;
}
.art-body .mk-yes  { background: var(--green-soft); color: var(--green-700); }
.art-body .mk-no   { background: #fdecec; color: #cf4141; }
.art-body .mk-warn { background: #fff3e0; color: #b26a00; }

/* подсказка о горизонтальной прокрутке на узких экранах */
@media (max-width: 719px) {
  .art-table-wrap { position: relative; }
  .art-table-wrap::after {
    content: "→"; position: absolute; right: 10px; top: 10px;
    width: 24px; height: 24px; border-radius: 50%;
    background: rgba(255,255,255,.92); border: 1px solid var(--line);
    color: var(--muted); font-size: 13px; line-height: 22px; text-align: center;
    pointer-events: none;
  }
}

/* -------------------------------------------------------------------------
   СТРАНИЦА СТАТЬИ — призыв в конце
   ------------------------------------------------------------------------- */
.art-cta {
  margin-top: clamp(44px, 5vw, 60px);
  background: var(--green-section); color: #fff;
  border-radius: var(--r-card);
  padding: clamp(32px, 4vw, 48px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
}
.art-cta h2 { font-size: clamp(22px, 2.4vw, 30px); color: #fff; margin: 0; max-width: 26ch; }
.art-cta p { margin-top: 12px; color: rgba(255,255,255,.72); font-size: 16px; max-width: 46ch; }
.art-cta .btn-primary { background: #fff; color: var(--green-section); }
.art-cta .btn-primary:hover { background: rgba(255,255,255,.88); }

/* «поделиться» + возврат к списку */
.art-foot {
  margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.art-back { display: inline-flex; align-items: center; gap: 8px; color: var(--green-700); font-weight: 600; font-size: 15px; }
.art-back:hover { color: var(--green); }
.art-back svg { width: 16px; height: 16px; }
.art-share { display: inline-flex; align-items: center; gap: 10px; color: var(--muted-2); font-size: 14px; }
.art-share a {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.art-share a:hover { color: var(--green-700); border-color: var(--green-soft); background: var(--green-soft); }
.art-share svg { width: 17px; height: 17px; }

/* -------------------------------------------------------------------------
   Появление при скролле — как у остальных секций лендинга.
   Скрытое состояние ставится только при .has-js (движение разрешено).
   ------------------------------------------------------------------------- */
.has-js .news-grid > * {
  opacity: 0; transform: translateY(26px);
  transition: opacity .7s cubic-bezier(.22, 1, .36, 1), transform .7s cubic-bezier(.22, 1, .36, 1);
}
.has-js .news-grid > *.reveal-in { opacity: 1 !important; transform: none !important; }

/* активный пункт меню «Новости» */
.nav-links a[aria-current="page"], .mobile-menu a[aria-current="page"] { color: var(--ink); font-weight: 600; }
