/* Раздел «Статьи»: хаб, страницы разделов и статьи. Использует токены site.css. */
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
/* body{overflow-x:hidden} turns body into a scroll container and breaks position:sticky; clip keeps the guard without that. */
.articles-page { background:var(--paper-2); overflow-x:clip; }
.articles-page .site-header { position:sticky; }

/* Hero */
.articles-hero { padding:42px 0 40px; }
.articles-hero .crumbs a { color:rgba(255,255,255,.7); }
.articles-hero .crumbs a:hover { color:#fff; }
.articles-hero h1 { font-size:clamp(34px,5vw,64px); max-width:1100px; }
.articles-hero-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:26px; }
.btn.ghost-light { background:transparent; border-color:rgba(255,255,255,.35); color:#fff; }
.btn.ghost-light:hover { border-color:#fff; }
.articles-search { margin-top:26px; max-width:720px; }
.articles-search input { width:100%; min-height:56px; border:1px solid rgba(255,255,255,.2); border-radius:4px; background:rgba(255,255,255,.08); color:#fff; padding:0 18px 0 48px; font-size:17px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23ffffff99' stroke-width='2'%3E%3Ccircle cx='8.5' cy='8.5' r='6.5'/%3E%3Cpath d='m13.5 13.5 5 5'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:16px 50%; }
.articles-search input::placeholder { color:rgba(255,255,255,.5); }
.articles-search input:focus { outline:none; border-color:#fff; background-color:rgba(255,255,255,.12); }
.articles-stats { display:flex; flex-wrap:wrap; gap:8px 28px; margin-top:22px; font-family:"IBM Plex Mono", monospace; font-size:13px; color:rgba(255,255,255,.6); }
.articles-stats b { color:#fff; font-size:18px; font-weight:600; margin-right:4px; }

/* Topic chips */
.topic-chips { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 30px; }
.topic-chips a { display:inline-flex; align-items:center; gap:8px; padding:9px 14px; border:1px solid var(--steel-100); background:#fff; border-radius:999px; font-size:14px; font-weight:500; color:var(--steel-700); transition:border-color .15s,color .15s,background .15s; }
.topic-chips a small { font-family:"IBM Plex Mono", monospace; font-size:11px; color:var(--steel-400); }
.topic-chips a:hover { border-color:var(--accent); color:var(--accent); }
.topic-chips a.active { background:var(--ink); border-color:var(--ink); color:#fff; }
.topic-chips a.active small { color:rgba(255,255,255,.6); }

/* Sections & grids */
.articles-section { padding:34px 0 80px; }
.topic-block { padding:34px 0 38px; border-top:1px solid var(--steel-100); scroll-margin-top:110px; }
.topic-block:first-child { border-top:0; padding-top:8px; }
.topic-block-head { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:16px 40px; align-items:end; margin-bottom:22px; }
.topic-block-head h2 { font-size:clamp(26px,3vw,36px); font-weight:600; }
.topic-block-head h2 a:hover { color:var(--accent); }
.topic-block-head p { margin-top:10px; color:var(--steel-600); max-width:820px; }
.topic-block-links { display:flex; gap:18px; font-size:14px; font-weight:600; white-space:nowrap; }
.topic-block-links a { color:var(--accent); }
.topic-block-links a:hover { color:var(--accent-deep); text-decoration:underline; }
.article-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.article-card { display:flex; flex-direction:column; background:#fff; border:1px solid var(--steel-100); border-radius:8px; overflow:hidden; transition:transform .15s,box-shadow .15s,border-color .15s; }
.article-card:hover { transform:translateY(-2px); box-shadow:0 16px 34px rgba(14,17,22,.07); border-color:var(--steel-200); }
.article-card-media { display:block; aspect-ratio:16/10; overflow:hidden; background:#fff; border-bottom:1px solid var(--steel-100); }
.article-card-media img { width:100%; height:100%; object-fit:cover; object-position:top center; }
.article-card-body { display:flex; flex-direction:column; gap:10px; padding:18px 20px 20px; flex:1; }
.article-card-topic { font-family:"IBM Plex Mono", monospace; font-size:11px; letter-spacing:.1em; text-transform:uppercase; color:var(--accent); }
.article-card h3 { font-size:19px; line-height:1.3; letter-spacing:-.01em; font-weight:600; }
.article-card h3 a:hover { color:var(--accent); }
.article-card h3 a::after { content:""; position:absolute; inset:0; }
.article-card { position:relative; }
.article-card-topic { position:relative; z-index:1; align-self:flex-start; }
.article-card p { color:var(--steel-600); font-size:15px; line-height:1.5; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.article-card-meta { margin-top:auto; font-family:"IBM Plex Mono", monospace; font-size:12px; color:var(--steel-400); }
.article-list { list-style:none; padding:0; margin:18px 0 0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 32px; }
.article-list li { display:flex; justify-content:space-between; gap:16px; align-items:baseline; padding:13px 0; border-bottom:1px solid var(--steel-100); }
.article-list a { font-weight:500; line-height:1.4; }
.article-list a:hover { color:var(--accent); }
.article-list span { flex:none; font-family:"IBM Plex Mono", monospace; font-size:12px; color:var(--steel-400); }
.articles-results { margin-bottom:40px; }
.articles-results-head { font-family:"IBM Plex Mono", monospace; font-size:13px; color:var(--steel-500); margin-bottom:16px; }
.articles-results-empty { padding:28px; background:#fff; border:1px dashed var(--steel-200); border-radius:8px; color:var(--steel-600); }
.articles-results-empty a { color:var(--accent); font-weight:600; }

/* Article page */
.article-shell { padding-top:26px; padding-bottom:30px; }
.article-shell > .crumbs { font-size:13px; color:var(--steel-400); margin-bottom:22px; }
.article-shell > .crumbs a:hover { color:var(--accent); }
.article-layout { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:40px; align-items:start; }
.article-body { background:#fff; border:1px solid var(--steel-100); border-radius:8px; padding:clamp(24px,4vw,56px); min-width:0; font-size:18px; line-height:1.7; color:#1d252d; }
.article-body article > * + * { margin-top:0; }
.article-body .eyebrow a { color:var(--accent); }
.article-body h1 { font-size:clamp(30px,3.6vw,46px); line-height:1.15; font-weight:600; margin:14px 0 16px; }
.article-body h2 { font-size:clamp(23px,2.4vw,29px); line-height:1.25; font-weight:600; margin:46px 0 14px; scroll-margin-top:110px; }
.article-body h3 { font-size:20px; line-height:1.35; font-weight:600; margin:28px 0 8px; letter-spacing:-.01em; }
.article-body p { margin:0 0 16px; }
.article-body a { color:var(--accent); text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:3px; }
.article-body a:hover { color:var(--accent-deep); }
.article-body ul,.article-body ol { padding-left:24px; margin:0 0 18px; }
.article-body li { margin:6px 0; }
.article-body .byline { font-family:"IBM Plex Mono", monospace; font-size:13px; color:var(--steel-400); padding-bottom:18px; border-bottom:1px solid var(--steel-100); }
.article-body .lead { font-size:20px; line-height:1.6; color:var(--steel-700); margin-top:20px; }
.article-body .answer { background:#eef3fa; border-left:4px solid var(--accent); border-radius:0 8px 8px 0; padding:22px 26px; margin:26px 0; }
.article-body .answer p { margin:0; }
.article-body .answer::before { content:"Коротко"; display:block; font-family:"IBM Plex Mono", monospace; font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--accent); margin-bottom:8px; }
.article-body .article-figure { margin:30px 0 34px; }
.article-body .article-figure.photo { padding:20px; border:1px solid var(--steel-100); border-radius:8px; background:linear-gradient(180deg,#fff,var(--steel-50)); }
.article-body .article-figure.photo img { width:auto; max-width:100%; height:auto; max-height:460px; margin:0 auto; }
.article-body .article-figure.diagram img,.article-body .article-figure.training img { width:100%; height:auto; border:1px solid var(--steel-100); border-radius:8px; }
.article-body .article-figure a.zoom { display:block; cursor:zoom-in; text-decoration:none; }
.article-body figcaption { font-size:14px; line-height:1.5; color:var(--steel-500); margin-top:12px; }
.article-body .diagram-intro { font-weight:600; margin-top:30px; }
.article-body .visual-text { font-size:15px; line-height:1.55; color:var(--steel-600); border:1px solid var(--steel-100); border-radius:6px; padding:10px 16px; margin:-14px 0 28px; }
.article-body .visual-text summary { cursor:pointer; color:var(--accent); font-weight:600; }
.article-body .visual-text ul { margin:10px 0 4px; }
.article-body .practical { border-left:3px solid #e07b16; padding-left:22px; }
.article-body .table-wrap { overflow-x:auto; margin:20px 0 24px; border:1px solid var(--steel-100); border-radius:8px; }
.article-body table { width:100%; border-collapse:collapse; font-size:15px; line-height:1.5; }
.article-body th { background:var(--steel-50); text-align:left; font-weight:600; }
.article-body th,.article-body td { vertical-align:top; padding:12px 14px; border-bottom:1px solid var(--steel-100); }
.article-body tbody tr:last-child td { border-bottom:0; }
.article-body code { font-family:"IBM Plex Mono", monospace; font-size:.9em; background:var(--steel-50); padding:2px 5px; border-radius:3px; }
.article-body .toc { font-size:15px; border:1px solid var(--steel-100); border-radius:8px; padding:16px 22px 8px; margin:26px 0 10px; background:var(--paper-2); }
.article-body .toc ol { columns:2; column-gap:30px; margin:8px 0; }
.article-body .toc li { break-inside:avoid; }
.article-body .toc a { text-decoration:none; color:var(--steel-700); }
.article-body .toc a:hover { color:var(--accent); }
.article-body #questions { margin-top:10px; }
.article-body #questions h3 { padding-top:16px; border-top:1px solid var(--steel-100); }
.article-body .cta { margin:40px 0 30px; padding:28px 30px; background:var(--ink); color:#fff; border-radius:8px; }
.article-body .cta h2 { margin:0 0 10px; color:#fff; font-size:24px; }
.article-body .cta p { color:rgba(255,255,255,.75); }
.article-body .cta p:last-child { margin:0; display:flex; flex-wrap:wrap; gap:12px 22px; align-items:center; }
.article-body .cta a { color:#fff; }
.article-body .cta a.button { display:inline-flex; align-items:center; min-height:44px; padding:0 18px; background:var(--accent); border-radius:2px; font-weight:600; text-decoration:none; }
.article-body .cta a.button:hover { background:var(--accent-deep); }
.article-body .cta p:last-child { font-size:0; }
.article-body .cta p:last-child a { font-size:16px; }
.article-body .related h2 { font-size:22px; margin-top:10px; }
.article-body .related-list { list-style:none; padding:0; display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.article-body .related-list li { margin:0; }
.article-body .related-list a { display:block; height:100%; padding:16px 18px; background:var(--steel-50); border:1px solid var(--steel-100); border-radius:6px; text-decoration:none; color:var(--ink); font-weight:600; line-height:1.4; font-size:16px; }
.article-body .related-list a:hover { border-color:var(--accent); color:var(--accent); }

.article-aside { position:sticky; top:104px; }
.article-aside-inner { display:grid; gap:16px; max-height:calc(100vh - 124px); overflow:auto; padding-bottom:4px; }
.toc-aside { background:#fff; border:1px solid var(--steel-100); border-radius:8px; padding:18px 18px 10px; font-size:14px; }
.toc-aside p { font-family:"IBM Plex Mono", monospace; font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--steel-400); margin-bottom:6px; }
.toc-aside strong { font-weight:500; }
.toc-aside ol { list-style:none; padding:0; margin:0; counter-reset:toc; }
.toc-aside li { counter-increment:toc; }
.toc-aside a { display:grid; grid-template-columns:24px 1fr; gap:4px; padding:7px 8px; margin:0 -8px; border-radius:4px; color:var(--steel-600); line-height:1.35; }
.toc-aside a::before { content:counter(toc,decimal-leading-zero); font-family:"IBM Plex Mono", monospace; font-size:11px; color:var(--steel-300); padding-top:2px; }
.toc-aside a:hover { color:var(--accent); background:var(--steel-50); }
.toc-aside a.active { color:var(--accent); background:#eef3fa; font-weight:600; }
.toc-aside a.active::before { color:var(--accent); }
.aside-cta { background:var(--ink); color:#fff; border-radius:8px; padding:20px; display:grid; gap:10px; }
.aside-cta b { font-size:17px; line-height:1.3; }
.aside-cta p { font-size:14px; color:rgba(255,255,255,.7); line-height:1.5; }
.aside-cta .aside-catalog { font-size:14px; color:rgba(255,255,255,.8); font-weight:500; }
.aside-cta .aside-catalog:hover { color:#fff; text-decoration:underline; }

.article-more { padding:30px 0 80px; }
.article-more-head { display:flex; justify-content:space-between; align-items:baseline; gap:20px; margin-bottom:20px; }
.article-more-head h2 { font-size:clamp(24px,2.6vw,32px); font-weight:600; }
.article-more-head a { color:var(--accent); font-weight:600; white-space:nowrap; }
.article-more .topic-chips { margin:34px 0 0; }

/* Lightbox */
.lightbox { position:fixed; inset:0; z-index:200; background:rgba(14,17,22,.92); display:grid; place-items:center; padding:24px; cursor:zoom-out; }
.lightbox img { max-width:min(1600px,100%); max-height:100%; width:auto; height:auto; background:#fff; border-radius:6px; box-shadow:0 30px 80px rgba(0,0,0,.4); }
.lightbox button { position:absolute; top:16px; right:16px; width:44px; height:44px; border:0; border-radius:50%; background:#fff; font-size:22px; line-height:1; }

@media (max-width:1180px) {
  .article-layout { grid-template-columns:minmax(0,1fr); }
  .article-aside { display:none; }
  .article-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (min-width:1181px) {
  .article-body .toc { display:none; }
}
@media (max-width:760px) {
  .articles-hero { padding:30px 0; }
  .topic-block-head { grid-template-columns:1fr; }
  .topic-block-links { flex-wrap:wrap; }
  .article-grid,.article-list { grid-template-columns:1fr; }
  .article-shell { padding-left:0; padding-right:0; }
  .article-shell > .crumbs { padding:0 16px; }
  .article-body { border-radius:0; border-left:0; border-right:0; padding:24px 16px 30px; font-size:17px; }
  .article-body .lead { font-size:18px; }
  .article-body .toc ol { columns:1; }
  .article-body .answer { padding:18px; }
  .article-body .related-list { grid-template-columns:1fr; }
  .article-body .cta { padding:22px 18px; }
  .article-body th,.article-body td { min-width:130px; }
  .article-more-head { flex-direction:column; }
  .topic-chips { flex-wrap:nowrap; overflow-x:auto; margin-left:calc(var(--pad) * -1); margin-right:calc(var(--pad) * -1); padding:0 var(--pad) 4px; scrollbar-width:none; }
  .topic-chips::-webkit-scrollbar { display:none; }
  .topic-chips a { flex:none; }
}
@media print {
  .site-header,.footer,.article-aside,.article-more,.skip-link { display:none !important; }
  .article-layout { display:block; }
  .article-body { border:0; padding:0; }
}
