/* yazyki — «Словарная статья». База: сброс, типографика, сетка, шапка, выдвижное меню, подвал.
   Токены — tokens.css (подключается первым). Медиазапросы только min-width: 768px и 1200px. */

/* ---------- Сброс ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--yz-header-h) + 16px); }
body {
  margin: 0;
  background: var(--yz-bg);
  color: var(--yz-ink);
  font: var(--yz-fw-regular) var(--yz-fs-body)/var(--yz-lh-body) var(--yz-font-body);
  font-variant-numeric: var(--yz-num);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
body.yz-lock { overflow: hidden; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
table { border-collapse: collapse; border-spacing: 0; }
th { text-align: left; font-weight: inherit; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 0; }
summary { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--yz-accent-2); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color var(--yz-t); }
a:hover { color: var(--yz-accent-text); }
:focus-visible { outline: var(--yz-focus-ring); outline-offset: var(--yz-focus-offset); }
b, strong { font-weight: var(--yz-fw-semibold); }

/* ---------- Типографика ---------- */
h1, h2, h3 { font-family: var(--yz-font-heading); font-variant-numeric: var(--yz-num); }
h1 { font-size: var(--yz-fs-h1); line-height: var(--yz-lh-h1); font-weight: var(--yz-fw-black); letter-spacing: var(--yz-ls-h1); }
h2 { font-size: var(--yz-fs-h2); line-height: var(--yz-lh-h2); font-weight: var(--yz-fw-bold); }
h2::before { content: ""; display: block; width: 32px; height: 3px; background: var(--yz-accent); margin-bottom: 12px; } /* красная строка, малая форма */
h3 { font-size: var(--yz-fs-h3); line-height: var(--yz-lh-h3); font-weight: var(--yz-fw-bold); }
h4 { font: var(--yz-fw-semibold) var(--yz-fs-h4)/var(--yz-lh-h4) var(--yz-font-body); }
.yz-lead { font-size: var(--yz-fs-lead); line-height: var(--yz-lh-lead); }
.yz-small { font-size: var(--yz-fs-small); line-height: var(--yz-lh-small); }
.yz-muted { color: var(--yz-muted); }
.yz-mono { font-family: var(--yz-font-mono); font-variant-numeric: var(--yz-num); }
.yz-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.yz-sr::before { display: none; }
.yz-icon { width: var(--yz-icon); height: var(--yz-icon); flex: none; fill: none; stroke: currentColor; stroke-width: var(--yz-icon-stroke); stroke-linecap: square; stroke-linejoin: miter; }
.yz-icon--sm { width: var(--yz-icon-sm); height: var(--yz-icon-sm); }
.yz-icon--lg { width: var(--yz-icon-lg); height: var(--yz-icon-lg); }

/* ---------- Сетка ---------- */
.yz-container { width: 100%; max-width: var(--yz-container); margin: 0 auto; padding: 0 var(--yz-gutter); }
.yz-main { display: block; padding-bottom: var(--yz-section-gap); }
.yz-block { margin-top: var(--yz-section-gap); }
.yz-block__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: var(--yz-s-6); }
.yz-block__head > * { min-width: 0; }
.yz-block__sub { margin-top: 8px; color: var(--yz-muted); max-width: var(--yz-measure); }
.yz-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--yz-gap); }
.yz-grid > * { min-width: 0; grid-column: 1 / -1; }
/* Две колонки «текст и липкая колонка» — обзор, статья, служебная */
.yz-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--yz-gap); }
.yz-layout > * { min-width: 0; }

/* ---------- Шапка ---------- */
.yz-skip { position: absolute; left: 8px; top: -60px; z-index: 70; background: var(--yz-accent-2); color: var(--yz-on-accent-2); padding: 10px 14px; }
.yz-skip:focus { top: 8px; color: var(--yz-on-accent-2); }
.yz-header { position: sticky; top: 0; z-index: var(--yz-z-header); background: var(--yz-bg); border-bottom: var(--yz-rule-red); }
.yz-header__in { display: flex; align-items: center; gap: 16px; height: var(--yz-header-h); }
.yz-logo { display: inline-flex; align-items: center; gap: 8px; color: var(--yz-accent-2); text-decoration: none; flex: none; min-height: 44px; }
.yz-logo:hover { color: var(--yz-accent-2); }
.yz-logo__mark { width: 28px; height: 28px; }
.yz-logo__name { font: var(--yz-fw-black) 22px/1 var(--yz-font-heading); color: var(--yz-ink); }
.yz-nav { display: none; }
.yz-nav__list { display: flex; gap: 20px; }
.yz-nav__link { display: inline-flex; align-items: center; height: 44px; font: var(--yz-fw-medium) 15px/1 var(--yz-font-body); color: var(--yz-ink); text-decoration: none; white-space: nowrap; }
.yz-nav__link:hover, .yz-nav__link[aria-current] { color: var(--yz-ink); text-decoration: underline; text-decoration-color: var(--yz-accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.yz-nav__link[aria-current] { font-weight: var(--yz-fw-semibold); }
.yz-header__tools { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.yz-header .yz-header__cta { display: none; }
.yz-menu-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid var(--yz-line-strong); border-radius: var(--yz-r-1); font: var(--yz-fw-semibold) 15px/1 var(--yz-font-body); color: var(--yz-ink); transition: border-color var(--yz-t), background-color var(--yz-t); }
.yz-menu-btn:hover { border-color: var(--yz-ink); background: var(--yz-surface); }

/* ---------- Выдвижное меню ---------- */
.yz-drawer { position: fixed; inset: 0; z-index: var(--yz-z-drawer); }
.yz-drawer__shade { position: absolute; inset: 0; background: rgba(35, 33, 28, .5); }
.yz-drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: 100%; background: var(--yz-bg); overflow-y: auto; padding: 12px var(--yz-gutter) 32px; display: flex; flex-direction: column; gap: 16px; }
.yz-drawer__top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.yz-drawer__title { font: var(--yz-fw-black) 22px/1 var(--yz-font-heading); }
.yz-drawer__list { border-top: var(--yz-rule-ink); }
.yz-drawer__link { display: flex; align-items: center; min-height: 48px; border-bottom: var(--yz-rule); font: var(--yz-fw-medium) 17px/1.2 var(--yz-font-body); color: var(--yz-ink); text-decoration: none; }
.yz-drawer__link:hover { background: var(--yz-surface); color: var(--yz-ink); }

/* ---------- Подвал ---------- */
.yz-footer { background: var(--yz-accent-2); color: var(--yz-on-accent-2); border-top: var(--yz-rule-red); padding: 40px 0 24px; }
.yz-footer :focus-visible { outline-color: var(--yz-focus-on-dark); }
.yz-footer a { color: var(--yz-on-accent-2); text-decoration: none; }
.yz-footer a:hover { color: var(--yz-on-accent-2); text-decoration: underline; }
.yz-footer__top { display: flex; flex-direction: column; gap: 8px; margin-bottom: 32px; }
.yz-footer__brand { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.yz-footer .yz-logo { color: var(--yz-on-accent-2); }
.yz-footer .yz-logo__name { color: var(--yz-on-accent-2); }
.yz-footer .yz-trans { color: var(--yz-on-accent-2-muted); }
.yz-footer .yz-trans::before, .yz-footer .yz-trans::after { color: var(--yz-on-accent-2); }
.yz-footer__about { max-width: 560px; color: var(--yz-on-accent-2-muted); font-size: 15px; line-height: 1.5; }
.yz-footer__cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px 24px; }
.yz-footer__col { min-width: 0; }
.yz-footer__h { font: var(--yz-fw-semibold) 13px/1.3 var(--yz-font-body); color: var(--yz-on-accent-2-muted); margin-bottom: 8px; }
.yz-footer__h::before { display: none; }
.yz-footer__list--two { columns: 2; column-gap: 24px; }
.yz-footer__list li { break-inside: avoid; }
.yz-footer__list a { display: flex; align-items: center; min-height: 44px; font-size: 15px; line-height: 1.25; }
.yz-footer__bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--yz-line-on-accent-2); display: grid; gap: 12px; font-size: 14px; line-height: 1.45; color: var(--yz-on-accent-2-muted); }
.yz-footer__bottom p { max-width: 880px; }
.yz-footer__bottom a { text-decoration: underline; }
.yz-footer__meta { display: flex; flex-wrap: wrap; gap: 4px 24px; font: 400 13px/1.4 var(--yz-font-mono); }

@media (min-width: 768px) {
  .yz-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .yz-header .yz-header__cta { display: inline-flex; }
  .yz-drawer__panel { width: 360px; border-left: var(--yz-rule-ink); }
  .yz-footer { padding-top: 56px; }
  .yz-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .yz-footer__list a { min-height: 36px; }
}

@media (min-width: 1200px) {
  .yz-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .yz-layout { grid-template-columns: minmax(0, 1fr) var(--yz-aside); }
  .yz-layout__aside { position: sticky; top: calc(var(--yz-header-h) + 24px); align-self: start; }
  .yz-nav { display: block; margin-left: 12px; }
  .yz-menu-btn { display: none; }
  .yz-footer__cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .yz-footer__list--two { columns: 1; }
}
