/**
 * v2 — Knowledge article detail page: layout, sticky TOC, prev/next.
 *
 * Загружается ТОЛЬКО на /knowledge/[slug] страницах (через _detail.php).
 * Не растим home.css из-за FTP limit ~80KB partial-upload bug.
 *
 * @since 2026-05-16
 */

/* ===== Layout grid (desktop) ===== */
@media (min-width: 1024px) {
  .xh-kb-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 56px;
    align-items: start;
  }
  .xh-kb-detail-layout .xh-kb-sidebar { order: 2; }
  .xh-kb-detail-layout .xh-kb-article { order: 1; min-width: 0; }
  .xh-kb-toc-mobile { display: none !important; }
}

/* ===== Mobile: hide sticky sidebar (TOC available via collapsible details) ===== */
@media (max-width: 1023px) {
  .xh-kb-sidebar { display: none; }
}

/* ===== Sticky TOC (desktop) ===== */
.xh-kb-toc-sticky {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 18px 18px 14px;
  background: rgba(12, 19, 34, .5);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 12px;
}
.xh-kb-toc-sticky__title {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #FFCC00;
}
.xh-kb-toc-sticky ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: kb-toc-counter;
}
.xh-kb-toc-sticky li {
  margin: 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.45;
}
.xh-kb-toc-sticky li[data-level="3"] { padding-left: 14px; }
.xh-kb-toc-sticky a {
  display: block;
  padding: 6px 10px;
  color: var(--xh-text-secondary, #a4b3c8);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.xh-kb-toc-sticky a:hover {
  color: var(--xh-text, #e8ecf2);
  background: rgba(255, 255, 255, .03);
}
.xh-kb-toc-sticky a.is-active {
  color: #FFCC00;
  border-left-color: #FFCC00;
  background: rgba(255, 204, 0, .06);
  font-weight: 600;
}
.xh-kb-toc-sticky a:focus-visible {
  outline: 2px solid #FFCC00;
  outline-offset: 2px;
}

/* Hide inline TOC (.xh-toc generated by markdown.php) on detail page when sidebar is active */
@media (min-width: 1024px) {
  .xh-kb-article > .xh-toc { display: none; }
}

/* ===== Mobile TOC (collapsible details) ===== */
.xh-kb-toc-mobile {
  margin: 0 0 24px;
  background: rgba(12, 19, 34, .6);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  overflow: hidden;
}
.xh-kb-toc-mobile > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--xh-text, #e8ecf2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.xh-kb-toc-mobile > summary::-webkit-details-marker { display: none; }
.xh-kb-toc-mobile > summary::after {
  content: '+';
  font-size: 18px;
  color: #FFCC00;
  line-height: 1;
  transition: transform .2s ease;
}
.xh-kb-toc-mobile[open] > summary::after { content: '−'; }
.xh-kb-toc-mobile ol {
  list-style: none;
  margin: 0;
  padding: 4px 16px 14px;
}
.xh-kb-toc-mobile li { font-size: 13px; line-height: 1.5; }
.xh-kb-toc-mobile li[data-level="3"] { padding-left: 14px; }
.xh-kb-toc-mobile a {
  display: block;
  padding: 5px 0;
  color: var(--xh-text-secondary, #a4b3c8);
  text-decoration: none;
}
.xh-kb-toc-mobile a:hover { color: #FFCC00; }

/* ===== Prev/Next navigation ===== */
.xh-kb-prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 40px 0 24px;
}
.xh-kb-prevnext__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
  background: rgba(12, 19, 34, .5);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  text-decoration: none;
  color: var(--xh-text, #e8ecf2);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.xh-kb-prevnext__item:hover {
  border-color: rgba(255, 204, 0, .4);
  background: rgba(12, 19, 34, .8);
  transform: translateY(-1px);
}
.xh-kb-prevnext__item:focus-visible {
  outline: 2px solid #FFCC00;
  outline-offset: 2px;
}
.xh-kb-prevnext__item--next { text-align: right; align-items: flex-end; }
.xh-kb-prevnext__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #FFCC00;
}
.xh-kb-prevnext__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--xh-text, #e8ecf2);
}
.xh-kb-prevnext__item--empty {
  visibility: hidden;
}

@media (max-width: 720px) {
  .xh-kb-prevnext {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .xh-kb-prevnext__item--next { text-align: left; align-items: flex-start; }
  .xh-kb-prevnext__item--empty { display: none; }
}

/* ===== Anchor scroll offset (for sticky header) ===== */
.xh-kb-article h2,
.xh-kb-article h3 {
  scroll-margin-top: 90px;
}

/* ===== Quick tips block (Sprint 1 audit — ref 5) ===== */
.xh-kb-quicktips {
  margin: 0 0 32px;
  padding: 22px 24px 20px;
  background: linear-gradient(135deg, rgba(255, 204, 0, .1), rgba(232, 132, 30, .06));
  border: 1px solid rgba(255, 204, 0, .25);
  border-radius: 14px;
}
.xh-kb-quicktips__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
.xh-kb-quicktips__icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255, 204, 0, .2);
  display: flex; align-items: center; justify-content: center;
  color: #FFCC00;
  flex-shrink: 0;
}
.xh-kb-quicktips__icon svg { width: 18px; height: 18px; }
.xh-kb-quicktips__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #FFCC00;
}
.xh-kb-quicktips__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.xh-kb-quicktips__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(12, 19, 34, .55);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--xh-text, #e8ecf2);
}
.xh-kb-quicktips__check {
  width: 18px; height: 18px;
  flex-shrink: 0;
  color: #78ffb4;
}
.xh-kb-quicktips__check svg { width: 18px; height: 18px; }

/* ============================================
   Article H2 accent — visual rhythm для длинных гайдов.
   Применяется к H2 внутри .xh-kb-article (prose-зона).
   ============================================ */
.xh-kb-article.xh-prose h2 {
  position: relative;
  padding-top: 28px;
  margin-top: 36px;
}
.xh-kb-article.xh-prose h2::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 36px; height: 3px;
  background: var(--xh-orange, #e88420);
  border-radius: 2px;
}
.xh-kb-article.xh-prose h2:first-child {
  margin-top: 0;
}

/* H3 — более компактный акцент */
.xh-kb-article.xh-prose h3 {
  position: relative;
  margin-top: 24px;
  padding-left: 14px;
}
.xh-kb-article.xh-prose h3::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--xh-border-light, #1e2d4a);
  border-radius: 2px;
}

/* Article таблицы — GFM tables wrapped в .xh-prose-table (см. xh_md_parse).
   Wrapper нужен чтобы horizontal scroll работал на узких viewport'ах без ломки grid layout. */
.xg-article.xh-prose .xh-prose-table {
  margin: 18px 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--xh-border, #162035);
  border-radius: var(--xh-radius, 6px);
  background: rgba(8, 13, 24, .35);
}
.xg-article.xh-prose .xh-prose-table table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 14px;
  min-width: 100%;
}
.xg-article.xh-prose .xh-prose-table th,
.xg-article.xh-prose .xh-prose-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--xh-border, #162035);
  text-align: left;
  vertical-align: top;
  white-space: normal;
  word-break: normal;
}
.xg-article.xh-prose .xh-prose-table tr:last-child td { border-bottom: 0; }
.xg-article.xh-prose .xh-prose-table th {
  font-family: var(--xh-font-heading, 'Rajdhani'), sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--xh-text, #e8ecf2);
  background: rgba(12, 19, 34, .55);
  white-space: nowrap;
}
.xg-article.xh-prose .xh-prose-table td {
  color: var(--xh-text-secondary, #a4b3c8);
}

/* Article code blocks — better contrast + mobile horizontal scroll для длинных формул */
.xg-article.xh-prose pre {
  background: #06090f;
  border: 1px solid var(--xh-border, #162035);
  border-radius: var(--xh-radius, 6px);
  padding: 14px 18px;
  margin: 16px 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 13px;
  line-height: 1.55;
}
.xg-article.xh-prose pre code {
  white-space: pre;
  color: #d8e2f5;
  display: block;
  min-width: 0;
}
.xg-article.xh-prose code {
  font-family: 'Fira Code', 'Cascadia Code', Consolas, Monaco, monospace;
  font-size: 0.92em;
  color: #ffcc66;
  word-break: break-word;
}

/* Blockquote — для caveats / notes */
.xg-article.xh-prose blockquote {
  margin: 18px 0;
  padding: 14px 18px 14px 22px;
  border-left: 3px solid var(--xh-orange, #e88420);
  background: rgba(232, 132, 30, .08);
  border-radius: 0 var(--xh-radius, 6px) var(--xh-radius, 6px) 0;
  color: var(--xh-text-secondary, #a4b3c8);
  font-size: 14.5px;
  line-height: 1.6;
}
.xg-article.xh-prose blockquote p:last-child { margin-bottom: 0; }

/* Series navigation — рендерится через [[series-nav]] token, ставится в начале статьи если _data.series заполнен */
.xg-article.xh-prose .xh-series-nav {
  margin: 0 0 28px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(232, 132, 30, .08), rgba(42, 125, 225, .06));
  border: 1px solid var(--xh-border-light, #1e2d4a);
  border-left: 3px solid var(--xh-orange, #e88420);
  border-radius: var(--xh-radius, 6px);
}
.xg-article.xh-prose .xh-series-nav__label {
  font-family: var(--xh-font-heading, 'Rajdhani'), sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--xh-text, #e8ecf2);
  margin-bottom: 12px;
}
.xg-article.xh-prose .xh-series-nav__links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.xg-article.xh-prose .xh-series-nav__prev,
.xg-article.xh-prose .xh-series-nav__next {
  display: block;
  padding: 10px 14px;
  background: rgba(8, 13, 24, .4);
  border: 1px solid var(--xh-border, #162035);
  border-radius: var(--xh-radius, 6px);
  text-decoration: none;
  color: var(--xh-text-secondary, #a4b3c8);
  font-size: 12.5px;
  line-height: 1.4;
  transition: all var(--xh-transition, .2s ease);
}
.xg-article.xh-prose .xh-series-nav__next { text-align: right; }
.xg-article.xh-prose .xh-series-nav__prev:hover,
.xg-article.xh-prose .xh-series-nav__next:hover {
  background: rgba(232, 132, 30, .1);
  border-color: var(--xh-orange, #e88420);
  color: var(--xh-text, #e8ecf2);
}
.xg-article.xh-prose .xh-series-nav__prev span,
.xg-article.xh-prose .xh-series-nav__next span {
  display: block;
  font-family: var(--xh-font-heading, 'Rajdhani'), sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--xh-text, #e8ecf2);
  margin-top: 2px;
}
.xg-article.xh-prose .xh-series-nav__placeholder { display: none; }
@media (max-width: 600px) {
  .xg-article.xh-prose .xh-series-nav__links { grid-template-columns: 1fr; }
  .xg-article.xh-prose .xh-series-nav__next { text-align: left; }
}

/* Mobile: table font slightly smaller, padding tighter — но scroll остаётся главным механизмом */
@media (max-width: 600px) {
  .xg-article.xh-prose .xh-prose-table table { font-size: 13px; }
  .xg-article.xh-prose .xh-prose-table th,
  .xg-article.xh-prose .xh-prose-table td { padding: 8px 10px; }
  .xg-article.xh-prose pre { font-size: 12px; padding: 12px 14px; }
}

/* ============================================
   Article view rebuild (xg-* prefix from scaffold)
   @since 2026-05-17 (Phase M scaffold rebuild)
   ============================================ */

/* HERO */
.xg-hero {
  position: relative;
  z-index: 1;
  padding: 40px 0 56px;
  overflow: hidden;
}
.xg-hero-bg { position: absolute; inset: 0; z-index: 0; }
.xg-hero-bg picture, .xg-hero-bg img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .4;
}
.xg-hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,10,20,.6) 0%, rgba(6,10,20,.88) 55%, var(--xh-bg-deep, #060a14) 100%);
}
.xg-hero-inner {
  position: relative; z-index: 1;
  max-width: var(--xh-max-w, 1200px);
  margin: 0 auto;
  padding: 0 var(--xh-container-pad, 32px);
}
.xg-hero-inner .xh-breadcrumbs { margin-bottom: 14px; }
.xg-hero-title {
  font-family: var(--xh-font-display, 'Archivo Black'), sans-serif;
  font-size: clamp(28px, 4.5vw, 48px);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  line-height: 1.05;
  margin: 0 0 14px;
}
.xg-hero-accent { color: var(--xh-orange, #e88420); }
.xg-hero-desc {
  font-size: 15px;
  color: var(--xh-text-secondary, #a4b3c8);
  max-width: 640px;
  margin: 0 0 20px;
  line-height: 1.6;
}
.xg-hero-meta { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.xg-meta-item {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--xh-text-muted, #8a99b0);
  font-family: var(--xh-font-heading, 'Rajdhani'), sans-serif;
  font-weight: 600;
}
.xg-meta-item svg { width: 16px; height: 16px; flex-shrink: 0; }

/* TIPS */
.xg-tips {
  position: relative; z-index: 1;
  max-width: var(--xh-max-w, 1200px);
  margin: -16px auto 0;
  padding: 0 var(--xh-container-pad, 32px);
}
.xg-tips-inner {
  background: var(--xh-bg-card, #0c1322);
  border: 1px solid var(--xh-border-light, #1e2d4a);
  border-radius: var(--xh-radius-lg, 10px);
  padding: 24px 28px;
}
.xg-tips-label {
  font-family: var(--xh-font-heading, 'Rajdhani'), sans-serif;
  font-size: 14px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: #fff; margin-bottom: 18px;
}
.xg-tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
}
.xg-tip { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.xg-tip-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(232,132,30,.08);
  border: 1px solid rgba(232,132,30,.25);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.xg-tip-icon svg { width: 22px; height: 22px; color: var(--xh-orange, #e88420); }
.xg-tip span { font-size: 13px; color: var(--xh-text-secondary, #a4b3c8); line-height: 1.4; }

/* LAYOUT */
.xg-layout { position: relative; z-index: 1; padding: 40px 0 56px; }
.xg-layout-inner {
  max-width: var(--xh-max-w, 1200px);
  margin: 0 auto;
  padding: 0 var(--xh-container-pad, 32px);
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}
.xg-article {
  min-width: 0;
  background: var(--xh-bg-card, #0c1322);
  border: 1px solid var(--xh-border, #162035);
  border-radius: var(--xh-radius-lg, 10px);
  padding: 36px 40px;
}
.xg-article.xh-prose { color: var(--xh-text-secondary, #a4b3c8); }

/* SIDEBAR */
.xg-sidebar {
  position: sticky;
  top: calc(var(--xh-header-h, 58px) + 16px);
  display: flex; flex-direction: column; gap: 16px;
}
.xg-sidebar-card {
  background: var(--xh-bg-card, #0c1322);
  border: 1px solid var(--xh-border, #162035);
  border-radius: var(--xh-radius-lg, 10px);
  padding: 20px;
}
.xg-sidebar-title {
  font-family: var(--xh-font-heading, 'Rajdhani'), sans-serif;
  font-size: 14px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: #fff; margin-bottom: 14px;
}
.xg-sidebar-label {
  font-family: var(--xh-font-heading, 'Rajdhani'), sans-serif;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--xh-text-muted, #8a99b0); margin-bottom: 10px;
}

/* TOC sidebar */
.xg-toc { display: flex; flex-direction: column; gap: 2px; }
.xg-toc-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--xh-radius, 6px);
  font-family: var(--xh-font-heading, 'Rajdhani'), sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--xh-text-secondary, #a4b3c8); letter-spacing: .2px;
  transition: all var(--xh-transition, .3s ease);
  text-decoration: none;
}
.xg-toc-link svg { width: 14px; height: 14px; flex-shrink: 0; opacity: .5; }
.xg-toc-link:hover { color: var(--xh-text, #e8ecf2); background: rgba(255,255,255,.04); }
.xg-toc-link.is-active { color: var(--xh-orange, #e88420); background: rgba(232,132,30,.08); }
.xg-toc-link.is-active svg { opacity: 1; color: var(--xh-orange, #e88420); }

/* Difficulty bar */
.xg-difficulty { display: flex; flex-direction: column; gap: 6px; }
.xg-difficulty-text {
  font-family: var(--xh-font-heading, 'Rajdhani'), sans-serif;
  font-size: 15px; font-weight: 700;
  color: var(--xh-green, #20a868);
}
.xg-difficulty-bar {
  width: 100%; height: 6px;
  background: var(--xh-border, #162035);
  border-radius: 3px; overflow: hidden;
}
.xg-difficulty-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--xh-green, #20a868), var(--xh-orange, #e88420));
}
.xg-reading-time {
  font-family: var(--xh-font-heading, 'Rajdhani'), sans-serif;
  font-size: 22px; font-weight: 700;
  color: var(--xh-text, #e8ecf2);
}

/* Related list */
.xg-related-list { display: flex; flex-direction: column; gap: 2px; }
.xg-related-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px; border-radius: var(--xh-radius, 6px);
  transition: background var(--xh-transition, .3s ease);
  text-decoration: none; color: inherit;
}
.xg-related-item:hover { background: rgba(255,255,255,.03); }
.xg-related-icon {
  width: 34px; height: 34px; border-radius: var(--xh-radius, 6px);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.xg-related-icon svg { width: 16px; height: 16px; }
.xg-related-icon--blue   { background: rgba(42,125,225,.10); border: 1px solid rgba(42,125,225,.25); color: var(--xh-blue-light, #4a9df5); }
.xg-related-icon--green  { background: rgba(32,168,104,.10); border: 1px solid rgba(32,168,104,.25); color: var(--xh-green, #20a868); }
.xg-related-icon--orange { background: rgba(232,132,30,.10); border: 1px solid rgba(232,132,30,.25); color: var(--xh-orange, #e88420); }
.xg-related-icon--teal   { background: rgba(32,176,184,.10); border: 1px solid rgba(32,176,184,.25); color: var(--xh-teal, #20b0b8); }
.xg-related-icon--purple { background: rgba(106,64,184,.10); border: 1px solid rgba(106,64,184,.25); color: var(--xh-purple, #6a40b8); }
.xg-related-body { min-width: 0; }
.xg-related-name {
  font-family: var(--xh-font-heading, 'Rajdhani'), sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--xh-text, #e8ecf2); line-height: 1.3;
}
.xg-related-type { font-size: 11px; color: var(--xh-text-muted, #8a99b0); }

/* Help card */
.xg-help-title {
  font-family: var(--xh-font-heading, 'Rajdhani'), sans-serif;
  font-size: 15px; font-weight: 700;
  color: #fff; margin-bottom: 6px;
}
.xg-help-desc {
  font-size: 13px; color: var(--xh-text-muted, #8a99b0);
  margin: 0 0 14px; line-height: 1.5;
}
.xg-help-actions { display: flex; gap: 8px; }

/* CTA */
.xg-cta { position: relative; z-index: 1; padding: 0 0 56px; }
.xg-cta-wrap {
  max-width: var(--xh-max-w, 1200px);
  margin: 0 auto;
  padding: 0 var(--xh-container-pad, 32px);
}
.xg-cta-inner {
  padding: 48px;
  border-radius: var(--xh-radius-lg, 10px);
  border: 1px solid var(--xh-border-light, #1e2d4a);
  position: relative; overflow: hidden; text-align: center;
}
.xg-cta-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.xg-cta-bg picture, .xg-cta-bg img { width: 100%; height: 100%; object-fit: cover; }
.xg-cta-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(8,12,22,.92) 0%, rgba(8,12,22,.75) 50%, rgba(8,12,22,.6) 100%);
}
.xg-cta-content { position: relative; z-index: 1; }
.xg-cta-content h2 {
  font-family: var(--xh-font-display, 'Archivo Black'), sans-serif;
  font-size: clamp(22px, 3vw, 30px);
  text-transform: uppercase; letter-spacing: 2px;
  color: #fff; margin: 0 0 12px;
}
.xg-cta-content p {
  font-size: 15px; color: var(--xh-text-secondary, #a4b3c8);
  margin: 0 auto 24px; max-width: 460px;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .xg-layout-inner { grid-template-columns: 1fr 260px; gap: 24px; }
  .xg-article { padding: 28px 32px; }
}
@media (max-width: 860px) {
  .xg-layout-inner { grid-template-columns: 1fr; }
  .xg-sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; order: 2; }
  .xg-tips { margin-top: -12px; }
}
@media (max-width: 600px) {
  .xg-hero { padding: 32px 0 40px; }
  .xg-article { padding: 24px 22px; }
  .xg-tips-inner { padding: 20px 18px; }
  .xg-sidebar { grid-template-columns: 1fr; }
  .xg-cta-inner { padding: 32px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .xg-toc-link, .xg-related-item { transition: none; }
}
