/* SimpleSchool — офіційна сіра тема */
:root {
  --bg: #eceef0;
  --surface: #ffffff;
  --surface-2: #f5f6f7;
  --ink: #1d2125;
  --ink-2: #3a4047;
  --muted: #646b73;
  --line: #d3d7db;
  --line-strong: #b5bbc1;
  --graphite: #2b2f34;
  --graphite-2: #363b41;
  --graphite-3: #4a5058;
  --on-dark: #e9ecef;
  --on-dark-muted: #a9b0b7;
  --accent: #5b6570;
  --focus: #8a96a3;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(20, 24, 28, .06), 0 8px 24px rgba(20, 24, 28, .08);
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --sans: "PT Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --wrap: 1140px;
  --measure: 760px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; }

a { color: var(--ink-2); }
a:focus-visible, .nav__btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 768px) { .wrap { padding: 0 32px; } }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--surface); color: var(--ink); padding: 8px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.skip-link:focus { top: 8px; }

/* ── Верхня смуга: дата + мови ───────────────────────── */
.topbar {
  background: var(--graphite);
  color: var(--on-dark-muted);
  font-size: 14px;
  border-bottom: 1px solid #1f2226;
}
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 40px;
}
.topbar__date { margin: 0; }
.topbar__label { margin-right: 4px; }
.topbar time { color: var(--on-dark); font-weight: 700; }

.langs { display: flex; gap: 4px; }
.langs__link {
  display: inline-block; min-width: 38px; text-align: center;
  padding: 3px 8px; border-radius: var(--radius);
  color: var(--on-dark-muted); text-decoration: none;
  font-weight: 700; letter-spacing: .04em; font-size: 13px;
  border: 1px solid transparent;
}
.langs__link:hover { color: var(--on-dark); border-color: var(--graphite-3); }
.langs__link.is-active { background: var(--on-dark); color: var(--graphite); }

/* ── Шапка ───────────────────────────────────────────── */
.site-header {
  background: var(--graphite-2);
  color: var(--on-dark);
  border-bottom: 3px solid var(--graphite-3);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px 24px; padding-top: 18px; padding-bottom: 18px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand__mark { display: block; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-family: var(--serif); font-weight: 700; font-size: 24px; letter-spacing: .01em; color: var(--on-dark); }
.brand__tag { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--on-dark-muted); margin-top: 3px; }

.nav { display: flex; flex-wrap: wrap; gap: 8px; }
.nav__btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px;
  border: 1px solid var(--graphite-3);
  border-radius: var(--radius);
  background: var(--graphite);
  color: var(--on-dark);
  font-family: var(--sans); font-size: 15px; font-weight: 700;
  letter-spacing: .02em; text-decoration: none; line-height: 1.2;
  transition: background-color .15s ease, border-color .15s ease;
}
a.nav__btn:hover { background: var(--graphite-3); border-color: var(--on-dark-muted); }
/* «Інші матеріали» — виглядає як кнопка, але без посилання */
.nav__btn--static { cursor: default; user-select: none; }

@media (max-width: 560px) {
  .nav { width: 100%; }
  .nav__btn { flex: 1 1 auto; padding: 9px 10px; font-size: 14px; }
}

/* ── Hero ────────────────────────────────────────────── */
.article { background: var(--surface); border-bottom: 1px solid var(--line); }

.hero {
  display: grid; gap: 28px;
  padding-top: 36px; padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-top: 56px; padding-bottom: 56px; }
}

.hero__title {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(30px, 4.6vw, 48px); line-height: 1.15;
  margin: 0 0 18px; color: var(--ink); letter-spacing: -.005em;
}
.hero__meta {
  display: inline-flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 22px; padding: 6px 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 14px; color: var(--muted);
}
.hero__meta time { color: var(--ink-2); font-weight: 700; }
.hero__lead {
  margin: 0; padding-left: 18px; border-left: 4px solid var(--line-strong);
  font-family: var(--serif); font-size: 20px; line-height: 1.55; color: var(--ink-2);
}

/* ── Рамки для зображень ─────────────────────────────── */
.frame {
  margin: 0;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.frame img {
  display: block;
  width: 100%;
  height: auto;            /* пропорції з атрибутів width/height — без розтягування */
  object-fit: contain;
  object-position: center;
  background: var(--surface-2);
  outline: 1px solid var(--line);
  outline-offset: -1px;
}
.frame--cover { width: 100%; max-width: 440px; justify-self: center; }
.frame--cover img { aspect-ratio: 1200 / 1228; }
.frame--wide { margin: 36px auto; }
.frame--wide img { aspect-ratio: 16 / 9; }

/* ── Текст статті ────────────────────────────────────── */
.article__body {
  max-width: calc(var(--measure) + 64px);
  padding-top: 36px; padding-bottom: 56px;
  font-family: var(--serif); font-size: 18.5px; line-height: 1.75; color: var(--ink);
}
.article__body p { margin: 0 0 1.15em; }
.article__body h2 {
  font-family: var(--serif); font-size: clamp(24px, 3vw, 30px); line-height: 1.25;
  margin: 1.8em 0 .7em; padding-bottom: .35em;
  border-bottom: 1px solid var(--line); color: var(--ink);
}

.quote {
  margin: 1.6em 0; padding: 22px 24px 20px 28px;
  background: var(--surface-2);
  border: 1px solid var(--line); border-left: 5px solid var(--graphite-3);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.quote p { margin: 0 0 .6em; font-style: italic; font-size: 19.5px; color: var(--ink-2); }
.quote__cite { font-family: var(--sans); font-size: 15px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }

.list { margin: 0 0 1.4em; padding: 0; list-style: none; }
.list li {
  position: relative; margin: 0 0 .7em; padding: 12px 16px 12px 44px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.list li::before {
  content: ""; position: absolute; left: 18px; top: 1.15em;
  width: 10px; height: 10px; background: var(--graphite-3); transform: rotate(45deg);
}

@media (max-width: 560px) {
  .article__body { font-size: 17px; }
  .hero__lead { font-size: 18px; }
  .quote { padding: 16px 16px 14px 18px; }
  .quote p { font-size: 18px; }
  .frame { padding: 6px; }
  .frame--wide { margin: 28px auto; }
}

/* ── Футер ───────────────────────────────────────────── */
.site-footer {
  background: var(--graphite);
  color: var(--on-dark-muted);
  font-size: 15.5px;
  scroll-margin-top: 0;
}
.site-footer__grid {
  display: grid; gap: 28px; padding-top: 44px; padding-bottom: 28px;
}
@media (min-width: 800px) { .site-footer__grid { grid-template-columns: 2fr 1fr; gap: 56px; } }

.brand--footer { margin-bottom: 14px; }
.brand--footer .brand__name { font-size: 22px; }
.site-footer__title {
  margin: 0 0 10px; font-family: var(--sans); font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em; color: var(--on-dark);
}
.site-footer__about p, .site-footer__contacts p { margin: 0; max-width: 62ch; }
.site-footer__label { font-size: 14px; }
.site-footer__mail { color: var(--on-dark); font-weight: 700; font-size: 17px; text-decoration: none; border-bottom: 1px solid var(--graphite-3); word-break: break-all; }
.site-footer__mail:hover { border-bottom-color: var(--on-dark-muted); }

.nav--footer { padding: 18px 0 22px; border-top: 1px solid var(--graphite-2); }

.site-footer__bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 20px; padding-top: 16px; padding-bottom: 22px;
  border-top: 1px solid var(--graphite-2); font-size: 14px;
}
.site-footer__bottom p { margin: 0; }
.langs--footer .langs__link { min-width: 0; font-weight: 400; letter-spacing: 0; font-size: 14px; }
