@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800;900&display=swap');

/* ══════════════════════════════
   ТОКЕНЫ
══════════════════════════════ */
:root {
  --bg:        #f5f4fb;
  --surface:   #ffffff;
  --surface-2: #f0eefa;
  --ink:       #161525;
  --text:      #161525;
  --muted:     #6b6880;
  --muted-lt:  #a0a3bd;
  --accent:    #7c3aed;
  --accent-h:  #5b21b6;
  --accent-bg: rgba(124,58,237,0.07);
  --link:      #7c3aed;
  --grad-vivid: linear-gradient(135deg, #5b21b6 0%, #7c3aed 50%, #c026d3 100%);
  --grad-ink:   linear-gradient(160deg, #1e1b2e 0%, #130f20 100%);
  --sh:    0 1px 4px rgba(109,40,217,0.05), 0 4px 16px rgba(109,40,217,0.06);
  --sh-lg: 0 8px 40px rgba(109,40,217,0.14);
  --r:     14px;
  --r-lg:  20px;
  --border: #e4dffa;
  --font:  'Manrope', system-ui, sans-serif;
}

/* ══════════════════════════════
   HERO — на всю ширину
══════════════════════════════ */
.kmg-hero {
  position: relative;
  width: 100%;
  min-height: 520px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-end;
  padding-bottom: 56px;
}

.kmg-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(13,10,25,0.35) 0%,
    rgba(13,10,25,0.6) 50%,
    rgba(13,10,25,0.88) 100%
  );
  z-index: 0;
}

.kmg-hero__inner {
  position: relative;
  z-index: 1;
  color: #fff;
  max-width: 860px;
}

.kmg-hero--no-img {
  min-height: auto;
  background: var(--bg);
  padding: 40px 0 0;
}

.kmg-hero--no-img .kmg-hero__overlay { display: none; }

.kmg-hero__eyebrow {
  margin-bottom: 16px;
}

.kmg-hero__cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--grad-vivid);
  color: #fff;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-family: var(--font);
}

.kmg-hero__title {
  font-family: var(--font);
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: #fff;
  margin: 0 0 16px;
}

.kmg-hero__title--dark { color: var(--ink); }

.kmg-hero__excerpt {
  font-size: 17px;
  color: rgba(255,255,255,0.78);
  line-height: 1.55;
  margin: 0 0 28px;
  max-width: 640px;
  font-family: var(--font);
}

.kmg-hero__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  font-family: var(--font);
}

.kmg-hero__meta--dark { color: var(--muted); }

.kmg-hero__ava {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
}

.kmg-hero__author-info {
  display: flex;
  flex-direction: column;
}

.kmg-hero__author-name {
  font-weight: 700;
  color: #fff;
  font-size: 14px;
}

.kmg-hero__author-role {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
}

.kmg-hero__meta-sep {
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,0.2);
  display: inline-block;
}

.kmg-hero__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ══════════════════════════════
   LAYOUT — двухколонка
══════════════════════════════ */
.kmg-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  padding: 32px 0 72px;
  align-items: start;
}

.kmg-content { min-width: 0; }

.kmg-sidebar__sticky {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ══════════════════════════════
   ОБНУЛЕНИЕ ЗАДВОЕННЫХ КЛАССОВ
   Статья содержит wrap > art-body > article
   Снимаем лишние стили с вложенных обёрток
══════════════════════════════ */
.kmg-body .wrap {
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
}

.kmg-body .art-body {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.kmg-body article {
  display: block;
}

/* ══════════════════════════════
   ТЕЛО СТАТЬИ
══════════════════════════════ */
.kmg-body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  padding: 40px;
}

.kmg-body h2 {
  font-family: var(--font);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  letter-spacing: -0.022em;
  line-height: 1.25;
  margin: 36px 0 18px;
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 14px;
}

.kmg-body h2:first-child { margin-top: 0; }

.kmg-body h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text);
}

.kmg-body p {
  margin-bottom: 18px;
}

.kmg-body a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(124,58,237,0.3);
  font-weight: 500;
}

.kmg-body a:hover { color: var(--accent-h); }

.kmg-body ul {
  list-style: none;
  margin: 16px 0 24px;
  padding: 0;
}

.kmg-body ul li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  line-height: 1.6;
}

.kmg-body ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--grad-vivid);
}

.kmg-body ol {
  padding-left: 24px;
  margin: 16px 0 24px;
}

.kmg-body ol li {
  margin-bottom: 10px;
  line-height: 1.6;
}

/* Таблицы */
.kmg-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 32px;
  font-size: 15px;
  border-radius: var(--r);
  overflow: hidden;
}

.kmg-body th {
  background: var(--ink);
  color: #fff;
  text-align: left;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 13px;
}

.kmg-body td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  vertical-align: top;
}

.kmg-body tr:nth-child(even) td { background: var(--surface-2); }
.kmg-body tr:last-child td { border-bottom: none; }

/* Lead */
.kmg-body .lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--muted);
  border-left: 4px solid var(--accent);
  padding-left: 20px;
  margin-bottom: 32px;
}

.kmg-body .lead-in {
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 20px;
}

/* Tip */
.kmg-body .tip {
  background: var(--accent-bg);
  border-left: 4px solid var(--accent);
  padding: 16px 22px;
  margin: 24px 0;
  font-size: 15px;
  line-height: 1.6;
  border-radius: 0 var(--r) var(--r) 0;
}

.kmg-body .tip strong { color: var(--accent-h); }

/* Highlight */
.kmg-body .highlight {
  margin: 24px 0;
  padding: 18px 22px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0;
  background: var(--accent-bg);
  color: var(--accent-h);
  font-style: italic;
  font-weight: 600;
  font-size: 15px;
}

/* FAQ */
.kmg-body .faq-item {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.kmg-body .faq-q {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 10px;
}

.kmg-body .faq-a {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

/* Conclusion box */
.kmg-body .conclusion-box {
  background: var(--grad-ink);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 36px;
  margin-top: 48px;
  position: relative;
  overflow: hidden;
}

.kmg-body .conclusion-box::before {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: var(--grad-vivid);
  opacity: 0.25;
  filter: blur(50px);
}

.kmg-body .conclusion-box h2 {
  color: #fff;
  border-bottom-color: var(--accent);
  padding-bottom: 16px;
  margin-top: 0;
}

.kmg-body .conclusion-box p { color: rgba(255,255,255,0.75); }
.kmg-body .conclusion-box ul li { color: rgba(255,255,255,0.75); }
.kmg-body .conclusion-box a { color: var(--accent); }
.kmg-body .conclusion-box strong { color: #fff; }

/* Blockquote */
.kmg-body blockquote {
  margin: 24px 0;
  padding: 0;
  border: none;
}

/* Картинки */
.kmg-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r);
  display: block;
}

/* Marquiz */
.kmg-body .kmg-marquiz-wrap {
  border-radius: var(--r);
  overflow: hidden;
  border: 8px solid var(--accent);
  margin: 28px 0;
}

/* ══════════════════════════════
   ХЛЕБНЫЕ КРОШКИ
══════════════════════════════ */
.bc-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  padding: 0 0 20px !important;
  margin: 0 !important;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
}

.bc-list li { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.bc-list a { color: var(--muted); text-decoration: none; transition: color .15s; }
.bc-list a:hover { color: var(--accent); }
.bc-list li:last-child { color: var(--text); font-weight: 600; }
.bc-sep { color: var(--muted-lt); font-size: 10px; }

/* ══════════════════════════════
   САЙДБАР КАРТОЧКИ
══════════════════════════════ */
.sc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  padding: 22px;
  font-family: var(--font);
}

.sc__title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.toc {
  list-style: none;
  display: grid;
  gap: 4px;
  padding: 0;
  margin: 0;
}

.toc a {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  text-decoration: none;
  transition: background .15s, color .15s;
  font-family: var(--font);
}

.toc a:hover { color: var(--text); background: var(--surface-2); }
.toc-hidden { display: none; }

.toc-toggle {
  margin-top: 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  width: 100%;
  font-family: var(--font);
  transition: .15s;
}

.toc-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Баннер сайдбара */
.sb-banner {
  display: block;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--sh);
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}

.sb-banner:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); }

.sb-banner__inner {
  background: var(--grad-ink);
  padding: 26px 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.sb-banner__inner::before {
  content: "";
  position: absolute;
  top: -50px; right: -50px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: var(--grad-vivid);
  opacity: 0.3;
  filter: blur(40px);
}

.sb-banner__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
  position: relative;
  font-family: var(--font);
}

.sb-banner__title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 18px;
  position: relative;
  font-family: var(--font);
}

.sb-banner__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  background: var(--grad-vivid);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  position: relative;
  text-decoration: none;
  font-family: var(--font);
}

/* Виджет связи */
.sw {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--sh);
  font-family: var(--font);
}

.sw__title { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.sw__sub { font-size: 12px; color: var(--muted); margin-bottom: 14px; }

.sw__buttons-row { display: flex; gap: 8px; }

.sw__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #fff !important;
  text-decoration: none !important;
  transition: .15s;
  font-family: var(--font);
}

.sw__btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.sw__btn--wa { background: #25D366; }
.sw__btn--tg { background: #0088cc; }
.sw__btn--phone { background: var(--ink); }

/* ══════════════════════════════
   ПОХОЖИЕ СТАТЬИ
══════════════════════════════ */
.section-ttl {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--ink);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.rc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh);
  transition: transform .22s, box-shadow .22s;
  display: block;
  text-decoration: none;
  color: inherit;
}

.rc:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); }
.rc__img { width: 100%; height: 110px; object-fit: cover; display: block; }
.rc__img-ph { width: 100%; height: 110px; display: flex; align-items: center; justify-content: center; font-size: 28px; background: var(--surface-2); }
.rc__body { padding: 12px 14px; }
.rc__cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 5px; font-family: var(--font); }
.rc__title { font-size: 13px; font-weight: 700; line-height: 1.5; color: var(--text); margin-bottom: 6px; font-family: var(--font); }
.rc__date { font-size: 11px; color: var(--muted-lt); font-family: var(--font); }

/* ══════════════════════════════
   АДАПТИВ
══════════════════════════════ */
@media (max-width: 1060px) {
  .kmg-layout { grid-template-columns: 1fr; }
  .kmg-sidebar__sticky { position: static; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .kmg-hero { min-height: 380px; padding-bottom: 36px; }
  .kmg-body { padding: 24px 20px; }
  .kmg-layout { padding: 20px 0 48px; gap: 20px; }
}

@media (max-width: 560px) {
  .kmg-hero { min-height: 300px; }
  .kmg-hero__title { font-size: 26px; }
  .related-grid { grid-template-columns: 1fr; }
  .kmg-body { padding: 20px 16px; }
}
