/* ---------- fonty (lokalnie, bez zewnętrznych serwerów) ---------- */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  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: "Archivo";
  src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  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"; font-weight: 400; font-display: swap;
  src: url("../fonts/ibm-plex-sans-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"; font-weight: 400; font-display: swap;
  src: url("../fonts/ibm-plex-sans-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"; font-weight: 500; font-display: swap;
  src: url("../fonts/ibm-plex-sans-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"; font-weight: 500; font-display: swap;
  src: url("../fonts/ibm-plex-sans-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"; font-weight: 600; font-display: swap;
  src: url("../fonts/ibm-plex-sans-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"; font-weight: 600; font-display: swap;
  src: url("../fonts/ibm-plex-sans-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;
}

/* ---------- tokeny ---------- */
:root {
  color-scheme: dark;

  --ink: #09130f;          /* panel */
  --land: #0d1d1a;         /* podłoże mapy */
  --raised: #132723;       /* hover, pola */
  --line: #20393a;         /* linie rozdzielające */
  --text: #e4efe8;
  --muted: #8ba69b;
  --brass: #e9b44c;        /* akcent: fokus, zaznaczenie, granica miasta */

  --c-komputery: #e9b44c;
  --c-telefony: #4fd6b4;

  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --panel-w: 400px;
  --r: 4px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 15px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.sprite { position: absolute; }

/* ---------- wspólne: glify kategorii, przyciski ---------- */
.glyph { width: 18px; height: 18px; flex: none; fill: currentColor; color: var(--c); }
.komputery { --c: var(--c-komputery); }
.telefony { --c: var(--c-telefony); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-block; padding: 9px 14px;
  font: 500 .9rem/1.2 var(--body); text-decoration: none;
  color: var(--ink); background: var(--brass);
  border: 1px solid var(--brass); border-radius: var(--r);
}
.btn:hover { background: color-mix(in srgb, var(--brass) 85%, white); }
.btn.alt { color: var(--text); background: transparent; border-color: var(--line); }
.btn.alt:hover { background: transparent; border-color: var(--brass); }
button.btn { cursor: pointer; }

/* ---------- zgoda na cookies (js/consent.js) ---------- */
.consent {
  position: fixed; inset: auto 0 0 0; z-index: 50;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px;
  padding: 14px 24px;
  background: var(--ink); border-top: 1px solid var(--brass);
  font-size: .85rem; line-height: 1.45;
}
.consent p { margin: 0; max-width: 72ch; }
.consent p + p { margin-top: 6px; color: var(--muted); }
.consent a { color: var(--brass); }
.consent .actions { flex: none; }
@media (max-width: 760px) {
  .consent { padding: 12px 16px; }
  .consent .actions { width: 100%; }
  .consent .btn { flex: 1; text-align: center; }
}

/* przycisk wyglądający jak link (np. „Ustawienia cookies” w stopce) */
.linklike {
  padding: 0; font: inherit; color: inherit; background: none; border: 0; cursor: pointer;
  text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px;
}
.linklike:hover { text-decoration-color: currentColor; }

/* Układ strony głównej: panel z listą + mapa. Wspólne tokeny i fonty są w base.css. */
html, body { height: 100%; }


/* ---------- układ ---------- */
.app {
  height: 100%;
  display: grid;
  grid-template-columns: var(--panel-w) 1fr;
}

.panel {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--ink);
  border-right: 1px solid var(--line);
}

.stage { position: relative; min-height: 0; background: var(--land); }
#map { position: absolute; inset: 0; }
.noscript { position: absolute; inset: 0; margin: 0; padding: 24px; }

/* ---------- nagłówek ---------- */
.head { padding: 26px 24px 18px; }
.head h1 {
  margin: 0;
  font: 800 2.15rem/0.95 var(--display);
  font-stretch: 66%;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.head p { margin: 12px 0 0; color: var(--muted); font-size: .9rem; max-width: 34ch; }

/* ---------- narzędzia ---------- */
.tools { padding: 0 24px 16px; display: grid; gap: 14px; border-bottom: 1px solid var(--line); }

.search {
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  background: var(--land);
  border: 1px solid var(--line); border-radius: var(--r);
}
.search:focus-within { border-color: var(--brass); }
.search .icon { width: 18px; height: 18px; flex: none; color: var(--muted); }
.search input {
  flex: 1; min-width: 0; padding: 11px 0;
  font: inherit; color: var(--text);
  background: none; border: 0; outline: 0;
}
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { filter: invert(.7); }
kbd {
  font: 500 .75rem/1 var(--body); color: var(--muted);
  padding: 4px 7px; border: 1px solid var(--line); border-radius: var(--r);
}
@media (hover: none) { kbd { display: none; } }

.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filter {
  display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 8px;
  padding: 8px 10px; text-align: left;
  font: inherit; font-size: .85rem; color: var(--text);
  background: var(--raised);
  border: 1px solid var(--c); border-radius: var(--r);
  cursor: pointer;
}
.filter .label { line-height: 1.2; }
.filter .n { color: var(--muted); font-variant-numeric: tabular-nums; }
/* wyłączony rodzaj: przerywana ramka bez wypełnienia */
.filter[aria-pressed="false"] { background: transparent; border-style: dashed; border-color: var(--line); color: var(--muted); }
.filter[aria-pressed="false"] .glyph { color: var(--muted); }


.legend { display: flex; align-items: center; gap: 8px; margin: -4px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.3; }

.status { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: .85rem; color: var(--muted); }
.link {
  padding: 0; font: inherit; font-weight: 500; color: var(--brass);
  background: none; border: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.link[disabled] { opacity: .6; cursor: progress; }

/* ---------- lista ---------- */
.scroller { flex: 1; min-height: 0; overflow-y: auto; scrollbar-color: var(--line) transparent; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--line); }
.row {
  position: relative;
  display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; column-gap: 12px; align-items: start;
  width: 100%; padding: 12px 24px; text-align: left;
  font: inherit; color: inherit; text-decoration: none; cursor: pointer;
  overflow-wrap: anywhere;
}
.row .glyph { margin-top: 2px; }
.row .name, .row .addr { display: block; }
.row .name { font-weight: 600; line-height: 1.3; }
.row .addr { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.row .dist { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 2px; }
.row:hover { background: var(--raised); }
.row[aria-current="true"] { background: var(--raised); }
.row[aria-current="true"]::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--brass); }

.empty { margin: 0; padding: 28px 24px; color: var(--muted); }

.more { padding: 16px 24px; border-top: 1px solid var(--line); }
.more ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .85rem; }
.more a { color: var(--muted); }
.more a:hover { color: var(--text); }

.credits { padding: 14px 24px; border-top: 1px solid var(--line); font-size: .75rem; line-height: 1.5; color: var(--muted); }
.credits p { margin: 0; }
.credits p + p { margin-top: 8px; }

.map-error { margin: 0; padding: 24px; color: var(--muted); }

/* ---------- mapa: kontrolki i karta ---------- */
.maplibregl-ctrl-group { background: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: none; }
.maplibregl-ctrl-group button { background-color: transparent; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line); }
.maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1) brightness(.9); }
.maplibregl-ctrl.maplibregl-ctrl-attrib { background: color-mix(in srgb, var(--ink) 85%, transparent); color: var(--muted); font-size: 11px; }
.maplibregl-ctrl-attrib a { color: var(--muted); }
.maplibregl-ctrl-attrib-button { background-color: transparent; filter: invert(1); }

.maplibregl-popup { max-width: 320px; }
.maplibregl-popup-content {
  padding: 16px 18px 14px; color: var(--text);
  font: 400 .875rem/1.45 var(--body);
  background: var(--ink); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 10px 30px rgb(0 0 0 / .45);
}
.maplibregl-popup-anchor-top .maplibregl-popup-tip, .maplibregl-popup-anchor-top-left .maplibregl-popup-tip, .maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--ink); }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--ink); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--ink); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--ink); }
.maplibregl-popup-close-button { color: var(--muted); font-size: 22px; padding: 2px 9px 4px; border-radius: var(--r); }
.maplibregl-popup-close-button:hover { background: var(--raised); color: var(--text); }

.card h2 { margin: 0 24px 2px 0; font: 700 1.2rem/1.15 var(--display); font-stretch: 78%; }
.card .kind { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--muted); font-size: .8rem; }
.card p { margin: 4px 0; }
.card dl { display: grid; grid-template-columns: max-content 1fr; gap: 1px 12px; margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.card dt { color: var(--muted); }
.card dd { margin: 0; }
.card .actions { margin-top: 14px; }
.card .btn { padding: 7px 12px; font-size: .85rem; }
.card .src { margin: 12px 0 0; color: var(--muted); font-size: .75rem; }

/* ---------- telefon ---------- */
@media (max-width: 820px) {
  html, body { height: auto; }
  .app { height: auto; grid-template-columns: 1fr; grid-template-rows: 56svh auto; }
  .stage { order: -1; }
  .panel { border-right: 0; }
  .head { padding: 20px 16px 14px; }
  .head h1 { font-size: 1.85rem; }
  .tools { padding: 0 16px 14px; }
  .row { padding-inline: 16px; }
  .more, .credits { padding-inline: 16px; }
  .scroller { overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
