/* HDDNews.pl — arkusz stylów portalu. Bez frameworków, bez JS.
   Paleta: grafit / biel + jeden akcent (ciemny pomarańcz ziemi).
   Tryb ciemny przez prefers-color-scheme. */

:root {
  --bg: #ffffff;
  --bg-alt: #f4f4f2;
  --bg-elev: #ffffff;
  --text: #1f2429;
  --text-muted: #5f666d;
  --line: #d9dbdd;
  --line-strong: #1f2429;
  --accent: #b4541e;
  --accent-text: #ffffff;
  --link: #1f2429;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wrap: 1180px;
  --gutter: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181b;
    --bg-alt: #1c2024;
    --bg-elev: #1f2428;
    --text: #e6e6e3;
    --text-muted: #a3a8ad;
    --line: #34393e;
    --line-strong: #c9ccce;
    --accent: #d9743b;
    --accent-text: #15181b;
    --link: #e6e6e3;
  }
}

*, *::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: 2px; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.005em;
}

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

.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; }

/* ---------- Nagłówek ---------- */

.site-header {
  background: var(--bg);
  border-bottom: 3px solid var(--line-strong);
}

.top-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 14px;
}

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

/* Logo tekstowe — jedno miejsce do podmiany na znak graficzny. */
.logo {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
}
.logo::first-letter { color: var(--accent); }
/* znak graficzny B „pod kreską”: litery w kolorze tekstu, kreska w akcencie (działa też w trybie ciemnym) */
.site-header .logo { display: block; font-size: 0; }
.logo-svg { display: block; height: 40px; width: auto; fill: currentColor; color: var(--text); }
.logo-svg .logo-kreska { fill: var(--accent); }
@media (max-width: 600px) { .logo-svg { height: 30px; } }

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

.top-tools {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 4px;
}
.top-tools a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 5px 10px;
  color: var(--text);
}
.top-tools a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.main-nav { border-top: 1px solid var(--line); }
.main-nav .wrap {
  display: flex;
  gap: 4px;
  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: 11px 12px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
}
.main-nav a:hover { border-bottom-color: var(--accent); text-decoration: none; color: var(--accent); }
.main-nav .nav-home { padding-left: 0; }

.date-bar {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-muted);
}
.date-bar .wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 7px;
  padding-bottom: 7px;
}
.date-bar time { font-weight: 600; color: var(--text); }
.date-bar-note a { color: var(--text-muted); font-weight: 600; }
.date-bar-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

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

/* ---------- Strona główna ---------- */

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-width: 0;
  gap: 40px;
  align-items: start;
}

.featured { padding-bottom: 8px; margin-bottom: 32px; }
.featured .card-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-alt); }
.featured-body { padding-top: 18px; }
.featured-title { font-size: 34px; margin: 6px 0 12px; }
.featured-lead { font-size: 18px; line-height: 1.5; color: var(--text); margin: 0 0 12px; }

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

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

.section-title {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-top: 3px solid var(--line-strong);
  padding-top: 10px;
  margin: 0 0 18px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 28px 24px;
}

.card { display: flex; flex-direction: column; }
.card-noimg {
  display: flex;
  align-items: flex-end;
  aspect-ratio: 16 / 10;
  background: var(--bg-alt);
  border-bottom: 3px solid var(--accent);
  margin-bottom: 12px;
  padding: 10px 12px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-muted);
}
.card-noimg:hover { text-decoration: none; color: var(--accent); }
.card .card-img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--bg-alt); margin-bottom: 12px; }
.card-title { font-size: 19px; margin: 6px 0 8px; }
.card-lead {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-state { color: var(--text-muted); font-size: 15px; padding: 24px 0; border-top: 1px solid var(--line); }

/* boczna kolumna */
.home-main, .home-side, .card, .featured { min-width: 0; }
.home-side { display: flex; flex-direction: column; gap: 32px; }
.side-box { border-top: 3px solid var(--accent); padding-top: 10px; }
.side-title {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.side-list li a { font-family: var(--serif); font-weight: 600; font-size: 16px; line-height: 1.3; display: block; }
.side-list .row-meta { display: block; margin-top: 4px; }
.side-empty { font-size: 14px; color: var(--text-muted); margin: 6px 0; }
.side-more { margin: 10px 0 0; font-size: 13px; font-weight: 600; }
.side-more a { color: var(--accent); }

/* ---------- Dział ---------- */

.page-title { font-size: 32px; margin: 0 0 22px; padding-bottom: 12px; border-bottom: 3px solid var(--line-strong); }

/* ---------- Artykuł ---------- */

.article { max-width: 760px; margin: 0 auto; }
.article-header { margin-bottom: 20px; }
.article-title { font-size: 38px; margin: 8px 0 14px; }
.article-lead { font-size: 19px; line-height: 1.5; margin: 0 0 12px; }
.article-meta { font-size: 14px; color: var(--text-muted); margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.pair-link { margin: 0; display: inline; }
.pair-link a { color: var(--accent); font-weight: 600; }

.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-top: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.article-body { font-size: 17.5px; line-height: 1.65; }
.article-body p { margin: 0 0 1.15em; }
.article-body h2 { font-size: 25px; margin: 1.6em 0 0.6em; }
.article-body h3 { font-size: 20px; margin: 1.4em 0 0.5em; }
.article-body h4 { font-size: 17px; margin: 1.2em 0 0.4em; font-family: var(--sans); }
.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(--accent);
  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;
  border: 1px solid var(--line);
}
.article-body pre {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
}
.article-body pre code { background: none; border: 0; 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 {
  margin: 36px 0 20px;
  padding: 16px 20px;
  background: var(--bg-alt);
  border-left: 4px solid var(--accent);
}
.sources h2 {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.sources ol { margin: 0; padding-left: 1.3em; font-size: 14px; }
.sources li { margin-bottom: 4px; word-break: break-word; }
.sources a { text-decoration: underline; text-underline-offset: 2px; }

.tags { font-size: 13px; color: var(--text-muted); margin: 0 0 8px; }
.tags-label { font-weight: 600; margin-right: 4px; }
.tag {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  color: var(--text);
}

.related { max-width: 760px; margin: 44px auto 0; }

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

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

.site-footer {
  border-top: 3px solid var(--line-strong);
  background: var(--bg-alt);
  padding: 26px 0 34px;
  font-size: 14px;
  color: var(--text-muted);
}
.site-footer p { margin: 0 0 8px; }
.footer-brand strong { font-family: var(--serif); font-size: 18px; color: var(--text); }
.footer-links a { margin-right: 18px; font-weight: 600; color: var(--text); }

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

@media (max-width: 900px) {
  .home-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .featured-title { font-size: 28px; }
  .article-title { font-size: 30px; }
}

@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .top-row { padding-top: 16px; padding-bottom: 10px; align-items: center; }
  .logo { font-size: 28px; }
  .brand-tagline { font-size: 10px; letter-spacing: 0.04em; }
  .featured-title { font-size: 24px; }
  .featured-lead { font-size: 16px; }
  .article-title { font-size: 26px; }
  .article-lead { font-size: 17px; }
  .article-body { font-size: 16.5px; }
  .card-grid { grid-template-columns: 1fr; gap: 22px; }
  .date-bar-note { display: none; }
  .page-title { font-size: 26px; }
}

/* ---------- Menu: podpozycja działu ---------- */

.nav-group { display: inline-flex; align-items: center; flex: 0 0 auto; }
.nav-group > a:first-child { padding-right: 6px; }
.nav-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  padding: 11px 12px 11px 6px;
  border-left: 1px solid var(--line);
  margin-left: 2px;
}
.nav-sub::before { content: "›"; margin-right: 5px; color: var(--text-muted); }

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

.board-header { margin-bottom: 26px; }
.board-header .page-title { margin-bottom: 10px; }
.board-subtitle { font-family: var(--sans); font-weight: 500; font-size: 16px; color: var(--text-muted); white-space: nowrap; }
.board-note { margin: 0; font-size: 14px; color: var(--text-muted); max-width: 760px; }
.board-finished-title { margin-top: 40px; }
.board .empty-state { border-top: 0; padding-top: 0; }

.board-box {
  margin: 0 0 22px;
  padding: 12px 16px;
  border-left: 4px solid var(--accent);
  background: var(--bg-alt);
  font-size: 15px;
}
.board-box a { font-weight: 700; color: var(--accent); }
.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: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 10px 8px 0;
  border-bottom: 2px solid var(--line-strong);
  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(--accent); font-weight: 700; }
.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(--accent); 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-strong);
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
}

@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: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  .tender-table td:first-child { color: var(--text); }
  .board-subtitle { white-space: normal; display: block; font-size: 14px; }
}

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

.notfound { padding: 60px var(--gutter); max-width: 720px; }
.notfound .logo { display: block; font-size: 32px; margin: 0 0 30px; }
.notfound .logo a { color: inherit; }
.notfound h1 { font-size: 72px; 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; }
