/*
 * Витрина «Руки з правильного місця». Цвета бренда: тёмно-синий #0F1E3D, жёлтый #F5C518, белый.
 * Тема — атрибут data-theme у <html>: light (по умолчанию), dark или system (как в системе).
 * Ставит его скрипт в <head> до отрисовки (layout/main.tpl), выбор — переключатель в шапке.
 * Всё, что меняется между темами, — переменные ниже; правил «если тёмная» по файлу нет.
 */
:root {
  color-scheme: light;
  --bg: #fffbef;
  --surface: #ffffff;
  --ink: #0f1e3d;
  --muted: #4f5b73;
  --line: #ece4cc;
  --sea: #0f1e3d;
  --sea-ink: #ffffff;
  --sun: #f5c518;
  --sun-soft: #fff4c2;
  --radius: 14px;
  --danger: #b42318;
  --mark: none;
  --mark-ink: #f5c518;   /* выделенные слова — фирменным жёлтым, как в тёмной теме (владелец 2026-10-29) */
  --foot-bg: #0f1e3d;
  --foot-ink: #fffbef;
  --foot-line: transparent;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1428;
  --surface: #13203d;
  --ink: #f2f4f8;
  --muted: #a9b3c7;
  --line: #23345a;
  --sea: #f5c518;
  --sea-ink: #0f1e3d;
  --sun-soft: #1c2a4a;
  --danger: #ff8a7a;
  --mark: none;
  --mark-ink: #f5c518;
  --foot-bg: #070e1d;
  --foot-ink: #a9b3c7;
  --foot-line: #23345a;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --bg: #0b1428;
    --surface: #13203d;
    --ink: #f2f4f8;
    --muted: #a9b3c7;
    --line: #23345a;
    --sea: #f5c518;
    --sea-ink: #0f1e3d;
    --sun-soft: #1c2a4a;
    --danger: #ff8a7a;
    --mark: none;
    --mark-ink: #f5c518;
    --foot-bg: #070e1d;
    --foot-ink: #a9b3c7;
    --foot-line: #23345a;
  }
}
/* Название сайта — узкий плотный Oswald 600 (свои файлы из assets/fonts, OFL; кириллица с і, ї, є, ґ) */
@font-face {
  font-family: 'Oswald'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/assets/fonts/oswald-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Oswald'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/assets/fonts/oswald-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1440px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
@media (min-width: 760px) { .wrap { padding-left: 32px; padding-right: 32px; } }

/* ---------- Шапка ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.brand img { width: 44px; height: 44px; object-fit: cover; object-position: 50% 8%; border-radius: 50%; background: var(--sun); flex: none; }
.logo { font-family: 'Oswald', 'Arial Narrow', sans-serif; font-weight: 600; letter-spacing: 0.005em; font-size: 26px; line-height: 1.1; }
.logo span { background: var(--mark); color: var(--mark-ink); padding: 0 .08em; margin: 0 -.08em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.nav { display: flex; align-items: center; gap: 24px; }
.nav-links { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 15px; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.langs, .themes { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; flex: none; }
.themes button {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 32px; padding: 0;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.themes button:hover { color: var(--ink); }
.themes button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.themes svg { width: 17px; height: 17px; }
.themes[hidden] { display: none; }
.langs a { text-decoration: none; color: var(--muted); font-size: 14px; padding: 6px 14px; text-transform: uppercase; }
.langs a.active { background: var(--ink); color: var(--bg); }
.menu-btn {
  display: none; align-items: center; justify-content: center; width: 42px; height: 42px; padding: 0;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 12px; cursor: pointer;
}
.menu-btn svg { width: 22px; height: 22px; }
.menu-btn .menu-close, .menu-btn[aria-expanded="true"] .menu-open { display: none; }
.menu-btn[aria-expanded="true"] .menu-close { display: block; }
.nav-theme { display: none; }
@media (max-width: 859px) {
  /* Шапка телефона: логотип с названием · языки · гамбургер. Разделы и тема — в раскрывающемся меню */
  .site-header .bar { flex-wrap: wrap; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .site-header .brand { flex: 1 1 0; gap: 8px; }
  .site-header .brand img { width: 36px; height: 36px; }
  .site-header .brand { min-width: 0; overflow: hidden; }
  .site-header .brand .logo { font-size: clamp(13px, 4.2vw, 20px); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Язык на телефоне — одна кнопка «на другой язык»: пара UA|RU не оставляла места названию в одну строку */
  .langs a.active { display: none; }
  .langs a { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 10px; font-size: 14px; font-weight: 600; color: var(--ink); }
  .langs { border-radius: 12px; background: var(--surface); }
  .header-tools { display: flex; align-items: center; gap: 8px; flex: none; }
  .header-tools .themes { display: none; }
  .menu-btn { display: inline-flex; }
  #site-nav { order: 3; width: 100%; display: none; }
  #site-nav.open { display: block; border-top: 1px solid var(--line); padding: 12px 0 6px; }
  .nav-links { flex-direction: column; gap: 4px; }
  .nav-links a { display: block; padding: 10px 0; font-size: 17px; color: var(--ink); }
  .nav-theme { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 4px; margin-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-weight: 600; }
  .nav-theme .themes button { width: 44px; height: 36px; }
}
@media (max-width: 359px) {
  .site-header .brand img { width: 30px; height: 30px; }
  .site-header .brand { gap: 6px; }
}
@media (min-width: 860px) {
  .header-tools { display: flex; align-items: center; gap: 16px; order: 3; }
  #site-nav { order: 2; margin-left: auto; }
}
/* ---------- Типографика и кнопки ---------- */
h1 { font-size: clamp(32px, 4.6vw, 76px); line-height: 1.04; margin: 0 0 18px; letter-spacing: -0.02em; }
h1 em { font-style: normal; background: var(--mark); color: var(--mark-ink); padding: 0 .06em; margin: 0 -.06em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
h2 { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.2; margin: 0 0 20px; letter-spacing: -0.01em; }
h3 { font-size: 19px; line-height: 1.3; margin: 0 0 8px; }
.lead { font-size: clamp(17px, 1.5vw, 22px); color: var(--muted); max-width: 640px; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tag {
  display: inline-block; background: var(--sun-soft); color: var(--ink);
  border-radius: 999px; padding: 4px 12px; font-size: 14px; margin-bottom: 16px;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border-radius: 12px; font-weight: 650; text-decoration: none; font-size: 16px;
  border: 1px solid var(--line); color: var(--ink); background: var(--surface); cursor: pointer;
}
.btn-primary { background: var(--sea); color: var(--sea-ink); border-color: var(--sea); }
.btn-outline { background: transparent; }

/* ---------- Секции ---------- */
.section { padding-top: 32px; padding-bottom: 32px; }
@media (min-width: 760px) { .section { padding-top: 44px; padding-bottom: 44px; } }
.section-tight { padding-top: 8px; padding-bottom: 44px; }
.hero { padding-top: 24px; padding-bottom: 32px; display: grid; gap: 8px 56px; align-items: center; grid-template-columns: 1fr; }
.hero-art { width: min(260px, 70vw); justify-self: center; order: -1; }
.hero-art img { width: 100%; display: block; }
@media (min-width: 760px) {
  .hero { grid-template-columns: 1.1fr 1fr; padding-top: 40px; padding-bottom: 48px; }
  .hero-art { width: 100%; max-width: 540px; order: 0; justify-self: center; }
}
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card p { margin: 0; color: var(--muted); }
.num {
  display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; background: var(--sun); color: #1d2433; margin-bottom: 12px;
}
.chips { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.chips li { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 16px; font-size: 15px; }
.chips li.start { border-color: var(--sun); box-shadow: inset 0 0 0 1px var(--sun); }
.areas-group { margin-bottom: 24px; }
.areas-group h3 { font-size: 15px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.note { background: var(--sun-soft); border-radius: var(--radius); padding: 24px; }
@media (min-width: 760px) { .note { padding: 36px 40px; } }
.note h2 { margin-bottom: 12px; }
.note p { margin: 0; max-width: 760px; }

/* ---------- Внутренние страницы ---------- */
.page-hero { padding-top: 32px; padding-bottom: 8px; }
.page-hero h1 { font-size: clamp(30px, 4vw, 46px); }
.page-hero-art img { border-radius: var(--radius); display: block; }
.page-layout { display: grid; gap: 32px; }
@media (min-width: 1000px) { .page-layout { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; } }
.breadcrumbs { font-size: 14px; color: var(--muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumbs a { color: var(--muted); }
.prose { max-width: 760px; }
.prose h2 { margin-top: 36px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose a { color: var(--ink); text-decoration-color: var(--sun); text-decoration-thickness: 2px; }
.page-toc { position: sticky; top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; font-size: 15px; }
.toc-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.toc-list a { color: var(--muted); text-decoration: none; }
.notice, .alert { background: var(--sun-soft); border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; }

/* Вопросы и ответы */
.faq-group { margin: 28px 0 12px; font-size: 22px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
.faq-item summary { cursor: pointer; padding: 16px 20px; font-weight: 650; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; float: right; color: var(--muted); }
.faq-item[open] summary::after { content: "–"; }
.faq-answer { padding: 0 20px 16px; color: var(--muted); }

/* Новости */
.news-card { display: block; text-decoration: none; }
.news-date, .news-meta { font-size: 14px; color: var(--muted); }
.pager { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.pager a, .pager span { border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; text-decoration: none; }
.pager .current { background: var(--ink); color: var(--bg); }
.author { display: flex; align-items: center; gap: 10px; }
.author img { border-radius: 50%; }

/* 404 и технические работы */
.error-page { padding-top: 56px; padding-bottom: 72px; }
.error-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 760px) { .error-grid { grid-template-columns: 1.2fr 1fr; } }
.error-code { display: block; font-size: clamp(72px, 12vw, 140px); font-weight: 800; line-height: 1; color: var(--sun); letter-spacing: -0.04em; }
.error-art img { width: 100%; max-width: 360px; display: block; margin: 0 auto; }
.error-links ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }

/* ---------- Подвал ---------- */
.site-footer { margin-top: 32px; background: var(--foot-bg); color: var(--foot-ink); border-top: 1px solid var(--foot-line); }
.site-footer .logo span { color: var(--sun); }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding-top: 28px; padding-bottom: 28px; font-size: 15px; }
.foot .brand img { width: 40px; height: 40px; }
.foot .logo { font-size: 22px; }
.foot-slogan { opacity: .85; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; list-style: none; margin: 0; padding: 0; }
.foot-links a { opacity: .8; text-decoration: none; }
.foot-links a:hover { opacity: 1; text-decoration: underline; }

/* ---------- Баннер согласия (только если включена аналитика) ---------- */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: 0 10px 30px rgba(15, 30, 61, .18); }
.consent[hidden] { display: none; }
.consent .btn-row { margin-top: 12px; }

@media (max-width: 560px) {
  .btn { width: 100%; }
}
