/* fundusze2028.pl – wspólny arkusz stylów */
:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f0eee8;
  --text: #1a1d1b;
  --text-2: #4f5551;
  --muted: #6b706c;
  --border: #e3e0d8;
  --accent: #0a7f5a;        /* słupki wykresu, przyciski */
  --accent-ink: #0a6b4c;    /* linki i tekst w kolorze akcentu */
  --accent-soft: #e3f2ec;
  --on-accent: #ffffff;
  --note-bg: #fff7e2;
  --note-border: #e6c467;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 22, .05), 0 4px 16px rgba(20, 24, 22, .04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121413;
    --surface: #1c1f1e;
    --surface-2: #232725;
    --text: #ecece8;
    --text-2: #b9bdb8;
    --muted: #9aa09b;
    --border: #2f3431;
    --accent: #2fa882;
    --accent-ink: #5cc9a4;
    --accent-soft: #183a2f;
    --on-accent: #0d1a14;
    --note-bg: #2b2618;
    --note-border: #6b5a26;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--font);
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent-ink); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Nagłówek */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 750; font-size: 19px; letter-spacing: -.01em; }
.logo-mark { width: 32px; height: 32px; flex: none; }
.logo span b { color: var(--accent-ink); font-weight: 750; }
.nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 550; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav-mobile { display: none; position: relative; }
.nav-mobile summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-weight: 600; font-size: 15px; }
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile ul { flex-direction: column; position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; box-shadow: 0 8px 30px rgba(0,0,0,.12); z-index: 5; }

@media (max-width: 900px) {
  .nav-desktop { display: none !important; }
  .nav-mobile { display: block; }
}

/* Okruszki i nagłówek artykułu */
.crumbs { font-size: 14px; color: var(--muted); margin: 24px 0 8px; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { margin: 0 6px; }

h1, h2, h3 { line-height: 1.22; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: clamp(30px, 5vw, 44px); margin: 8px 0 14px; font-weight: 780; }
h2 { font-size: clamp(23px, 3.2vw, 28px); margin: 44px 0 12px; font-weight: 740; scroll-margin-top: 16px; }
h3 { font-size: 19px; margin: 28px 0 8px; font-weight: 700; }
p { margin: 0 0 16px; }
.lead { font-size: 19px; color: var(--text-2); margin-bottom: 20px; }
.meta { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 24px; }

article ul, article ol { padding-left: 22px; margin: 0 0 18px; }
article li { margin-bottom: 6px; }
article li::marker { color: var(--accent-ink); }
strong { font-weight: 680; }

/* Spis treści */
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin: 8px 0 28px; }
.toc p { font-weight: 700; margin: 0 0 6px; font-size: 15px; }
.toc ol { margin: 0; padding-left: 20px; font-size: 15px; }
.toc li { margin: 3px 0; }

/* Ramki */
.note, .key { border-radius: var(--radius); padding: 16px 18px; margin: 22px 0; }
.note { background: var(--note-bg); border: 1px solid var(--note-border); }
.key { background: var(--accent-soft); border: 1px solid transparent; }
.note > :last-child, .key > :last-child { margin-bottom: 0; }
.note strong:first-child, .key strong:first-child { display: block; margin-bottom: 4px; }

/* Tabele */
.table-wrap { overflow-x: auto; margin: 18px 0 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Źródła i powiązane */
.sources { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 15px; color: var(--text-2); }
.sources h2 { font-size: 18px; margin-top: 0; }
.sources ol { padding-left: 20px; }
.sources li { margin-bottom: 6px; word-break: break-word; }
.related { margin: 40px 0 0; }
.related h2 { font-size: 20px; }

/* Strona główna */
.hero { padding: 48px 0 16px; }
.hero h1 { font-size: clamp(34px, 6vw, 56px); max-width: 860px; margin-top: 12px; }
.hero .lead { max-width: 700px; font-size: clamp(18px, 2.2vw, 21px); }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #d18b00; box-shadow: 0 0 0 3px rgba(209,139,0,.18); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.btn { display: inline-block; padding: 11px 18px; border-radius: 10px; font-weight: 650; text-decoration: none; font-size: 16px; }
.btn-primary { background: var(--accent-ink); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); }
@media (prefers-color-scheme: dark) { .btn-primary { background: var(--accent); } }
.btn-ghost { border: 1px solid var(--border); color: var(--text); background: var(--surface); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 32px 0 8px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat .label { font-size: 14px; color: var(--text-2); margin: 0 0 4px; }
.stat .value { font-size: 32px; font-weight: 720; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 6px; }
.stat .src { font-size: 13px; color: var(--muted); margin: 0; }

.section { padding: 28px 0; }
.section > h2:first-child { margin-top: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.panel h2 { margin-top: 0; font-size: 22px; }

/* Oś czasu */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 30px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted); }
.timeline li::after { content: ""; position: absolute; left: 10px; top: 24px; bottom: -2px; width: 2px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline li.done::before { background: var(--accent); border-color: var(--accent); }
.timeline li.now::before { background: #d18b00; border-color: #d18b00; box-shadow: 0 0 0 4px rgba(209,139,0,.2); }
.timeline .when { display: block; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.timeline .what { font-size: 15.5px; }
.timeline .tag { font-size: 12px; font-weight: 700; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }

/* Wykres słupkowy (jedna seria) */
.chart { margin: 4px 0 8px; }
.chart-title { font-weight: 700; margin: 0 0 2px; }
.chart-sub { font-size: 14px; color: var(--muted); margin: 0 0 16px; }
.bars { list-style: none; margin: 0; padding: 0; }
.bar-row { position: relative; display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: 12px; align-items: center; padding: 7px 0; outline: none; }
.bar-label { font-size: 14.5px; color: var(--text-2); line-height: 1.3; }
.bar-track { position: relative; display: flex; align-items: center; gap: 8px; min-height: 22px; border-left: 1px solid var(--border); }
.bar { height: 20px; width: var(--w); background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-value { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); }
.bar-tip { position: absolute; left: 38%; bottom: calc(100% - 2px); z-index: 3; background: var(--text); color: var(--bg); font-size: 13px; line-height: 1.4; padding: 8px 10px; border-radius: 8px; max-width: 300px; opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.bar-row:hover .bar-tip, .bar-row:focus .bar-tip { opacity: 1; transform: none; }
.bar-row:hover .bar, .bar-row:focus .bar { filter: brightness(1.1); }
.chart details { margin-top: 10px; font-size: 14.5px; }
.chart summary { cursor: pointer; color: var(--accent-ink); font-weight: 600; }
@media (max-width: 520px) {
  .bar-row { grid-template-columns: 1fr; gap: 4px; }
  .bar-tip { left: 0; }
}

/* Karty artykułów */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin: 16px 0; }
.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 16px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin: 0 0 6px; font-size: 18px; color: var(--text); }
.card p { margin: 0; font-size: 15px; color: var(--text-2); }
.card .more { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 650; color: var(--accent-ink); }

.points { counter-reset: p; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.points li { counter-increment: p; position: relative; padding: 14px 16px 14px 56px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.points li::before { content: counter(p); position: absolute; left: 16px; top: 14px; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 750; display: grid; place-items: center; font-size: 15px; }
.points strong { display: block; }

/* FAQ i słownik */
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 650; padding: 15px 0; list-style-position: outside; }
.faq details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.faq details > div { padding-bottom: 6px; }
dl.glossary dt { font-weight: 700; margin-top: 22px; scroll-margin-top: 16px; }
dl.glossary dd { margin: 4px 0 0; color: var(--text-2); }
.az { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.az a { font-size: 14px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; background: var(--surface); }

.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 32px; }
.checklist li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 16px; height: 16px; border: 2px solid var(--accent); border-radius: 4px; }

/* Stopka */
.site-footer { margin-top: 64px; background: var(--surface); border-top: 1px solid var(--border); font-size: 14.5px; color: var(--text-2); }
.site-footer .wrap { padding-top: 28px; padding-bottom: 32px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--text-2); }
.site-footer .disclaimer { margin: 0 0 8px; }
.site-footer .copy { color: var(--muted); margin: 0; }

.notfound { text-align: center; padding: 60px 0 20px; }
.notfound .code { font-size: 72px; font-weight: 800; color: var(--accent-ink); margin: 0; line-height: 1; }

@media print {
  .site-header, .site-footer, .toc, .related { display: none; }
  body { background: #fff; color: #000; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
