﻿/* =========================
   Article page
   ========================= */

.article-hero{
  padding: 34px 0 14px;
}
.article-title{
  margin: 10px 0 12px;
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.article-subtitle{
  margin: 0 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
  color: white;
  /*text-shadow: 1px 1px 1px black;*/
}

/* hero image */
.article-hero-media{
  position: relative;
  margin-top: 14px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg2);
  box-shadow: 0 18px 45px rgba(15,23,42,.10);
}
.article-hero-img{
  width: 100%;
  height: clamp(220px, 34vw, 420px);
  object-fit: cover;
  display:block;
  transform: scale(1.01);
}
.article-hero-glow{
  position:absolute;
  inset:0;
  background:
    radial-gradient(900px 360px at 15% 15%, rgba(15,98,254,.18), transparent 60%),
    radial-gradient(900px 360px at 85% 35%, rgba(124,58,237,.14), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,0) 30%, rgba(255,255,255,.10) 100%);
  pointer-events:none;
}

.article-section{
  padding-top: 18px;
}

.article-main{ min-width: 0; } /* prevents overflow */

/**************************************************************/
.toc-title{
  font-size: 12px;
  font-weight: 900;
  color: var(--muted2);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.toc-list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap: 6px;
}
.toc-link{
  display:block;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid transparent;

  color: rgba(11,18,32,.55);       /* “полупрозрачный – не активный” */
  background: rgba(246,247,251,.6);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;

  transition: transform .12s ease, background .12s ease, color .12s ease, border-color .12s ease;
}
.toc-link:hover{
  color: var(--text);
  background: #fff;
  border-color: var(--border);
  transform: translateY(-1px);
}
.toc-link.is-active{
  color: var(--text);
  background: linear-gradient(135deg, rgba(15,98,254,.10), rgba(124,58,237,.08));
  border-color: rgba(15,98,254,.18);
}

/* mobile toc under image */
.toc-mobile{
  display:none;
  margin: 12px 0 12px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow);
  padding: 14px;
  backdrop-filter: blur(10px);
}
.toc-mobile-title{
  font-size: 12px;
  font-weight: 900;
  color: var(--muted2);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.toc-mobile .toc-list{ gap: 8px; }

/* Article typography */
.article-body{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 22px;
}

    .article-body img {  
    width:-webkit-fill-available;
    }

.article-body p{
  margin: 0 0 14px;
  font-size: 17px;                 /* крупнее */
  line-height: 1.9;
  color: #111827;
  max-width: 78ch;
}
.article-body p + p{ margin-top: 10px; }

.article-body h2{
  margin: 26px 0 12px;
  font-size: 24px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  position: relative;
  padding-left: 14px;
}
.article-body h2::before{
  content:"";
  position:absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  box-shadow: 0 0 0 4px var(--accentSoft);
}

/* ===========================
   Article H3 — more noticeable, but still “clean”
   Plays nice with your H2 gradient bar.
   =========================== */

.article-body h3{
  margin: 22px 0 10px;
  font-size: 19px;              /* a bit bigger */
  font-weight: 750;             /* Inter supports 700; browser will map */
  letter-spacing: -0.015em;
  line-height: 1.25;
  position: relative;
  padding-left: 12px;
}

/* thinner, shorter accent bar than H2 */
.article-body h3::before{
  content:"";
  position:absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  box-shadow: 0 0 0 3px var(--accentSoft);
  opacity: .9;
}

/* subtle underline accent (doesn’t look like a link) */
.article-body h3::after{
  content:"";
  position:absolute;
  left: 12px;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: linear-gradient(90deg, rgba(0,0,0,.10), rgba(0,0,0,0));
}

/* optional: if an H3 goes right after H2, reduce top gap a bit */
.article-body h2 + h3{
  margin-top: 14px;
}

/* mobile tweaks */
@media (max-width: 520px){
  .article-body h3{
    font-size: 18px;
    margin: 20px 0 9px;
    padding-left: 11px;
  }
  .article-body h3::after{
    bottom: -5px;
  }
}


.article-body a{
  color: var(--accent);
  font-weight: 700;
  border-bottom: 1px solid rgba(15,98,254,.25);
}
.article-body a:hover{
  border-bottom-color: rgba(15,98,254,.45);
}

.article-body ul, .article-body ol{
  margin: 10px 0 16px 22px;
  color: #111827;
  font-size: 17px;
  line-height: 1.85;
}
.article-body li{ margin: 6px 0; }

.article-body blockquote{
  margin: 14px 0;
  padding: 14px 16px;
  border-left: 4px solid rgba(15,98,254,.30);
  background: rgba(15,98,254,.06);
  border-radius: 16px;
  color: #111827;
}

/* Custom blocks inside HtmlBody */
.article-body .divImp,
.article-body .divAdv,
.article-body .divSample,
.article-body .divPrompt{
  margin: 16px 0;
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 14px 14px 14px 14px;
  background: #fff;
  position: relative;
}

.article-body .divImp{ border-color: rgba(239,68,68,.25); background: rgba(239,68,68,.06); }
.article-body .divAdv{ border-color: rgba(14,165,233,.25); background: rgba(14,165,233,.06); }
.article-body .divSample{ border-color: rgba(124,58,237,.22); background: rgba(124,58,237,.06); }

.article-body .divImp::before,
.article-body .divAdv::before,
.article-body .divSample::before{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.65);
  margin-bottom: 10px;
}

/*.article-body .divImp::before{ content:"Важно"; }
.article-body .divAdv::before{ content:"Совет"; }
.article-body .divSample::before{ content:"Пример"; }*/

/* PROMPT = tech/code block */
.article-body .divPrompt{
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.28);
  background: linear-gradient(180deg, #0b1220 0%, #0a1020 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 14px 40px rgba(2,6,23,.25);
  padding: 16px 16px 16px 16px;
  color: rgba(226,232,240,.92);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* бейдж Prompt в техно стиле */
.article-body .divPrompt::before{
  content:"Prompt";
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(99,102,241,.35);
  background: rgba(99,102,241,.12);
  color: rgba(224,231,255,.95);
  margin-bottom: 10px;
}

/* внутри prompt делаем текст как код */
.article-body .divPrompt p,
.article-body .divPrompt li{
  color: rgba(226,232,240,.90);
  font-size: 14px;
  line-height: 1.8;
  margin: 0 0 10px;
  max-width: none;
}

.article-body .divPrompt a{
  color: #93c5fd;
  border-bottom-color: rgba(147,197,253,.35);
}

.article-body .divFaq{
  border: 1px dashed rgba(148,163,184,.55);
  background: rgba(255,255,255,.88);
  padding: 16px;
  border-radius: 18px;
}

/* Title (если вдруг в FAQ вставляют h2) */
.article-body .divFaq h2{
  margin: 0 0 12px 0;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* Question */
.article-body .divFaq h3{
  margin: 12px 0 6px 0;
  padding: 12px 14px 12px 46px;
  border: 1px solid rgba(148,163,184,.35);
  background: rgba(246,247,251,.85);
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.35;
  position: relative;
}

/* “?” icon */
.article-body .divFaq h3:before{
  content:"?";
  position:absolute;
  left:14px;
  top:50%;
  transform:translateY(-50%);
  width:22px;
  height:22px;
  line-height:22px;
  text-align:center;
  border-radius:50%;
  border: 1px solid rgba(15,98,254,.35);
  font-weight:900;
  font-size:13px;
  color: rgba(15,98,254,.95);
  background: rgba(255,255,255,.9);
}

/* Answer */
.article-body .divFaq p{
  margin: 6px 0 0 0;
  padding: 10px 14px 10px 46px;
  background:#fff;
  border-left: 3px solid rgba(15,98,254,.18);
  border-radius: 14px;
  line-height: 1.75;
  color:#111827;
  max-width: none;
}

/* spacing between Q blocks */
.article-body .divFaq p + h3{ margin-top: 16px; }

.article-body .divFaq a{
  text-decoration: underline;
  border-bottom: none;
}
.article-body .divFaq a:hover{ text-decoration: none; }



/* =========================
   Vote block (centered, modern, with icon element)
   ========================= */

.article-vote{
  margin-top: 18px;
  padding: 22px 18px;
  border-radius: calc(var(--radius-xl) + 4px);
  border: 1px solid rgba(230,232,239,.95);

  background:
    radial-gradient(520px 180px at 20% 10%, rgba(15,98,254,.16), transparent 60%),
    radial-gradient(520px 180px at 80% 30%, rgba(124,58,237,.12), transparent 60%),
    rgba(255,255,255,.78);

  /*box-shadow:
    0 18px 50px rgba(15,23,42,.10),
    inset 0 1px 0 rgba(255,255,255,.75);*/

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  text-align: center;
  display: grid;
  gap: 14px;
  justify-items: center;
}

/* Title + subtitle */
.vote-head{
  display: grid;
  gap: 6px;
  justify-items: center;
}
.vote-head h3{
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;

  background: linear-gradient(90deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.vote-head p{
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 62ch;
}

/* Buttons row */
.vote-actions{
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content:center;
  align-items:center;
  margin-top: 2px;
}

/* Buttons (large, tech) */
.vote-btn{
  appearance: none;
  border: 1px solid rgba(230,232,239,.95);
  background: rgba(255,255,255,.92);
  border-radius: 999px;

  padding: 14px 18px;
  min-width: 220px;

  font-weight: 900;
  font-size: 15px;
  letter-spacing: -0.01em;

  cursor: pointer;
  user-select: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;

  box-shadow:
    0 14px 30px rgba(15,23,42,.10),
    inset 0 1px 0 rgba(255,255,255,.8);

  transition:
    transform .14s ease,
    box-shadow .14s ease,
    background .14s ease,
    border-color .14s ease,
    filter .14s ease;
}

/* Icon element (big + modern) */
.vote-ico{
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 24px;
  line-height: 1;

  border: 1px solid rgba(230,232,239,.95);
  background: rgba(246,247,251,.85);
  box-shadow:
    0 10px 22px rgba(15,23,42,.08),
    inset 0 1px 0 rgba(255,255,255,.75);
}

/* Text */
.vote-text{
  display: inline-flex;
  align-items: center;
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
}

/* Hover/focus */
.vote-btn:hover{
  transform: translateY(-2px);
  box-shadow:
    0 18px 42px rgba(15,23,42,.14),
    inset 0 1px 0 rgba(255,255,255,.85);
  border-color: rgba(15,98,254,.22);
}
.vote-btn:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 4px var(--accentSoft),
    0 18px 42px rgba(15,23,42,.14);
  border-color: rgba(15,98,254,.35);
}

/* Tech tint per button */
.vote-btn[data-vote="yes"]{
  background: linear-gradient(180deg, rgba(15,98,254,.10), rgba(255,255,255,.92));
}
.vote-btn[data-vote="yes"] .vote-ico{
  border-color: rgba(15,98,254,.20);
  background: linear-gradient(180deg, rgba(15,98,254,.12), rgba(255,255,255,.88));
}

.vote-btn[data-vote="no"]{
  background: linear-gradient(180deg, rgba(124,58,237,.10), rgba(255,255,255,.92));
}
.vote-btn[data-vote="no"] .vote-ico{
  border-color: rgba(124,58,237,.20);
  background: linear-gradient(180deg, rgba(124,58,237,.12), rgba(255,255,255,.88));
}

/* Disabled */
.vote-btn.is-disabled,
.vote-btn:disabled{
  opacity: .55;
  cursor: default;
  transform: none;
  filter: grayscale(.25);
  box-shadow: 0 10px 22px rgba(15,23,42,.08);
}
.vote-btn.is-disabled .vote-ico,
.vote-btn:disabled .vote-ico{
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
}

/* Stats pill */
.vote-stats{
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  font-size: 13px;
  color: var(--muted);

  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(230,232,239,.95);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px rgba(15,23,42,.06);
}
.vote-stats b{
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
}

/* Note */
.vote-note{
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  padding: 12px 14px;
  border-radius: 16px;

  border: 1px solid rgba(15,98,254,.18);
  background:
    radial-gradient(520px 160px at 20% 10%, rgba(15,98,254,.14), transparent 60%),
    rgba(15,98,254,.06);

  color: #1f2937;
  font-size: 14px;
  line-height: 1.6;
  max-width: 72ch;
}

@media (max-width: 520px){
  .vote-btn{ min-width: 100%; }
}


/* Author */
.author-box{
  margin-top: 14px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow);
  padding: 18px;
  display:flex;
  gap: 14px;
  align-items:flex-start;
}
.author-ico{
  width: 42px; height: 42px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15,98,254,.16), rgba(124,58,237,.12));
  border: 1px solid rgba(15,98,254,.14);
  box-shadow: 0 12px 26px rgba(15,98,254,.12);
  flex: 0 0 auto;
}
.author-body h3{ margin:0 0 8px; font-size: 16px; }
.author-body p{ margin:0 0 10px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.author-meta{ display:flex; gap:8px; flex-wrap: wrap; }

/* Below blocks */
.below-block{
  margin-top: 18px;

}
.below-head {
text-align: center;
}
.below-head h2{
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.below-head p{
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.below-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.mini-post{
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 26px rgba(15,23,42,.06);
  overflow:hidden;
  transition: transform .12s ease, box-shadow .12s ease;
  display:block;
}
.mini-post:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(15,23,42,.10);
}
.mini-post-imgwrap{
  height: 120px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.mini-post-imgwrap img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}
.mini-post-body{
  padding: 14px;
}
.mini-post-body h3{
  margin: 10px 0 10px;
  font-size: 14px;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

/* Other categories */
.browse-cats{
  margin-top: 18px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow);
  padding: 18px;
}
.browse-head h2{
  margin:0 0 6px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted2);
}
.browse-head p{
  margin:0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  max-width: 80ch;
}
.browse-links{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}
.browse-link{
  display:inline-flex;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  font-weight: 800;
  font-size: 12px;
}
.browse-link:hover{
  background: #eef1ff;
  border-color: #dbe0ff;
  color: var(--accent);
}

/* Responsive */
@media (max-width: 980px){
  .article-layout{ grid-template-columns: 1fr; }
  .article-aside{ display:none; }
  .toc-mobile{ display:block; }
  .below-grid{ grid-template-columns: 1fr; }
}
/*****************************************************************/


/* В пассиве — полупрозрачный */
.toc-card{
              
  opacity: .55;             /* пассивный */
  transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.72);
  box-shadow: 0 10px 26px rgba(15,23,42,.06);
  padding: 14px;
  backdrop-filter: blur(10px);
}

/* aside TOC */

.article-main{ min-width:0; }

@media (max-width: 980px){
  .article-layout{ grid-template-columns: 1fr; }
  .article-aside{ display:none; }
}

/* При наведении — чёткий */
.toc-card:hover{
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(15,23,42,.10);
  background: rgba(255,255,255,.88);
}

.editorial{
  margin-top: 14px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow);
  padding: 16px;
}

.editorial-top{
  display:flex;
  gap: 12px;
  align-items:flex-start;
}

.editorial-ico{
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(15,98,254,.12), rgba(124,58,237,.10));
  border: 1px solid rgba(15,98,254,.16);
  box-shadow: 0 14px 30px rgba(15,98,254,.10);
  flex: 0 0 auto;
}
.editorial-ico svg{ width: 22px; height: 22px; }

.editorial-text h2{
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted2);
}
.editorial-text p{
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  max-width: 80ch;
}

.editorial-links{
  margin-top: 12px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

.editorial-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--accent);
  font-weight: 900;
  font-size: 13px;
}
.editorial-link:hover{
  background: #f4f7ff;
  border-color: #dbe0ff;
}

.takeaways{
  margin-top: 14px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(230,232,239,.95);
  background:
    radial-gradient(520px 160px at 20% 10%, rgba(15,98,254,.14), transparent 60%),
    radial-gradient(520px 160px at 85% 60%, rgba(124,58,237,.10), transparent 60%),
    rgba(255,255,255,.78);
  box-shadow: 0 18px 45px rgba(15,23,42,.08);
  backdrop-filter: blur(10px);
  padding: 16px;
}

.takeaways-head{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.takeaways-ico{
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color: var(--accent);
  background: rgba(15,98,254,.10);
  border: 1px solid rgba(15,98,254,.18);
  box-shadow: 0 12px 26px rgba(15,98,254,.12);
}
.takeaways-ico svg{ width: 20px; height: 20px; }

.takeaways-title{
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted2);
}

/* Takeaways list — modern, compact, inset */
.takeaways-list{
  /* reset */
  list-style: none;
  margin: 0;
  padding: 10px 10px 2px;

  /* layout */
  display: grid;
  gap: 10px;

  /* typography (closer to TOC card style) */
  font-size: 13px;
  line-height: 1.65;
  color: rgba(17,24,39,.92);
}

/* item card */
.takeaways-list li{
  margin: 0;
  position: relative;

  /* inset so it doesn’t stick to the edge */
  padding: 10px 12px 10px 38px;

  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.72);
  box-shadow: 0 10px 22px rgba(15,23,42,.06);
}

/* custom marker */
.takeaways-list li::before{
  content: "";
  position: absolute;
  left: 12px;
  top: 12px;

  width: 18px;
  height: 18px;
  border-radius: 999px;

  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.9), rgba(255,255,255,.2)),
              linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 0 4px rgba(15,98,254,.10);
}

/* subtle “shine” line to look more tech */
.takeaways-list li::after{
  content: "";
  position: absolute;
  left: 38px;
  right: 12px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,.7), rgba(255,255,255,0));
  opacity: .7;
}

/* links inside takeaways, if any */
.takeaways-list a{
  color: var(--accent);
  text-decoration: none;
  font-weight: 800;
}
.takeaways-list a:hover{
  text-decoration: underline;
}

/* make inline code/strong look nice if it appears */
.takeaways-list code{
  font-size: .95em;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15,23,42,.06);
  border: 1px solid rgba(15,23,42,.10);
}
.takeaways-list strong{
  font-weight: 900;
}

/* mobile tweaks */
@media (max-width: 980px){
  .takeaways-list{ font-size: 13px; }
  .takeaways-list li{ padding: 10px 12px 10px 36px; }
  .takeaways-list li::before{ width: 17px; height: 17px; }
}



.popular-badge{
  margin-left: auto;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15,98,254,.20);
  background: rgba(15,98,254,.08);
  color: #0b57e6;
  font-weight: 900;
  letter-spacing: .04em;
  font-size: 12px;
  white-space: nowrap;
}
.popular-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 0 4px var(--accentSoft);
}
@media (max-width: 980px){
  .popular-badge{ margin-left: 0; }
  .takeaways-list{ font-size: 15px; }
}
/* ===== HERO sticky wrapper (limits sticky to this block) ===== */
.hero-sticky-row{
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: start;
}

/* sticky only inside hero-sticky-row (so it can’t go above takeaways) */
/*.hero-sticky-aside{
  position: relative;         
  align-self: start;
}*/

/* responsive */
@media (max-width: 980px){
  .hero-sticky-row{ grid-template-columns: 1fr; }
  .hero-sticky-aside{ display:none; } /* keep your toc-mobile */
}

/* --- FIX: make aside sticky reliable inside CSS Grid --- */
.article-aside{
  align-self: start;
  overflow: visible;     /* на всякий случай */
}

/* ===== Article layout (NO GRID) ===== */
.article-layout{
  display:flex;               /* вместо grid */
  align-items:flex-start;
  gap: 24px;
}

/* main column */
.article-main{
  flex: 1 1 auto;
  min-width: 0;               /* важно, чтобы контент не распирал */
}

/* aside column */
.article-aside{
  flex: 0 0 320px;            /* фикс ширина, как было */
  align-self:flex-start;
}

/* sticky wrapper (самый надёжный вариант) */
.article-aside-sticky{
  position: sticky !Important;
  top: 92px;                  /* под твой sticky header */
}

/* на всякий случай: toc-card больше НЕ sticky */
.article-aside .toc-card{
  position: relative;         /* или просто убери position sticky */
}

/* ===== Responsive ===== */
@media (max-width: 980px){
  .article-layout{ display:block; }
  .article-aside{ display:none; }
}

/* ===============================
   FINAL STICKY TOC (WORKING)
   =============================== */

/* Layout */
.article-layout{
  display:flex;
  gap: var(--gap);
  align-items:flex-start;
}
.article-main{ flex: 1 1 auto; min-width:0; }

/* КЛЮЧ: sticky на самом aside (flex-item) */
.article-aside{
  flex: 0 0 var(--asideW);
  width: var(--asideW);
  align-self: flex-start;

  position: sticky;
  top: 20px;
}

/* Card */
.toc-card{
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}

/* Внутренний скролл — только у списка, не у sticky-элемента */
.toc{
  max-height: calc(100vh - (var(--stickyTop) + 24px));
  overflow:auto;
  padding-right: 4px;
}

.toc-title{
  font-weight:700;
  font-size:14px;
  margin-bottom: 10px;
}

.toc-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.toc-link{
  display:block;
  text-decoration:none;
  color: var(--muted);
  font-size:14px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.toc-link:hover{
  color: var(--text);
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.08);
}
.toc-link.is-active{
  color: var(--text);
  background: rgba(122,167,255,.14);
  border-color: rgba(122,167,255,.25);
}


/* Mobile TOC */
.toc-mobile{ display:none; margin-bottom: 14px; }

@media (max-width: 980px){
  .article-layout{ flex-direction:column; }
  .article-aside{ display:none; position: static; top:auto; }
  .toc-mobile{ display:block; }
  .toc{ max-height:none; overflow:visible; }
}

.spacer{ height: 1200px; }
.footer-note{ margin-top:16px; color:var(--muted); font-size:13px; }


/* ==============================
   Article code blocks (<pre>)
   ============================== */

.article-body pre {
    margin: 1.6rem 0;
    padding: 1.2rem 1.4rem;

    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
                 "Liberation Mono", "Courier New", monospace;
    font-size: 0.92rem;
    line-height: 1.6;

    color: #0f172a;               /* near-slate-900 */
    background: #f8fafc;          /* subtle gray */
    border: 1px solid #e5e7eb;    /* light neutral */
    border-radius: 12px;

    overflow-x: auto;
    white-space: pre;
    word-break: normal;
    tab-size: 2;

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.6),
        0 1px 2px rgba(15,23,42,0.04);
}

/* scroll bar — аккуратно */
.article-body pre::-webkit-scrollbar {
    height: 8px;
}

.article-body pre::-webkit-scrollbar-track {
    background: transparent;
}

.article-body pre::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 6px;
}

.article-body pre::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

.article-body pre code {
    display: block;
    padding: 0;
    background: transparent;
    color: inherit;
}

.article-body pre {
    border-left: 4px solid #94a3b8; /* slate */
}
.article-body pre code {
    background-image: linear-gradient(
        rgba(0,0,0,0.03) 50%,
        transparent 50%
    );
    background-size: 100% 3.2em;
}
@media (max-width: 640px) {
    .article-body pre {
        font-size: 0.85rem;
        padding: 1rem;
        border-radius: 10px;
    }
}


/********************************************************************/


/* Wrapper for horizontal scroll (you already use it) */
.overflowX{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 18px 0 22px;
  padding: 2px;
  border-radius: 16px;
}

/* Nice scrollbars (optional) */
.overflowX::-webkit-scrollbar{ height: 10px; }
.overflowX::-webkit-scrollbar-track{ background: rgba(0,0,0,.04); border-radius: 999px; }
.overflowX::-webkit-scrollbar-thumb{ background: rgba(0,0,0,.14); border-radius: 999px; }
.overflowX:hover::-webkit-scrollbar-thumb{ background: rgba(0,0,0,.22); }

.article-body table{
  width: 100%;
  min-width: 640px; /* keeps columns readable on mobile; wrapper scrolls */
  border-collapse: separate;
  border-spacing: 0;
  background: var(--tbl-bg);
  color: var(--tbl-text);
  border: 1px solid var(--tbl-border);
  border-radius: 16px;
  box-shadow: var(--tbl-shadow);
  overflow: hidden; /* for rounded corners */
}

/* Caption support (if you use it) */
.article-body table caption{
  caption-side: top;
  text-align: left;
  padding: 10px 14px 8px;
  font-size: 13px;
  color: var(--tbl-muted);
}

/* Head */
.article-body table thead th{
  position: sticky; /* helps inside overflow containers in many browsers */
  top: 0;
  z-index: 1;
  text-align: left;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
  padding: 14px 14px;
  color: rgba(0,0,0,.86);

  background:
    linear-gradient(90deg, rgba(246,200,0,.16), rgba(53,167,255,.12)),
    rgba(255,255,255,.92);
  border-bottom: 1px solid var(--tbl-border-2);
}

/* Header top border radius */
.article-body table thead th:first-child{ border-top-left-radius: 16px; }
.article-body table thead th:last-child{ border-top-right-radius: 16px; }

/* Cells */
.article-body table td{
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
  vertical-align: top;
  border-bottom: 1px solid var(--tbl-border);
}

/* Make first column slightly stronger (often “Критерий”) */
.article-body table tbody td:first-child{
  font-weight: 600;
  color: rgba(0,0,0,.84);
  width: 26%;
}

/* Zebra rows */
.article-body table tbody tr:nth-child(even) td{
  background: rgba(0,0,0,.02);
}

/* Hover */
@media (hover:hover){
  .article-body table tbody tr:hover td{
    background: rgba(246,200,0,.08);
  }
}

/* Remove last row border and round bottom corners */
.article-body table tbody tr:last-child td{ border-bottom: 0; }
.article-body table tbody tr:last-child td:first-child{ border-bottom-left-radius: 16px; }
.article-body table tbody tr:last-child td:last-child{ border-bottom-right-radius: 16px; }

/* Links inside tables */
.article-body table a{
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(53,167,255,.45);
  text-underline-offset: 2px;
}
.article-body table a:hover{
  text-decoration-color: rgba(53,167,255,.85);
}

/* Inline code/mark inside tables (if present) */
.article-body table code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12.5px;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(0,0,0,.05);
  border: 1px solid rgba(0,0,0,.08);
}
.article-body table mark{
  background: rgba(246,200,0,.28);
  padding: 0 .2em;
  border-radius: 6px;
}

/* Compact variant if you ever add class="table-compact" */
.article-body table.table-compact thead th{ padding: 12px 12px; font-size: 13px; }
.article-body table.table-compact td{ padding: 10px 12px; font-size: 13px; }

/* Mobile: slightly tighter */
@media (max-width: 520px){
  .overflowX{ margin: 14px 0 18px; border-radius: 14px; }
  .article-body table{ border-radius: 14px; }
  .article-body table thead th{ padding: 12px 12px; font-size: 13px; }
  .article-body table td{ padding: 10px 12px; font-size: 13px; }
  .article-body table tbody td:first-child{ width: 32%; }
}

/* Print: clean and sharp */
@media print{
  .overflowX{ overflow: visible; box-shadow: none; }
  .article-body table{
    min-width: auto;
    box-shadow: none;
    border: 1px solid #bbb;
  }
  .article-body table thead th{
    background: #f3f3f3 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/**********************************/
/* ===========================
   Article ordered list (ol)
   =========================== */

.article-body ol{
  counter-reset: step;
  margin: 20px 20px 20px;
  padding: 0;
  list-style: none;
}

/* list item */
.article-body ol > li{
  position: relative;
  padding-left: 42px;
  margin: 12px 0;
  line-height: 1.55;
}

/* number bubble */
.article-body ol > li::before{
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;

  width: 28px;
  height: 28px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 14px;
  font-weight: 700;
  color: #fff;

  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow:
    0 4px 10px rgba(0,0,0,.12),
    0 0 0 4px var(--accentSoft);
}

/* strong inside list — slightly emphasized */
.article-body ol > li > strong{
  font-weight: 700;
}

/* paragraph inside li */
.article-body ol > li p{
  margin: 6px 0 0;
}

/* nested ol (second level) */
.article-body ol ol{
  margin-top: 10px;
}

.article-body ol ol > li{
  padding-left: 36px;
}

.article-body ol ol > li::before{
  width: 22px;
  height: 22px;
  font-size: 12px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  box-shadow: 0 0 0 3px var(--accentSoft);
}
