/* Mapa Łebian – „atlas dróg”.
   Papier mapy, granatowy tusz, błękit Bałtyku z promieni logo, czerwień pinezek. */

/* ——— Fonty (własne pliki, bez zewnętrznych serwerów) ——— */
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/newsreader-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/newsreader-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/newsreader-latin-400-italic.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/newsreader-latin-ext-400-italic.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/newsreader-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/newsreader-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans Condensed"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-condensed-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Sans Condensed"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-condensed-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-condensed-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Sans Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-condensed-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-condensed-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Sans Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-condensed-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* ——— Kolory ——— */
:root {
  --paper: #eef2ef;
  --surface: #ffffff;
  --sunk: #e3e9e5;
  --ink: #15314b;
  --ink-2: #4a6073;
  --line: #c9d5d0;
  --baltic: #1479ab;
  --baltic-soft: #d6eaf4;
  --pin: #cf2438;
  --contour: #a8bdb3;
  /* mapy */
  --sea: #d7e7ee;
  --land: #f8f9f5;
  --land-edge: #b7c8c1;
  --grid: rgba(21, 49, 75, 0.12);
  --route: rgba(20, 121, 171, 0.38);

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "IBM Plex Sans Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 4px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1720;
    --surface: #14212c;
    --sunk: #0a131a;
    --ink: #e3ecf0;
    --ink-2: #9db1bd;
    --line: #26394a;
    --baltic: #5bbbe8;
    --baltic-soft: #133246;
    --pin: #ff5f6f;
    --contour: #2c4540;
    --sea: #081219;
    --land: #1d303d;
    --land-edge: #34505f;
    --grid: rgba(227, 236, 240, 0.07);
    --route: rgba(91, 187, 232, 0.42);
    color-scheme: dark;
  }
}

/* ——— Podstawy ——— */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--serif); }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; } /* atrybut hidden ma pierwszeństwo przed display z klas */
a { color: var(--baltic); text-underline-offset: 0.16em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--baltic); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.12; text-wrap: balance; margin: 0; }
h1 { font-weight: 400; font-size: clamp(2.1rem, 5vw, 3.3rem); letter-spacing: -0.012em; }
h2 { font-weight: 600; font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
p { margin: 0; }
figure { margin: 0; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; }

.muted { color: var(--ink-2); }
.mono, .km { font-family: var(--mono); font-size: 0.88em; font-variant-numeric: tabular-nums; }
.eyebrow { font: 600 0.75rem/1.2 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 62ch; }
.note { font: 400 0.92rem/1.5 var(--sans); color: var(--ink-2); max-width: 70ch; }

/* ——— Nagłówek i stopka ——— */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 600 1.28rem/1 var(--serif); }
.brand-mark { width: 30px; height: 30px; color: var(--ink); }
.main-nav ul { display: flex; flex-wrap: wrap; gap: 2px 20px; list-style: none; margin: 0; padding: 0; }
.main-nav a { display: inline-block; font: 500 0.98rem/1 var(--sans); color: var(--ink-2); text-decoration: none; padding: 8px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--ink); }
.main-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--pin); }

main { padding-block: 36px 72px; display: grid; gap: 44px; }
main > section, main > article, .person, .place, .story, .photo-page { display: grid; gap: 30px; align-content: start; }
section { display: grid; gap: 14px; align-content: start; }

.site-footer { background: var(--surface); border-top: 1px solid var(--line); }
.footer-row { padding-block: 26px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; font: 400 0.92rem/1.5 var(--sans); }

/* ——— Nagłówki stron ——— */
.page-head { display: grid; gap: 10px; }
.page-head .sub { font-style: italic; font-size: 1.2rem; color: var(--ink-2); }

/* ——— Mapy SVG ——— */
.map { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.map-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--sea); }
.map-sea, .map-lake { fill: var(--sea); }
.map-land { fill: var(--land); stroke: var(--land-edge); stroke-width: 0.7; stroke-linejoin: round; }
.map-grid { fill: none; stroke: var(--grid); stroke-width: 0.8; }
.map-grid-label text { font: 400 10px var(--mono); fill: var(--ink-2); opacity: 0.75; }
.map-routes path { fill: none; stroke: var(--route); stroke-linecap: round; }
.map-dots circle { fill: var(--baltic); opacity: 0.85; }
.map-path path { fill: none; stroke: var(--baltic); stroke-width: 2.5; stroke-linecap: round; }
.map-leba { fill: var(--pin); stroke: var(--surface); stroke-width: 2.5; }
.map-person .map-leba, .map-place .map-leba { fill: var(--ink); }
.map-birth { fill: var(--pin); stroke: var(--surface); stroke-width: 2.5; }
.map-stop circle { fill: var(--baltic); stroke: var(--surface); stroke-width: 2; }
.map-stop text { font: 600 11px var(--sans); fill: var(--surface); text-anchor: middle; }
.map-label { font: 500 14px var(--sans); fill: var(--ink); paint-order: stroke; stroke: var(--land); stroke-width: 4px; stroke-linejoin: round; }
.map-label-strong { font-weight: 600; font-size: 15px; }

/* ——— Strona główna ——— */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; align-items: center; }
.hero-text { display: grid; gap: 18px; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.4rem); }
.hero h1 em { font-style: italic; color: var(--baltic); }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-map { display: grid; gap: 8px; }
.hero-map .map { border: 1px solid var(--line); }
.hero-map figcaption { font: 400 0.82rem/1.4 var(--sans); color: var(--ink-2); }
.button { display: inline-block; font: 600 0.98rem/1 var(--sans); padding: 13px 18px; border-radius: var(--radius); background: var(--ink); color: var(--paper); text-decoration: none; border: 1px solid var(--ink); }
.button:hover { background: var(--baltic); border-color: var(--baltic); }
.button-quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.button-quiet:hover { background: var(--surface); border-color: var(--ink); color: var(--ink); }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; border-block: 1px solid var(--line); }
.stats div { padding: 16px 12px 14px; border-left: 1px solid var(--line); display: flex; flex-direction: column-reverse; gap: 4px; }
.stats div:first-child { border-left: 0; padding-left: 0; }
.stats dd { margin: 0; font: 400 2rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.stats dt { font: 400 0.86rem/1.3 var(--sans); color: var(--ink-2); }

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; }
.rank { margin: 0; padding: 0; list-style: none; counter-reset: r; font-family: var(--sans); }
.rank li { counter-increment: r; display: grid; grid-template-columns: 2.2ch minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rank li::before { content: counter(r); color: var(--pin); font: 400 1.1rem/1 var(--serif); }
.rank .muted { grid-column: 2; font-size: 0.9rem; }
.rank .km { grid-column: 3; grid-row: 1; text-align: right; }

/* ——— Tabele ——— */
.letters { display: flex; flex-wrap: wrap; gap: 4px; font-family: var(--sans); }
.letters a { min-width: 2.3em; text-align: center; padding: 6px 0; border: 1px solid var(--line); border-radius: 3px; text-decoration: none; background: var(--surface); }
.letters a:hover { border-color: var(--baltic); }
.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tabela { width: 100%; border-collapse: collapse; font: 400 0.96rem/1.35 var(--sans); min-width: 640px; }
.tabela th, .tabela td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tabela thead th { position: sticky; top: 0; background: var(--surface); font-weight: 600; font-size: 0.76rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
.tabela tbody th { font-weight: 600; }
.tabela tbody th a { text-decoration: none; }
.tabela tbody th a:hover { text-decoration: underline; }
.tabela tbody tr:hover { background: var(--sunk); }
.tabela tbody tr:last-child > * { border-bottom: 0; }
.tabela .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabela tr:target { background: var(--baltic-soft); }
.tag { display: inline-block; font: 500 0.72rem/1 var(--sans); padding: 3px 6px; border-radius: 3px; background: var(--sunk); color: var(--ink-2); white-space: nowrap; vertical-align: 0.1em; }
.tag-born { background: color-mix(in srgb, var(--pin) 13%, transparent); color: var(--pin); }
.approx { color: var(--ink-2); margin-left: 2px; }

/* ——— Osoba ——— */
.person-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: end; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.person-head h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); }
.portrait { width: min(180px, 34vw); }
.portrait img { border-radius: var(--radius); aspect-ratio: 3 / 4; object-fit: cover; width: 100%; box-shadow: 0 1px 0 var(--line); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0; font: 400 1rem/1.5 var(--sans); }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; }
.distance { display: flex; flex-wrap: wrap; gap: 16px 56px; }
.distance > div { display: grid; gap: 6px; }
.big-km { font: 400 clamp(2.2rem, 6vw, 3.4rem)/1 var(--mono); letter-spacing: -0.04em; }

.route { list-style: none; margin: 0; padding: 0; font-family: var(--sans); }
.route-stop { position: relative; padding-left: 34px; }
.route-stop::before { content: ""; position: absolute; left: 8px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--baltic); }
.route-stop::after { content: ""; position: absolute; left: 13px; top: 24px; bottom: -4px; border-left: 2px dashed var(--contour); }
.route-stop.is-birth::before { background: var(--pin); }
.route-stop.is-leba::before { background: var(--ink); }
.route-stop.is-leba::after { display: none; }
.route-stop:has(.route-num)::before { display: none; }
.route-num { position: absolute; left: 4px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--baltic); color: var(--surface); font: 600 0.72rem/20px var(--sans); text-align: center; }
.route-place { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 1.02rem; }
.route-place > a { font-weight: 600; }
.route-note { flex-basis: 100%; font: italic 400 0.95rem/1.4 var(--serif); color: var(--ink-2); }
.route-leg { font: 400 0.82rem/1 var(--mono); color: var(--ink-2); padding: 10px 0 18px; }

.card-list, .plain-list { list-style: none; margin: 0; padding: 0; font-family: var(--sans); }
.card-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.card-list li:first-child { border-top: 1px solid var(--line); }
.plain-list li { padding: 3px 0; }

/* ——— Zdjęcia ——— */
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 45%), 1fr)); gap: 18px 14px; margin: 8px 0; }
.galeria-el a { display: block; }
.galeria-el img, .photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; background: var(--sunk); }
.galeria-el a:hover img, .photo-grid a:hover img { outline: 2px solid var(--baltic); outline-offset: 2px; }
figcaption { font: 400 0.86rem/1.4 var(--sans); color: var(--ink-2); margin-top: 6px; }
.ilustracja { margin-block: 26px; }
.ilustracja img { border-radius: 3px; max-height: 70vh; width: auto; }
.photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 45%), 1fr)); gap: 22px 16px; }
.photo-grid a { display: grid; gap: 7px; text-decoration: none; color: var(--ink); font: 400 0.9rem/1.35 var(--sans); }
.photo-large { background: var(--sunk); border-radius: var(--radius); padding: clamp(8px, 2vw, 24px); }
.photo-large img { max-height: 78vh; width: auto; margin-inline: auto; }

/* Kadrowanie miniatur (pole „kadr” zdjęcia; pionowe bez pola – od góry). */
img.kadr-gora { object-position: 50% 0; }
img.kadr-dol { object-position: 50% 100%; }
img.kadr-lewo { object-position: 0 50%; }
img.kadr-prawo { object-position: 100% 50%; }

/* ——— Historie ——— */
.prose { max-width: 66ch; font-size: 1.16rem; line-height: 1.72; }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3 { margin-top: 1.7em; }
.prose blockquote { margin-inline: 0; padding-left: 20px; border-left: 3px solid var(--contour); font-style: italic; color: var(--ink-2); }
.prose hr { border: 0; margin-block: 2.2em; text-align: center; }
.prose hr::after { content: "· · ·"; color: var(--contour); letter-spacing: 0.5em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.story .page-head { max-width: 66ch; }
.story-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; align-items: start; }
.story-layout > .prose > p:first-of-type { font-size: 1.24rem; }
.story-aside { display: grid; gap: 8px; font: 400 0.96rem/1.5 var(--sans); position: sticky; top: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.story-aside h2 { font: 600 0.74rem/1.2 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); margin-top: 10px; }
.story-aside h2:first-child { margin-top: 0; }

/* ——— Formularze, filtry, wyszukiwarka ——— */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
input[type="search"], select {
  font: 400 1rem/1.2 var(--sans); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 11px; min-width: 0; max-width: 100%;
}
input[type="search"]:focus, select:focus { border-color: var(--baltic); outline: 2px solid color-mix(in srgb, var(--baltic) 30%, transparent); outline-offset: 0; }
.button-link { all: unset; cursor: pointer; font: 500 0.92rem/1.2 var(--sans); color: var(--baltic); text-decoration: underline; text-underline-offset: 0.16em; }
.button-link:focus-visible { outline: 2px solid var(--baltic); outline-offset: 2px; }

.site-search { margin-left: auto; }
.site-search input { width: 12rem; padding: 7px 10px; font-size: 0.95rem; background: var(--paper); }
.header-row { flex-wrap: wrap; }

.filtry { display: grid; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-family: var(--sans); }
.filtry-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 18px; }
.filtry label { display: grid; gap: 4px; font-size: 0.82rem; color: var(--ink-2); }
.filtry label.check { display: flex; align-items: center; gap: 6px; font-size: 0.95rem; color: var(--ink); }
.filtry label.check input { width: 17px; height: 17px; accent-color: var(--baltic); margin: 0; }
.filtr-szukaj { flex: 1 1 260px; }
.filtr-szukaj input { width: 100%; }
.licznik { margin-left: auto; font: 500 0.9rem/1.2 var(--sans); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.chips { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; display: inline-flex !important; align-items: center; gap: 6px; font: 500 0.9rem/1 var(--sans) !important; color: var(--ink) !important; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; background: var(--paper); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--paper) !important; }
.chip:has(input:checked) .muted { color: inherit; opacity: 0.7; }
.chip:has(input:focus-visible) { outline: 2px solid var(--baltic); outline-offset: 2px; }

.tabela th .sort { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; text-transform: inherit; letter-spacing: inherit; }
.tabela th .sort:hover { color: var(--ink); }
.tabela th .sort:focus-visible { outline: 2px solid var(--baltic); outline-offset: 2px; }
.tabela th.num .sort { flex-direction: row-reverse; }
.sort-arrow { color: var(--baltic); min-width: 1ch; }
.tabela th[aria-sort="ascending"], .tabela th[aria-sort="descending"] { color: var(--ink); }

.search-page { display: flex; flex-wrap: wrap; gap: 10px; }
.search-page input { flex: 1 1 320px; font-size: 1.15rem; padding: 12px 14px; }
.search-results { display: grid; gap: 28px; }
.search-summary { font: 500 1rem/1.4 var(--sans); color: var(--ink-2); }
.search-group { display: grid; gap: 8px; }
.search-group h2 { font-size: 1.25rem; }
.search-list { list-style: none; margin: 0; padding: 0; font-family: var(--sans); }
.search-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.search-list li.has-thumb { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: start; }
.search-list img { width: 64px; height: 48px; object-fit: cover; border-radius: 3px; }
.search-list a { font-weight: 600; font-size: 1.05rem; }
.search-list .muted { font-size: 0.9rem; }
.snippet { font: 400 0.98rem/1.5 var(--serif); color: var(--ink-2); margin-top: 4px; }
.snippet mark { background: color-mix(in srgb, var(--baltic) 22%, transparent); color: var(--ink); padding: 0 2px; border-radius: 2px; }

/* ——— Formularz kontaktowy ——— */
.kontakt { display: grid; gap: 6px; max-width: 40rem; font-family: var(--sans); }
.kontakt label { font-weight: 600; font-size: 0.95rem; margin-top: 10px; }
.kontakt input[type="text"], .kontakt input[type="email"], .kontakt textarea, .kontakt select {
  font: 400 1rem/1.4 var(--sans); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; width: 100%;
}
.kontakt textarea { resize: vertical; min-height: 10rem; }
.kontakt :is(input, textarea, select):focus { border-color: var(--baltic); outline: 2px solid color-mix(in srgb, var(--baltic) 30%, transparent); outline-offset: 0; }
.kontakt .button { margin-top: 8px; cursor: pointer; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.dotyczy { padding: 12px 14px; background: var(--baltic-soft); border-radius: var(--radius); font-weight: 500; }
.report { font-family: var(--sans); font-size: 0.95rem; padding-top: 16px; border-top: 1px solid var(--line); }
.kontakt-podglad { white-space: normal; }

/* ——— Mapa interaktywna ——— */
.page-map main { max-width: none; }
.map-app { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: stretch; }
.map-panel { align-content: start; }
.map-canvas { min-height: 72vh; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sea); z-index: 0; }
.map-link { font-family: var(--sans); }
.map-person { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.95rem; }
.map-person > a { font-weight: 600; font-size: 1.1rem; }
.map-person-route { margin: 0; padding-left: 1.4em; display: grid; gap: 2px; }
.map-cluster { display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--baltic) 85%, transparent); color: #fff; font: 600 0.85rem/1 var(--sans); border: 3px solid rgba(255, 255, 255, 0.7); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.map-stop-icon { display: grid !important; place-items: center; border-radius: 50%; background: #1479ab; color: #fff; font: 600 0.75rem/1 var(--sans); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); }
.map-stop-icon.is-birth { background: #cf2438; }
.map-leba-label { font: 600 0.9rem/1 var(--sans); }
.map-popup { display: grid; gap: 6px; font-family: var(--sans); font-size: 0.92rem; }
.map-popup strong { font: 600 1.1rem/1.2 var(--serif); }
.map-popup ul { margin: 0; padding-left: 1.1em; max-height: 180px; overflow: auto; }
.map-popup-label { font-weight: 600; }
.leaflet-container { font-family: var(--sans); }
.leaflet-container a { color: var(--baltic); }
@media (prefers-color-scheme: dark) {
  .map-canvas .leaflet-tile-pane { filter: brightness(0.75) contrast(1.1) saturate(0.7); }
  .leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
}

/* ——— Powiększenie zdjęcia ——— */
.lightbox { border: 0; padding: 0; max-width: 96vw; max-height: 96vh; background: transparent; overflow: visible; }
.lightbox::backdrop { background: rgba(5, 12, 18, 0.88); }
.lightbox figure { display: grid; gap: 10px; justify-items: center; }
.lightbox img { max-width: 92vw; max-height: 84vh; width: auto; height: auto; border-radius: 3px; background: #111; }
.lightbox figcaption { color: #e3ecf0; font: 400 0.95rem/1.4 var(--sans); text-align: center; max-width: 70ch; margin: 0; }
.lightbox figcaption a { color: #8fd0f0; white-space: nowrap; }
.lightbox button { position: fixed; border: 0; background: rgba(255, 255, 255, 0.12); color: #fff; font: 400 2rem/1 var(--sans); width: 48px; height: 48px; border-radius: 50%; cursor: pointer; }
.lightbox button:hover { background: rgba(255, 255, 255, 0.25); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; }
.lb-next { right: 16px; top: 50%; }

/* ——— Wąskie ekrany ——— */
@media (max-width: 860px) {
  .hero, .story-layout, .two-col, .map-app { grid-template-columns: minmax(0, 1fr); }
  .map-canvas { min-height: 60vh; order: -1; } /* na telefonie najpierw mapa, pod nią filtry */
  .site-search { order: 3; flex-basis: 100%; }
  .site-search input { width: 100%; }
  .story-aside { position: static; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div, .stats div:first-child { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .person-head { grid-template-columns: minmax(0, 1fr); }
  .portrait { width: min(200px, 60vw); }
  .map-label { font-size: 18px; }
}

/* ——— Druk: karta osoby, historia ——— */
@media print {
  :root { --paper: #fff; --surface: #fff; --ink: #000; --ink-2: #444; --sea: #eef3f5; --land: #fff; }
  .site-header nav, .site-footer, .skip, .letters { display: none; }
  body { font-size: 11pt; }
  main { padding: 0; gap: 16pt; }
  a { color: inherit; text-decoration: none; }
  .story-layout { grid-template-columns: 1fr; }
  .story-aside { position: static; }
  .map-frame, figure, .route-stop { break-inside: avoid; }
}
