/* SternMeister Blog — стили темы.
   Бренд: зелёный #004b2b, графит #292c29, тёплый светлый фон #efede7, Montserrat для заголовков. */

:root {
  --green: #004b2b;
  --green-dark: #00351f;
  --green-soft: #e4efe8;
  --ink: #292c29;
  --ink-2: #4b4f4b;
  --muted: #7a7f7a;
  --paper: #ffffff;
  --paper-2: #f6f4ef;
  --sand: #efede7;
  --line: #e2e0d9;
  --accent: #c9a227;
  --radius: 10px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Montserrat", var(--font-body);
  --wrap: 1180px;
  --narrow: 720px;
  --wide: 1000px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--green-dark); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; color: var(--ink); text-wrap: balance; margin: 0; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--green); color: #fff; padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap--narrow { max-width: var(--narrow); }
.wrap--wide { max-width: var(--wide); }

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); backdrop-filter: saturate(150%) blur(6px); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 68px; }
.site-header__brand { color: var(--green); display: inline-flex; align-items: center; }
.site-header__brand:hover { color: var(--green-dark); }
.site-header__logo { height: 26px; width: auto; display: block; }
.site-header__logo-text { font-family: var(--font-head); font-weight: 700; font-size: 20px; }
.site-nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; align-items: center; }
.site-nav__list a { display: inline-block; padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 500; font-size: 15px; }
.site-nav__list a:hover { background: var(--paper-2); color: var(--green-dark); }
.site-nav__list .is-cta > a { background: var(--green); color: #fff; }
.site-nav__list .is-cta > a:hover { background: var(--green-dark); }
.site-header__toggle { display: none; width: 44px; height: 44px; border: 0; background: none; padding: 10px; cursor: pointer; flex-direction: column; justify-content: center; gap: 5px; }
.site-header__toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
@media (max-width: 840px) {
  .site-header__toggle { display: flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 68px; background: #fff; border-bottom: 1px solid var(--line); padding: 12px 20px 20px; }
  .site-nav.is-open { display: block; }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-nav__list a { display: block; padding: 12px; border-radius: 8px; font-size: 17px; }
  .site-header__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .site-header__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .site-header__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ── Hero / archive ──────────────────────────────────────────────────────── */
.hero { padding: 56px 20px 28px; }
.hero__kicker { margin: 0 0 8px; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; font-weight: 600; color: var(--green); }
.hero__title { font-size: clamp(30px, 4.5vw, 44px); }
.hero__lead { margin: 12px 0 0; max-width: 60ch; font-size: 19px; color: var(--ink-2); }
.hero__job { margin: 6px 0 0; color: var(--green); font-weight: 600; }
.hero--author { display: flex; gap: 28px; align-items: flex-start; }
.hero__avatar { width: 128px; height: 128px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; padding-bottom: 48px; }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.card { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: 0 10px 30px -14px rgba(0,0,0,.25); transform: translateY(-2px); }
.card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--sand); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__kicker { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--green); font-weight: 600; }
.card__title { font-size: 20px; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--green-dark); }
.card__excerpt { margin: 0; color: var(--ink-2); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__meta { margin: auto 0 0; padding-top: 8px; font-size: 13px; color: var(--muted); display: flex; gap: 8px; }

.pagination { padding: 0 0 56px; }
.pagination .nav-links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pagination .page-numbers { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); }
.pagination .page-numbers.current { background: var(--green); color: #fff; border-color: var(--green); }

/* ── Article ─────────────────────────────────────────────────────────────── */
.article__header { padding: 48px 20px 24px; }
.article__breadcrumbs { margin: 0 0 14px; font-size: 14px; color: var(--muted); display: flex; gap: 8px; }
.article__breadcrumbs a { color: var(--muted); text-decoration: none; }
.article__breadcrumbs a:hover { color: var(--green); }
.article__title { font-size: clamp(28px, 4vw, 40px); }
.article__lead { margin: 16px 0 0; font-size: 20px; line-height: 1.5; color: var(--ink-2); }
.article__meta { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; font-size: 14px; color: var(--muted); }
.article__author { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.article__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.avatar--initial { display: inline-flex; align-items: center; justify-content: center; background: var(--green-soft); color: var(--green); font-weight: 700; font-family: var(--font-head); }
/* Редакция: логотип в плашке, а не портрет в круге.
   Размеры заданы жёстко, а не по содержимому: иначе плашка меняет ширину в момент
   загрузки SVG и страница дёргается (CLS). */
.avatar--org { display: inline-flex; align-items: center; justify-content: center; background: var(--green-soft); border-radius: 8px; flex: 0 0 auto; }
.avatar--org img { display: block; width: 100%; height: auto; color: var(--green); }
.article__avatar.avatar--org { width: 118px !important; height: 40px !important; border-radius: 8px; padding: 0 12px; }
.author-box__avatar.avatar--org { width: 152px !important; height: 52px !important; border-radius: 10px; padding: 0 16px; }
.hero__avatar.avatar--org { width: 200px !important; height: 68px !important; border-radius: 12px; padding: 0 22px; }
.article__cover { margin: 8px auto 32px; }
.article__cover img { width: 100%; border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; }
.article__cover figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.article__layout { display: grid; grid-template-columns: minmax(0, var(--narrow)); justify-content: center; padding-bottom: 48px; }

.prose { font-size: 18px; line-height: 1.7; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 26px; margin-top: 2em; }
.prose h3 { font-size: 21px; margin-top: 1.6em; }
.prose p { margin: 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose blockquote { margin: 1.4em 0; padding: 12px 20px; border-left: 4px solid var(--green); background: var(--paper-2); border-radius: 0 8px 8px 0; color: var(--ink-2); }
.prose figure { margin: 1.6em 0; }
.prose figure img, .prose > img { border-radius: var(--radius); }
.prose figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--paper-2); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose code { background: var(--paper-2); padding: .1em .35em; border-radius: 4px; font-size: .92em; }
.prose .wp-caption { max-width: 100%; }

.toc { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; }
.toc__title { margin: 0 0 8px; font-family: var(--font-head); font-weight: 600; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--green); }
.toc__list { margin: 0; padding-left: 1.3em; font-size: 16px; }
.toc__item + .toc__item { margin-top: 4px; }
.toc__item--h3 { list-style: none; padding-left: 1em; font-size: 15px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.faq { margin-top: 2.4em; }
.faq__title { font-size: 26px; margin-bottom: .6em; }
.faq__item { border-top: 1px solid var(--line); }
.faq__item:last-child { border-bottom: 1px solid var(--line); }
.faq__q { cursor: pointer; padding: 16px 32px 16px 0; font-weight: 600; font-family: var(--font-head); font-size: 17px; list-style: none; position: relative; }
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 24px; color: var(--green); font-weight: 400; }
.faq__item[open] .faq__q::after { content: "–"; }
.faq__a { padding: 0 0 18px; color: var(--ink-2); font-size: 17px; }
.faq__a > * + * { margin-top: .8em; }

.sources { margin-top: 2.4em; font-size: 15px; color: var(--ink-2); }
.sources__title { font-size: 20px; margin-bottom: .5em; }
.sources__list { margin: 0; padding-left: 1.4em; }
.sources__list li + li { margin-top: .3em; }
.sources a { word-break: break-word; }

.cta { margin-top: 2.6em; background: var(--green); color: #fff; border-radius: var(--radius); padding: 28px 28px 26px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.cta__body { flex: 1 1 320px; }
.cta__title { margin: 0; font-family: var(--font-head); font-weight: 600; font-size: 22px; color: #fff; }
.cta__text { margin: 8px 0 0; color: rgba(255,255,255,.85); font-size: 16px; }
.cta__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button { display: inline-block; padding: 12px 20px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 15px; line-height: 1.2; border: 2px solid transparent; cursor: pointer; }
.button--primary { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.button--primary:hover { background: #d9b23a; border-color: #d9b23a; color: var(--ink); }
.button--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.button--ghost:hover { border-color: #fff; color: #fff; }
.hero .button--primary { background: var(--green); color: #fff; border-color: var(--green); }

.author-box { margin-top: 2.4em; display: flex; gap: 20px; align-items: flex-start; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); }
.author-box__avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; font-size: 32px; }
.author-box__name { margin: 0; font-family: var(--font-head); font-weight: 600; font-size: 18px; }
.author-box__name a { color: var(--ink); text-decoration: none; }
.author-box__job { margin: 2px 0 0; color: var(--green); font-size: 14px; font-weight: 600; }
.author-box__bio { margin: 10px 0 0; font-size: 15px; color: var(--ink-2); }

.related { padding-top: 24px; border-top: 1px solid var(--line); }
.related__title { font-size: 24px; margin-bottom: 20px; }

.search { display: flex; gap: 10px; max-width: 520px; margin-top: 20px; }
.search input { flex: 1; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; font: inherit; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer { background: var(--sand); margin-top: 48px; color: var(--ink-2); font-size: 15px; }
.site-footer__inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; padding-top: 44px; padding-bottom: 24px; }
.site-footer__brand { margin: 0 0 8px; font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--green); }
.site-footer__heading { margin: 0 0 10px; font-weight: 600; color: var(--ink); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: 6px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--green); text-decoration: underline; }
.site-footer__bottom { border-top: 1px solid rgba(0,0,0,.08); padding-top: 16px; padding-bottom: 28px; font-size: 13px; color: var(--muted); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .prose { font-size: 17px; }
  .hero { padding-top: 36px; }
  .hero--author { flex-direction: column; }
  .cta { padding: 22px 20px; }
  .author-box { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .site-header__toggle span { transition: none; }
}
