/* Справочник военнослужащего и семьи — общие стили
   Палитра и типографика в духе работа-бпла.рф: тёмно-зелёный, кремовый фон,
   песочно-золотой акцент, Montserrat для заголовков, Open Sans для текста.
   Mobile-first. */

:root {
  --bg: #f6f6f1;
  --surface: #ffffff;
  --surface-2: #e9eee5;
  --ink: #202c26;
  --ink-2: #4f5a52;
  --ink-3: #606a62;
  --line: #c7d3c8;
  --line-soft: #e4e9e1;
  --green: #284c39;
  --green-deep: #20382b;
  --green-footer: #1e3026;
  --gold: #e8c67c;
  --gold-ink: #263424;
  --on-dark: #edf1e9;
  --on-dark-2: #becbbe;
  --warn: #8a5a12;
  --warn-soft: #fbf1dc;
  --radius: 7px;
  --radius-lg: 12px;
  --wrap: 1160px;
  --text: 740px;
  --font: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Montserrat", "Open Sans", system-ui, Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 var(--font);
}

img { max-width: 100%; height: auto; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 20;
  background: var(--gold); color: var(--gold-ink); padding: 8px 14px; font-weight: 600;
}
.skip-link:focus { left: 16px; top: 8px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 760px) { .wrap { padding: 0 24px; } }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: var(--radius);
  background: var(--gold); color: var(--gold-ink);
  font: 650 15px/1.2 var(--font-head); text-decoration: none;
  border: 1px solid var(--gold); transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn-ghost:hover { background: rgba(255,255,255,.08); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ---------- Шапка ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 68px; flex-wrap: wrap;
}
.logo {
  display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;
  color: var(--ink); text-decoration: none;
  font: 700 16px/1.2 var(--font-head);
}
.logo-mark {
  width: 40px; height: 40px; flex: none; border-radius: var(--radius);
  background: var(--green-deep); display: grid; place-items: center;
}
.logo-mark svg { width: 20px; height: 20px; fill: var(--gold); }
.logo small { display: block; font: 400 13px/1.3 var(--font); color: var(--ink-3); }
@media (max-width: 420px) { .logo { font-size: 14px; } .logo small { display: none; } }

.header-phone { display: none; font: 700 15px/1 var(--font-head); color: var(--ink); text-decoration: none; }
@media (min-width: 1100px) { .header-phone { display: inline; } }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle-label {
  cursor: pointer; width: 44px; height: 40px; border: 1px solid var(--line);
  border-radius: var(--radius); display: grid; place-items: center;
}
.nav-toggle-label span, .nav-toggle-label span::before, .nav-toggle-label span::after {
  display: block; width: 18px; height: 2px; background: var(--ink); position: relative; content: "";
}
.nav-toggle-label span::before { position: absolute; top: -6px; }
.nav-toggle-label span::after { position: absolute; top: 6px; }
.nav-toggle:focus-visible + .nav-toggle-label { outline: 3px solid var(--gold); }

.site-nav { width: 100%; display: none; padding-bottom: 12px; }
.nav-toggle:checked ~ .site-nav { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.site-nav a {
  display: block; padding: 10px 12px; border-radius: var(--radius);
  color: var(--ink); text-decoration: none; font: 600 15px/1.3 var(--font-head);
}
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="page"] { background: var(--surface-2); color: var(--green); }

@media (min-width: 960px) {
  .nav-toggle-label { display: none; }
  .logo { flex: none; }
  .site-nav { display: block; width: auto; padding: 0; }
  .site-nav ul { display: flex; gap: 2px; }
  .site-nav a { font-size: 14px; padding: 8px 10px; }
}

/* ---------- Тёмный первый экран ---------- */
.page-hero {
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(232,198,124,.14), transparent 60%),
    linear-gradient(180deg, var(--green-deep), #1b3125);
  color: var(--on-dark);
  padding: 20px 0 36px;
}
.page-hero h1 {
  color: #fff; font: 750 clamp(28px, 6vw, 40px)/1.15 var(--font-head);
  letter-spacing: -0.035em; margin: 14px 0 0; max-width: 860px;
}
.page-hero .lead { color: var(--on-dark); font-size: 17px; max-width: 740px; margin: 18px 0 0; }
.page-hero .meta { color: var(--on-dark-2); margin-top: 14px; }
.page-hero .verify { background: rgba(232,198,124,.18); color: var(--gold); }

.star-rule { display: flex; align-items: center; gap: 12px; margin: 18px 0 0; }
.star-rule::before, .star-rule::after { content: ""; width: 44px; height: 1px; background: var(--gold); opacity: .8; }
.star-rule svg { width: 16px; height: 16px; fill: var(--gold); }

.page-hero .breadcrumbs, .page-hero .breadcrumbs a { color: var(--on-dark-2); }
.page-hero .breadcrumbs li + li::before { color: var(--on-dark-2); }

/* Главная: крупный первый экран с плитками */
.page-hero.home { padding: 40px 0 48px; }
.page-hero.home h1 { font-size: clamp(30px, 7vw, 48px); }
.hero-tiles {
  display: grid; grid-template-columns: 1fr; margin-top: 28px;
  border: 1px solid rgba(190,203,190,.28); border-radius: var(--radius-lg); overflow: hidden;
  background: rgba(255,255,255,.04);
}
@media (min-width: 640px) { .hero-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .hero-tiles { grid-template-columns: repeat(4, 1fr); } }
.hero-tile { padding: 18px 20px; border-bottom: 1px solid rgba(190,203,190,.2); color: var(--on-dark); text-decoration: none; display: block; }
@media (min-width: 640px) { .hero-tile:nth-child(odd) { border-right: 1px solid rgba(190,203,190,.2); } }
@media (min-width: 1000px) { .hero-tile { border-bottom: 0; border-right: 1px solid rgba(190,203,190,.2); } .hero-tile:last-child { border-right: 0; } }
a.hero-tile:hover { background: rgba(255,255,255,.05); }
.hero-tile small { display: block; color: var(--on-dark-2); font-size: 13px; }
.hero-tile strong { display: block; color: #fff; font: 700 19px/1.3 var(--font-head); margin-top: 4px; }

/* ---------- Хлебные крошки ---------- */
.breadcrumbs { font-size: 13px; color: var(--ink-3); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; }

/* ---------- Типографика статьи ---------- */
main { display: block; padding-bottom: 56px; }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); }
h2 { font-size: clamp(22px, 4.4vw, 28px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.25; margin: 44px 0 14px; scroll-margin-top: 84px; }
h3 { font-size: 18px; font-weight: 700; line-height: 1.35; margin: 28px 0 8px; }
.lead { font-size: 18px; color: var(--ink-2); }
.meta { font-size: 13px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 16px; }

.article { max-width: var(--text); }
.article p, .article ul, .article ol { margin: 0 0 14px; }
.article li { margin-bottom: 6px; }

.layout { display: grid; gap: 32px; padding-top: 32px; }
@media (min-width: 1020px) {
  .layout { grid-template-columns: minmax(0, var(--text)) 320px; justify-content: space-between; }
  .aside { position: sticky; top: 92px; align-self: start; }
}
.article-wide { padding-top: 8px; }

/* ---------- Блоки ---------- */
.answer {
  background: var(--surface); border: 1px solid var(--line-soft); border-left: 4px solid var(--green);
  border-radius: var(--radius); padding: 18px 20px; margin: 0 0 24px;
  box-shadow: 0 1px 2px rgba(32,44,38,.04);
}
.answer strong:first-child { display: block; font: 700 12px/1.4 var(--font-head); letter-spacing: .08em; text-transform: uppercase; color: var(--green); margin-bottom: 6px; }
.answer p:last-child { margin-bottom: 0; }

.note {
  background: var(--warn-soft); border-left: 4px solid var(--gold);
  border-radius: var(--radius); padding: 14px 18px; margin: 24px 0; font-size: 15px;
}
.note p:last-child { margin-bottom: 0; }

.help {
  background: var(--surface-2); border-left: 4px solid var(--green);
  border-radius: var(--radius); padding: 14px 18px; margin: 24px 0;
}
.help p:last-child { margin-bottom: 0; }

.toc { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px 20px; font-size: 15px; }
.toc h2 { font: 700 12px/1.4 var(--font-head); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 4px; }
.toc li::marker { color: var(--green); font-weight: 700; }

.table-wrap { overflow-x: auto; margin: 16px 0 20px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
caption { text-align: left; padding: 12px 14px 0; font: 700 14px/1.4 var(--font-head); }
th, td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
thead th { background: var(--green-deep); color: var(--on-dark); font: 600 13px/1.4 var(--font-head); }
tbody tr:nth-child(even) td { background: #fafbf8; }
tbody tr:last-child td { border-bottom: 0; }
td.num { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 48px; margin-bottom: 16px; min-height: 32px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 32px; height: 32px; border-radius: var(--radius);
  background: var(--green); color: #fff;
  display: grid; place-items: center; font: 700 15px/1 var(--font-head);
}

.checklist { list-style: none; padding: 0; }
.checklist li { padding-left: 28px; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 14px; height: 8px; border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg); }

/* Карточки разделов */
.cards { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 16px 0 8px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .cards.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.card {
  display: block; background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg); padding: 20px 22px; color: var(--ink); text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.card:hover { border-color: var(--line); box-shadow: 0 6px 18px rgba(32,44,38,.08); transform: translateY(-2px); }
.card h3 { margin: 0 0 6px; font-size: 18px; color: var(--ink); }
.card p { margin: 0; color: var(--ink-3); font-size: 15px; }
.card.urgent { border-top: 3px solid var(--gold); }
.card.urgent h3 { color: var(--green); }

/* Секции главной на белом фоне */
.band { background: var(--surface); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 8px 0 36px; margin: 40px 0 0; }
.band .card { background: var(--bg); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head a { font: 600 14px/1.3 var(--font-head); }

/* Контакты */
.contact { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); padding: 18px 20px; margin: 12px 0; }
.contact h3 { margin: 0 0 6px; font-size: 17px; }
.contact p { margin: 0 0 4px; font-size: 15px; }
.contact .tel { font: 700 20px/1.3 var(--font-head); text-decoration: none; color: var(--green); }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); margin: 8px 0; padding: 0 20px; }
.faq summary { cursor: pointer; padding: 16px 32px 16px 0; font: 600 16px/1.4 var(--font-head); list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: 13px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-2); color: var(--green); display: grid; place-items: center; font-size: 18px; line-height: 1;
}
.faq details[open] summary::after { content: "−"; background: var(--gold); color: var(--gold-ink); }
.faq details > div { padding-bottom: 16px; }
.faq details > div p:last-child { margin-bottom: 0; }

.sources-note { font-size: 13px; color: var(--ink-3); margin: 0 0 10px; }
.sources { font-size: 14px; color: var(--ink-2); }
.sources li { margin-bottom: 6px; }

/* Боковая колонка */
.aside .box { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 16px; font-size: 14px; }
.aside .box.dark { background: var(--green-deep); border-color: var(--green-deep); color: var(--on-dark); }
.aside .box.dark h2 { color: var(--gold); }
.aside .box.dark li { border-color: rgba(190,203,190,.2); }
.aside .box.dark a { color: #fff; }
.aside .box h2 { font: 700 12px/1.4 var(--font-head); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; }
.aside .box ul { list-style: none; padding: 0; margin: 0; }
.aside .box li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.aside .box li:last-child { border-bottom: 0; }
.aside .tel { font: 700 18px/1.3 var(--font-head); text-decoration: none; }

/* ---------- Подвал ---------- */
.site-footer { background: var(--green-footer); color: var(--on-dark-2); padding: 40px 0 36px; font-size: 14px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.site-footer h2 { font: 700 13px/1.4 var(--font-head); letter-spacing: .06em; text-transform: uppercase; color: var(--gold); margin: 0 0 12px; }
.site-footer p { color: var(--on-dark-2); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--on-dark); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.disclaimer { font-size: 13px; color: var(--on-dark-2); margin-top: 28px; border-top: 1px solid rgba(190,203,190,.2); padding-top: 18px; }

/* Метка «требует проверки» — видна редактору, перед публикацией убрать */
.verify { background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }

/* ---------- Печать (памятка) ---------- */
@media print {
  .site-header, .site-footer, .aside, .breadcrumbs, .skip-link, .toc, .btn-row, .hero-tiles { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .page-hero { background: none; color: #000; padding: 0; }
  .page-hero h1, .page-hero .lead { color: #000; }
  a { color: #000; }
  .layout { display: block; }
  .faq details > div { display: block; }
  .verify { display: none; }
}
