/* Файл сгенерирован автоматически — не редактировать вручную */
/* Палитра «Полночь и коралл» — те же значения, что в теме админки */
:root {
  --navy: #0B1B3A;
  --coral: #FF6B57;
  --bg: #F6F4F1;
  --surface: #FFFFFF;
  --surface-muted: #FAF8F5;
  --text: #0F172A;
  --text-secondary: #617087;
  --text-tertiary: #94A3B8;
  --heading: #0B1B3A;
  --link: #C2410C;
  --link-hover: #9A3412;
  --border: #E6E1DA;
  --border-soft: #EFEBE5;
  --row-hover: #FBF9F6;
  --callout-bg: #FFF4F1;
  --code-bg: #F1EDE7;
  --code-text: #0B1B3A;
  --pre-bg: #0B1B3A;
  --pre-text: #E2E8F0;
  --mark-bg: rgba(255, 107, 87, 0.22);
  --focus-ring: 0 0 0 3px rgba(255, 107, 87, 0.35);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.05), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
  --shadow-pop: 0 12px 32px -8px rgba(15, 23, 42, 0.28), 0 2px 6px rgba(15, 23, 42, 0.08);
  --side-bg: #0B1B3A;
  --side-text: #C7D2E5;
  --side-text-strong: #FFFFFF;
  --side-muted: #8FA3C7;
  --side-hover: #13264F;
  --side-selected: #1E3563;
  --side-divider: rgba(255, 255, 255, 0.08);
  --popup-bg: #FFFFFF;
  --popup-hover: #FFF1EE;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Menlo, Consolas, monospace;
  --sidebar-width: 288px;
  --toc-width: 232px;
  --topbar-height: 56px;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A1326;
    --surface: #111C33;
    --surface-muted: #15213D;
    --text: #E2E8F0;
    --text-secondary: #94A3B8;
    --text-tertiary: #64748B;
    --heading: #F1F5F9;
    --link: #FFA08F;
    --link-hover: #FFB8AA;
    --border: #1E2D4D;
    --border-soft: #18264A;
    --row-hover: rgba(255, 255, 255, 0.03);
    --callout-bg: rgba(255, 107, 87, 0.08);
    --code-bg: rgba(255, 255, 255, 0.07);
    --code-text: #E2E8F0;
    --pre-bg: #08142C;
    --mark-bg: rgba(255, 107, 87, 0.3);
    --shadow-card: none;
    --shadow-pop: 0 16px 40px -8px rgba(0, 0, 0, 0.6);
    --side-bg: #08142C;
    --side-selected: #22386A;
    --popup-bg: #15213D;
    --popup-hover: #1B305B;
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--link-hover);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 6px;
}

img {
  max-width: 100%;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
}

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

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--coral);
  color: var(--navy);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

@media print {
  .sidebar,
  .topbar,
  .scrim,
  .toc,
  .pager,
  .heading-anchor {
    display: none !important;
  }

  .layout,
  .page.has-toc {
    display: block !important;
  }

  .main {
    padding: 0 !important;
  }

  .doc {
    border: 0 !important;
    box-shadow: none !important;
  }
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.topbar,
.scrim {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  border-right: 1px solid var(--side-divider);
  background: var(--side-bg);
  color: var(--side-text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 12px 12px;
  padding: 8px;
  border-radius: 12px;
  color: var(--side-text-strong);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.brand:hover {
  color: var(--side-text-strong);
  background: var(--side-hover);
}

.brand.is-active {
  background: var(--side-selected);
  box-shadow: inset 3px 0 0 var(--coral);
}

.brand-mark {
  flex: none;
  display: block;
}

.nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 12px 24px;
  border-top: 1px solid var(--side-divider);
  scrollbar-width: thin;
  scrollbar-color: var(--side-selected) transparent;
}

.nav-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 2px 0;
  padding: 7px 12px;
  border-radius: 10px;
  color: var(--side-text);
  font-size: 14.5px;
  line-height: 1.35;
  text-decoration: none;
}

.nav-link:hover {
  background: var(--side-hover);
  color: var(--side-text-strong);
}

.nav-link.is-active {
  background: var(--side-selected);
  color: var(--side-text-strong);
  box-shadow: inset 3px 0 0 var(--coral);
  font-weight: 500;
}

.nav-num {
  flex: none;
  min-width: 1.5em;
  color: var(--side-muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.nav-link.is-active .nav-num {
  color: var(--coral);
}

.main {
  min-width: 0;
  padding: 40px 48px 64px;
}

.main:focus {
  outline: none;
}

.page {
  max-width: calc(72ch + 96px);
  margin: 0 auto;
}

@media (max-width: 960px) {
  .layout {
    display: block;
  }

  .topbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 6px;
    height: var(--topbar-height);
    padding: 0 12px 0 6px;
    background: var(--side-bg);
    color: var(--side-text-strong);
    box-shadow: 0 1px 0 var(--side-divider);
  }

  .topbar-title {
    overflow: hidden;
    color: var(--side-text-strong);
    font-weight: 600;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(320px, 86vw);
    height: auto;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0s linear 0.2s;
  }

  .nav-open .sidebar {
    transform: none;
    visibility: visible;
    transition: transform 0.2s ease;
  }

  .nav-open .scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    background: rgba(6, 17, 42, 0.55);
  }

  .main {
    padding: calc(var(--topbar-height) + 20px) 20px 48px;
  }
}

@media (max-width: 600px) {
  .main {
    padding: calc(var(--topbar-height) + 12px) 10px 32px;
  }
}

.doc {
  padding: 40px 48px 48px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  overflow-wrap: break-word;
}

.doc :is(h1, h2, h3, h4) {
  position: relative;
  color: var(--heading);
  line-height: 1.25;
  letter-spacing: -0.01em;
  scroll-margin-top: 24px;
}

.doc h1 {
  margin: 0 0 20px;
  font-size: 2rem;
  font-weight: 700;
}

.doc h2 {
  margin: 2.4em 0 0.7em;
  padding-top: 1.1em;
  border-top: 1px solid var(--border-soft);
  font-size: 1.5rem;
  font-weight: 650;
}

.doc h3 {
  margin: 1.9em 0 0.6em;
  font-size: 1.2rem;
  font-weight: 600;
}

.doc h4 {
  margin: 1.6em 0 0.5em;
  font-size: 1.05rem;
  font-weight: 600;
}

.heading-anchor {
  margin-left: 0.35em;
  color: var(--coral);
  font-weight: 500;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s;
}

:is(h2, h3, h4):hover > .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}

.doc :is(p, ul, ol) {
  margin: 0 0 1em;
}

.doc li + li,
.doc li > :is(ul, ol) {
  margin-top: 0.35em;
}

.doc :is(ul, ol) {
  padding-left: 1.4em;
}

.doc li::marker {
  color: var(--text-tertiary);
}

.doc strong {
  color: var(--heading);
  font-weight: 600;
}

.doc hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.doc blockquote {
  margin: 1.25em 0;
  padding: 14px 18px;
  border-left: 4px solid var(--coral);
  border-radius: 4px 12px 12px 4px;
  background: var(--callout-bg);
}

.doc blockquote > :last-child {
  margin-bottom: 0;
}

.doc :not(pre) > code {
  padding: 0.12em 0.38em;
  border-radius: 6px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.doc pre {
  margin: 1.25em 0;
  padding: 16px 18px;
  overflow-x: auto;
  border-radius: 12px;
  background: var(--pre-bg);
  color: var(--pre-text);
  font-size: 0.875rem;
  line-height: 1.55;
}

.table-wrap {
  margin: 1.25em 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.table-wrap :is(th, td) {
  min-width: 8.5em;
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}

.table-wrap th {
  background: var(--surface-muted);
  color: var(--heading);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.table-wrap td {
  border-top: 1px solid var(--border-soft);
}

.table-wrap tbody tr:first-child td {
  border-top: 0;
}

.table-wrap tbody tr:hover td {
  background: var(--row-hover);
}

.shot {
  margin: 1.5em 0 1.75em;
}

.zoom {
  display: block;
  cursor: zoom-in;
}

.zoom img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.zoom:hover img {
  border-color: rgba(255, 107, 87, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 107, 87, 0.15);
}

.shot figcaption {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: center;
}

@media (max-width: 960px) {
  .doc :is(h1, h2, h3, h4) {
    scroll-margin-top: calc(var(--topbar-height) + 16px);
  }
}

.toc-side {
  display: none;
}

@media (min-width: 1280px) {
  .page.has-toc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--toc-width);
    gap: 40px;
    max-width: calc(72ch + 96px + 40px + var(--toc-width));
  }

  .page.has-toc .toc-side {
    display: block;
  }

  .page.has-toc .toc-inline {
    display: none;
  }
}

.toc-inline {
  margin: 0 0 28px;
  padding: 12px 18px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--surface-muted);
}

.toc-inline summary {
  color: var(--heading);
  font-weight: 600;
  cursor: pointer;
}

.toc-inline ol {
  margin: 10px 0 4px;
  padding-left: 1.4em;
}

.toc-inline li + li {
  margin-top: 0.25em;
}

.toc-side {
  position: sticky;
  top: 32px;
  align-self: start;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding-top: 8px;
  font-size: 0.875rem;
  line-height: 1.4;
  scrollbar-width: thin;
}

.toc-title {
  margin: 0 0 10px;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toc-side ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--border);
}

.toc-side a {
  display: block;
  margin-left: -2px;
  padding: 5px 0 5px 14px;
  border-left: 2px solid transparent;
  color: var(--text-secondary);
  text-decoration: none;
}

.toc-side a:hover {
  color: var(--heading);
}

.toc-side a.is-current {
  border-left-color: var(--coral);
  color: var(--heading);
  font-weight: 500;
}

.pager {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.pager-link {
  display: flex;
  flex: 0 1 calc(50% - 8px);
  flex-direction: column;
  gap: 2px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pager-link:hover {
  border-color: var(--coral);
  box-shadow: var(--shadow-card);
}

.pager-next {
  margin-left: auto;
  text-align: right;
}

.pager-dir {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.pager-title {
  color: var(--heading);
  font-weight: 600;
  line-height: 1.35;
}

.footer {
  margin-top: 24px;
  color: var(--text-tertiary);
  font-size: 0.8125rem;
}

@media (max-width: 600px) {
  .doc {
    padding: 24px 16px 28px;
    border-radius: 14px;
  }

  .doc h1 {
    font-size: 1.6rem;
  }

  .doc h2 {
    font-size: 1.3rem;
  }

  .pager {
    flex-direction: column;
    gap: 10px;
  }

  .pager-link {
    flex-basis: auto;
  }

  .footer {
    padding: 0 6px;
  }
}

.burger {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.burger:hover {
  background: var(--side-hover);
}

.burger-lines,
.burger-lines::before,
.burger-lines::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.burger-lines {
  position: relative;
}

.burger-lines::before,
.burger-lines::after {
  content: '';
  position: absolute;
  left: 0;
}

.burger-lines::before {
  top: -6px;
}

.burger-lines::after {
  top: 6px;
}

.search {
  position: relative;
  margin: 0 16px 14px;
}

.search-input {
  width: 100%;
  padding: 9px 34px 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--side-text-strong);
  font: inherit;
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
}

.search-input::placeholder {
  color: var(--side-muted);
}

.search-input:focus {
  border-color: var(--coral);
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  box-shadow: var(--focus-ring);
}

.search-input::-webkit-search-cancel-button {
  display: none;
}

.search-hint {
  position: absolute;
  top: 50%;
  right: 10px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  color: var(--side-muted);
  font-size: 11px;
  line-height: 18px;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 50;
  max-height: min(60vh, 460px);
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  border-radius: 12px;
  background: var(--popup-bg);
  box-shadow: var(--shadow-pop);
  list-style: none;
}

.search-result {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}

.search-result:hover,
.search-result.is-active {
  background: var(--popup-hover);
  color: var(--text);
}

.search-result-page {
  display: block;
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 12px;
}

.search-result mark {
  border-radius: 3px;
  background: var(--mark-bg);
  color: inherit;
}

.search-empty {
  padding: 10px;
  color: var(--text-secondary);
  font-size: 14px;
}

@media (max-width: 960px) {
  .search-hint {
    display: none;
  }
}

.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #FFFFFF;
}

.lightbox::backdrop {
  background: rgba(6, 17, 42, 0.94);
}

.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  margin: 0;
  padding: 56px 64px 24px;
}

.lightbox-image {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.lightbox-caption {
  max-width: 72ch;
  color: #E2E8F0;
  font-size: 0.9375rem;
  text-align: center;
}

.lightbox-caption a {
  margin-left: 10px;
  color: #FFA08F;
}

.lightbox-button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  font: inherit;
  font-size: 22px;
  cursor: pointer;
}

.lightbox-button:hover {
  background: var(--coral);
  color: var(--navy);
}

.lightbox-close {
  top: 10px;
  right: 12px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 10px;
}

.lightbox-next {
  right: 10px;
}

@media (max-width: 600px) {
  .lightbox-figure {
    padding: 56px 8px 16px;
  }

  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 12px;
    transform: none;
  }
}
