/* Dotacje.co.uk — system font stack (Polish glyphs), no external assets */
:root {
  --ink: #15211e;
  --ink-soft: #3d4b47;
  --muted: #5b6965;
  --paper: #f7f5f0;
  --surface: #ffffff;
  --line: #d9ddd6;
  --brand: #0d5c50;
  --brand-dark: #073f37;
  --brand-tint: #e3f0ec;
  --gold: #f2b33d;
  --gold-tint: #fff4dc;
  --energy: #0d5c50;
  --energy-tint: #e3f0ec;
  --kids: #3d40b0;
  --kids-tint: #ebebfb;
  --money: #9a4216;
  --money-tint: #fbeee5;
  --focus: #b34700;
  --radius: 14px;
  --measure: 70ch;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  overflow-wrap: break-word;
}
@media (min-width: 48em) { body { font-size: 1.125rem; } }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.2; color: var(--ink); overflow-wrap: break-word; hyphens: manual; }
@media (max-width: 30em) { h1, h2, h3 { hyphens: auto; } }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.75rem); letter-spacing: -0.015em; margin: 0.25em 0 0.4em; font-weight: 800; }
h2 { font-size: clamp(1.4rem, 1.15rem + 1.1vw, 1.85rem); margin: 0 0 0.6em; font-weight: 750; }
h3 { font-size: 1.2rem; margin: 1.6em 0 0.5em; font-weight: 700; }
h4 { font-size: 1.05rem; margin: 1.4em 0 0.4em; }
p, ul, ol, dl { margin: 0 0 1em; }
a { color: var(--brand); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: var(--brand-dark); text-decoration-thickness: 0.14em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
code { font-size: 0.92em; background: #eef0ec; padding: 0.05em 0.3em; border-radius: 4px; }
strong { font-weight: 700; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 10; background: var(--ink); color: #fff;
  padding: 0.75rem 1rem; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 1rem; color: #fff; }
main:focus { outline: none; }

.wrap { width: 100%; max-width: 76rem; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 48rem; }
@media (min-width: 48em) { .wrap { padding: 0 2rem; } }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); min-height: 44px; min-width: 0; max-width: 100%; }
.logo-mark { width: 2.4rem; height: 2.4rem; flex: none; }
.brand-name { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; }
.brand-name { min-width: 0; }
.brand-name span { color: var(--brand); display: inline-block; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0.4rem 0.8rem; border-radius: 999px;
  text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 0.97rem;
}
.site-nav a:hover { background: var(--brand-tint); color: var(--brand-dark); }
.site-nav a[aria-current="page"] { background: var(--brand); color: #fff; }

/* Home hero */
.home-hero { background: linear-gradient(180deg, #fff 0%, var(--paper) 100%); padding: 2.5rem 0 2rem; }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.hero-grid > * { min-width: 0; }
@media (min-width: 60em) { .hero-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } .home-hero { padding: 3.5rem 0 3rem; } }
.hero-art svg { width: 100%; height: auto; max-width: 26rem; display: block; margin: 0 auto; }
@media (max-width: 59.99em) { .hero-art { display: none; } }
.lead { font-size: 1.15em; color: var(--ink-soft); max-width: 60ch; }
.kicker { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.95rem; color: var(--brand-dark); margin: 0; flex-wrap: wrap; }
.kicker svg { width: 1.6rem; height: 1.6rem; flex: none; }
.kicker-plain { color: var(--muted); font-weight: 600; }
.hero-links { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.hero-links a {
  display: inline-flex; align-items: center; gap: 0.55rem; min-height: 48px; padding: 0.55rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none;
  color: var(--ink); font-weight: 650; box-shadow: 0 1px 2px rgba(21, 33, 30, 0.06);
}
.hero-links a:hover { border-color: var(--brand); color: var(--brand-dark); }
.hero-links svg { width: 1.5rem; height: 1.5rem; color: var(--brand); flex: none; }

/* Cards */
.guides { padding: 2.5rem 0 1rem; }
.section-lead { color: var(--ink-soft); max-width: 62ch; }
.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); margin: 1.5rem 0; }
.card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--accent, var(--brand));
  border-radius: var(--radius); padding: 1.4rem 1.4rem 1.2rem; box-shadow: 0 1px 3px rgba(21, 33, 30, 0.06);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card:hover { box-shadow: 0 8px 24px rgba(21, 33, 30, 0.1); }
@media (prefers-reduced-motion: no-preference) { .card:hover { transform: translateY(-2px); } }
.card:focus-within { box-shadow: 0 0 0 3px var(--focus); }
.card-energy { --accent: var(--energy); --tint: var(--energy-tint); }
.card-kids { --accent: var(--kids); --tint: var(--kids-tint); }
.card-money { --accent: var(--money); --tint: var(--money-tint); }
.card-icon { width: 3.25rem; height: 3.25rem; border-radius: 12px; display: grid; place-items: center; background: var(--tint, var(--brand-tint)); color: var(--accent, var(--brand)); margin-bottom: 0.9rem; }
.card-icon svg { width: 2.1rem; height: 2.1rem; }
.card-kicker { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent, var(--brand)); margin: 0 0 0.3rem; }
.card-title { font-size: 1.25rem; margin: 0 0 0.6rem; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-title a:focus-visible { outline: none; }
.card-title a:hover { color: var(--accent); text-decoration: underline; }
.card p { color: var(--ink-soft); }
.card-points { padding-left: 1.2rem; color: var(--ink-soft); font-size: 0.97rem; }
.card-points li { margin-bottom: 0.3rem; }
.card-meta { margin: auto 0 0; padding-top: 0.8rem; border-top: 1px dashed var(--line); font-size: 0.9rem; color: var(--muted) !important; }
.cards-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }

/* Article hero */
.article-hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 1.25rem 0 2rem; }
.hero-energy { background: linear-gradient(180deg, var(--energy-tint), #fff 85%); }
.hero-kids { background: linear-gradient(180deg, var(--kids-tint), #fff 85%); }
.hero-kids .kicker { color: var(--kids); }
.hero-money { background: linear-gradient(180deg, var(--money-tint), #fff 85%); }
.hero-money .kicker { color: var(--money); }
.hero-neutral { background: linear-gradient(180deg, var(--brand-tint), #fff 85%); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 1rem; font-size: 0.92rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin: 0 0.5rem; color: var(--muted); }
.breadcrumbs a { color: var(--ink-soft); display: inline-block; padding: 0.35rem 0; }
.facts { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); margin: 1.5rem 0 0; }
.facts div { min-width: 0; background: rgba(255, 255, 255, 0.85); border: 1px solid var(--line); border-radius: 12px; padding: 0.75rem 1rem; }
.facts dt { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.facts dd { margin: 0.15rem 0 0; font-weight: 600; font-size: 0.98rem; line-height: 1.45; }

/* Article layout */
.article-layout { display: grid; gap: 2rem; padding-top: 2rem; padding-bottom: 2.5rem; }
.article-layout > * { min-width: 0; }
@media (min-width: 64em) {
  .article-layout { grid-template-columns: 17rem minmax(0, 1fr); gap: 3rem; }
  .toc { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
}
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.toc-title { font-weight: 800; margin: 0 0 0.5rem; }
.toc ol { margin: 0; padding-left: 1.3rem; font-size: 0.95rem; line-height: 1.4; }
.toc li { margin: 0.1rem 0; }
.toc a { display: block; padding: 0.35rem 0; color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--brand); text-decoration: underline; }

.prose { max-width: var(--measure); }
.prose > section, .home-content > section { padding-top: 0.5rem; margin-bottom: 2.25rem; }
.prose h2 { padding-top: 0.5rem; border-top: 3px solid var(--brand-tint); padding-top: 1rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.4rem; }
.prose li::marker { color: var(--brand); }
.note { font-size: 0.93rem; color: var(--muted); font-style: italic; }

ol.steps { list-style: none; counter-reset: step; padding-left: 0; }
ol.steps > li { counter-increment: step; position: relative; padding: 0.15rem 0 0.5rem 2.6rem; min-height: 2rem; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0.05rem; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 0.9rem; display: grid; place-items: center;
}

/* Program facts box */
.program { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: 12px; padding: 1rem 1.1rem; margin: 0 0 1.5rem; }
.program-title { font-weight: 800; margin: 0 0 0.5rem; }
.program dl { margin: 0; display: grid; gap: 0.15rem; }
.program dl div { display: grid; grid-template-columns: minmax(0, 10.5rem) minmax(0, 1fr); gap: 0.25rem 1rem; padding: 0.45rem 0; border-top: 1px solid #eceee9; }
.program dl div:first-child { border-top: 0; }
.program dt { font-weight: 700; color: var(--ink-soft); font-size: 0.95rem; }
.program dd { margin: 0; font-size: 0.97rem; }
@media (max-width: 36em) { .program dl div { grid-template-columns: minmax(0, 1fr); } }

/* Boxes */
.box { border-radius: 12px; padding: 1rem 1.15rem 0.3rem; margin: 1.5rem 0; border: 1px solid var(--line); background: var(--surface); }
.box-title { font-weight: 700; margin-bottom: 0.5rem; }
.box-kind { display: inline-block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; padding: 0.15rem 0.55rem; border-radius: 999px; margin-right: 0.35rem; vertical-align: 0.1em; }
.box-przyklad { background: #fbfaf6; border-color: #e7e1cf; }
.box-przyklad .box-kind { background: var(--gold-tint); color: #6a4700; border: 1px solid #ecd39a; }
.box-uwaga { background: var(--gold-tint); border-color: #ecd39a; }
.box-uwaga .box-kind { background: #fff; color: #6a4700; border: 1px solid #ecd39a; }
.box-wazne { background: var(--brand-tint); border-color: #bfdcd3; }
.box-wazne .box-kind { background: #fff; color: var(--brand-dark); border: 1px solid #bfdcd3; }
figure.box { margin-left: 0; margin-right: 0; }

/* Tables */
.table-wrap { max-width: 100%; overflow-x: auto; margin: 1rem 0 1.5rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.97rem; }
caption { text-align: left; padding: 0.75rem 1rem 0; font-weight: 700; }
th, td { text-align: left; vertical-align: top; padding: 0.65rem 1rem; border-bottom: 1px solid #eceee9; }
thead th { background: #f1f4f1; font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
tbody th { font-weight: 600; }
tbody tr:last-child > * { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 40em) {
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  table, thead, tbody, tr, th, td { display: block; width: 100%; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  caption { display: block; padding: 0 0 0.6rem; }
  tr { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 0.75rem; padding: 0.35rem 0; }
  tbody th, td { border: 0; padding: 0.35rem 1rem; text-align: left; white-space: normal; }
  tbody th { font-weight: 700; padding-top: 0.55rem; }
  td::before { content: attr(data-label); display: block; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
  .table-wrap .num { text-align: left; white-space: normal; }
  td::before { white-space: normal; overflow-wrap: anywhere; }
}

/* FAQ, sources, disclaimer */
.faq-item { border-top: 1px solid var(--line); padding: 0.4rem 0 0.2rem; }
.faq-item h3 { margin: 0.8rem 0 0.4rem; font-size: 1.1rem; }
.sources ol { font-size: 0.95rem; }
.sources a { overflow-wrap: anywhere; }
.disclaimer { display: flex; gap: 0.75rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; font-size: 0.95rem; color: var(--ink-soft); }
.disclaimer svg { width: 1.5rem; height: 1.5rem; flex: none; color: var(--brand); margin-top: 0.1rem; }
.disclaimer span { min-width: 0; }

/* Related */
.related { background: #eef2ee; border-top: 1px solid var(--line); padding: 2.5rem 0 1.5rem; }

/* Home content */
.home-content, .page-body { padding-top: 1.5rem; padding-bottom: 2.5rem; }
.home-content .table-wrap { max-width: 100%; }
.button { display: inline-flex; align-items: center; min-height: 48px; padding: 0.6rem 1.2rem; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 700; text-decoration: none; }
.button:hover { background: var(--brand-dark); color: #fff; }
.back-home { margin: 1rem 0 3rem; }

/* Footer */
.site-footer { background: #10231f; color: #d6e2de; padding: 2.5rem 0 2rem; margin-top: 0; font-size: 0.95rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.footer-grid > * { min-width: 0; }
.footer-brand, .footer-head { color: #fff; font-weight: 800; margin-bottom: 0.4rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li a { display: inline-block; padding: 0.3rem 0; }
.site-footer :focus-visible { outline-color: var(--gold); }

@media print {
  .site-header, .site-footer, .toc-col, .related, .skip-link { display: none; }
  body { background: #fff; }
  a.ext::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}
