/* Журнал ТМЦ контроля — статьи и список.
   Дизайн-язык 1:1 по референсу kursach24.ru/blog (article.css):
   ширина текста 680px, Golos Text, крошки капсом, TOC, нумерованные шаги,
   бары, дерево, мягкая врезка «Кстати», FAQ, финальный CTA, «Читайте также».
   Акцент — зелёный #0F6E56 (action из дизайн-системы ТМЦ), brand-плитка #FFCC00. */

/* Golos Text: локальные subset-файлы (fontsource naming). В наличии 400 и 600 —
   600 покрывает и medium, и demibold. */
@font-face {
  font-family: "Golos Text";
  src: url("/fonts/journal/golos-text-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Golos Text";
  src: url("/fonts/journal/golos-text-cyrillic-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  src: url("/fonts/journal/golos-text-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Golos Text";
  src: url("/fonts/journal/golos-text-cyrillic-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/journal/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/journal/ibm-plex-mono-cyrillic-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --art-bg: #ffffff;
  --art-text: #111827;
  --art-text-secondary: #4b5563;
  --art-text-faint: #6b7280;
  --art-border: #e5e7eb;
  --art-accent: #0f6e56;
  --art-accent-pressed: #0b5542;
  --art-accent-soft: #e4f5ef;
  --art-accent-ring: rgba(15, 110, 86, 0.35);
  --art-accent-fill: #f0faf6;
  --art-brand: #ffcc00;
  --art-brand-ink: #0a0a0b;
  --art-warm: #f9fafb;
  --art-warm-border: #f3f4f6;
  --art-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Golos Text", -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--art-text);
  background: var(--art-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(255, 204, 0, 0.45);
}

a {
  color: var(--art-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(15, 110, 86, 0.35);
  transition: color 0.15s var(--art-ease), text-decoration-color 0.15s var(--art-ease);
}
a:hover {
  color: var(--art-accent-pressed);
  text-decoration-color: currentColor;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--art-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--art-brand-ink);
  color: #fff;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip:focus {
  left: 0;
}

/* ═══ ШАПКА ═══ */

.art-header {
  border-bottom: 1px solid var(--art-border);
  background: var(--art-bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.art-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.art-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--art-text);
}
.art-brand:hover {
  color: var(--art-text);
}

.art-brand-tile {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--art-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.art-brand-tile svg {
  width: 16px;
  height: 16px;
  color: var(--art-brand-ink);
  display: block;
}

.art-brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--art-text);
}

.art-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.art-nav-link {
  font-size: 14px;
  color: var(--art-text-secondary);
  text-decoration: none;
  transition: color 0.15s var(--art-ease);
}
.art-nav-link:hover {
  color: var(--art-text);
}
.art-nav-link--active {
  color: var(--art-text);
  font-weight: 500;
}

/* ═══ ОСНОВНОЙ КОНТЕЙНЕР ═══ */

.art-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 0;
}

/* Крошки */

.art-crumb {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--art-text-faint);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.art-crumb a {
  color: var(--art-text-faint);
  text-decoration: none;
  transition: color 0.15s var(--art-ease);
}
.art-crumb a:hover {
  color: var(--art-text);
}

.art-crumb-sep {
  color: var(--art-border);
  font-size: 11px;
}

/* Заголовок статьи / страницы */

.art-h1 {
  font-size: clamp(30px, 4.5vw, 42px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.028em;
  text-wrap: balance;
  hyphens: none;
  margin-bottom: 14px;
}

.art-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--art-text-faint);
  margin-bottom: 36px;
}

.art-meta-role {
  font-weight: 500;
  color: var(--art-text-secondary);
}

.art-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--art-border);
  flex-shrink: 0;
}

/* Содержание */

.art-toc {
  border: 1px solid var(--art-border);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 32px 0 40px;
}

.art-toc-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--art-text-faint);
  margin-bottom: 10px;
}

.art-toc ol {
  list-style: none;
  counter-reset: toc;
}

.art-toc li {
  counter-increment: toc;
  padding: 3px 0;
}

.art-toc li a {
  font-size: 14px;
  color: var(--art-text-secondary);
  text-decoration: none;
  transition: color 0.15s var(--art-ease);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.art-toc li a:hover {
  color: var(--art-accent);
}

.art-toc li a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--art-text-faint);
  flex-shrink: 0;
  min-width: 18px;
}

/* Лид */

.art-answer {
  font-size: 19px;
  line-height: 1.65;
  color: var(--art-text);
  margin: 0 0 16px;
  text-wrap: pretty;
}

.art-lede {
  font-size: 19px;
  line-height: 1.65;
  color: var(--art-text-secondary);
  margin-bottom: 44px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--art-warm-border);
  text-wrap: pretty;
}

/* ═══ ПРОЗА ═══ */

.art-h2 {
  font-size: clamp(22px, 3vw, 27px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
  hyphens: none;
  margin: 52px 0 18px;
  scroll-margin-top: 84px;
}

.art-h3 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  margin: 32px 0 10px;
  scroll-margin-top: 84px;
}

/* Метки сравнения (Excel / ТМЦ контроль и т.п.) */

.art-marks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -10px 0 14px;
}

.art-marks span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--art-text-faint);
  border: 1px solid var(--art-border);
  border-radius: 999px;
  padding: 3px 10px;
}

.art-p {
  margin-bottom: 16px;
  color: #1f2937;
  max-width: 62ch;
  text-wrap: pretty;
}

.art-strong {
  font-weight: 600;
  color: var(--art-text);
}

.art-ul,
.art-ol {
  margin: 0 0 18px 0;
  padding-left: 0;
  list-style: none;
}

.art-ul li,
.art-ol li {
  padding-left: 24px;
  position: relative;
  margin-bottom: 8px;
  color: #1f2937;
  max-width: 62ch;
}

.art-ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--art-accent);
}

.art-ol {
  counter-reset: ol;
}
.art-ol li {
  counter-increment: ol;
}
.art-ol li::before {
  content: counter(ol) ".";
  position: absolute;
  left: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  color: var(--art-accent);
  font-weight: 500;
}

.art-code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88em;
  background: var(--art-warm);
  border: 1px solid var(--art-border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--art-text);
}

/* Фото в статье */

.art-fig {
  margin: 40px 0;
  border: 1px solid var(--art-border);
  border-radius: 12px;
  overflow: hidden;
}

.art-fig img {
  display: block;
  width: 100%;
}

.art-fig-cap {
  padding: 14px 20px;
  font-size: 13px;
  color: var(--art-text-faint);
  border-top: 1px solid var(--art-border);
  background: var(--art-warm);
}

/* Шаги (figure type: steps) */

.art-steps {
  list-style: none;
  margin: 0;
  padding: 24px;
  background: var(--art-warm);
  counter-reset: steps;
}

.art-steps li {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--art-border);
  counter-increment: steps;
}
.art-steps li:first-child {
  padding-top: 0;
}
.art-steps li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.art-steps li::before {
  content: counter(steps, decimal-leading-zero);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--art-accent);
  background: var(--art-accent-soft);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.art-steps li strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--art-text);
  margin-bottom: 2px;
}

.art-steps li span {
  font-size: 14px;
  color: var(--art-text-secondary);
  line-height: 1.65;
}

/* Бары (figure type: bars) */

.art-bars {
  padding: 24px;
  background: var(--art-warm);
}

.art-bar {
  margin-bottom: 14px;
}
.art-bar:last-child {
  margin-bottom: 0;
}

.art-bar-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 6px;
}

.art-bar-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--art-text);
}

.art-bar-value {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--art-text-faint);
}

.art-bar-track {
  height: 6px;
  background: var(--art-accent-soft);
  border-radius: 3px;
  overflow: hidden;
}

.art-bar-fill {
  height: 100%;
  background: var(--art-accent);
  border-radius: 3px;
}

/* Дерево (figure type: tree) */

.art-tree {
  padding: 24px;
  background: var(--art-warm);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13.5px;
  line-height: 1.9;
}

.art-tree ul {
  list-style: none;
  padding-left: 22px;
  border-left: 1px solid var(--art-border);
  margin-left: 8px;
}
.art-tree > ul {
  border-left: none;
  padding-left: 0;
  margin-left: 0;
}

.art-tree li {
  padding: 2px 0;
  color: var(--art-text);
  position: relative;
}

.art-tree li li::before {
  content: "└";
  position: absolute;
  left: -16px;
  color: var(--art-text-faint);
  font-size: 11px;
  top: 5px;
}

.art-tree li ul {
  border-left: 1px solid var(--art-accent-ring);
}

/* Таблица */

.art-table-wrap {
  margin: 28px 0;
  overflow-x: auto;
  border: 1px solid var(--art-border);
  border-radius: 10px;
}

.art-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.art-table th {
  font-weight: 600;
  font-size: 13px;
  color: var(--art-text-secondary);
  text-align: left;
  padding: 12px 16px;
  background: var(--art-warm);
  border-bottom: 1px solid var(--art-border);
  white-space: nowrap;
}

.art-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--art-warm-border);
  color: #1f2937;
  vertical-align: top;
}

.art-table tr:last-child td {
  border-bottom: none;
}

/* Мягкая врезка «Кстати» / «На объекте» */

.art-soft {
  margin: 40px 0;
  border: 1px solid var(--art-border);
  border-radius: 12px;
  padding: 24px;
  background: var(--art-warm);
}

.art-soft-tag {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--art-accent);
  margin-bottom: 10px;
}
.art-soft-tag svg {
  width: 14px;
  height: 14px;
  display: block;
}

.art-soft-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.art-soft-desc {
  font-size: 14px;
  color: var(--art-text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
  max-width: 56ch;
}

.art-soft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.art-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--art-accent);
  color: var(--art-accent);
  text-decoration: none;
  background: var(--art-bg);
  transition: background 0.2s var(--art-ease), color 0.2s var(--art-ease), transform 0.2s var(--art-ease);
}
.art-btn:hover {
  background: var(--art-accent);
  color: #fff;
  transform: translateY(-1px);
}
.art-btn svg {
  width: 16px;
  height: 16px;
  display: block;
  transition: transform 0.2s var(--art-ease);
}
.art-btn:hover svg {
  transform: translateX(3px);
}

.art-btn--ghost {
  border-color: var(--art-border);
  color: var(--art-text-secondary);
}
.art-btn--ghost:hover {
  background: var(--art-warm);
  color: var(--art-text);
  border-color: var(--art-text-faint);
}

/* FAQ */

.art-faq {
  margin: 0 0 10px;
}

.art-faq details {
  border: 1px solid var(--art-border);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.2s var(--art-ease);
}
.art-faq details[open] {
  border-color: var(--art-accent-ring);
}

.art-faq summary {
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--art-text);
  transition: color 0.15s var(--art-ease);
}
.art-faq summary::-webkit-details-marker {
  display: none;
}
.art-faq summary:hover {
  color: var(--art-accent);
}

.art-faq summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--art-text-faint);
  border-bottom: 1.5px solid var(--art-text-faint);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s var(--art-ease);
  flex-shrink: 0;
}
.art-faq details[open] summary::after {
  transform: rotate(-135deg) translateY(-1px);
}

.art-faq details p {
  padding: 0 20px 16px;
  font-size: 14px;
  color: var(--art-text-secondary);
  line-height: 1.7;
  max-width: 60ch;
}

/* Финальный CTA */

.art-final {
  margin: 64px 0;
  padding: 48px 40px;
  border: 1px solid var(--art-border);
  border-radius: 16px;
  text-align: center;
  background: var(--art-bg);
}

.art-final h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--art-accent);
  text-wrap: balance;
}

.art-final p {
  font-size: 15px;
  color: var(--art-text-secondary);
  margin-bottom: 24px;
  text-wrap: pretty;
}

.art-final-note {
  font-size: 12px !important;
  color: var(--art-text-faint) !important;
  margin-top: 14px;
  margin-bottom: 0 !important;
}

/* Читайте также */

.art-related {
  margin: 0 0 64px;
}

.art-related-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--art-text-faint);
  margin-bottom: 16px;
}

.art-related-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.art-related a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--art-border);
  border-radius: 10px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--art-text);
  transition: border-color 0.15s var(--art-ease), background 0.15s var(--art-ease);
}
.art-related a:hover {
  border-color: var(--art-accent-ring);
  background: var(--art-warm);
  color: var(--art-text);
}

.art-related svg {
  width: 18px;
  height: 18px;
  color: var(--art-text-faint);
  flex-shrink: 0;
  transition: transform 0.15s var(--art-ease), color 0.15s var(--art-ease);
}
.art-related a:hover svg {
  transform: translateX(3px);
  color: var(--art-accent);
}

/* Вернуться */

.art-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--art-text-faint);
  text-decoration: none;
  margin-bottom: 48px;
  transition: color 0.15s var(--art-ease);
}
.art-back:hover {
  color: var(--art-text);
}
.art-back svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* ═══ СПИСОК СТАТЕЙ ═══ */

.art-groups {
  margin-top: 8px;
}

.art-group {
  margin-bottom: 44px;
}

.art-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--art-text-faint);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--art-warm-border);
}

.art-list {
  list-style: none;
}

.art-list li {
  border-bottom: 1px solid var(--art-warm-border);
}
.art-list li:last-child {
  border-bottom: none;
}

.art-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
  text-decoration: none;
  color: var(--art-text);
  transition: opacity 0.15s var(--art-ease);
}
.art-list a:hover {
  opacity: 0.55;
  color: var(--art-text);
}

.art-list strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-bottom: 4px;
}

.art-list span {
  display: block;
  font-size: 14px;
  color: var(--art-text-faint);
  line-height: 1.5;
}

.art-list-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--art-text-faint);
  flex-shrink: 0;
}

/* ═══ ПОДВАЛ ═══ */

.art-footer {
  border-top: 1px solid var(--art-border);
  padding: 32px 0 40px;
  margin-top: 0;
}

.art-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.art-footer-note {
  font-size: 12px;
  color: var(--art-text-faint);
  max-width: 46ch;
  line-height: 1.6;
}

/* ═══ МОБИЛЬНЫЙ ═══ */

@media (max-width: 640px) {
  .art-wrap {
    padding: 32px 20px 0;
  }

  .art-h1 {
    font-size: 27px;
  }

  .art-answer,
  .art-lede {
    font-size: 17px;
  }

  .art-final {
    padding: 32px 24px;
  }

  .art-soft-actions {
    flex-direction: column;
  }

  .art-btn {
    justify-content: center;
  }

  .art-list a {
    flex-direction: column;
    gap: 4px;
  }

  .art-list-num {
    display: none;
  }

  .art-nav {
    gap: 16px;
  }

  .art-steps,
  .art-bars,
  .art-tree {
    padding: 18px;
  }

  .art-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}
