/* GeotermiaNews.pl — arkusz stylów portalu. Bez frameworków, bez JS.
   Typografia: Fraunces (tytuły) + IBM Plex Sans (tekst).
   Paleta „z głębi ziemi”: grafitowo-brązowa baza, akcent miedziany, chłodny kontrapunkt
   ciemnego turkusu (woda termalna). Jedyny ozdobnik: cienka linia gradientu temperatur
   pod nagłówkiem (.thermo). Tryb ciemny przez prefers-color-scheme. */

:root {
  --bg: #f6f2ec;
  --bg-alt: #ece5db;
  --bg-elev: #fffcf8;
  --text: #2a2420;
  --text-muted: #6d6259;
  --line: #d9cfc3;
  --line-strong: #2a2420;
  --accent: #b4502a;
  --accent-text: #fff8f2;
  --cool: #1d6b73;
  --ember: #6b1f12;
  --link: #2a2420;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wrap: 1160px;
  --gutter: 20px;
  --side: 272px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1815;
    --bg-alt: #252019;
    --bg-elev: #2b2520;
    --text: #ece5dc;
    --text-muted: #a99f93;
    --line: #3d352e;
    --line-strong: #d8cfc3;
    --accent: #e07c50;
    --accent-text: #1b1815;
    --cool: #4fb6bb;
    --ember: #c4432a;
    --link: #ece5dc;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  font-variation-settings: "opsz" 72;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  min-width: 0;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-text);
  padding: 8px 12px;
}
.skip:focus { left: 8px; top: 8px; z-index: 10; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Nagłówek: data | logo wyśrodkowane | narzędzia; menu w jednej linii ---------- */

.site-header { background: var(--bg); }

.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding-top: 26px;
  padding-bottom: 18px;
}
.masthead-date {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.masthead-date time { font-weight: 500; }
.masthead-tools {
  margin: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.masthead-tools a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
}
.masthead-tools a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.brand { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; text-align: center; }
.brand:hover { text-decoration: none; }

/* Logo tekstowe — jedno miejsce do podmiany na znak graficzny (LOGO_HTML w build.py). */
.logo {
  font-family: var(--serif);
  font-weight: 700;
  font-variation-settings: "opsz" 144;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--text);
  white-space: nowrap;
}
.logo .logo-a { color: var(--accent); }
.logo .logo-b { color: var(--text); font-weight: 600; }
.logo-small { font-size: 26px; }

.brand-tagline {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.main-nav { border-top: 1px solid var(--line); }
.main-nav .wrap {
  display: flex;
  justify-content: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.main-nav .wrap::-webkit-scrollbar { display: none; }
.main-nav a {
  flex: 0 0 auto;
  padding: 12px 11px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text);
}
.main-nav a:hover { color: var(--accent); text-decoration: none; }
.main-nav .nav-home { font-weight: 600; }

/* Podpozycja działu (Przetargi › Tablica) */
.nav-group { display: inline-flex; align-items: center; flex: 0 0 auto; }
.nav-group > a:first-child { padding-right: 4px; }
.nav-sub {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cool);
  padding: 12px 11px 12px 4px;
}
.nav-sub::before { content: "›"; margin-right: 4px; color: var(--text-muted); }

/* Linia gradientu temperatur: chłodna woda → gorąca skała. Jedyny ozdobnik. */
.thermo {
  height: 5px;
  background: linear-gradient(90deg, var(--cool) 0%, var(--accent) 62%, var(--ember) 100%);
}

main.wrap { flex: 1 0 auto; width: 100%; padding-top: 30px; padding-bottom: 56px; }

/* ---------- Elementy wspólne ---------- */

.card-kicker {
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.kicker { color: var(--accent); }
.type-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.card-meta, .row-meta {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.section-title {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin: 0 0 4px;
}
.section-title .count { color: var(--accent); margin-left: 4px; }

.noimg {
  display: flex;
  align-items: flex-end;
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  font-family: var(--serif);
  font-weight: 600;
  color: var(--text-muted);
}
.noimg span { padding: 8px 10px; }
.noimg:hover { text-decoration: none; color: var(--accent); }

.empty-state { color: var(--text-muted); font-size: 15px; padding: 18px 0; }

/* ---------- Strona główna: górny rząd 1 + 2 ---------- */

.top-row {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 36px;
  padding-bottom: 32px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
}
.lead-story, .second-story { min-width: 0; }
.lead-img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--bg-alt); }
.lead-img.noimg { aspect-ratio: 16 / 10; font-size: 26px; }
.lead-body { padding-top: 16px; }
.lead-title { font-size: 36px; margin: 8px 0 12px; }
.lead-lead { font-size: 18px; line-height: 1.5; margin: 0 0 10px; }

.second-stories { display: flex; flex-direction: column; gap: 26px; }
.second-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-alt); }
.second-img.noimg { aspect-ratio: 16 / 9; font-size: 20px; }
.second-body { padding-top: 10px; }
.second-title { font-size: 22px; margin: 6px 0 8px; }

/* ---------- Strona główna: lewa kolumna + lista chronologiczna ---------- */

.home-layout {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.home-side { display: flex; flex-direction: column; gap: 30px; min-width: 0; }
.side-box { background: var(--bg-elev); border: 1px solid var(--line); padding: 14px 16px 12px; }
.side-box-przetargi { border-top: 3px solid var(--cool); }
.side-box-nauka { border-top: 3px solid var(--accent); }
.side-box-agh { border-top: 3px solid var(--line-strong); }
.side-title {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.side-list li:last-child { border-bottom: 0; }
.side-list li a { font-family: var(--serif); font-weight: 600; font-size: 15.5px; line-height: 1.3; display: block; }
.side-list .row-meta { display: block; margin-top: 3px; font-size: 12.5px; }
.side-empty { font-size: 14px; color: var(--text-muted); margin: 6px 0; }
.side-more { margin: 8px 0 0; font-size: 13px; font-weight: 600; }
.side-more a { color: var(--accent); }
.side-box-przetargi .side-more a { color: var(--cool); }

.stream { min-width: 0; }
.stream-list { list-style: none; margin: 0; padding: 0; }
.stream-item {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.stream-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg-alt); }
.stream-img.noimg { aspect-ratio: 4 / 3; font-size: 15px; }
.stream-title { font-size: 21px; margin: 5px 0 6px; }
.stream-lead {
  margin: 0 0 6px;
  font-size: 14.5px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Dział: lista z datą w kolumnie po lewej ---------- */

.page-head { margin-bottom: 26px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.page-title { font-size: 34px; margin: 4px 0 0; }
.page-sub { margin: 6px 0 0; font-size: 15px; color: var(--text-muted); }

.dated-list { list-style: none; margin: 0; padding: 0; max-width: 880px; }
.dated-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.dated-date { margin: 0; }
.dated-date time { display: flex; flex-direction: column; color: var(--text-muted); }
.dated-day { font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1; color: var(--accent); }
.dated-rest { font-size: 12.5px; letter-spacing: 0.04em; margin-top: 4px; }
.dated-title { font-size: 24px; margin: 5px 0 8px; }
.dated-lead { margin: 0; font-size: 15px; color: var(--text-muted); }
.dated-compact .dated-item { padding: 14px 0; }
.dated-compact .dated-title { font-size: 20px; }
.dated-compact .dated-lead { display: none; }
.dated-compact .dated-day { font-size: 26px; }

/* ---------- Artykuł: duży lead, źródła w bocznej ramce ---------- */

.article { max-width: 1040px; margin: 0 auto; }
.article-header { max-width: 760px; margin-bottom: 26px; }
.article-title { font-size: 42px; margin: 10px 0 16px; }
.article-lead { font-family: var(--serif); font-weight: 600; font-variation-settings: "opsz" 14; font-size: 22px; line-height: 1.4; margin: 0 0 14px; }
.article-meta { font-size: 14px; color: var(--text-muted); margin: 0; }

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 48px;
  align-items: start;
}
.article-main { min-width: 0; max-width: 700px; }
.article-aside { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.article-figure { margin: 0 0 26px; }
.article-figure img { width: 100%; background: var(--bg-alt); }
.article-figure figcaption, figure figcaption {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.article-body { font-size: 17.5px; line-height: 1.65; }
.article-body p { margin: 0 0 1.15em; }
.article-body h2 { font-size: 26px; margin: 1.6em 0 0.6em; }
.article-body h3 { font-size: 21px; margin: 1.4em 0 0.5em; }
.article-body h4 { font-size: 17px; margin: 1.2em 0 0.4em; font-family: var(--sans); font-weight: 600; }
.article-body a { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.article-body ul, .article-body ol { margin: 0 0 1.15em; padding-left: 1.4em; }
.article-body li { margin-bottom: 0.35em; }
.article-body li p { margin-bottom: 0.5em; }
.article-body blockquote {
  margin: 1.2em 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--cool);
  color: var(--text-muted);
  font-style: italic;
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body code {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--bg-alt);
  padding: 1px 5px;
}
.article-body pre {
  background: var(--bg-alt);
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
}
.article-body pre code { background: none; padding: 0; font-size: inherit; }
.article-body figure { margin: 1.4em 0; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

.table-wrap { overflow-x: auto; margin: 0 0 1.3em; }
.article-body table { border-collapse: collapse; width: 100%; font-size: 15px; }
.article-body th, .article-body td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.article-body th { border-bottom: 2px solid var(--line-strong); font-weight: 600; }
.ta-r { text-align: right !important; }
.ta-c { text-align: center !important; }

.sources {
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-top: 3px solid var(--cool);
}
.sources h2 {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px;
}
.sources ol { margin: 0; padding-left: 1.3em; font-size: 13.5px; line-height: 1.45; }
.sources li { margin-bottom: 6px; word-break: break-word; }
.sources a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--cool); }

.tags { font-size: 13px; color: var(--text-muted); margin: 0; }
.tags-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 6px; }
.tag {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  margin: 2px 4px 2px 0;
  color: var(--text);
}

.pair-link { margin: 0; font-size: 14px; font-weight: 600; }
.pair-link a { color: var(--accent); }

.related { max-width: 1040px; margin: 48px auto 0; }

.static-page .article-body { font-size: 17px; }

/* ---------- Stopka ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  padding: 30px 0 38px;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}
.site-footer p { margin: 0 0 8px; }
.footer-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 12px; }
.footer-tagline { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; }
.footer-masthead { color: var(--text); }
.footer-links { margin-top: 14px; }
.footer-links a { margin: 0 10px; font-weight: 600; color: var(--text); }

/* ---------- Tablica przetargów ---------- */

.board-header .page-title { margin-bottom: 0; }
.board-note { margin: 10px 0 0; font-size: 14px; color: var(--text-muted); max-width: 760px; }
.board-finished-title { margin-top: 40px; }

.board-box {
  margin: 0 0 22px;
  padding: 12px 16px;
  border-left: 3px solid var(--cool);
  background: var(--bg-elev);
  font-size: 15px;
}
.board-box a { font-weight: 600; color: var(--cool); }
.board-box span { color: var(--text-muted); margin-left: 6px; }

.tender-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tender-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 10px 8px 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tender-table td { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.tender-table td:first-child { white-space: nowrap; color: var(--text-muted); }
.tender-table td:last-child { white-space: nowrap; padding-right: 0; }
.tender-table time { white-space: nowrap; }
.tender-buyer { display: block; font-weight: 600; }
.tender-place { display: block; font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.tender-subject { font-family: var(--serif); font-weight: 600; font-size: 16px; line-height: 1.35; }
.orig-note { font-family: var(--sans); font-weight: 400; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.tender-number { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tender-table td:last-child a { color: var(--cool); font-weight: 600; }
.muted { color: var(--text-muted); }

.tender-fragment { margin-top: 6px; font-family: var(--sans); font-weight: 400; font-size: 13.5px; }
.tender-fragment summary { cursor: pointer; color: var(--cool); font-weight: 600; font-size: 12.5px; list-style-position: inside; }
.tender-fragment blockquote {
  margin: 8px 0 0;
  padding: 6px 0 6px 14px;
  border-left: 3px solid var(--line);
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
}

/* ---------- 404 ---------- */

.notfound { padding: 60px var(--gutter); max-width: 720px; }
.notfound-brand { margin: 0 0 12px; }
.notfound .thermo { margin-bottom: 30px; }
.notfound h1 { font-size: 80px; margin: 0 0 14px; color: var(--accent); }
.notfound p { font-size: 17px; margin: 0 0 16px; }
.notfound a { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* ---------- Responsywność ---------- */

@media (max-width: 960px) {
  .top-row { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .second-stories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .home-layout { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .home-side { order: 2; }
  .stream { order: 1; }
  .article-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .article-aside { position: static; }
  .lead-title { font-size: 30px; }
  .article-title { font-size: 34px; }
}

@media (max-width: 760px) {
  /* tabela → karty: każda komórka z etykietą z data-label */
  .tender-table, .tender-table tbody, .tender-table tr, .tender-table td { display: block; width: 100%; }
  .tender-table thead { display: none; }
  .tender-table tr { border-bottom: 2px solid var(--line-strong); padding: 10px 0 12px; }
  .tender-table td { border: 0; padding: 4px 0; white-space: normal !important; }
  .tender-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  .tender-table td:first-child { color: var(--text); }
}

@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .masthead {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "brand brand" "date tools";
    gap: 10px 12px;
    padding-top: 18px;
    padding-bottom: 12px;
  }
  .brand { grid-area: brand; }
  .masthead-date { grid-area: date; font-size: 12px; }
  .masthead-tools { grid-area: tools; }
  .logo { font-size: 32px; }
  .brand-tagline { font-size: 10.5px; letter-spacing: 0.12em; }
  .main-nav .wrap { justify-content: flex-start; }
  .main-nav a { padding: 11px 9px; font-size: 13.5px; }
  .main-nav .nav-home { padding-left: 0; }
  main.wrap { padding-top: 22px; }
  .lead-title { font-size: 26px; }
  .lead-lead { font-size: 16px; }
  .second-stories { grid-template-columns: minmax(0, 1fr); }
  .second-title { font-size: 20px; }
  .second-img.noimg, .lead-img.noimg { aspect-ratio: 16 / 6; }
  .stream-item { grid-template-columns: 104px minmax(0, 1fr); gap: 14px; padding: 16px 0; }
  .stream-img img, .stream-img.noimg { aspect-ratio: 1 / 1; }
  .stream-img.noimg { font-size: 12px; }
  .stream-title { font-size: 18px; }
  .stream-lead { display: none; }
  .dated-item { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 18px 0; }
  .dated-date time { flex-direction: row; align-items: baseline; gap: 6px; }
  .dated-day { font-size: 20px; }
  .dated-rest { margin-top: 0; }
  .dated-title { font-size: 21px; }
  .page-title { font-size: 28px; }
  .article-title { font-size: 28px; }
  .article-lead { font-size: 19px; }
  .article-body { font-size: 16.5px; }
  .notfound h1 { font-size: 60px; }
}

/* strona główna przy małej liczbie tekstów: ramki działów w siatce na całą szerokość (Varna 30.09.2026) */
.home-boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; align-items: start; }
.second-stories .side-box { margin: 0; }
.top-row:last-child { border-bottom: 0; margin-bottom: 0; }
/* WCAG 1.4.1: linki w wierszu tekstu odróżnialne nie tylko kolorem (audyt Świętosławy 30.09.2026) */
.card-meta a, .card-kicker a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- Logo: dublet na warstwach geologii (SVG inline) ---------- */
.logo .logo-svg { display: block; height: 64px; width: auto; }
.logo-small .logo-svg { height: 40px; }
.notfound-brand .logo-svg { height: 56px; margin: 0 auto; }
.logo-svg .gn-a { fill: var(--accent); }
.logo-svg .gn-b { fill: var(--text); }
.logo-svg .gn-claim { fill: var(--text-muted); }
.logo-svg .gn-s1 { stop-color: var(--accent); }
.logo-svg .gn-s2 { stop-color: var(--cool); }
@media (max-width: 760px) { .logo .logo-svg { height: 44px; } }
