/* ===========================================================================
   Блог mini.aurama.ru

   Файл СГЕНЕРИРОВАН не будет - он рукописный, но живёт рядом с генерируемой
   статикой. Правится здесь.

   Цвета повторяют токены Ant Design 6, которыми покрашен планировщик, чтобы
   блог и инструмент выглядели одним продуктом. Тему ставит тот же
   assets/theme-switch.js (атрибут data-theme на <html>, ключ mini_theme).
   ⚠️ prefers-color-scheme намеренно НЕ учитываем: у продукта решение от
   2026-07-27 - светлая по умолчанию, тёмная только по явному выбору.
   =========================================================================== */

:root {
  --bg:        #f5f5f5;
  --surface:   #ffffff;
  --surface-2: #fafafa;
  --text:      rgba(0, 0, 0, .88);
  --text-2:    rgba(0, 0, 0, .65);
  --text-3:    rgba(0, 0, 0, .45);
  --border:    #d9d9d9;
  --border-2:  #f0f0f0;
  --primary:   #1677ff;
  --primary-h: #4096ff;
  --primary-bg:#e6f4ff;
  --warn:      #d48806;
  --warn-bg:   #fffbe6;
  --warn-br:   #ffe58f;
  --ok:        #389e0d;
  --ok-bg:     #f6ffed;
  --ok-br:     #b7eb8f;
  --shadow:    0 1px 2px rgba(0,0,0,.03), 0 1px 6px -1px rgba(0,0,0,.02);
}

html[data-theme="dark"] {
  --bg:        #000000;
  --surface:   #141414;
  --surface-2: #1d1d1d;
  --text:      rgba(255, 255, 255, .85);
  --text-2:    rgba(255, 255, 255, .65);
  --text-3:    rgba(255, 255, 255, .45);
  --border:    #424242;
  --border-2:  #303030;
  --primary:   #1668dc;
  --primary-h: #3c89e8;
  --primary-bg:#111a2c;
  --warn:      #d8bd14;
  --warn-bg:   #2b2111;
  --warn-br:   #594214;
  --ok:        #49aa19;
  --ok-bg:     #162312;
  --ok-br:     #274916;
  --shadow:    0 1px 2px rgba(0,0,0,.5), 0 1px 6px -1px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-h); text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px;
}

img { max-width: 100%; height: auto; }

/* ------------------------------------------------------------------ шапка */
.bh {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 10px clamp(12px, 3vw, 32px);
  background: var(--surface);
  border-bottom: 1px solid var(--border-2);
}
.bh-brand { display: flex; align-items: center; }
.bh-brand img { display: block; width: 120px; height: auto; }
.bh-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bh-nav > a {
  padding: 6px 10px; border-radius: 6px; color: var(--text-2);
  font-size: 14px; font-weight: 500;
}
.bh-nav > a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.bh-cta {
  background: var(--primary); color: #fff !important;
  padding: 6px 14px !important;
}
.bh-cta:hover { background: var(--primary-h); text-decoration: none; }
.bh-theme {
  width: 34px; height: 34px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-2); cursor: pointer; font-size: 16px; line-height: 1;
}
.bh-theme:hover { color: var(--text); border-color: var(--primary); }
.bh-theme-moon { display: none; }
html[data-theme="dark"] .bh-theme-sun { display: none; }
html[data-theme="dark"] .bh-theme-moon { display: inline; }

/* ---------------------------------------------------------------- каркас */
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 24px) 64px;
}

.crumbs { font-size: 13px; color: var(--text-3); margin-bottom: 18px; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--primary); }
.crumbs span { margin: 0 6px; }

/* ---------------------------------------------------------------- статья */
.post h1 {
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 12px;
  text-wrap: balance;
}
.post-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-size: 13.5px; color: var(--text-3);
  margin: 0 0 22px;
}
.post-lead {
  font-size: 19px; line-height: 1.6; color: var(--text-2);
  margin: 0 0 28px; padding-left: 16px;
  border-left: 3px solid var(--primary);
}

.post h2 {
  font-size: clamp(22px, 3.4vw, 27px);
  line-height: 1.3; font-weight: 650; letter-spacing: -.015em;
  margin: 44px 0 14px; scroll-margin-top: 70px; text-wrap: balance;
}
.post h3 {
  font-size: 19px; line-height: 1.35; font-weight: 600;
  margin: 30px 0 10px; scroll-margin-top: 70px;
}
.post h4 {
  font-size: 16.5px; line-height: 1.4; font-weight: 600;
  margin: 24px 0 8px;
}
.post p { margin: 0 0 16px; }
.post ul, .post ol { margin: 0 0 18px; padding-left: 24px; }
.post li { margin-bottom: 8px; }
.post li > ul, .post li > ol { margin: 8px 0 0; }
.post hr { border: none; border-top: 1px solid var(--border-2); margin: 36px 0; }
.post strong { font-weight: 650; }

.post blockquote {
  margin: 0 0 20px; padding: 2px 0 2px 18px;
  border-left: 3px solid var(--border);
  color: var(--text-2); font-style: italic;
}
.post blockquote p:last-child { margin-bottom: 0; }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .88em;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ------------------------------------------------------------ оглавление */
.toc {
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 10px; padding: 16px 20px; margin: 0 0 32px;
}
.toc-t {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-3); margin: 0 0 10px; font-weight: 600;
}
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 6px; font-size: 15px; }

/* ---------------------------------------------------------------- врезки */
.box {
  border-radius: 10px; padding: 18px 22px; margin: 0 0 24px;
  border: 1px solid var(--border-2); background: var(--surface);
}
.box > *:last-child { margin-bottom: 0; }
.box-title { font-weight: 650; margin: 0 0 8px; }

.box-note  { background: var(--primary-bg); border-color: transparent; }
.box-warn  { background: var(--warn-bg); border-color: var(--warn-br); }
.box-warn .box-title { color: var(--warn); }
.box-ok    { background: var(--ok-bg); border-color: var(--ok-br); }
.box-ok .box-title { color: var(--ok); }

.box-howto { background: var(--surface); border: 1px solid var(--border); }
.box-howto ol { counter-reset: st; list-style: none; padding-left: 0; margin: 0; }
.box-howto ol > li {
  counter-increment: st; position: relative;
  padding-left: 38px; margin-bottom: 14px;
}
.box-howto ol > li::before {
  content: counter(st);
  position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 600; line-height: 26px; text-align: center;
}

.box-cta {
  background: var(--primary-bg); border-color: transparent;
  text-align: left;
}
.box-cta .box-title { font-size: 18px; }

.btn {
  display: inline-block; margin-top: 4px;
  background: var(--primary); color: #fff !important;
  padding: 10px 22px; border-radius: 8px;
  font-weight: 600; font-size: 15.5px;
}
.btn:hover { background: var(--primary-h); text-decoration: none; }

/* -------------------------------------------------------------- таблицы */
.table-wrap {
  overflow-x: auto; margin: 0 0 24px;
  border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface);
}
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border-2); }
thead th {
  background: var(--surface-2); color: var(--text-2);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }

/* ----------------------------------------------------------- иллюстрации */
.post-figure { margin: 0 0 26px; }
.post-figure img {
  display: block; width: 100%;
  border: 1px solid var(--border-2); border-radius: 10px;
  background: var(--surface);
}
.post-figure figcaption {
  margin-top: 8px; font-size: 13.5px; color: var(--text-3); line-height: 1.5;
}

/* --------------------------------------------------------- «дальше» / список */
.related { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border-2); }
.related h2 { font-size: 21px; margin: 0 0 16px; font-weight: 650; }
.related-grid { display: grid; gap: 12px; }
.rcard {
  display: flex; flex-direction: column; gap: 5px;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 10px; padding: 16px 18px; color: var(--text);
}
.rcard:hover { border-color: var(--primary); text-decoration: none; }
.rcard-t { font-weight: 600; line-height: 1.35; }
.rcard-d { font-size: 14.5px; color: var(--text-2); line-height: 1.5; }

.blog-head { margin-bottom: 32px; }
.blog-head h1 {
  font-size: clamp(30px, 5vw, 42px); font-weight: 700;
  letter-spacing: -.02em; margin: 0 0 12px;
}
.blog-lead { font-size: 18px; color: var(--text-2); margin: 0; max-width: 60ch; }

.post-list { display: grid; gap: 14px; margin-bottom: 36px; }
.pcard {
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 12px; box-shadow: var(--shadow);
}
.pcard:hover { border-color: var(--primary); }
.pcard-link { display: block; padding: 22px 24px; color: var(--text); }
.pcard-link:hover { text-decoration: none; }
.pcard h2 {
  font-size: 20px; line-height: 1.35; font-weight: 650;
  margin: 0 0 8px; color: var(--text);
}
.pcard p { margin: 0 0 10px; color: var(--text-2); font-size: 15.5px; line-height: 1.55; }
.pcard-meta { font-size: 13px; color: var(--text-3); margin: 0 !important; }

/* ----------------------------------------------------------------- подвал */
.bf {
  border-top: 1px solid var(--border-2);
  background: var(--surface);
  padding: 28px clamp(16px, 4vw, 24px);
}
.bf-in { max-width: 760px; margin: 0 auto; color: var(--text-2); font-size: 14.5px; }
.bf-in p { margin: 0 0 8px; }
.bf-links { color: var(--text-3); }

@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .bh { gap: 10px; padding: 8px 14px; }
  .bh-brand img { width: 96px; }
  .bh-nav > a { padding: 6px 8px; font-size: 13.5px; }
  .bh-cta { padding: 6px 12px !important; }
  .post-lead { font-size: 17.5px; }
  .box { padding: 16px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
