/* ─────────────────────────────────────────────────────
   Гранти для релігійних організацій — стилі
   Editorial minimalist, без gradients, без emoji, без cards-on-gradient
   ───────────────────────────────────────────────────── */

:root {
  --bg: #FAFAF7;
  --bg-alt: #F2F0E9;
  --bg-dark: #1A1A1A;
  --ink: #1A1A1A;
  --ink-soft: #4A4A4A;
  --ink-mute: #8A8A8A;
  --accent: #B8472A;
  --accent-soft: #D4593A;
  --rule: #DAD7CD;
  --rule-soft: #ECE9E0;
  --green: #4A6B3F;
  --warn: #B8472A;

  --font-display: "Spectral", "Lora", Georgia, serif;
  --font-body: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;

  --measure: 68ch;
  --gutter: clamp(20px, 5vw, 56px);
  --nav-w: 280px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

/* ─── Навігація ─── */

.layout {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  min-height: 100vh;
}

.nav {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--nav-w);
  padding: 32px 28px;
  background: var(--bg-alt);
  border-right: 1px solid var(--rule);
  overflow-y: auto;
  z-index: 10;
}

.nav__brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  color: var(--ink);
}

.nav__sub {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 32px;
}

.nav__list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: navc;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav__list li { display: contents; }

.nav__list a {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-soft);
  transition: color 120ms;
}

.nav__list a::before {
  counter-increment: navc;
  content: counter(navc, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  font-weight: 500;
  flex-shrink: 0;
}

.nav__list a:hover,
.nav__list a.is-active {
  color: var(--accent);
}

.nav__list a:hover::before,
.nav__list a.is-active::before {
  color: var(--accent);
}

.nav__foot {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--ink-mute);
  line-height: 1.5;
}

/* ─── Контент ─── */

.main {
  grid-column: 2;
  padding: 0 var(--gutter);
  max-width: 100%;
}

.section {
  padding: 96px 0 80px;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 24px;
}

.section:last-child { border-bottom: none; }

.section__inner {
  max-width: var(--measure);
  margin: 0 auto;
}

.section__num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 12px;
  font-weight: 500;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(38px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 500;
  margin: 0 0 16px;
  color: var(--ink);
}

.section__lede {
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.45;
  color: var(--ink-soft);
  margin: 0 0 56px;
  font-weight: 400;
  font-style: italic;
}

/* ─── Hero ─── */

.hero {
  padding: 14vh 0 12vh;
  border-bottom: 1px solid var(--rule);
}

.hero__inner {
  max-width: 880px;
  margin: 0 auto;
}

.hero__kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 28px;
  font-weight: 500;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(56px, 8vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 0 0 32px;
  color: var(--ink);
}

.hero__title em {
  font-style: italic;
  color: var(--accent);
}

.hero__lede {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.4;
  color: var(--ink-soft);
  max-width: 720px;
  margin: 0 0 56px;
  font-weight: 400;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}

.stat__num {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 8px;
}

.stat__label {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-soft);
  margin: 0;
}

/* ─── Текстові елементи ─── */

.section h3 {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 56px 0 16px;
  font-weight: 500;
  color: var(--ink);
}

.section h4 {
  font-size: 18px;
  line-height: 1.4;
  margin: 32px 0 12px;
  font-weight: 600;
  color: var(--ink);
}

.section p {
  margin: 0 0 18px;
}

.section strong { color: var(--ink); font-weight: 600; }

.section em { font-style: italic; }

.section a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.section a:hover { text-decoration-thickness: 2px; }

.section ul, .section ol {
  margin: 0 0 24px;
  padding-left: 24px;
}

.section ul li,
.section ol li {
  margin-bottom: 6px;
}

.section ul li::marker { color: var(--accent); }

/* ─── Pull quote ─── */

.pullquote {
  border-left: 3px solid var(--accent);
  padding: 8px 0 8px 24px;
  margin: 32px 0;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink);
  font-style: italic;
}

/* ─── Callout ─── */

.callout {
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  padding: 24px 28px;
  margin: 32px 0;
  position: relative;
}

.callout--warn {
  border-color: var(--accent);
  border-left-width: 4px;
}

.callout__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 10px;
}

.callout p:last-child { margin-bottom: 0; }

/* ─── Таблиці ─── */

.table-wrap {
  margin: 32px 0;
  border: 1px solid var(--rule);
  overflow-x: auto;
}

.section table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

.section th {
  text-align: left;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.section td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}

.section tbody tr:last-child td { border-bottom: none; }

.section tbody tr:hover { background: var(--rule-soft); }

td.num,
th.num { font-family: var(--font-mono); white-space: nowrap; }

.tag-yes { color: var(--green); font-weight: 600; }
.tag-no { color: var(--accent); font-weight: 600; }
.tag-mid { color: var(--ink-soft); font-weight: 600; }

/* ─── Кроки ─── */

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 32px 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 20px 0 20px 64px;
  border-top: 1px solid var(--rule-soft);
}

.steps li:last-child { border-bottom: 1px solid var(--rule-soft); }

.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.steps strong {
  display: block;
  font-size: 18px;
  font-family: var(--font-display);
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--ink);
}

/* ─── KPI grid ─── */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  margin: 32px 0;
  border: 1px solid var(--rule);
}

.kpi {
  padding: 24px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.kpi:last-child { border-right: none; }

@media (max-width: 720px) {
  .kpi { border-right: none; }
}

.kpi__num {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--accent);
}

.kpi__label {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* ─── Ідея-карточки (без cards-on-gradient — це строгі строки) ─── */

.ideas {
  list-style: none;
  padding: 0;
  margin: 32px 0;
  counter-reset: idea;
}

.ideas > li {
  counter-increment: idea;
  position: relative;
  padding: 24px 0 24px 64px;
  border-top: 1px solid var(--rule);
}

.ideas > li:last-child { border-bottom: 1px solid var(--rule); }

.ideas > li::before {
  content: counter(idea, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  font-weight: 500;
}

.ideas h4 {
  margin: 0 0 8px;
  font-size: 18px;
  font-family: var(--font-display);
  font-weight: 500;
}

.ideas p { margin: 4px 0; font-size: 15px; line-height: 1.6; }

.ideas .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 8px;
}

/* ─── Footer ─── */

.foot {
  background: var(--bg-dark);
  color: var(--bg);
  padding: 80px var(--gutter);
}

.foot__inner {
  max-width: var(--measure);
  margin: 0 auto;
}

.foot__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 500;
  margin: 0 0 24px;
  color: var(--bg);
}

.foot__text { color: rgba(250, 250, 247, 0.7); font-size: 16px; line-height: 1.7; }
.foot__text a { color: var(--bg); }

/* ─── Code ─── */

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--rule-soft);
  padding: 2px 6px;
  border-radius: 2px;
  color: var(--ink);
}

pre {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  background: var(--bg-dark);
  color: #E8E6DD;
  padding: 24px;
  margin: 24px 0;
  overflow-x: auto;
}

pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* ─── Iconify ─── */

iconify-icon {
  display: inline-block;
  vertical-align: -0.125em;
  width: 1em;
  height: 1em;
}

/* ─── Mobile ─── */

@media (max-width: 900px) {
  :root { --nav-w: 100%; }

  .layout { display: block; }

  .nav {
    position: relative;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--rule);
    height: auto;
    padding: 24px 20px;
    overflow: visible;
  }

  .nav__list { flex-direction: row; flex-wrap: wrap; gap: 4px 16px; }
  .nav__list a { padding: 6px 0; border-bottom: none; font-size: 13px; }
  .nav__foot { display: none; }

  .main { padding: 0 20px; }

  .section { padding: 64px 0 56px; }

  .hero { padding: 60px 0 48px; }

  .hero__stats { grid-template-columns: 1fr; gap: 16px; }
}
