/* Bellissimo Kuzbass — дизайн-система «Атлас»
   Песочный фон, просторные карточки, хлебные крошки, секции маршрутов и списки ориентиров.
   Без внешних шрифтов и зависимостей. */

:root {
  --sand-50: #fbf7ef;
  --sand-100: #f5ecdb;
  --sand-200: #ebdcc0;
  --sand-300: #d9c39b;
  --ink: #2b2620;
  --ink-soft: #5a5146;
  --forest: #1f5a53;      /* основной акцент: контраст на sand-100 > 7:1 */
  --forest-dark: #153f3a;
  --clay: #9a3b17;        /* вторичный акцент: контраст на sand-100 > 5.5:1 */
  --line: #cdb994;
  --card: #fffdf8;
  --warn-bg: #fbe9d7;
  --warn-line: #c46a2b;
  --focus: #0b57d0;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(43, 38, 32, .06), 0 6px 18px rgba(43, 38, 32, .06);
  --container: 1140px;
  --measure: 70ch;
  --font-body: "PT Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "PT Serif", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--sand-100);
  /* тонкие «изолинии» карты как фон — локальный SVG, без внешних запросов */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240' fill='none' stroke='%23d9c39b' stroke-opacity='.35' stroke-width='1'%3E%3Cpath d='M-10 60c40-20 80 20 120 0s80-20 140 0'/%3E%3Cpath d='M-10 110c50-25 90 25 130 0s70-20 130 5'/%3E%3Cpath d='M-10 165c45-20 85 20 125-5s85-15 135 5'/%3E%3Cpath d='M-10 215c40-15 90 15 130-5s80-10 130 5'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

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

a { color: var(--forest); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--forest-dark); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; color: var(--ink); margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem); margin-top: 0; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 28px; } }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--forest); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Шапка ---------- */
.site-header {
  background: var(--sand-50);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  background: radial-gradient(circle at 50% 50%, var(--sand-50) 0 5px, transparent 6px),
              conic-gradient(from 45deg, var(--forest) 0 25%, var(--clay) 0 50%, var(--forest) 0 75%, var(--clay) 0);
  box-shadow: inset 0 0 0 3px var(--sand-50), 0 0 0 1px var(--line);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }
.brand-tag { font-size: .8rem; color: var(--ink-soft); }

.nav-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-weight: 700; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 14px; min-height: 44px; cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; position: relative; content: "";
}
.nav-toggle-bars::before { position: absolute; top: -6px; }
.nav-toggle-bars::after { position: absolute; top: 6px; }

.main-nav { flex-basis: 100%; display: none; padding-bottom: 12px; }
.main-nav.is-open { display: block; }
.no-js .main-nav { display: block; }
.no-js .nav-toggle { display: none; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.main-nav a {
  display: block; padding: 10px 12px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--ink); font-weight: 600;
}
.main-nav a:hover { background: var(--sand-200); }
.main-nav a[aria-current="page"] { background: var(--forest); color: #fff; }

.lang-switch { display: flex; gap: 4px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.lang-switch a, .lang-switch span {
  display: inline-block; min-width: 40px; min-height: 36px; text-align: center; padding: 7px 8px;
  border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; font-weight: 700;
  text-decoration: none; text-transform: uppercase; color: var(--ink); background: var(--card);
}
.lang-switch [aria-current="true"] { background: var(--ink); color: var(--sand-50); border-color: var(--ink); }

@media (min-width: 1000px) {
  .header-inner { padding-top: 8px; }
  .nav-toggle { display: none; }
  .lang-switch { order: 2; }
  .main-nav { display: block; flex-basis: 100%; order: 3; padding: 0 0 8px; border-top: 1px solid var(--sand-200); }
  .main-nav ul { display: flex; flex-wrap: wrap; gap: 2px; padding-top: 6px; }
  .main-nav a { padding: 6px 10px; font-size: .95rem; white-space: nowrap; }
}

/* ---------- Хлебные крошки ---------- */
.breadcrumbs { padding-top: 14px; font-size: .92rem; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-soft); }
.breadcrumbs li + li::before { content: "→"; color: var(--clay); margin-right: 2px; }
.breadcrumbs a { color: var(--ink-soft); }

/* ---------- Первый экран ---------- */
.hero { padding-top: 28px; padding-bottom: 8px; }
.hero-card {
  background: var(--sand-50); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px);
  padding: 28px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
@media (min-width: 720px) { .hero-card { padding: 44px 44px; } }
.hero-card::after { /* компасная роза */
  content: ""; position: absolute; right: -40px; bottom: -40px; width: 180px; height: 180px; border-radius: 50%;
  border: 1px dashed var(--sand-300); box-shadow: 0 0 0 22px rgba(217,195,155,.18);
  pointer-events: none;
}
.eyebrow { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--clay); margin-bottom: .6em; }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: var(--measure); }
.hero-points { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; max-width: var(--measure); }
.hero-points li { padding-left: 28px; position: relative; }
.hero-points li::before {
  content: ""; position: absolute; left: 4px; top: .45em; width: 12px; height: 12px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); background: var(--clay);
}
.hero-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 10px 16px;
  border-radius: 999px; font-weight: 700; text-decoration: none; border: 1px solid var(--forest);
  color: var(--forest); background: var(--card);
}
.btn:hover { background: var(--forest); color: #fff; }
.btn-primary { background: var(--forest); color: #fff; }
.btn-primary:hover { background: var(--forest-dark); }

/* ---------- Секции ---------- */
main { display: block; padding-bottom: 40px; }
.section { padding-top: 28px; padding-bottom: 8px; }
.section-intro { color: var(--ink-soft); max-width: var(--measure); }
.prose { max-width: var(--measure); }

.toc {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; margin: 18px 0 0;
}
.toc h2 { font-size: 1rem; font-family: var(--font-body); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin-bottom: .4em; }
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* ---------- Карточки ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px;
}
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--ink-soft); }
.card-link { position: relative; }
.card-link h3 a { text-decoration: none; color: var(--ink); }
.card-link h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-link:hover { border-color: var(--forest); }
.card-link:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.card-link h3 a:focus-visible { outline: none; }
.card-more { margin-top: auto; font-weight: 700; color: var(--forest); font-size: .95rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 4px 0 0; }
.tags li { font-size: .78rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--sand-200); color: var(--ink); }

/* ---------- Маршрут (характерный элемент «Атласа») ---------- */
.route { list-style: none; margin: 0; padding: 0 0 0 4px; counter-reset: stop; max-width: 780px; }
.route li { position: relative; padding: 0 0 20px 44px; counter-increment: stop; }
.route li::before {
  content: counter(stop); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .9rem;
  background: var(--forest); color: #fff; box-shadow: 0 0 0 4px var(--sand-100);
}
.route li::after {
  content: ""; position: absolute; left: 14px; top: 34px; bottom: 2px; border-left: 2px dashed var(--sand-300);
}
.route li:last-child::after { display: none; }
.route h3 { margin: 2px 0 4px; }
.route p { margin: 0; color: var(--ink-soft); }

/* ---------- Пошаговые инструкции ---------- */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 14px; }
.step {
  counter-increment: step; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 18px 70px; position: relative; box-shadow: var(--shadow);
}
.step::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 18px; top: 16px;
  font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; color: var(--clay);
}
.step h3 { margin: 0 0 6px; }
.step p { margin: 0 0 6px; }
.step .example { font-size: .95rem; color: var(--ink-soft); border-left: 3px solid var(--sand-300); padding-left: 10px; margin: 8px 0 0; }

.panel {
  background: var(--sand-50); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; max-width: 780px;
}
.panel h2 { font-size: 1.15rem; font-family: var(--font-body); font-weight: 700; margin-bottom: .5em; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist li { padding-left: 28px; position: relative; }
.checklist li::before {
  content: ""; position: absolute; left: 2px; top: .3em; width: 16px; height: 16px; border-radius: 4px;
  border: 2px solid var(--forest);
}
.bullets { margin: 0; padding-left: 1.2em; max-width: var(--measure); }
.bullets li { margin-bottom: 6px; }

/* ---------- Ориентиры / термины ---------- */
.landmarks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 860px; }
.landmarks li { display: grid; grid-template-columns: 1fr; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; }
@media (min-width: 640px) { .landmarks li { grid-template-columns: 220px 1fr; gap: 16px; } }
.landmarks dt, .landmarks .term { font-weight: 700; }
.landmarks dd, .landmarks .def { margin: 0; color: var(--ink-soft); }

/* ---------- Таблица ---------- */
.table-wrap { overflow-x: auto; max-width: 900px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: .98rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--sand-200); vertical-align: top; }
thead th { background: var(--sand-200); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- Предупреждение / заметки ---------- */
.callout {
  border-left: 5px solid var(--warn-line); background: var(--warn-bg); padding: 16px 18px; border-radius: var(--radius-sm);
  max-width: 780px;
}
.callout h2 { font-size: 1.15rem; font-family: var(--font-body); font-weight: 700; margin-bottom: .4em; }
.callout p { margin: 0; }
.callout-info { border-left-color: var(--forest); background: #e6efe9; }
.provenance { border: 2px dashed var(--clay); background: var(--sand-50); padding: 16px 18px; border-radius: var(--radius); max-width: 780px; }
.provenance h2 { font-size: 1.1rem; font-family: var(--font-body); font-weight: 700; color: var(--clay); }
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--ink); color: var(--sand-50); }
.verify-note { font-size: .92rem; color: var(--ink-soft); max-width: var(--measure); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 16px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none; position: relative; padding-right: 28px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 2px; top: 10px; font-size: 1.4rem; color: var(--clay); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; color: var(--ink-soft); }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; max-width: 860px; margin-bottom: 10px; }
.faq-item h3 { margin-bottom: .3em; }
.faq-item p { margin: 0; color: var(--ink-soft); }

/* ---------- Каталог публикаций ---------- */
.catalog { background: var(--sand-50); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); padding: 22px 20px; }
@media (min-width: 720px) { .catalog { padding: 30px 34px; } }
.catalog-empty { border: 2px dashed var(--sand-300); border-radius: var(--radius); padding: 18px; color: var(--ink-soft); background: var(--card); }
.catalog-cols { display: grid; gap: 20px; margin-top: 18px; }
@media (min-width: 820px) { .catalog-cols { grid-template-columns: 1fr 1fr; } }
.catalog h3 { font-size: 1.05rem; }

/* ---------- Связанные / источники ---------- */
.related { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 24px; }
.sources { font-size: .95rem; color: var(--ink-soft); }
.sources ul { padding-left: 1.2em; margin: 0 0 8px; }

/* ---------- Подвал ---------- */
.site-footer { background: var(--ink); color: var(--sand-100); padding: 36px 0 24px; margin-top: 24px; }
.site-footer a { color: var(--sand-100); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; gap: 24px; }
@media (min-width: 820px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.site-footer h2 { color: var(--sand-100); font-size: 1rem; font-family: var(--font-body); text-transform: uppercase; letter-spacing: .08em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-bottom { border-top: 1px solid rgba(245,236,219,.2); margin-top: 24px; padding-top: 16px; font-size: .88rem; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
.to-top { color: var(--sand-100); }

@media print {
  .site-header, .site-footer, .skip-link, .nav-toggle { display: none !important; }
  body { background: #fff; }
}

/* === Статьи-размещения и список публикаций (postbuild.py) === */
.pub-wrap { padding-top: 8px; padding-bottom: 48px; }
.pub { max-width: 780px; background: #fffdf8; color: #2b2620; border: 1px solid #cdb994; border-radius: 14px; padding: clamp(18px, 4vw, 44px); overflow-wrap: break-word; }
.pub-kicker { margin: 0 0 8px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #c46a2b; }
.pub h1 { font-family: var(--font-head); font-size: clamp(1.55rem, 3.4vw, 2.25rem); line-height: 1.2; margin: 0 0 14px; }
.pub-lead { font-size: 1.12rem; line-height: 1.6; margin: 0; }
.pub-meta { margin: 18px 0 22px; padding: 8px 0; border-top: 1px solid #cdb994; border-bottom: 1px solid #cdb994; font-size: .85rem; color: #5a5146; }
.pub-toc { margin: 0 0 8px; padding: 12px 18px; border: 1px solid #cdb994; border-radius: 14px; }
.pub .pub-toc h2 { font-size: .95rem; margin: 0 0 6px; font-family: inherit; }
.pub-toc ol { margin: 0; padding-left: 1.3em; }
.pub-toc li { margin: 3px 0; }
.pub h2 { font-family: var(--font-head); font-size: 1.35rem; line-height: 1.3; margin: 30px 0 10px; scroll-margin-top: 16px; }
.pub p, .pub li { line-height: 1.65; }
.pub ul, .pub ol { padding-left: 1.3em; }
.pub li { margin: 5px 0; }
.pub a { color: #1f5a53; text-decoration-thickness: 1px; text-underline-offset: 2px; overflow-wrap: anywhere; }
.pub-note { margin: 18px 0; padding: 12px 16px; background: #fbe9d7; border-left: 4px solid #c46a2b; border-radius: 0 14px 14px 0; }
.pub-note p { margin: 0; }
.pub-sources { margin-top: 28px; font-size: .92rem; }
.pub-foot { margin-top: 30px; padding-top: 12px; border-top: 1px solid #cdb994; font-size: .92rem; }
.pub-list { list-style: none; margin: 16px 0 24px; padding: 0; display: grid; gap: 12px; }
.pub-list li { background: #fffdf8; border: 1px solid #cdb994; border-radius: 14px; padding: 14px 16px; }
.pub-list a { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; color: #1f5a53; overflow-wrap: anywhere; }
.pub-list p { margin: 6px 0 4px; color: #5a5146; font-size: .95rem; line-height: 1.5; }
.pub-list-meta { font-size: .8rem; color: #5a5146; }
.pub { margin-top: 14px; }
