/* ============================================================
   ARTICLE HERO
   ============================================================ */
.article-hero {
  padding: 128px 0 0;
  background:
    radial-gradient(760px 420px at 92% -10%, rgba(255,122,0,.10), transparent 62%),
    radial-gradient(700px 500px at -10% 18%, rgba(57,49,133,.09), transparent 65%),
    #F7F8FA;
  position: relative; overflow: hidden;
}
.article-hero::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,122,0,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,122,0,.05) 1px, transparent 1px);
  background-size: 44px 44px; pointer-events: none;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 80%);
}

.article-h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.85rem);
  line-height: 1.14; font-weight: 800; letter-spacing: -.032em;
  color: #0B1220; margin-bottom: 20px; max-width: 900px;
}
.article-lead {
  font-size: 1.08rem; line-height: 1.65; color: #4B5563;
  max-width: 800px; font-weight: 400; margin-bottom: 26px;
}
.article-lead b { color: #0B1220; font-weight: 600; }

.article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  padding: 16px 0 22px;
  border-top: 1px solid rgba(11,18,32,.08);
  border-bottom: 1px solid rgba(11,18,32,.08);
  font-size: .82rem; color: #6B7280; font-weight: 500;
}
.article-meta__item { display: inline-flex; align-items: center; gap: 7px; }
.article-meta__item svg { color: #9CA3AF; flex-shrink: 0; }
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: #D5DAE2; }
.article-meta__source { margin-left: auto; color: #9CA3AF; font-size: .78rem; }

/* Cover */
.article-cover { margin: 0 auto; padding: 0 24px 0; max-width: 1000px; }
.article-cover__inner {
  position: relative; border-radius: 22px; overflow: hidden;
  aspect-ratio: 16 / 8;
  box-shadow: 0 40px 80px -40px rgba(11,18,32,.28), 0 12px 32px -16px rgba(11,18,32,.10);
  border: 1px solid rgba(11,18,32,.08);
}
.article-cover__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.cover-caption {
  position: absolute; left: 22px; bottom: 18px; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 8px;
  background: rgba(11,18,32,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255,255,255,.85);
  font-size: .72rem; font-weight: 500;
  border: 1px solid rgba(255,255,255,.10);
}
.cover-caption svg { color: #EBFF00; flex-shrink: 0; }

/* ============================================================
   ARTICLE LAYOUT
   ============================================================ */
.article-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}
@media (min-width: 1024px) {
  .article-container { padding: 72px 40px 112px; }
}

/* ============================================================
   TOC
   ============================================================ */
.toc-card {
  margin-bottom: 52px;
  padding: 24px 28px 22px;
  border-radius: 18px;
  background: linear-gradient(180deg, #FAFBFC 0%, #F5F6F8 100%);
  border: 1px solid rgba(11,18,32,.07);
  position: relative;
  overflow: hidden;
}
.toc-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, #FF7A00 0%, #393185 60%, #00A0E3 100%);
  opacity: .8;
}
.toc-card__head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 14px; margin-bottom: 10px;
  border-bottom: 1px solid rgba(11,18,32,.08);
  font-size: .72rem; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: #0B1220;
}
.toc-card__head svg { color: #FF7A00; flex-shrink: 0; }
.toc-card__count {
  margin-left: auto;
  font-size: .66rem; font-weight: 700; letter-spacing: .1em;
  color: #9CA3AF;
  padding: 3px 9px; border-radius: 6px;
  background: rgba(11,18,32,.05);
  text-transform: none;
}
.toc-card__list {
  column-count: 1;
  column-gap: 40px;
}
@media (min-width: 640px) {
  .toc-card__list { column-count: 2; }
}
.toc-item {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  display: flex; align-items: flex-start; gap: 11px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  font-size: .9rem; font-weight: 500; color: #374151;
  line-height: 1.4;
  transition: background-color .22s ease, color .22s ease;
  position: relative;
  text-decoration: none;
}
.toc-item:hover {
  background: rgba(255,122,0,.07);
  color: #0B1220;
}
.toc-item__num {
  flex-shrink: 0;
  font-size: .72rem; font-weight: 800;
  color: #FF7A00;
  min-width: 24px;
  padding-top: 3px;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.toc-item--sub {
  padding-left: 30px;
  font-size: .85rem;
  color: #6B7280;
}
.toc-item--sub .toc-item__num {
  min-width: 30px;
  font-size: .68rem;
  color: #9CA3AF;
  font-weight: 700;
}
.toc-item.active {
  background: rgba(255,122,0,.10);
  color: #FF7A00;
  font-weight: 600;
}
.toc-item.active .toc-item__num { color: #FF7A00; }

/* ============================================================
   SHARE
   ============================================================ */
.article-share {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(11,18,32,.08);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.article-share__title { font-size: .875rem; font-weight: 600; color: #0B1220; }
.article-share__list { display: flex; align-items: center; gap: 8px; }
.share-btn {
  width: 42px; height: 42px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #6B7280; background: #fff;
  border: 1px solid rgba(11,18,32,.10);
  transition: all .3s ease;
}
.share-btn:hover {
  color: #FF7A00; border-color: rgba(255,122,0,.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -10px rgba(255,122,0,.4);
}

/* ============================================================
   PREV / NEXT
   ============================================================ */
.article-nav {
  display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 48px;
}
@media (min-width: 640px) { .article-nav { grid-template-columns: 1fr 1fr; } }

.article-nav__item {
  position: relative; overflow: hidden; padding: 22px;
  border-radius: 16px; background: #fff;
  border: 1px solid rgba(11,18,32,.08);
  transition: all .4s cubic-bezier(.2,.8,.25,1);
  display: block;
  text-decoration: none;
}
.article-nav__item:hover {
  transform: translateY(-4px);
  border-color: rgba(255,122,0,.35);
  box-shadow: 0 20px 40px -22px rgba(255,122,0,.28);
}
.article-nav__item::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg,#FF7A00,#393185);
  transform: scaleX(0); transform-origin: left;
  transition: transform .5s cubic-bezier(.2,.8,.25,1);
}
.article-nav__item:hover::before { transform: scaleX(1); }
.article-nav__label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .7rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: #9CA3AF; margin-bottom: 10px;
}
.article-nav__title {
  font-size: .96rem; font-weight: 700; color: #0B1220; line-height: 1.4;
  transition: color .3s ease;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-nav__item:hover .article-nav__title { color: #FF7A00; }
.article-nav__item--next { text-align: right; }
.article-nav__item--next .article-nav__label { justify-content: flex-end; }
.article-nav__item--next .article-nav__label svg { order: 2; margin-left: 4px; }

/* ============================================================
   RELATED
   ============================================================ */
.related-section {
  position: relative;
  padding: 5rem 0 6rem;
  border-top: 1px solid rgba(11,18,32,.06);
  background: #F7F8FA;
  overflow: hidden;
}
.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 768px) { .related-grid { grid-template-columns: repeat(3, 1fr); } }

.related-card {
  position: relative; overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(11,18,32,.08);
  background: #fff;
  box-shadow: 0 1px 3px rgba(11,18,32,.04), 0 8px 24px -8px rgba(11,18,32,.06);
  display: flex; flex-direction: column;
  transition: transform .55s cubic-bezier(.2,.8,.25,1), border-color .4s ease, box-shadow .4s ease;
}
.related-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg,#FF7A00,#393185);
  transform: scaleX(0); transform-origin: left;
  transition: transform .55s cubic-bezier(.2,.8,.25,1); z-index: 2;
}
.related-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255,122,0,.35);
  box-shadow: 0 20px 40px -20px rgba(255,122,0,.25);
}
.related-card:hover::before { transform: scaleX(1); }
.related-card:hover .related-card__img { transform: scale(1.05); }
.related-card:hover .related-card__title { color: #FF7A00; }
.related-card__img { transition: transform .8s cubic-bezier(.2,.8,.25,1); }
.related-card__title { transition: color .35s ease; }

/* ============================================================
   READ PROGRESS
   ============================================================ */
#readProgress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  z-index: 60; background: transparent; pointer-events: none;
}
#readProgress__fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg,#FF7A00 0%,#393185 60%,#00A0E3 100%);
  box-shadow: 0 0 10px rgba(255,122,0,.5);
  transition: width .1s linear;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 560px) {
  .article-hero { padding: 112px 0 0; }
  .article-container { padding: 40px 20px 72px; }
  .article-cover { padding: 0 16px; }
  .article-cover__inner { aspect-ratio: 4 / 3; border-radius: 16px; }
  .article-meta { gap: 12px; }
  .article-meta__source { display: none; }
  .toc-card { padding: 20px 18px 16px; margin-bottom: 40px; }
  .toc-item { padding: 8px 10px; font-size: .86rem; }
  .toc-item--sub { padding-left: 24px; }
}


/* ============================================================
   TABLE WRAP — горизонтальный скролл таблиц на мобилке
   ============================================================ */
@media (max-width: 700px) {
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    margin: 1.6em 0;
  }
  .table-wrap table {
    min-width: 620px;   /* таблица не сжимается — появляется скролл */
  }
}

/* На всякий случай — таблица не выходит за родителя на любых экранах */
.table-wrap { max-width: 100%; }
.table-wrap table { max-width: none; }


/* ============================================================
   TABLE — акцентная шапка, зебра, hover
   ============================================================ */
.prose .table-wrap thead th {
  background: var(--accent, #FF7A00);
  color: #fff;
  border-bottom: 1px solid var(--accent, #FF7A00);
}

/* Зебра: каждая вторая строка чуть другого оттенка */
.prose .table-wrap tbody tr:nth-child(even) {
  background: rgba(57, 49, 133, .04);
}

/* Hover */
.prose .table-wrap tbody tr {
  transition: background-color .18s ease;
}
.prose .table-wrap tbody tr:hover {
  background: rgba(255, 122, 0, .09);
}