/* article.css - Article page styles for /spravka/<slug>/. Extends site.css.
   Narrow readable column (~700px), sticky sidebar TOC on desktop, generous
   air around headings, callouts and tables. */
@import url('./site.css?v=9');

/* ========== HERO ========================================================== */
.ap-hero {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-1);
  padding: 32px 0 40px;
}
.ap-hero__crumbs { font-size: 13px; color: var(--fg-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0 0 20px; }
.ap-hero__crumbs a { color: var(--fg-3); text-decoration: none; }
.ap-hero__crumbs a:hover { color: var(--fg-1); }
.ap-hero__crumbs .sep { color: var(--c-steel-300); }
.ap-hero__crumbs .cur { color: var(--fg-1); }

.ap-hero__badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  background: var(--c-accent-soft);
  color: var(--c-accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--r-2);
  margin-bottom: 18px;
}

.ap-hero__h1 {
  font-size: 44px;
  line-height: 1.12;
  letter-spacing: -0.015em;
  font-weight: 600;
  margin: 0 0 18px;
  max-width: 22ch;
  color: var(--fg-1);
}

.ap-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-3);
  margin-bottom: 22px;
}
.ap-hero__meta-item { display: inline-flex; align-items: center; gap: 6px; }
.ap-hero__meta-item svg { color: var(--c-accent); }
.ap-hero__meta-sep { color: var(--c-steel-300); }

.ap-hero__lede {
  font-size: 19px;
  line-height: 1.55;
  color: var(--fg-2);
  margin: 0;
  max-width: 60ch;
  font-weight: 400;
}

/* ----- Split hero: текст слева, фото статьи справа (16:9) ----- */
.ap-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
  gap: 48px;
  align-items: center;
}
.ap-hero__text { min-width: 0; }

.ap-hero__media {
  position: relative;
  align-self: stretch;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-4);
  overflow: hidden;
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-3);
  background: var(--c-steel-150);
  margin: 0;
}
.ap-hero__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* тонкая внутренняя кромка (как у премиум-плиток каталога) */
.ap-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.10);
  pointer-events: none;
}
@media (max-width: 768px) {
  .ap-hero__grid { grid-template-columns: 1fr; gap: 24px; }
  .ap-hero__media { width: 100%; }
}

/* ========== MAIN GRID (TOC + ARTICLE) ===================================== */
.ap-main { padding: 48px 0 56px; }
.ap-main__grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 700px);
  gap: 64px;
  justify-content: center;
  align-items: start;
}

/* ========== TOC =========================================================== */
.ap-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  font-size: 13px;
}
.ap-toc__h {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-3);
  font-weight: 600;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-1);
}
.ap-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ap-toc__item {
  position: relative;
}
.ap-toc__item a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  padding: 8px 10px 8px 12px;
  text-decoration: none;
  color: var(--fg-2);
  line-height: 1.4;
  border-left: 2px solid transparent;
  border-radius: 0 var(--r-2) var(--r-2) 0;
  transition: all var(--t-fast) var(--ease-std);
}
.ap-toc__num { color: var(--c-steel-400); font-size: 11px; padding-top: 1px; }
.ap-toc__lbl { font-size: 13px; }
.ap-toc__item a:hover { color: var(--fg-1); background: var(--bg-soft); }
.ap-toc__item.is-active a {
  color: var(--c-accent);
  border-left-color: var(--c-accent);
  background: var(--c-accent-soft);
  font-weight: 500;
}
.ap-toc__item.is-active .ap-toc__num { color: var(--c-accent); }

/* ========== ARTICLE BODY ================================================== */
.ap-article { min-width: 0; }

/* prose typography */
.ap-rich { font-size: 17px; line-height: 1.7; color: var(--fg-1); }
.ap-rich > p { margin: 0 0 22px; }
.ap-rich > p a {
  color: var(--c-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(43,92,138,0.35);
}
.ap-rich > p a:hover { border-bottom-color: var(--c-accent); }
.ap-rich strong { font-weight: 600; }

/* H2 with hash anchor */
.ap-h2 {
  position: relative;
  font-size: 28px;
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  margin: 48px 0 16px;
  scroll-margin-top: 96px;
}
.ap-h2:first-child { margin-top: 0; }
.ap-h2__hash {
  position: absolute;
  left: -28px;
  top: 0;
  color: var(--c-accent);
  font-family: var(--font-mono);
  font-weight: 500;
  opacity: 0.45;
}

/* H3 */
.ap-h3 {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--fg-1);
  margin: 32px 0 12px;
}

/* lists */
.ap-ul, .ap-ol {
  margin: 0 0 22px;
  padding-left: 22px;
}
.ap-ul li, .ap-ol li {
  margin-bottom: 8px;
  padding-left: 6px;
}
.ap-ul li::marker { color: var(--c-accent); }
.ap-ol li::marker { color: var(--c-accent); font-family: var(--font-mono); font-weight: 500; }
.ap-ul li a, .ap-ol li a {
  color: var(--c-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(43,92,138,0.35);
}

/* ========== TABLE ========================================================= */
.ap-table { margin: 28px 0 28px; }
.ap-table__caption {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--fg-3);
  margin-bottom: 10px;
}
.ap-table__wrap {
  border: 1px solid var(--border-1);
  border-radius: var(--r-3);
  overflow: hidden;
  background: #fff;
}
.ap-table__t {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.ap-table__t thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-3);
  padding: 12px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-1);
}
.ap-table__t tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-1);
  vertical-align: top;
  color: var(--fg-1);
  line-height: 1.5;
}
.ap-table__t tbody tr:last-child td { border-bottom: 0; }
.ap-table__t td.head { font-weight: 600; }
.ap-table__t td.num, .ap-table__t th.num { font-family: var(--font-mono); white-space: nowrap; }
.ap-table__note {
  font-size: 13px;
  color: var(--fg-3);
  line-height: 1.5;
  margin: 10px 0 0;
}

/* ========== CALLOUTS ====================================================== */
.ap-callout {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 16px;
  padding: 18px 20px 20px;
  margin: 28px 0;
  border-radius: var(--r-3);
  border: 1px solid var(--border-1);
  background: #fff;
  border-left-width: 3px;
  align-items: start;
}
.ap-callout__ic {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.ap-callout__ic svg { width: 18px; height: 18px; }
.ap-callout__tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.ap-callout__text { font-size: 15px; line-height: 1.6; color: var(--fg-1); }
.ap-callout__text a { color: var(--c-accent); text-decoration: none; border-bottom: 1px solid rgba(43,92,138,0.35); }

.ap-callout--important {
  border-left-color: var(--c-danger);
  background: var(--c-danger-soft);
}
.ap-callout--important .ap-callout__ic { background: #fff; color: var(--c-danger); }
.ap-callout--important .ap-callout__tag { color: var(--c-danger); }

.ap-callout--tip {
  border-left-color: var(--c-success);
  background: var(--c-success-soft);
}
.ap-callout--tip .ap-callout__ic { background: #fff; color: var(--c-success); }
.ap-callout--tip .ap-callout__tag { color: var(--c-success); }

.ap-callout--note {
  border-left-color: var(--c-accent);
  background: var(--c-accent-soft);
}
.ap-callout--note .ap-callout__ic { background: #fff; color: var(--c-accent); }
.ap-callout--note .ap-callout__tag { color: var(--c-accent); }

/* ========== FIGURE / IMAGE ================================================ */
.ap-figure { margin: 28px 0; }
.ap-figure__frame {
  background: var(--bg-soft);
  border: 1px solid var(--border-1);
  border-radius: var(--r-3);
  overflow: hidden;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ap-figure__frame img { display: block; max-width: 100%; height: auto; }
.ap-figure__svg svg { display: block; width: 100%; height: auto; max-width: 600px; }
.ap-figure__cap {
  font-size: 13px;
  color: var(--fg-3);
  line-height: 1.5;
  margin-top: 10px;
  padding-left: 4px;
  border-left: 2px solid var(--c-steel-200);
  padding-left: 12px;
}

/* ========== QUOTE ========================================================= */
.ap-quote {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 16px;
  margin: 32px 0;
  padding: 20px 22px 20px 18px;
  background: var(--c-graphite);
  color: #fff;
  border-radius: var(--r-3);
  border-left: 3px solid var(--c-accent);
}
.ap-quote__mark { color: var(--c-accent); padding-top: 2px; }
.ap-quote__body p {
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 8px;
  color: #fff;
}
.ap-quote__cite {
  font-style: normal;
  font-size: 13px;
  color: var(--c-steel-300);
  letter-spacing: 0.02em;
}

/* ========== INLINE CTA (within body) ====================================== */
.ap-cta {
  margin: 32px 0;
  padding: 24px 26px;
  background: var(--c-graphite);
  color: #fff;
  border-radius: var(--r-3);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
.ap-cta__ttl { font-size: 18px; font-weight: 600; margin-bottom: 6px; color: #fff; }
.ap-cta__sub { font-size: 14px; color: var(--c-steel-300); line-height: 1.5; margin: 0; max-width: 50ch; }
.ap-cta__sub a { color: #fff; border-bottom: 1px solid rgba(255,255,255,0.3); text-decoration: none; }
.ap-cta__btns { display: flex; flex-direction: column; gap: 8px; }
.ap-cta__btns .btn--secondary {
  background: transparent;
  color: #fff;
  border-color: #3F4B57;
}
.ap-cta__btns .btn--secondary:hover { background: rgba(255,255,255,0.05); border-color: var(--c-steel-300); }

/* ========== TLDR ("Коротко") ============================================== */
.ap-tldr {
  margin: 56px 0;
  padding: 28px 30px;
  background: #fff;
  border: 1px solid var(--border-1);
  border-radius: var(--r-3);
  border-left: 3px solid var(--c-accent);
}
.ap-tldr__head { margin-bottom: 18px; }
.ap-tldr__tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 6px;
}
.ap-tldr__h { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.ap-tldr__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.ap-tldr__item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: baseline;
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg-1);
}
.ap-tldr__num { color: var(--c-accent); font-size: 13px; font-weight: 500; }
.ap-tldr__txt a { color: var(--c-accent); text-decoration: none; border-bottom: 1px solid rgba(43,92,138,0.35); }

/* ========== FAQ =========================================================== */
.ap-faq { margin: 56px 0; }
.ap-faq__head { margin-bottom: 18px; }
.ap-faq__tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 6px;
}
.ap-faq__h { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }

/* ========== RELATED ======================================================= */
.ap-related { margin: 56px 0; }
.ap-related__head { margin-bottom: 18px; }
.ap-related__tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 6px;
}
.ap-related__h { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.ap-related__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: #fff;
  border: 1px solid var(--border-1);
  border-radius: var(--r-3);
  overflow: hidden;
}
.ap-related__card {
  display: block;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-1);
  text-decoration: none;
  color: inherit;
  transition: background var(--t-fast) var(--ease-std);
}
.ap-related__card:last-child { border-bottom: 0; }
.ap-related__card:hover { background: var(--bg-soft); }
.ap-related__kind {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 6px;
}
.ap-related__ttl { font-size: 16px; font-weight: 600; color: var(--fg-1); margin-bottom: 4px; }
.ap-related__sub { font-size: 13px; color: var(--fg-3); line-height: 1.5; margin-bottom: 8px; }
.ap-related__arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-accent);
}
.ap-related__arrow svg { width: 12px; height: 12px; }

/* ========== AUTHOR ======================================================== */
.ap-author {
  margin: 56px 0 24px;
  padding: 24px 26px;
  background: var(--bg-soft);
  border: 1px solid var(--border-1);
  border-radius: var(--r-3);
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 20px;
  align-items: start;
}
.ap-author__avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--c-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ap-author__tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 4px;
}
.ap-author__name { font-size: 17px; font-weight: 600; color: var(--fg-1); margin-bottom: 2px; }
.ap-author__role { font-size: 13px; color: var(--fg-3); margin-bottom: 12px; }
.ap-author__bio { font-size: 14px; color: var(--fg-2); line-height: 1.55; margin: 0 0 12px; }
.ap-author__contact { font-size: 13px; color: var(--fg-3); line-height: 1.5; }
.ap-author__contact a { color: var(--c-accent); text-decoration: none; border-bottom: 1px solid rgba(43,92,138,0.35); }

/* ========== SHARE ========================================================= */
.ap-share {
  margin-top: 32px;
  padding: 16px 0 0;
  border-top: 1px solid var(--border-1);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
}
.ap-share__lbl { color: var(--fg-3); margin-right: 6px; }
.ap-share__btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border-1);
  border-radius: var(--r-2);
  color: var(--fg-1);
  text-decoration: none;
  transition: all var(--t-fast) var(--ease-std);
}
.ap-share__btn:hover { border-color: var(--c-accent); color: var(--c-accent); background: var(--c-accent-soft); }

/* ========== ACCORDION (FAQ) shared style ================================== */
.acc { border: 1px solid var(--border-1); border-radius: var(--r-3); background: #fff; overflow: hidden; }
.acc-item { border-bottom: 1px solid var(--border-1); }
.acc-item:last-child { border-bottom: 0; }
.acc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  color: var(--fg-1);
  list-style: none;
}
.acc-head::-webkit-details-marker { display: none; }
.acc-head .chev { color: var(--fg-3); transition: transform var(--t-fast) var(--ease-std); flex-shrink: 0; }
.acc-item[open] .acc-head .chev { transform: rotate(180deg); color: var(--c-accent); }
.acc-item[open] .acc-head { color: var(--c-accent); }
.acc-body {
  padding: 0 22px 18px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg-2);
}
.acc-body p:first-child { margin-top: 0; }
.acc-body a { color: var(--c-accent); text-decoration: none; border-bottom: 1px solid rgba(43,92,138,0.35); }

/* ========== RESPONSIVE ==================================================== */
@media (max-width: 1024px) {
  .ap-main__grid {
    grid-template-columns: minmax(0, 700px);
    justify-content: center;
    gap: 32px;
  }
  .ap-toc {
    position: static;
    background: #fff;
    border: 1px solid var(--border-1);
    border-radius: var(--r-3);
    padding: 16px 18px;
  }
  .ap-toc__h { margin-bottom: 10px; padding-bottom: 10px; }
}
@media (max-width: 720px) {
  .ap-hero { padding: 24px 0 28px; }
  .ap-hero__h1 { font-size: 30px; }
  .ap-hero__lede { font-size: 17px; }
  .ap-rich { font-size: 16px; }
  .ap-h2 { font-size: 24px; margin: 36px 0 12px; }
  .ap-h2__hash { display: none; }
  .ap-h3 { font-size: 18px; }
  .ap-cta { grid-template-columns: 1fr; }
  .ap-cta__btns { flex-direction: row; }
  .ap-author { grid-template-columns: 1fr; }
  .ap-author__avatar { width: 48px; height: 48px; font-size: 16px; }
  .ap-quote { padding: 18px; }
  .ap-tldr { padding: 22px 20px; }
  .ap-tldr__item { grid-template-columns: 28px 1fr; }
}
