/* ==========================================================================
   smotrim — самодостаточная тема блога «Новости».
   Используется PHP-листингом (/<lang>/blog/) и страницами статей, которые
   коммитит autopost. Палитра/типографика повторяют главный сайт
   (css/style.css), но файл независим: на страницах блога нет React.
   ========================================================================== */

:root {
  --bg: #f4efe7;
  --bg-warm: #ebe4d6;
  --bg-card: #fbf8f1;
  --ink: #161814;
  --ink-soft: #3a3d36;
  --ink-mute: #6c6f64;
  --line: rgba(22, 24, 20, 0.09);
  --line-strong: rgba(22, 24, 20, 0.16);

  --green: #1f4d3a;
  --green-soft: #2f6b53;
  --green-tint: #d8e3dc;
  --clay: #d96846;
  --clay-soft: #e8856a;
  --honey: #e8b94a;

  --radius: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(22,24,20,0.06), 0 4px 14px rgba(22,24,20,0.04);
  --shadow-md: 0 8px 28px rgba(22,24,20,0.08), 0 2px 6px rgba(22,24,20,0.05);
  --shadow-lg: 0 24px 60px rgba(22,24,20,0.14), 0 6px 18px rgba(22,24,20,0.08);

  --max: 1240px;
  --font-display: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --font-body: "Manrope", "Inter", system-ui, -apple-system, sans-serif;
}

/* Сайт всегда светлый (тема по умолчанию в tweaks-панели — light, системную
   тёмную он НЕ слушает). Блог тоже держим светлым, в общем стиле страницы. */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 clamp(18px, 4vw, 40px); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; }

/* ---------- Skip link (a11y) ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--green);
  color: #fdfbf6;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.hdr {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 84%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.hdr-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 72px;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 40px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.brand-mark { display: inline-flex; }
.brand-mark img { width: 38px; height: 38px; object-fit: contain; display: block; }
.brand-name { line-height: 1; }
.brand-dot { color: var(--clay); }

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}
.nav a {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--line);
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.nav a:hover {
  color: var(--ink);
  background: var(--bg-warm);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.nav a.is-active {
  color: #fff;
  background: var(--clay);
  border-color: transparent;
  box-shadow: 0 1px 0 rgba(255,255,255,.16) inset, 0 8px 22px -10px rgba(217,104,70,.6);
}
.nav a.is-active:hover { background: #c2573a; color: #fff; }

.hdr-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.hdr-phone {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}
.hdr-phone:hover { color: var(--ink); }

.lang-switch { display: inline-flex; gap: 4px; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: var(--bg-card);
  border: 1px solid var(--line);
}
.lang-btn:hover { background: var(--bg-warm); color: var(--ink); }
.lang-btn--active { color: #fff; background: var(--green); border-color: transparent; }

/* Lang switch (dropdown) — как на главной странице сайта (.lang-dd в style.css). */
.lang-dd { position: relative; }
.lang-dd-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  cursor: pointer;
}
.lang-dd-toggle:hover { background: var(--bg-warm); }
.lang-dd .chev { transition: transform .2s ease; }
.lang-dd.is-open .chev { transform: rotate(180deg); }
.lang-dd-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 168px;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 60;
}
.lang-dd.is-open .lang-dd-menu { display: flex; }
.lang-dd-menu a {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}
.lang-dd-menu a:hover { background: var(--bg-warm); color: var(--ink); }
.lang-dd-menu a.is-active { color: var(--green); font-weight: 700; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease, color .2s ease;
}
.btn--primary {
  background: var(--green);
  color: #fdfbf6;
  box-shadow: 0 1px 0 rgba(255,255,255,.14) inset, 0 8px 22px -8px rgba(31, 77, 58, .55);
}
.btn--primary:hover { background: #173a2c; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--bg-warm); }
.btn--online {
  background: #e63946;
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.14) inset, 0 8px 22px -8px rgba(230,57,70,.55);
}
.btn--online:hover { background: #c8313d; }
.btn--sm { padding: 9px 16px; font-size: 14px; }
.btn--lg { padding: 15px 26px; font-size: 16px; }

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 42px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--bg-card);
  cursor: pointer;
}
.menu-toggle span { display: block; width: 18px; height: 2px; margin: 0 auto; background: var(--ink); border-radius: 2px; }

@media (max-width: 1024px) {
  .nav {
    display: none;
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px clamp(18px, 4vw, 40px) 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
  }
  .nav.nav--open { display: flex; }
  .nav a { justify-content: flex-start; padding: 13px 16px; font-size: 16px; }
  .menu-toggle { display: flex; }
}
/* Видимость кнопок справа — как на главной странице сайта: телефон-кнопку
   прячем, когда видны пилюли меню (>1024), и телефон+онлайн прячем на узких. */
@media (min-width: 1025px) {
  .hdr-actions .btn--ghost { display: none; }
}
@media (max-width: 880px) {
  .hdr-actions .btn--ghost, .hdr-actions .btn--online { display: none; }
}

/* ---------- Blog index ---------- */
.blog { padding: clamp(40px, 6vw, 80px) 0 clamp(56px, 8vw, 100px); }
.blog-head { max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 16px;
}
.kicker-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--clay); box-shadow: 0 0 0 4px color-mix(in oklab, var(--clay) 22%, transparent); }
/* Заголовки — цвета чернил, как .section-title на лендинге (зелёный там только
   у акцентных слов em), чтобы блог не выглядел сплошь зелёным. */
.blog-title { font-size: clamp(34px, 6vw, 58px); font-weight: 500; color: var(--ink); letter-spacing: -0.02em; }
.blog-title em { font-style: italic; color: var(--green); }
.blog-sub { margin-top: 16px; font-size: clamp(17px, 2vw, 19px); color: var(--ink-soft); }

.blog-empty {
  margin-top: 20px;
  padding: clamp(32px, 6vw, 56px);
  text-align: center;
  background: var(--bg-card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--ink-mute);
  font-size: 18px;
}

/* ---------- News grid + cards ---------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 2.2vw, 28px);
}
@media (max-width: 900px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .news-grid { grid-template-columns: 1fr; } }

.news-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.news-card__media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-warm); }
.news-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.news-card:hover .news-card__media img { transform: scale(1.05); }
.news-card__media--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
}
.news-card__body { display: flex; flex-direction: column; gap: 10px; padding: clamp(18px, 2.4vw, 24px); flex: 1; }
.news-card__meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-mute); }
.news-card__tag {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--green-tint);
  color: var(--green);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.01em;
}
.news-card__title { font-size: clamp(19px, 2vw, 22px); color: var(--ink); }
.news-card__excerpt { font-size: 15px; color: var(--ink-soft); flex: 1; }
.news-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  font-weight: 700;
  font-size: 14px;
  color: var(--clay);
}
.news-card:hover .news-card__cta { gap: 11px; }
.news-card__cta svg { transition: transform .2s ease; }

/* ---------- Pager ---------- */
.pager { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: clamp(36px, 5vw, 56px); }
.pager a, .pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 15px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.pager a:hover { background: var(--bg-warm); color: var(--ink); border-color: var(--line-strong); }
.pager .is-current { background: var(--green); color: #fdfbf6; border-color: transparent; }
.pager .is-disabled { opacity: 0.4; }

/* ---------- Article page ---------- */
.article-wrap { padding: clamp(36px, 5vw, 72px) 0 clamp(56px, 8vw, 100px); }
.article { max-width: 760px; margin: 0 auto; }
.article__back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-mute);
  margin-bottom: 22px;
}
.article__back:hover { color: var(--clay); }
.article__title { font-size: clamp(30px, 5.2vw, 50px); font-weight: 500; color: var(--ink); letter-spacing: -0.02em; }
.article__meta { display: flex; align-items: center; gap: 12px; margin-top: 18px; font-size: 14px; color: var(--ink-mute); }
.article__cover {
  width: 100%;
  border-radius: var(--radius-lg);
  margin-top: 28px;
  box-shadow: var(--shadow-md);
}
.article__body { margin-top: 32px; font-size: 18px; line-height: 1.75; color: var(--ink-soft); }
.article__body h2 { font-size: clamp(24px, 3.4vw, 32px); color: var(--ink); margin: 38px 0 14px; }
.article__body h3 { font-size: clamp(20px, 2.6vw, 25px); color: var(--ink); margin: 30px 0 12px; }
.article__body p { margin: 0 0 18px; }
.article__body ul, .article__body ol { margin: 0 0 18px; padding-left: 1.4em; }
.article__body li { margin-bottom: 8px; }
.article__body a { color: var(--green); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.article__body a:hover { color: var(--clay); }
.article__body img { border-radius: var(--radius); margin: 24px 0; box-shadow: var(--shadow-sm); }
.article__body blockquote {
  margin: 24px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--clay);
  color: var(--ink);
  font-style: italic;
}
.article__backlink {
  margin-top: 40px;
  padding: 22px 26px;
  background: var(--green-tint);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--ink);
}
.article__backlink a { color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Footer ---------- */
.ftr { border-top: 1px solid var(--line); background: var(--bg-warm); padding: clamp(40px, 5vw, 64px) 0 32px; }
.ftr-inner { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 clamp(18px, 4vw, 40px); }
.ftr-brand .brand { font-size: 22px; }
.ftr-tag { margin-top: 12px; color: var(--ink-mute); font-size: 14px; max-width: 320px; }
.ftr-cols {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(24px, 5vw, 64px);
  margin-top: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.ftr-ttl { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 8px; }
.ftr-col a { color: var(--ink-soft); font-size: 15px; font-weight: 500; }
.ftr-col a:hover { color: var(--clay); }
.ftr-bot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 24px; font-size: 13px; color: var(--ink-mute); }

/* ---------- A11y ---------- */
:focus-visible { outline: 3px solid var(--clay); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .news-card:hover { transform: none; }
  .news-card:hover .news-card__media img { transform: none; }
}
