/* «Ради уюта» — единая таблица стилей (ТЗ на дизайн, design_research.md, раздел 6).
   Все цвета, шрифты и размеры — в переменных :root. Контраст пар проверен по WCAG 2.1 AA.
   Шрифты Golos Text и Lora (лицензия SIL OFL 1.1) хостятся у нас: 4 файла woff2, латиница + кириллица.
   Lora в урезанной версии переименована в «Radi Serif» — так требует OFL для зарезервированного имени. */

@font-face { font-family: "Golos Text"; src: url("/assets/fonts/golos-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Golos Text"; src: url("/assets/fonts/golos-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Radi Serif"; src: url("/assets/fonts/serif-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Radi Serif"; src: url("/assets/fonts/serif-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --bg: #ffffff;            /* фон страницы */
  --warm: #faf6f0;          /* фон секций и карточек */
  --line: #e6dccf;          /* рамки */
  --text: #1f1b16;          /* основной текст, 17,1:1 */
  --muted: #5c5249;         /* вторичный текст, 7,6:1 */
  --accent: #a8432a;        /* терракота: ссылки и кнопки, 6,0:1 */
  --accent-hover: #8a3420;
  --c-dom: #2f6b5a;  --t-dom: #e4efea;      /* рубрика «Дом и порядок»: цвет и светлый фон обложки */
  --c-uyut: #a8432a; --t-uyut: #f6e4dc;     /* «Уют и интерьер» */
  --c-zabota: #8c3b6e; --t-zabota: #f3e3ed; /* «Забота о себе» */
  --c-kuhnya: #8a5a00; --t-kuhnya: #f6ecd6; /* «Кухня без суеты» */
  --tg-bg: #eaf3fa; --tg-btn: #1b6fa6;      /* блок подписки и кнопка Telegram */
  --dzen-btn: #000000;
  --focus: #1b5fcc;
  --foot-bg: #1f1b16; --foot-text: #f4ede4; --foot-muted: #c9bfb3;
  --font-body: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Radi Serif", Georgia, "Times New Roman", serif;
  --fs: 1.125rem;           /* 18px на мобильном */
  --lh: 1.6;
  --h1: 1.875rem; --h2: 1.5rem; --h3: 1.25rem; --small: .9375rem;
  --radius: 12px;
  --wrap: 75rem;            /* 1200px */
  --prose: 68ch;
  --header-h: 3.5rem;       /* 56px */
  --gap: 1.25rem;
}
@media (min-width: 64rem) { :root { --fs: 1.1875rem; --h1: 2.5rem; --h2: 1.75rem; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs)/var(--lh) var(--font-body); text-align: left; }
a { color: var(--accent); text-underline-offset: .15em; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { overflow-wrap: break-word; hyphens: manual; font-family: var(--font-head); font-weight: 700; line-height: 1.2; margin: 0 0 .75rem; }
h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); margin-top: 2rem; }
h3 { font-size: var(--h3); font-weight: 600; }
p { margin: 0 0 1rem; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gap); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--text); color: #fff; padding: .75rem 1rem; z-index: 100; }
.skip:focus { left: .5rem; top: .5rem; color: #fff; }
main:focus { outline: none; }
.meta { color: var(--muted); font-size: var(--small); margin: 0; }
.lead { font-size: 1.25rem; color: var(--muted); max-width: var(--prose); }

/* Цвет рубрики задаётся классом и наследуется через переменные */
.r-dom { --rc: var(--c-dom); --rt: var(--t-dom); }
.r-uyut { --rc: var(--c-uyut); --rt: var(--t-uyut); }
.r-zabota { --rc: var(--c-zabota); --rt: var(--t-zabota); }
.r-kuhnya { --rc: var(--c-kuhnya); --rt: var(--t-kuhnya); }

/* ---------- Шапка 56px, закреплена ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.header-bar { display: flex; align-items: center; gap: .5rem; min-height: var(--header-h); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--warm); color: var(--text); }
.logo { display: inline-flex; align-items: center; gap: .45rem; font-family: var(--font-head); font-weight: 700; font-size: 1.375rem; color: var(--text); text-decoration: none; margin-right: auto; }
.logo-ico { color: var(--accent); }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; min-height: 44px; padding: .55rem .8rem; color: var(--text); text-decoration: none; border-radius: 8px; }
.site-nav a:hover { background: var(--warm); color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--accent); font-weight: 500; text-decoration: underline; text-underline-offset: .3em; }
@media (max-width: 63.99rem) {
  .header-bar { flex-wrap: wrap; }
  .site-nav { order: 5; width: 100%; padding-bottom: .5rem; }
  .js .site-nav { display: none; }
  .js .site-nav.open { display: block; }
}
@media (min-width: 64rem) {
  .burger { display: none; }
  .site-nav ul { display: flex; gap: .25rem; }
  .site-nav { margin-left: auto; }
  .logo { margin-right: 0; }
}

/* ---------- Чипсы рубрик ---------- */
.chips-wrap { padding-top: 1rem; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0 0 .5rem; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border: 2px solid var(--rc); border-radius: 999px; color: var(--rc); background: var(--bg); text-decoration: none; font-weight: 500; }
.chip:hover { background: var(--rt); color: var(--rc); }

/* ---------- Обложки (CSS + SVG, без фото) ---------- */
.cover { display: flex; align-items: center; justify-content: center; background: var(--rt); color: var(--rc); border-radius: var(--radius); }
.cover.r169 { aspect-ratio: 16 / 9; }
.cover.r43 { aspect-ratio: 4 / 3; }
.cover-ico { width: 30%; height: auto; max-width: 140px; }

/* ---------- Главная ---------- */
.featured { padding-top: 1rem; }
.feat { display: grid; gap: 1rem; }
@media (min-width: 48rem) { .feat { grid-template-columns: 1.4fr 1fr; align-items: center; gap: 2rem; } }
.feat-title { font-size: var(--h1); margin-top: .25rem; }
.feat-title a, .card-title a { color: var(--text); text-decoration: none; }
.feat-title a:hover, .card-title a:hover { color: var(--accent); text-decoration: underline; }
.feat-lead { color: var(--muted); }
.section { padding-bottom: 1.5rem; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; }
.section-head h2 { color: var(--rc, var(--text)); }
.all-link { display: inline-block; padding: .6rem 0; line-height: 1.4; font-weight: 500; }
.cards { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 40rem) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card article { height: 100%; display: flex; flex-direction: column; background: var(--warm); border-radius: var(--radius); overflow: hidden; }
.card .cover { border-radius: 0; }
.card-body { padding: 1rem 1.1rem 1.1rem; min-width: 0; overflow-wrap: break-word; }
.card-title { font-size: var(--h3); margin: .25rem 0 .5rem; }
.card-rub { margin: 0; }
.rub { display: inline-block; padding: .35rem 0; color: var(--rc); font-size: var(--small); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; text-decoration: none; }
.rub:hover { color: var(--rc); text-decoration: underline; }
.guides { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap); }
@media (min-width: 48rem) { .guides { grid-template-columns: 1fr 1fr; } }
.guide { padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); }
.guide ul { padding-left: 1.2rem; margin: 0; }
.guide li { margin: .4rem 0; }

/* ---------- Блок подписки ---------- */
.subscribe { background: var(--tg-bg); border-radius: var(--radius); padding: 1.25rem; margin: 1.5rem 0; }
.subscribe h2, .subscribe h3 { margin-top: 0; font-size: var(--h3); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.25rem; border-radius: 10px; font: 500 1rem/1.2 var(--font-body); text-decoration: none; border: 2px solid transparent; cursor: pointer; }
.btn-tg { background: var(--tg-btn); color: #fff; }
.btn-dzen { background: var(--dzen-btn); color: #fff; }
.btn-dzen:hover, .btn-tg:hover { color: #fff; text-decoration: underline; }
.btn-main { background: var(--accent); color: #fff; }
.btn-main:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { background: var(--bg); color: var(--text); border-color: var(--text); }
.btn-ghost:hover { background: var(--warm); color: var(--text); }


/* ---------- Статья ---------- */
.article { padding-top: .5rem; padding-bottom: 2.5rem; }
.article > *, .prose { max-width: var(--prose); }
.article > .related, .article > .cover { max-width: 52rem; }
.art-head h1 { margin-top: .25rem; }
.art-head .meta { margin-bottom: 1.25rem; }
.art-head .meta a { color: var(--muted); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; padding: 0; margin: 1rem 0 .5rem; font-size: var(--small); color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: .3rem; }
.toc { margin: 1.5rem 0 .5rem; background: var(--warm); border-radius: var(--radius); padding: .25rem 1.25rem; }
.toc summary { min-height: 44px; display: flex; align-items: center; font-family: var(--font-head); font-weight: 600; font-size: var(--h3); cursor: pointer; }
.toc ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.toc li { margin: .35rem 0; }
.dzen-line { margin: .5rem 0 1.5rem; }
.dzen-line a { display: inline-block; padding: .6rem 0; line-height: 1.4; font-weight: 500; }
.prose ul { padding-left: 1.3rem; }
.prose li { margin: 0 0 .6rem; }
.tip { background: var(--warm); border-left: 6px solid var(--rc); border-radius: 0 var(--radius) var(--radius) 0; padding: 1rem 1.25rem; margin: 1.5rem 0; }
.tip-title { font-weight: 500; color: var(--rc); margin-bottom: .35rem; text-transform: uppercase; letter-spacing: .04em; font-size: var(--small); }
.tip p:last-child { margin: 0; }
.course-slot[hidden] { display: none; }
.faq-item { border-top: 1px solid var(--line); padding-top: 1rem; }
.faq-item h3 { margin-bottom: .4rem; }
.share-list { list-style: none; display: flex; flex-wrap: wrap; gap: .75rem; padding: 0; margin: 0; }
.copy-status { margin-left: .75rem; color: var(--muted); }

/* ---------- Поиск ---------- */
.search-form label { display: block; font-weight: 500; margin-bottom: .4rem; }
.search-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.search-row input { flex: 1 1 14rem; min-height: 48px; padding: 0 .9rem; font: inherit; border: 2px solid var(--muted); border-radius: 10px; }
.search-results { list-style: none; padding: 0; }
.search-results li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.search-results a { font-family: var(--font-head); font-weight: 600; font-size: var(--h3); }
.search-results p { margin: .3rem 0 0; color: var(--muted); }

/* ---------- Подвал ---------- */
.site-footer { margin-top: 2rem; padding: 2rem 0 1rem; background: var(--foot-bg); color: var(--foot-text); }
.site-footer a { color: var(--foot-text); display: inline-block; padding: .6rem 0; line-height: 1.4; }
.site-footer a:hover { color: #fff; }
.site-footer :focus-visible { outline-color: #8fb4ff; }
.footer-grid { display: grid; gap: 1.5rem; }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-logo { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; margin-bottom: .5rem; }
.footer-h { font-family: var(--font-body); font-size: 1rem; font-weight: 500; color: var(--foot-muted); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 .25rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.footer-note { color: var(--foot-muted); font-size: var(--small); border-top: 1px solid #3a332c; margin-top: 1.5rem; padding-top: 1rem; }

/* ---------- Нижнее меню на мобильном, 56px ---------- */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--bg); border-top: 1px solid var(--line); }
.bottom-nav ul { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0 0 env(safe-area-inset-bottom); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: var(--header-h); font-size: .9375rem; line-height: 1.2; color: var(--text); text-decoration: none; }
.bottom-nav a[aria-current="page"] { color: var(--accent); font-weight: 500; }
body { padding-bottom: calc(var(--header-h) + env(safe-area-inset-bottom)); }
@media (min-width: 64rem) { .bottom-nav { display: none; } body { padding-bottom: 0; } }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* На узком экране карточка горизонтальная: миниатюра 4:3 слева, текст справа — лента читается быстрее */
@media (max-width: 39.99rem) {
  .card article { flex-direction: row; align-items: stretch; }
  .card .cover { flex: 0 0 36%; aspect-ratio: 4 / 3; align-self: flex-start; }
  .card .cover-ico { width: 45%; }
  .card-body { padding: .6rem .85rem; }
  .card-title { font-size: 1.125rem; }
}

/* ---------- Форма обратной связи (/kontakty/#forma) ---------- */
.cform { margin: 1rem 0 2rem; padding: 1.25rem; background: var(--warm); border: 1px solid var(--line); border-radius: var(--radius); max-width: 36rem; }
.cf-field { margin: 0 0 1.25rem; }
.cform label, .cf-label { display: block; font-weight: 500; margin: 0 0 .35rem; }
.cf-hint { margin: 0 0 .35rem; color: var(--muted); font-size: var(--small); }
.cform input[type="text"], .cform input[type="tel"], .cform input[type="email"] {
  display: block; width: 100%; min-height: 48px; padding: .6rem .8rem; font: inherit; color: var(--text);
  background: #fff; border: 2px solid #8a7f74; border-radius: 8px; box-sizing: border-box; }
.cform input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--focus); }
.cform input[aria-invalid="true"] { border-color: #b3261e; }
.cf-check { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; align-items: start; }
.cf-check input { width: 24px; height: 24px; margin: .2rem 0 0; accent-color: var(--accent); }
.cf-check label { font-weight: 400; margin: 0; }
.cf-check .cf-err { grid-column: 1 / -1; }
.cf-err { margin: .4rem 0 0; color: #b3261e; font-weight: 500; }
.cf-err::before { content: "Ошибка: "; }
.cf-turnstile { min-height: 65px; }
.cf-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cform button[disabled] { opacity: .7; cursor: wait; }
.cf-status { margin: 1rem 0 0; font-weight: 500; }
.cf-status:empty { display: none; }
.cf-status.is-ok { padding: .75rem 1rem; background: #e4efea; color: #1d4a3d; border-radius: 8px; }
.cf-status.is-error { padding: .75rem 1rem; background: #fbe9e7; color: #8c1d18; border-radius: 8px; }
