@import url("/fonts.css");

:root {
  --mist: #f2f5f7;
  --surface: #ffffff;
  --ink: #13212b;
  --ink-soft: #51626f;
  --line: #cfd8de;
  --verified: #0b6b58;
  --verified-bg: #dff1eb;
  --caution: #8a5a00;
  --caution-bg: #fbefd2;
  --display: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --data: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font: 400 1rem/1.6 var(--body);
}

a { color: inherit; text-decoration-color: var(--verified); text-underline-offset: 0.2em; }
a:hover { color: var(--verified); }
:focus-visible { outline: 3px solid var(--verified); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--display); line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 650; margin-top: 3rem; margin-bottom: 1rem; }
h3 { font-size: 1.1rem; font-weight: 650; margin-top: 2rem; margin-bottom: 0.5rem; }
p { margin: 0 0 1rem; max-width: 68ch; }

.site-header, .site-footer, .page { padding-inline: clamp(1rem, 4vw, 3rem); }
.site-header {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 2rem;
  padding-block: 1.25rem; border-bottom: 1px solid var(--line);
}
.brand { font: 800 1.4rem/1 var(--display); letter-spacing: -0.04em; text-decoration: none; }
.brand span { color: var(--verified); }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-size: 0.95rem; }
.site-header nav a { text-decoration: none; }
.site-header nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }

.page { max-width: 76rem; margin-inline: auto; padding-block: clamp(2rem, 5vw, 4rem); }
.page.narrow { max-width: 46rem; }
.lead { font-size: 1.15rem; color: var(--ink-soft); margin-top: 1rem; }
.eyebrow { font: 500 0.8rem/1 var(--data); color: var(--ink-soft); margin-bottom: 0.75rem; }
.eyebrow a { text-decoration: none; }
.muted { color: var(--ink-soft); font-size: 0.9rem; }

.site-footer {
  border-top: 1px solid var(--line); padding-block: 2rem; margin-top: 3rem;
  font-size: 0.9rem; color: var(--ink-soft);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin-bottom: 1rem; }

/* Stempel weryfikacji: każda liczba w serwisie ma datę sprawdzenia. */
.stamp {
  display: inline-flex; align-items: center; gap: 0.45em; white-space: nowrap;
  font: 500 0.78rem/1 var(--data); padding: 0.4em 0.6em; border-radius: 3px;
  color: var(--verified); background: var(--verified-bg);
}
.stamp::before { content: ""; width: 0.5em; height: 0.5em; border-radius: 50%; background: currentColor; }
.stamp.unknown, .stamp.aging { color: var(--caution); background: var(--caution-bg); }
.stamp.stale { color: #8f2416; background: #f9e1dc; white-space: normal; }

.tag {
  display: inline-block; font: 500 0.78rem/1 var(--data); padding: 0.4em 0.6em;
  border: 1px solid var(--line); border-radius: 3px; background: var(--surface);
}
.notice {
  background: var(--caution-bg); color: var(--caution); border-left: 4px solid currentColor;
  padding: 0.9rem 1.1rem; max-width: 68ch;
}

.price { font: 500 1rem/1.3 var(--data); white-space: nowrap; }
.price small { font-weight: 400; color: var(--ink-soft); }

/* Tabele danych */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-block: 2rem 0.75rem; }
.toolbar label { font-size: 0.9rem; color: var(--ink-soft); }
select, input, textarea, button { font: inherit; color: inherit; }
select, input, textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: 0.5rem 0.65rem;
}

.tiers { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.tiers button {
  font: 500 0.82rem/1 var(--data); padding: 0.5em 0.75em; border-radius: 3px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.tiers button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.tiers button:disabled { color: var(--ink-soft); cursor: default; opacity: 0.6; }
.offers tr[hidden] { display: none; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; margin-bottom: 0.75rem; font-size: 0.95rem; }
.filters label { display: inline-flex; align-items: center; gap: 0.5rem; }
.filters input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--verified); }
.notice[hidden] { display: none; }

table { width: 100%; border-collapse: collapse; background: var(--surface); }
caption { text-align: left; font-size: 0.9rem; color: var(--ink-soft); padding-bottom: 0.5rem; }
th, td { text-align: left; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: baseline; }
thead th { font: 500 0.78rem/1.2 var(--data); color: var(--ink-soft); border-bottom: 2px solid var(--ink); }
td.num, th.num { text-align: right; font-family: var(--data); }
.offers td.num:not([data-label^="Koszt"]) { white-space: nowrap; }
tbody tr:hover { background: var(--mist); }
.offer-name { font-weight: 600; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }

@media (max-width: 44rem) {
  .offers thead { position: absolute; left: -999rem; }
  .offers, .offers tbody, .offers tr, .offers td { display: block; }
  .offers tr { padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); }
  .offers td { padding: 0.15rem 0; border: 0; text-align: left; }
  .offers caption { display: block; padding: 0.75rem 1rem 0; }
  .offers td.num { white-space: normal; }
  .offers td[data-label]::before {
    content: attr(data-label) ": "; font: 400 0.78rem/1 var(--data); color: var(--ink-soft);
  }
}

/* Karta parametrów */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0; margin: 0;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0; }
.facts div { padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.facts dt { font: 400 0.78rem/1.2 var(--data); color: var(--ink-soft); margin-bottom: 0.3rem; }
.facts dd { margin: 0; font-weight: 600; }
.facts dd.unknown { font-weight: 400; color: var(--ink-soft); }

.split { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-top: 1.25rem; }
.button {
  display: inline-block; padding: 0.6rem 1rem; border-radius: 3px; text-decoration: none;
  background: var(--ink); color: var(--surface); font-weight: 600; border: 0; cursor: pointer;
}
.button:hover { background: var(--verified); color: var(--surface); }
button[type="submit"] { padding: 0.6rem 1rem; border-radius: 3px; background: var(--ink); color: var(--surface);
  font-weight: 600; border: 0; cursor: pointer; }

/* Wykres historii ceny: linia schodkowa, bo cena obowiązuje do następnej zmiany. */
.chart { background: var(--surface); border: 1px solid var(--line); padding: 1rem; margin-bottom: 1rem; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .step { fill: none; stroke: var(--verified); stroke-width: 2.5; stroke-linejoin: round; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart text { font: 400 11px var(--data); fill: var(--ink-soft); }
.chart circle { fill: var(--surface); stroke: var(--verified); stroke-width: 2; }

/* Formularz zgłoszenia */
.form .field { margin-bottom: 1rem; display: grid; gap: 0.35rem; max-width: 34rem; }
.form label { font-size: 0.9rem; font-weight: 600; }
.form textarea { min-height: 8rem; }
.form .errorlist { color: #a12a1b; margin: 0; padding: 0; list-style: none; font-size: 0.9rem; }
.hp { position: absolute; left: -999rem; }

.prose h2 { margin-top: 2.5rem; }
.prose ul { padding-left: 1.2rem; max-width: 68ch; }
.prose li { margin-bottom: 0.4rem; }
