/* Грантотека — просвітницький проєкт ГО «Спільнота КСВ»
   Статика, нуль зовнішніх залежностей. Системний шрифтовий стек. */

:root {
  --bg: #f4f9fd;
  --surface: #ffffff;
  --surface-2: #e9f4fc;
  --ink: #0b2748;
  --ink-soft: #33506e;
  --muted: #61718020;
  --muted-text: #5a7086;
  --primary: #002a57;
  --primary-2: #0077c2;
  --accent: #0094e9;
  --line: #dbe8f2;
  --line-strong: #c3d8e8;
  --ok: #2f6b46;
  --focus: #0094e9;
  --maxw: 1080px;
  --readw: 720px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20,39,60,.05), 0 6px 20px rgba(20,39,60,.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

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

img { max-width: 100%; height: auto; }

a { color: var(--primary-2); text-underline-offset: 2px; }
a:hover { color: var(--primary); }

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

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--primary); color: #fff; padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 20px; max-width: var(--maxw); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 9px;
  background: var(--primary); color: #fff; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 22px; line-height: 1;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.brand-sub { font-size: 12px; color: var(--muted-text); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  text-decoration: none; color: var(--ink-soft); font-size: 16px; font-weight: 500;
  padding: 8px 12px; border-radius: 8px;
}
.nav a:hover { background: var(--surface-2); color: var(--primary); }
.nav a[aria-current="page"] { color: var(--primary); background: var(--surface-2); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 8px 10px; font-size: 15px; cursor: pointer; color: var(--ink);
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 8px; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 8px 14px 16px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 420px at 12% -10%, #0094e920, transparent),
    radial-gradient(900px 360px at 92% 0%, #70cbff26, transparent),
    linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding: 64px 0 56px;
}
.hero-badge {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .03em;
  text-transform: uppercase; color: var(--primary-2);
  background: #0094e914; border: 1px solid #0094e93a;
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--serif); font-size: clamp(30px, 5vw, 46px); line-height: 1.12;
  letter-spacing: -.015em; margin: 0 0 16px; max-width: 18ch; color: var(--ink);
}
.hero p.lead { font-size: clamp(18px, 2.4vw, 21px); color: var(--ink-soft); max-width: 60ch; margin: 0 0 26px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-weight: 600; font-size: 16px; padding: 12px 20px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #0f2f4d; color: #fff; }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Sections ---------- */
main { display: block; }
section { padding: 52px 0; }
.section-title { font-family: var(--serif); font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -.01em; margin: 0 0 8px; }
.section-intro { color: var(--muted-text); max-width: 62ch; margin: 0 0 32px; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.card h3 { font-size: 20px; margin: 0 0 8px; letter-spacing: -.01em; }
.card p { color: var(--muted-text); margin: 0 0 16px; font-size: 16px; }
.card .card-link { margin-top: auto; font-weight: 600; text-decoration: none; }
.card .card-link::after { content: " →"; }

a.card { text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }

.card-num {
  width: 34px; height: 34px; border-radius: 8px; background: var(--surface-2);
  color: var(--primary); font-weight: 700; display: grid; place-items: center;
  margin-bottom: 14px; font-size: 15px; border: 1px solid var(--line);
}

/* ---------- Alt band ---------- */
.band { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- Article ---------- */
.article { padding: 44px 0 20px; }
.article-head { max-width: var(--readw); margin: 0 auto 8px; }
.breadcrumb { font-size: 14px; color: var(--muted-text); margin-bottom: 16px; }
.breadcrumb a { color: var(--muted-text); }
.article-head h1 { font-family: var(--serif); font-size: clamp(28px, 4.4vw, 40px); line-height: 1.15; letter-spacing: -.015em; margin: 0 0 12px; }
.article-meta { color: var(--muted-text); font-size: 15px; }
.prose { max-width: var(--readw); margin: 0 auto; }
.prose > p, .prose > ul, .prose > ol, .prose > h2, .prose > h3, .prose > blockquote, .prose > .callout, .prose > figure, .prose > table { margin-left: auto; margin-right: auto; }
.prose h2 { font-family: var(--serif); font-size: 27px; letter-spacing: -.01em; margin: 40px 0 12px; padding-top: 8px; }
.prose h3 { font-size: 21px; margin: 28px 0 8px; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 24px; }
.prose li { margin: 8px 0; }
.prose blockquote {
  border-left: 4px solid var(--primary-2); background: var(--surface-2);
  margin: 24px 0; padding: 14px 20px; border-radius: 0 8px 8px 0; color: var(--ink-soft);
}

.callout {
  border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: var(--radius); padding: 18px 20px; margin: 24px 0;
}
.callout-title { font-weight: 700; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.callout.info { border-left: 4px solid var(--primary-2); }
.callout.warn { border-left: 4px solid var(--accent); }
.callout p:last-child { margin-bottom: 0; }

.toc {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin: 0 auto 32px; max-width: var(--readw);
}
.toc strong { display: block; margin-bottom: 8px; font-size: 15px; color: var(--muted-text); text-transform: uppercase; letter-spacing: .03em; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 4px 0; }

table {
  width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; }
tr:last-child td { border-bottom: none; }

.article-nav { max-width: var(--readw); margin: 40px auto 0; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }

/* ---------- Definition / data lists ---------- */
.data-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 22px; margin: 0; }
.data-list dt { font-weight: 600; color: var(--muted-text); }
.data-list dd { margin: 0; }
@media (max-width: 560px) { .data-list { grid-template-columns: 1fr; gap: 2px; } .data-list dd { margin-bottom: 10px; } }

/* ---------- Page intro (non-home) ---------- */
.page-head { padding: 48px 0 8px; }
.page-head h1 { font-family: var(--serif); font-size: clamp(28px, 4.4vw, 40px); letter-spacing: -.015em; margin: 0 0 12px; }
.page-head p { color: var(--ink-soft); max-width: 62ch; margin: 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: #002a57; color: #c2d6e8; margin-top: 40px;
  padding: 48px 0 32px; font-size: 15px; line-height: 1.6;
}
.site-footer a { color: #7cc6f5; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } }
.site-footer h4 { color: #fff; font-size: 15px; margin: 0 0 12px; text-transform: uppercase; letter-spacing: .04em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 6px 0; }
.footer-org-name { color: #fff; font-weight: 600; }
.footer-legal {
  margin-top: 32px; padding-top: 20px; border-top: 1px solid #ffffff1a;
  font-size: 13px; color: #8ba0b2; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
}
.nonprofit-tag { color: #a7d0b3; }

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.lead-list { list-style: none; padding: 0; margin: 0; }
.lead-list li { padding-left: 28px; position: relative; margin: 12px 0; }
.lead-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--ok); font-weight: 700; }

/* Плашка оффера в першому екрані: статична, видна без JavaScript (08.10.2026) */
.gq-offer { background: var(--surface); border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; margin: 16px 0 10px; box-shadow: var(--shadow); }
.gq-offer p { margin: 0 0 10px; font-size: 16px; line-height: 1.55; color: var(--ink); }
.gq-offer p:last-child { margin-bottom: 0; }
.gq-offer-btn { display: inline-block; background: var(--primary-2); color: #fff !important; text-decoration: none; font-weight: 700; font-size: 16px; padding: 10px 18px; border-radius: 99px; }
.gq-offer-btn:hover, .gq-offer-btn:focus { background: var(--primary); }

/* Калькулятор суми гранту «Власна справа» */
.gq-calc { background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 14px; padding: 18px 18px 20px; margin: 22px 0; }
.gq-calc h2 { margin-top: 0; }
.gq-calc fieldset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.gq-calc legend { font-weight: 700; font-size: 16px; margin-bottom: 6px; padding: 0; }
.gq-calc label { display: flex; align-items: flex-start; gap: 9px; font-size: 16px; line-height: 1.45; margin: 6px 0; cursor: pointer; }
.gq-calc input[type=radio], .gq-calc input[type=checkbox] { margin-top: 4px; width: 17px; height: 17px; flex: none; }
.gq-calc input[type=range] { width: 100%; accent-color: var(--primary-2); }
.gq-calc .gqc-base { font-weight: 700; }
.gq-calc output { display: block; background: var(--surface); border-radius: var(--radius); padding: 12px 14px; font-size: 18px; margin: 4px 0 12px; }
.gq-calc output span { font-size: 15px; color: var(--muted-text); }
.gq-calc .gqc-note { font-size: 14px; color: var(--muted-text); margin: 0 0 12px; }
.gq-calc .gq-offer-btn { border: 0; cursor: pointer; font-family: inherit; }
