/* ==========================================================================
   Елена Масолова — главная. Десктоп, первая версия макета.
   Палитра: тёплый светло-бежевый фон, темно-графитовый текст.
   Акцент = полужирный вес, без цветов. На hover — подчёркивание.
   ========================================================================== */

:root {
  /* Палитра: тёплый бежевый фон + графит */
  --bg:        #fbfaf4;   /* фон */
  --bg-soft:   #f2f0e7;   /* чуть темнее, для разделителей */
  --text:      #000000;   /* основной текст — чистый чёрный */
  --muted:     #8a877e;   /* приглушённый (счётчики, подписи) */
  --accent:    #1f1f1e;   /* акцент — графит, тот же что текст */
  --accent-2:  #1f1f1e;   /* hover — тот же цвет */
  --rule:      #e8e5da;   /* тонкая линия */
  --pill:       rgba(31,31,30,.06);       /* фон пилюли с числом */
  --pill-hover: rgba(31,31,30,.12);       /* пилюля при hover */

  --serif:  'IBM Plex Serif', Georgia, 'Times New Roman', serif;
  --sans:   'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;

  --container: 1120px;
}

/* reset-lite */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
ul { margin: 0; padding: 0; list-style: none; }
/* Ссылки по-умолчанию: графит, полужирные, без подчёркивания */
a { color: var(--text); text-decoration: none; font-weight: 600; }
a:hover { color: var(--text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  max-width: var(--container);
  margin: 0 auto;
  padding: 40px 56px 80px;
}

/* ---------- Язык-переключатель: dropdown с выбранным флагом ---------- */
.lang {
  position: relative;
  margin-left: 24px;
  padding-left: 20px;
  border-left: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
}
.lang__current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 10px;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 4px;
}
.lang__current:hover { background: var(--bg-soft); }
.lang__flag { font-size: 15px; line-height: 1; }
.lang__chev {
  display: inline-block;
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  margin-left: 2px;
  transition: transform .2s ease;
}
.lang.is-open .lang__chev { transform: translateY(1px) rotate(-135deg); }
.lang__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.06);
  padding: 6px;
  display: none;
  z-index: 20;
}
.lang.is-open .lang__menu { display: block; }
.lang__menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  border-radius: 5px;
  text-decoration: none;
}
.lang__menu a:hover { background: var(--bg-soft); }
.lang__menu a.is-active { background: var(--bg-soft); font-weight: 700; }

/* Блок справа: навигация + язык */
.top-right { display: flex; align-items: center; gap: 0; }

/* ---------- Top bar ---------- */
.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}
.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  letter-spacing: 0.2px;
}
.brand:hover { color: var(--text); text-decoration: none; }

.top-nav {
  display: flex;
  gap: 28px;
}
.top-nav a {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--text);
  border-bottom: 1px dotted transparent;
  padding-bottom: 2px;
}
.top-nav a:hover {
  color: var(--accent);
  text-decoration: none;
  border-bottom-color: var(--accent);
}

/* Эмодзи в десктопной шапке (видны рядом с текстом ссылок-хайлайтов) */
.top-nav a .emo-d {
  display: inline;
  font-style: normal;
}

/* ---------- Хайлайты-полоска под шапкой (только мобилка) ---------- */
.hl-mobile { display: none !important; }

/* ---------- Bio ---------- */
.bio {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: start;
  padding: 40px 0 36px;
  border-bottom: 1px solid var(--rule);
}
.bio__photo img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.bio__text h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.1;
  margin: 2px 0 16px;
  color: var(--text);
}
/* Компактный блок био */
.bio__body p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.35;
  margin: 0 0 4px;
  color: var(--text);
}
.bio__body p:last-child { margin-bottom: 0; }

/* Ссылки внутри био — обычный вес, чёрное подчёркивание */
.bio__body a {
  color: #1f1f1e;
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-color: #1f1f1e;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  border-bottom: 0;
  padding-bottom: 0;
}
.bio__body a:hover {
  color: #1f1f1e;
  text-decoration-thickness: 2px;
}

.emo {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 16px;
  vertical-align: -2px;
  margin: 0 2px;
}

/* Стрелка SVG stroke 2 */
.arrow {
  display: inline-block;
  vertical-align: -2px;
  margin: 0 4px;
  color: #1f1f1e;
}
.arrow svg { width: 22px; height: 12px; display: block; }

/* Соцссылки в био: 18px serif, полужирные, без подчёркивания */
.bio__socials {
  display: flex;
  gap: 28px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.bio__socials a {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: #1f1f1e;
  text-decoration: none;
  border-bottom: 0;
  padding-bottom: 0;
}
.bio__socials a:hover {
  color: #1f1f1e;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Легаси-классы из v14 — оставляю для совместимости, но на главной не используются */
.bio__lead {
  font-size: 19px;
  line-height: 1.55;
  margin: 0 0 18px;
  max-width: 640px;
}
.bio__list {
  font-size: 17px;
  line-height: 1.6;
  max-width: 640px;
}
.bio__list li {
  padding-left: 18px;
  position: relative;
  margin-bottom: 6px;
}
.bio__list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--muted);
}

/* ---------- Main: sidebar + posts ---------- */
.main {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 72px;
  padding-top: 28px;
}

/* Sidebar / tags — вертикальный список, тег + «пилюля» с числом после слова */
.tags__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.tags__list li { margin: 0; display: block; }
.tags__list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.3;
  font-weight: 400;
}
@media (hover: hover) {
  .tags__list a:hover {
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
  }
  .tags__list a:hover .count {
    background: var(--pill-hover, rgba(200,69,43,.12));
    color: var(--accent);
  }
}
.tags__list .count {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--pill, rgba(138,130,119,.15));
  padding: 2px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  transition: background .15s, color .15s;
}
/* На десктопе JS-fit не работает — «Все посты» прячем, все теги видны. */
.tags__list .tags__more { display: none !important; }
.tags__list .tags__overflow { display: block; }

/* Posts list — минимализм в духе Пола Грэма, но современный */
.posts__list {
  max-width: 640px;
}
.posts__list li {
  padding: 0;
  margin: 0;
}
.posts__list a {
  display: block;
  padding: 12px 0;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.4;
  color: var(--text);
  font-weight: 400;
  border-bottom: 1px solid var(--rule);
}
.posts__list li:first-child a { padding-top: 0; border-top: 0; }
.posts__list a:hover {
  color: var(--accent);
  text-decoration: none;
  background: transparent;
}

/* Pin: закреплённый пост отмечается закрашенной чёрной звездой слева.
   Используем SVG-фон вместо Unicode ★, чтобы рисунок был одинаковым во всех браузерах
   (без системных emoji-вариантов). */
.posts__list li.is-pinned { position: relative; }
.posts__list li.is-pinned > a { padding-left: 24px; }
/* Звезда позиционируется от верха бокса на 0.5em (по центру первой строки текста).
   font-size 20px × line-height 1.4 = 28px, середина базлайна в ~14px от верха строки. */
.posts__list li.is-pinned > a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 19px; /* padding-top 12px + 7px (половина высоты звезды), выравнивая по центру строки */
  width: 14px;
  height: 14px;
  background: no-repeat center/contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231f1f1e'><path d='M12 2l2.9 6.9 7.5.6-5.7 4.9 1.8 7.3L12 17.8 5.5 21.7l1.8-7.3L1.6 9.5l7.5-.6L12 2z'/></svg>");
}
/* У первого <a> нет padding-top — сверху сразу текст. Поднимаем звезду. */
.posts__list li.is-pinned:first-child > a::before {
  top: 7px;
}

/* ==========================================================================
   Варианты пометки ссылок на посты (лента главной). Применять на <ul>
   через модификатор: posts__list--arrow / --preview / --meta
   ========================================================================== */

/* Вариант 1: стрелка в конце + подсветка при hover.
   Структура: <a><span class="title">…</span></a>
   .title — flex item с min-width:0 и ellipsis; ::after — стрелка с flex-shrink:0.
   Длинные титлы обрезаются в одну строку, стрелка остаётся справа за словом. */
.posts__list--arrow a {
  display: flex;
  align-items: baseline;
  min-width: 0;
  transition: color .15s ease;
}
.posts__list--arrow a > .title {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.posts__list--arrow a::after {
  content: "\00a0→";
  color: var(--muted);
  opacity: .6;
  flex-shrink: 0;
  transition: transform .15s ease, opacity .15s ease, color .15s ease;
}
.posts__list--arrow a:hover {
  color: var(--accent);
}
.posts__list--arrow a:hover::after {
  color: var(--accent);
  opacity: 1;
  transform: translateX(3px);
}

/* Вариант 2: превью-строка (дек) под заголовком + hover-подсветка */
.posts__list--preview a {
  display: block;
  padding: 14px 0;
}
.posts__list--preview .p-title {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.35;
  color: var(--text);
  font-weight: 400;
  transition: color .15s ease;
}
.posts__list--preview .p-dek {
  display: block;
  margin-top: 4px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.posts__list--preview a:hover .p-title { color: var(--accent); }
.posts__list--preview a:hover .p-dek   { color: var(--text); }

/* Вариант 3: дата/тег слева от заголовка */
.posts__list--meta a {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: baseline;
  gap: 20px;
}
.posts__list--meta .p-meta {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.posts__list--meta .p-title {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.35;
  color: var(--text);
  transition: color .15s ease;
}
.posts__list--meta a:hover .p-title { color: var(--accent); }

/* ---------- Footer ---------- */
.foot {
  margin-top: 80px;
  padding: 22px 0 36px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
}
.foot p { margin: 0; }
.foot__email {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  text-decoration: none;
  transition: color .15s ease;
}
.foot__email:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* ==========================================================================
   Страница тега: заголовок фильтра + крестик сброса
   ========================================================================== */
.filter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 40px 0 28px;
  border-bottom: 1px solid var(--rule);
}
.filter__label {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.filter__value {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.filter__reset {
  margin-left: 6px;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--pill);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px; line-height: 1;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.filter__reset:hover {
  background: var(--pill-hover);
  color: var(--accent);
  text-decoration: none;
}

/* Активный тег в сайдбаре: цвет акцентом + чуть крупнее и жирнее */
.tags__list a.is-active {
  color: var(--accent);
  font-size: 17px;
  font-weight: 700;
}
.tags__list a.is-active .count {
  background: var(--pill-hover);
  color: var(--accent);
  font-size: 12px;
}

/* ==========================================================================
   Страница статьи: узкая колонка по центру, без сайдбара
   ========================================================================== */
.article {
  max-width: 680px;
  margin: 0 auto;
  padding: 64px 0 0;
}
.article__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 40px;
  line-height: 1.15;
  margin: 0 0 40px;
  text-align: center;
  letter-spacing: -0.01em;
}
.article__body {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
  color: var(--text);
}
/* Вертикальный ритм: каждый блок отделён от соседнего сверху */
.article__body > * { margin: 0; }
.article__body > * + * { margin-top: 1.4em; }
/* Подзаголовок вида <p><strong>…:</strong></p> + список — сжимаем отступ */
.article__body > p + ul,
.article__body > p + ol { margin-top: 0.6em; }
.article__body h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.25;
  margin-top: 2.2em;
}
.article__body h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.3;
  margin-top: 2em;
}
.article__body ul, .article__body ol {
  padding-left: 1.4em;
}
.article__body ul li, .article__body ol li {
  margin-bottom: 6px;
}
.article__body ul { list-style: disc; }
.article__body ol { list-style: decimal; }
/* Вложенные списки внутри li — разумный отступ */
.article__body li > ul,
.article__body li > ol { margin-top: 0.4em; margin-bottom: 0.4em; }
.article__body strong { font-weight: 700; }

/* Callout — выделенный блок (примечание/обновление).
   Вариант D: золотая акцентная граница + светло-золотой фон. */
.article__body .callout {
  border-left: 3px solid #c19a3e;
  background: #fbf6e8;
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
  font-size: 0.95em;
  color: #4a3d1a;
}
/* Вариант D — без иконки (золотая граница уже задаёт акцент). */
.article__body em { font-style: italic; }
.article__body s { text-decoration: line-through; text-decoration-thickness: 1px; }
.article__body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.article__body a:hover { color: var(--accent-2); }

/* Snitch — один элемент внутри буллета, разный layout для десктопа/мобайла.
   Десктоп: float справа в <li>, высота ~118px, текст обтекает.
   Мобайл: display:block выше текста буллета, по центру, ~50% ширины. */
.article__body .snitch {
  float: right;
  width: 140px;
  height: 118px;
  margin: 0 0 12px 24px;
  color: var(--text);
  pointer-events: none;
  shape-outside: margin-box;
}
.article__body .snitch svg {
  width: 100%;
  height: 100%;
  display: block;
}
@media (max-width: 720px) {
  .article__body .snitch {
    float: none;
    display: block;
    width: 50%;
    max-width: 180px;
    height: auto;
    aspect-ratio: 140 / 118;
    margin: 8px auto 16px;
  }
  /* На мобилке буллет со снитчем — картинка сверху, маркер «•» рядом с кружком
     выглядит странно — прячем маркер, выравниваем текст по другим буллетам. */
  .article__body li:has(> .snitch) {
    list-style: none;
  }
}
.article__body blockquote {
  border-left: 3px solid var(--rule);
  padding-left: 20px;
  color: var(--muted);
  font-style: italic;
}
.article__body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 32px auto;
  border-radius: 4px;
}
/* Высокие картинки (вертикальные/квадратные) — ограничиваем по высоте,
   горизонтальные (aspect-ratio > 1.1) остаются в полную ширину колонки. */
.article__body img[data-orient="portrait"] {
  max-width: 55%;
  max-height: 70vh;
  object-fit: contain;
}
.article__body figure { margin: 32px 0; }
.article__body figure figcaption {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}
.article__body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--pill);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* CTA-подписки на email (в конце статьи) — форма с полем */
.cta {
  max-width: 680px;
  margin: 64px auto 0;
  padding: 28px 32px;
  background: var(--bg-soft);
  border-radius: 6px;
  text-align: center;
}
.cta__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  margin: 0 0 8px;
}
.cta__title-short { display: none; }
.cta__text {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 18px;
}
.cta__form {
  display: flex;
  gap: 8px;
  max-width: 440px;
  margin: 0 auto;
}
.cta__form input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--rule);
  background: var(--bg);
  padding: 10px 14px;
  border-radius: 5px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  outline: none;
}
.cta__form input:focus { border-color: var(--accent); }
.cta__form button {
  flex: 0 0 auto;
  border: 0;
  background: var(--text);
  color: #fff;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 5px;
  cursor: pointer;
  transition: background .15s;
}
.cta__form button:hover { background: #000; }

/* «Похожие статьи» — идут сразу после текста, без большого отступа и разделителя */
.related {
  max-width: 680px;
  margin: 56px auto 0;
}
.related__title {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}
.related__list { }
.related__list li { margin: 0; }
.related__list a {
  display: block;
  padding: 14px 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.4;
  color: var(--text);
  border-bottom: 1px solid var(--rule);
  transition: color .15s ease;
}
.related__list li:first-child a { border-top: 1px solid var(--rule); }
.related__list a::after {
  content: "\00a0→";
  color: var(--muted);
  opacity: .6;
  display: inline-block;
  transition: transform .15s ease, opacity .15s ease, color .15s ease;
}
.related__list a:hover { color: var(--accent); text-decoration: none; }
.related__list a:hover::after { color: var(--accent); opacity: 1; transform: translateX(3px); }

/* ==========================================================================
   Страница 404
   ========================================================================== */
.err {
  max-width: 560px;
  margin: 0 auto;
  padding: 120px 0;
  text-align: center;
}
.err__code {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 96px;
  line-height: 1;
  color: var(--accent);
  margin: 0 0 16px;
}
.err__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 28px;
  color: var(--text);
  margin: 0 0 32px;
}
.err__text {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 28px;
}
.err__back {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
}
.err__back:hover { background: var(--accent-2); color: #fff; text-decoration: none; }

/* ==========================================================================
   v7 — Новые элементы: бургер, CTA-полоса, раскрывающиеся теги, bio more
   На десктопе большинство скрыто. На мобильном включается через @media.
   ========================================================================== */

/* Бургер в шапке — только на мобильном */
.top-burger { display: none; }

/* Раскрывающиеся элементы в bio — на десктопе развёрнуто, кнопки нет */
.bio__more { display: none; }

/* Заголовок тегов и кнопка-тогглер */
.tags__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.tags__head .tags__title { margin: 6px 0 0; }
/* Ссылка «Все посты» / «All topics» — в конце облака тегов.
   Добавляется через JS, выглядит как обычный тег, но приглушён. */
.tags__toggle {
  color: var(--muted);
  border-bottom-color: var(--muted) !important;
  cursor: pointer;
}
@media (hover: hover) {
  .tags__toggle:hover { color: var(--accent); border-bottom-color: var(--accent) !important; }
}

/* Правила для облака тегов на мобайле (скрытые теги + разделитель) живут в медиа-блоке (max-width:800px) ниже. */

/* CTA-полоса — только на мобильном */
.cta-strip { display: none; }

/* CTA в сайдбаре (десктоп) — акцентная карточка, вариант A */
.sidebar-cta {
  margin-top: 32px;
  padding: 22px 20px 20px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--text);
  border-radius: 0;
  max-width: 260px;
}
.sidebar-cta__kicker {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 10px;
}
.sidebar-cta__title {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 8px;
  color: var(--text);
}
.sidebar-cta__label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.sidebar-cta__text {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 12px;
}
.sidebar-cta input {
  display: block;
  width: 100%;
  border: 1px solid var(--rule);
  background: var(--bg);
  padding: 8px 10px;
  border-radius: 5px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text);
  outline: none;
  margin-bottom: 8px;
}
.sidebar-cta input:focus { border-color: var(--accent); }
.sidebar-cta button {
  display: block;
  width: 100%;
  border: 0;
  background: var(--text);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: 5px;
  cursor: pointer;
}
.sidebar-cta button:hover { background: var(--accent); }

/* CTA-полоса между bio и main (десктоп), вариант B */
.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin: 36px 0 8px;
  padding: 22px 28px;
  background: var(--bg-soft);
  border-radius: 6px;
}
.cta-band__text { max-width: 420px; }
.cta-band__title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
}
.cta-band__hint {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.cta-band__form { display: flex; gap: 8px; flex: 0 0 auto; }
.cta-band__form input {
  border: 1px solid var(--rule);
  background: var(--bg);
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  border-radius: 5px;
  min-width: 240px;
  outline: none;
}
.cta-band__form input:focus { border-color: var(--text); }
.cta-band__form button {
  border: 0;
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  border-radius: 5px;
  cursor: pointer;
}
.cta-band__form button:hover { background: #000; }

/* CTA-секция перед футером (десктоп), вариант C */
.cta-footer {
  margin: 48px 0 24px;
  padding: 44px 56px;
  background: var(--bg-soft);
  border-radius: 8px;
  text-align: center;
}
.cta-footer__title {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
}
.cta-footer__hint {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 20px;
}
.cta-footer__form {
  display: flex;
  gap: 10px;
  justify-content: center;
  max-width: 480px;
  margin: 0 auto;
}
.cta-footer__form input {
  flex: 1;
  border: 1px solid var(--rule);
  background: var(--bg);
  padding: 12px 16px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--text);
  border-radius: 5px;
  outline: none;
}
.cta-footer__form input:focus { border-color: var(--text); }
.cta-footer__form button {
  border: 0;
  background: var(--text);
  color: var(--bg);
  padding: 12px 24px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  border-radius: 5px;
  cursor: pointer;
}
.cta-footer__form button:hover { background: #000; }

/* ==========================================================================
   Мобильная раскладка (< 800px)
   ========================================================================== */
@media (max-width: 800px) {

  :root { --container: 100%; }

  /* На мобайле все десктопные CTA скрываем (есть .cta-strip сверху) */
  .sidebar-cta,
  .cta-band,
  .cta-footer { display: none; }

  /* На моб. странице тега не показываем биографию и полосу подписки */
  body.page-tag .bio { display: none; }
  body.page-tag .cta-strip { display: none; }

  body {
    font-size: 17px;
  }

  .page {
    max-width: 100%;
    padding: 0;
  }

  /* ---- Верхняя шапка: имя + бургер, sticky ---- */
  .top {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
  }
  .brand { font-size: 16px; font-weight: 700; }
  .top-nav { display: none; }

  /* Полоска хайлайтов под шапкой: 50/50, с разделителями */
  .hl-mobile {
    display: flex !important;
    align-items: stretch;
    border-bottom: 1px solid var(--rule);
    background: var(--bg);
  }
  .hl-mobile a {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    text-align: center;
  }
  .hl-mobile a + a {
    border-left: 1px solid var(--rule);
  }
  .hl-mobile a:hover {
    color: var(--text);
    text-decoration: none;
  }
  .hl-mobile .emo-d {
    display: inline;
    font-style: normal;
  }
  .top-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    flex-shrink: 0;
  }
  .top-burger span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--text);
    margin: 0 auto;
    transition: transform .2s ease, opacity .2s ease;
  }
  body.menu-open .top-burger span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
  body.menu-open .top-burger span:nth-child(2) { opacity: 0; }
  body.menu-open .top-burger span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

  /* На мобайле: компактный dropdown-переключатель слева от бургера */
  .top-right { gap: 6px; }
  .lang {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }
  .lang__current { padding: 6px 6px 6px 8px; font-size: 12px; }
  .lang__menu { right: 0; min-width: 140px; }

  /* Оверлей меню (по нажатию бургера) */
  body.menu-open .top-nav {
    display: flex;
    position: fixed;
    top: 52px; left: 0; right: 0; bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 20px;
    background: var(--bg);
    z-index: 15;
  }
  body.menu-open .top-nav a {
    font-family: var(--serif);
    font-size: 20px;
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
    color: var(--text);
  }
  /* В бургер-меню скрываем эмодзи у ссылок-хайлайтов — только текст */
  body.menu-open .top-nav a .emo-d { display: none; }

  /* ---- Био: фото 128 по центру, имя и био под ним ---- */
  .bio {
    display: block;
    padding: 20px 20px 24px;
    border-bottom: 1px solid var(--rule);
    position: relative;
    text-align: center;
  }
  .bio__photo { float: none; margin: 0; }
  .bio__photo img {
    width: 128px; height: 128px;
    border-radius: 50%;
    margin: 0 auto 16px;
  }
  .bio__text h1 {
    font-size: 28px;
    line-height: 1.15;
    margin: 0 0 14px;
  }
  .bio__body {
    text-align: left;
    max-width: 480px;
    margin: 0 auto;
  }
  .bio__body p {
    font-size: 16px;
    line-height: 1.4;
    margin: 0 0 4px;
  }
  .emo { font-size: 14px; vertical-align: -1px; }
  .arrow svg { width: 18px; height: 10px; }
  .bio__socials {
    justify-content: center;
    gap: 14px;
    margin-top: 16px;
    flex-wrap: nowrap;
  }
  .bio__socials a { font-size: 15px; white-space: nowrap; }

  /* Легаси — на главной v15 не используется */
  .bio__lead {
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
    max-width: none;
  }
  .bio__extra {
    display: none;
    font-size: 14.5px;
    line-height: 1.5;
    margin: 10px 0 0;
    max-width: none;
    clear: both;
  }
  .bio__more {
    display: none;
    margin-top: 4px;
    background: none;
    border: 0;
    padding: 0;
    font-family: var(--sans);
    font-size: 12.5px;
    color: var(--accent);
    font-weight: 500;
    cursor: pointer;
  }
  .bio__more-arrow { display: inline-block; margin-left: 2px; }
  .bio.is-open .bio__extra { display: block; }

  /* ---- CTA-полоса подписки: после bio, до тем ---- */
  .cta-strip {
    display: block;
    padding: 12px 20px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--rule);
  }
  .cta-strip__form {
    display: flex;
    gap: 6px;
    min-width: 0;
  }
  .cta-strip__form input {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid var(--rule);
    background: var(--bg);
    padding: 8px 10px;
    border-radius: 5px;
    font-family: var(--sans);
    font-size: 13px;
    color: var(--text);
    outline: none;
  }
  .cta-strip__form button {
    flex: 0 0 auto;
    border: 0;
    background: var(--text);
    color: var(--bg);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 5px;
    cursor: pointer;
  }
  .cta-strip__hint {
    margin-top: 6px;
    font-family: var(--sans);
    font-size: 11.5px;
    color: var(--muted);
  }

  /* ---- Main: без сайдбара, теги идут текстом сверху ---- */
  .main {
    display: block;
    padding-top: 0;
  }
  .tags {
    padding: 12px 20px 12px;
    border-bottom: 1px solid var(--rule);
  }
  /* На странице тега на мобайле прячем облако тегов сверху — показываем только посты по тегу */
  body.page-tag .tags { display: none; }
  .tags__head { margin-bottom: 6px; }
  .tags__title {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0;
  }
  .tags__toggle { display: inline-block; }
  .tags__list {
    font-family: var(--serif);
    font-size: 15.5px;
    line-height: 1.5;
    color: var(--text);
    max-width: none;
  }
  .tags__list li {
    display: inline;
    margin: 0;
  }
  .tags__list li:not(:last-child)::after {
    content: ",\00a0";
    color: var(--muted);
    font-family: var(--serif);
  }
  .tags__list a {
    display: inline;
    padding: 0;
    gap: 0;
    color: var(--text);
    font-family: var(--serif);
    font-size: 15.5px;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 1px;
    white-space: nowrap;
  }
  .tags__list .tag { white-space: nowrap; }
  .tags__list .count {
    display: inline;
    padding: 0;
    margin-left: 2px;
    background: transparent;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 11px;
    vertical-align: 0.1em;
    border-radius: 0;
    font-weight: 400;
  }
  @media (hover: hover) {
    .tags__list a:hover { color: var(--accent); }
    .tags__list a:hover .count { background: transparent; color: var(--accent); }
  }
  .tags__list a.is-active {
    color: var(--accent);
    border-color: var(--accent);
    font-weight: 700;
    font-size: 17px;
  }
  .tags__list a.is-active .count { color: var(--accent); font-size: 11px; }
  /* Тач-зона: даём ссылке достаточно padding по вертикали, чтобы попадать пальцем */
  .tags__list a { padding: 4px 0; line-height: 1.7; }

  /* Облако: скрытые теги + «Все посты» показываем (перекрываем десктопные дефолты) */
  .tags__list .tags__more { display: inline-block !important; }
  .tags__list .tags__overflow { display: none; }
  .tags.is-open .tags__list .tags__overflow { display: inline; }
  .tags.is-open .tags__list .tags__overflow:not(:last-child)::after {
    content: ",\00a0";
    color: var(--muted);
    font-family: var(--serif);
  }

  /* ---- Посты: плотный список, без линий сверху/снизу в мобайле ---- */
  .posts {
    padding: 14px 20px 20px;
  }
  .posts__list { max-width: none; }
  .posts__list a {
    padding: 5px 0;
    font-size: 18px;
    line-height: 1.4;
    border: 0;
  }
  /* На моб первому <a> возвращаем padding-top:5px (на десктопе он 0 — там звезда
     компенсируется top:7px). Это нужно, чтобы высота <a> у first-child и у остальных
     совпадала, и top:50% давал одинаковую позицию звезды. */
  .posts__list li:first-child a { border: 0; padding-top: 5px; }
  /* Звёздочка у топ-поста на моб: выравниваем именно по центру строки (через inline-flex на a) */
  .posts__list li.is-pinned > a {
    padding-left: 24px;
    position: relative;
  }
  .posts__list li.is-pinned > a::before {
    top: 50%;
    transform: translateY(-50%);
    /* высота <a> на моб = padding 5+5 + 1 строка ~25, чтобы звезда сидела ровно по центру */
  }
  .posts__list li.is-pinned:first-child > a::before {
    top: 50%;
    transform: translateY(-50%);
  }

  /* Related на мобайле: линии остаются, шрифт чуть меньше */
  .related__list a { padding: 16px 0; font-size: 18px; }

  /* ---- Футер ---- */
  .foot {
    margin-top: 0;
    padding: 16px 20px 24px;
    border-top: 1px solid var(--rule);
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 13px;
  }

  /* ---- Страница тега ---- */
  .filter {
    padding: 14px 20px;
  }
  .filter__value { font-size: 18px; }

  /* ---- Страница статьи ---- */
  .article {
    padding: 24px 20px 0;
  }
  .article__title {
    font-size: 28px;
    margin-bottom: 24px;
    text-align: left;
  }
  .article__body {
    font-size: 17px;
    line-height: 1.6;
  }
  .article__body h2 { font-size: 22px; }
  .article__body h3 { font-size: 19px; }

  .cta {
    margin: 36px 20px 0;
    padding: 16px 16px;
  }
  .cta__title { font-size: 17px; margin: 0 0 4px; white-space: nowrap; }
  .cta__title-long { display: none; }
  .cta__title-short { display: inline; }
  .cta__text  { font-size: 13px; margin: 0 0 12px; }
  .cta__form  { flex-direction: column; gap: 8px; max-width: none; }
  .cta__form input,
  .cta__form button { width: 100%; }

  .related {
    margin: 20px 20px 0;
  }

  /* ---- Страница 404 ---- */
  .err {
    padding: 60px 20px 80px;
  }
  .err__code  { font-size: 72px; }
  .err__title { font-size: 22px; }
  .err__text  { font-size: 16px; }
}
