@font-face {
  font-family: "Golos Text";
  src: url("/assets/fonts/golos-text.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/28px "Golos Text", Arial, sans-serif;
}
h1, h2, h3, p, ul, ol { margin: 0; }
nav ul, nav ol { padding: 0; list-style: none; }
h1, h2 { font-family: var(--heading); font-weight: var(--heading-weight); overflow-wrap: anywhere; }
h1 { font-size: var(--h1-size); line-height: var(--h1-line); letter-spacing: var(--h1-tracking, normal); }
h2 { font-size: var(--h2-size); line-height: var(--h2-line); }
h3 { font-size: 18px; line-height: 26px; font-weight: 600; }
b, strong { font-weight: 600; }
p { overflow-wrap: anywhere; }
img { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--surface); color: var(--accent); }

.small { font-size: 14px; line-height: 20px; color: var(--muted); }
.container { width: min(calc(100% - 32px), 1120px); margin-inline: auto; }
.reading { width: 100%; max-width: 66ch; }

.site-header { border-block-end: 1px solid var(--rule); }
.header-line { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wordmark { font: var(--heading-weight) var(--wordmark-size)/1.28 var(--heading); }
.wordmark, .wordmark a { color: var(--ink); text-decoration: none; }
.wordmark a:focus-visible { display: inline-block; }
.icon-button {
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-chip);
  cursor: pointer;
}
.menu-toggle span { font: 400 27px/1 "Golos Text", sans-serif; }
.desktop-nav { display: none; }
.mobile-menu {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  padding: 0;
  margin: 0;
  overflow: auto;
  border: 0;
  background: var(--bg);
  color: var(--ink);
}
body:has(.mobile-menu[open]) { overflow: hidden; }
.mobile-menu .header-line { border-bottom: 1px solid var(--rule); }
.mobile-menu nav { padding-block: 12px 28px; }
.mobile-menu nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
}
.mobile-menu nav a[aria-current], .mobile-menu nav a:hover { color: var(--accent); }

.rubric-dot { display: inline-block; width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: var(--rubric-color); }
.chip-nav ul { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-chip);
  color: var(--ink);
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
}
.chip:hover { color: var(--accent); }
.chip-short { display: none; }
.chip-nav-scroll { overflow-x: auto; margin-inline: -16px; padding: 4px 16px 10px; scrollbar-color: var(--muted) var(--surface); }
.chip-nav-scroll ul { width: max-content; flex-wrap: nowrap; }

.home, .rubric-page, .error-page, .service-page { padding-block: 34px 60px; }
.home-intro > p, .error-page > p, .rubric-intro > p, .service-page > p { margin-top: 14px; }
.home-intro .chip-nav, .error-page .chip-nav { margin-top: 22px; }
.home-rubric { margin-top: 46px; }
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 18px;
}
.section-heading h2 > a { color: var(--ink); text-decoration: none; }
.section-heading h2 > a:hover { text-decoration: underline; }
.section-heading h2 .rubric-dot { margin-inline-end: 10px; vertical-align: .16em; }
.section-link { color: var(--accent); flex: none; }
.rubric-intro, .error-popular h2 { margin-bottom: 24px; }
.rubric-intro h1 { color: var(--rubric-color); }
.error-popular { margin-top: 42px; }

.cover {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--surface);
}
.cover-portrait { aspect-ratio: 3 / 4; }
.cover img, .cover-art { display: block; width: 100%; height: 100%; object-fit: cover; }
.card { min-width: 0; }
.card > a { display: block; color: var(--ink); text-decoration: none; }
.card > a:hover .card-title { text-decoration: underline; }
.card-label { margin-top: 9px; min-width: 0; }
.card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
}
.card-time { display: block; margin-top: 5px; }
.card-grid, .related-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px 20px; }

.rubric-cards + .ad-slot { margin-block: 28px; }
.ad-slot {
  display: grid;
  place-items: center;
  background: var(--surface);
  min-height: 280px;
}
.ad-rubric { min-height: 250px; }
.pagination ul { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination a, .pagination span {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 4px;
  border-radius: var(--radius-chip);
}
.pagination span { background: var(--accent); color: var(--bg); }

.article-shell { padding-block: 21px 60px; }
.article-main { min-width: 0; }
.breadcrumbs ol { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.breadcrumbs a { color: var(--muted); }
.article-main > h1 { margin-block: 16px 14px; }
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 20px; }
.meta-rubric { font-weight: 600; }
.article-main > .cover { margin-bottom: 18px; }
.article-lead { margin-bottom: 24px; }
.article-lead .reading { max-width: 66ch; }
.article-main > .cover + .ad-slot { margin-top: 24px; }
.article-body { margin-block: 26px; overflow-wrap: anywhere; }
.article-body > * + * { margin-top: 18px; }
.article-body h2:not(:first-child) { margin-top: 28px; }
.article-body h3:not(:first-child) { margin-top: 22px; }
.article-body img { height: auto; max-width: 100%; }
.article-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 12px; }
.article-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-card); }
.article-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.article-body td, .article-body th { border: 1px solid var(--rule); padding: 7px; }
.article-body pre { white-space: pre-wrap; }
.article-body ul, .article-body ol { padding-inline-start: 1.65em; }
.article-body .steps { padding-inline-start: 35px; }
.steps li { padding-inline-start: 4px; }
.steps li + li { margin-top: 12px; }
.steps li::marker { font-size: 24px; font-weight: 600; color: var(--rubric-color); }
.article-faq { margin-block: 26px; padding: 16px; border-radius: var(--radius-card); background: var(--surface); }
.article-faq .article-body { margin: 0; }
.related { margin-top: 38px; }
.related h2 { margin-bottom: 16px; }
.article-sidebar { display: none; }

.site-footer { background: var(--surface); }
.footer-inner { padding-block: 30px; display: grid; gap: 23px; }
.footer-inner ul { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-inner nav a { color: var(--ink); font-size: 14px; line-height: 20px; }

@media (min-width: 600px) {
  .container { width: min(calc(100% - 48px), 1120px); }
  .chip-nav-scroll { margin-inline: 0; padding-inline: 4px; }
  .chip-nav-scroll ul { flex-wrap: wrap; width: auto; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  body { font-size: 18px; line-height: 30px; }
  h1 { font-size: var(--h1-desktop-size); line-height: var(--h1-desktop-line); }
  h2 { font-size: var(--h2-desktop-size); line-height: var(--h2-desktop-line); }
  h3 { font-size: 20px; line-height: 28px; }
  .home, .rubric-page, .error-page, .service-page { padding-block: 48px 76px; }
  .article-shell { padding-block: 27px 76px; }
  .home-rubric { margin-top: 55px; }
}
@media (min-width: 1024px) {
  .menu-toggle, .chip-full { display: none; }
  .chip-short { display: inline; }
  .chip-nav-scroll .chip { padding-inline: 10px; }
  .desktop-nav { display: block; }
  .desktop-nav ul { display: flex; flex-wrap: wrap; gap: 0 clamp(12px, 1.7vw, 25px); }
  .desktop-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 1px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    border-block-end: 2px solid transparent;
  }
  .desktop-nav a:hover, .desktop-nav a.active { color: var(--accent); border-block-end-color: var(--accent); }
  .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .article-shell {
    display: grid;
    grid-template-columns: minmax(0, 680px) 300px;
    align-items: stretch;
    gap: clamp(32px, 5vw, 64px);
  }
  .article-sidebar { display: block; padding-top: 56px; }
  .sidebar-links { display: grid; gap: 3px; margin-block: 12px 26px; }
  .sidebar-links a { display: flex; gap: 10px; align-items: center; min-height: 35px; color: var(--ink); font-size: 15px; line-height: 22px; text-decoration: none; }
  .sidebar-links a:hover { text-decoration: underline; }
  .ad-sidebar { position: sticky; top: 24px; width: 300px; min-height: 600px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto; animation: none; transition: none; }
}
