/* Podstrony renderowane w workerze (cf/src/posts.js page()): archiwum RCB, komunikaty, województwo, powiaty, gminy.
   Ładowane tylko przez page() — strona główna z mapą korzysta z app.css + map.css i tego pliku nie widzi. */

/* bazowy układ archiwum, wpisów i stron regionów */
.posts-main { max-width: 1200px; margin-inline: auto; }
.post-pagination { display: flex; justify-content: space-between; gap: 16px; margin-block: 24px; }
.post-detail { max-width: 850px; margin-block: 24px; overflow-wrap: anywhere; }
.post-detail h1 { font-size: clamp(24px,3vw,38px); line-height: 1.3; }
.post-notice { padding: 18px; background: var(--surface); border-left: 3px solid var(--orange); }
.post-meta { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; margin-block: 24px; }
.post-meta dt { color: var(--muted); }
.post-meta dd { margin: 0; }
.post-detail .fulltext,.post-versions { line-height: 1.7; }
@media(max-width: 700px) { .post-meta { grid-template-columns: 1fr; gap: 6px; } .post-meta dd { margin-bottom: 12px; } }
.region-cols { columns: 2 280px; column-gap: 32px; padding-left: 18px; line-height: 1.6; }
.region-cols li { break-inside: avoid; margin-bottom: 6px; }
.region-days { padding-left: 18px; line-height: 1.6; }
.region-days li { margin-bottom: 12px; }
.post-detail h3 { margin-top: 20px; }

.posts {
  --k-c: var(--green);
  --k-g: #d4d4d4;
  --k-z: #525252;
  --card: var(--panel);
  --card-line: var(--line);
  --top: 65px;
  line-height: 1.6;
}

/* pasek górny, plakietki, eyebrow, karta stanu, chipy i znaczniki osi czasu są wspólne ze stroną główną — app.css */

/* --- treść i typografia --- */
.posts .archive-main { max-width: 1120px; padding: 28px 24px 64px; }
.posts .post-detail { max-width: none; margin: 0; }
.posts nav[aria-label="Okruszki"] { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.posts nav[aria-label="Okruszki"] a { color: var(--fg2); }
.posts h1 { font-size: clamp(28px, 1.6vw + 20px, 40px); line-height: 1.15; letter-spacing: -0.025em; font-weight: 700; margin: 0 0 14px; max-width: 30ch; text-wrap: balance; }
.posts h2 { font-size: clamp(21px, .6vw + 17px, 26px); line-height: 1.25; letter-spacing: -0.015em; font-weight: 650; margin: 56px 0 16px; }
.posts h3 { font-size: 13px; line-height: 1.4; letter-spacing: .1em; text-transform: uppercase; font-weight: 650; color: var(--muted); margin: 32px 0 12px; }
.posts p { max-width: 70ch; line-height: 1.6; color: var(--fg2); }
.posts strong { color: var(--fg); }
.posts .muted { color: var(--muted); }

/* --- karta stanu / nagłówek strony --- */
.posts .status-card, .posts .page-head { padding: 28px 32px; margin: 0 0 20px; }
.posts .page-head { background: var(--card); border: 1px solid var(--card-line); border-radius: 16px; }
.posts .status-card .lead, .posts .page-head p { font-size: 17px; margin: 0; }
.posts .page-head p + p { margin-top: 12px; }
.posts .page-head .eyebrow, .posts .status-card .eyebrow { font-size: 12px; margin: 0 0 12px; }
.posts .page-head .eyebrow + h1 + p { margin-top: 0; }
.posts .status-line, .posts .stat-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; max-width: none; margin: 20px 0 0 !important; padding-top: 18px; border-top: 1px solid var(--card-line); font-size: 15px; }
.posts .status-line a { color: var(--fg); font-weight: 600; }

.posts .post-notice { max-width: none; margin: 0 0 20px; padding: 14px 18px; border: 1px solid rgba(251, 191, 36, .28); border-left: 3px solid var(--orange); border-radius: 12px; background: rgba(251, 191, 36, .06); font-size: 15px; }
.posts .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; max-width: none; margin: 20px 0; }
.posts a.button { color: var(--fg); }

/* --- liczby: kafle bento --- */
.posts .bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(112px, auto); gap: 12px; margin: 0 0 8px; }
.posts .tile { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-width: 0; padding: 18px 20px; background: var(--card); border: 1px solid var(--card-line); border-radius: 14px; }
.posts .tile.big { grid-column: span 2; grid-row: span 2; background: var(--surface); padding: 24px 28px; }
.posts .tile-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.posts .tile-num { font-size: 40px; line-height: 1; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.posts .tile-num small { font-size: .5em; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 2px; }
.posts .tile.big .tile-num { font-size: clamp(64px, 6vw, 96px); }
.posts .tile-sub { font-size: 14px; color: var(--muted); }
.posts .tile.big .tile-sub { font-size: 18px; color: var(--fg2); }
.posts .key { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 3px; }
.posts .k-c { background: var(--k-c); }
.posts .k-g { background: var(--k-g); }
.posts .k-z { background: var(--k-z); }

/* --- partition bar --- */
.posts .pbar { display: flex; gap: 4px; height: 12px; margin: 24px 0 14px; }
.posts .pbar span { flex-basis: 0; min-width: 8px; border-radius: 999px; }
.posts .plegend { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 24px; }
.posts .plegend li { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 4px 10px; font-size: 14px; color: var(--fg2); }
.posts .plegend strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.posts .plegend .muted { font-size: 13px; min-width: 3.5ch; text-align: right; font-variant-numeric: tabular-nums; }

/* --- oś czasu Alertów RCB (strony regionów) i komunikatów dnia (archiwum) --- */
.posts .timeline, .posts .post-versions { margin: 12px 0 0; max-width: 78ch; }
.posts .timeline > li, .posts .post-versions > li { padding: 0 0 22px 30px; }
.posts .tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 6px; font-size: 14px; }
.posts a.badge.date { color: var(--fg); font-size: 14px; }
.posts a.badge.date:hover { border-color: var(--blue); }
.posts .timeline summary { display: block; min-height: 0; list-style: none; cursor: pointer; color: var(--fg2); line-height: 1.6; }
.posts .timeline summary::-webkit-details-marker { display: none; }
.posts .timeline summary::before { content: none; }
.posts .clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.posts details[open] .clamp { display: block; -webkit-line-clamp: unset; line-clamp: none; }
.posts .more { display: inline-block; margin-top: 2px; color: var(--blue); font-size: 14px; font-weight: 500; }
.posts .more::before { content: "Pokaż całość"; }
.posts details[open] .more::before { content: "Zwiń"; }
.posts .post-versions time { margin-bottom: 8px; }
.posts .post-versions .tl-title { display: block; color: var(--fg); font-weight: 600; text-decoration: none; line-height: 1.45; }
.posts .post-versions .tl-title:hover { text-decoration: underline; }
.posts .post-versions p { margin: 6px 0 0; color: var(--fg2); }
.posts .post-detail > details { margin-top: 32px; }
.posts .post-detail > details > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }

/* --- siatka kart (gminy, powiaty) i chipy --- */
.posts .cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.posts .card { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--card); border: 1px solid var(--card-line); border-radius: 12px; transition: border-color .15s, background .15s; }
.posts .card:has(a:hover) { border-color: #404040; background: #1a1a1a; }
.posts .card a, .posts .card-name { font-size: 16px; font-weight: 600; color: var(--fg); text-decoration: none; line-height: 1.35; }
.posts .card a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.posts .card-kind { font-size: 13px; color: var(--muted); }
.posts .card-num { margin-top: 10px; font-size: 14px; color: var(--fg2); }
.posts .card-num strong { font-size: 22px; font-weight: 650; margin-right: 3px; font-variant-numeric: tabular-nums; }
.posts .card.empty { background: transparent; border-style: dashed; }
.posts .card.empty .card-name, .posts .card.empty .card-num { color: var(--muted); font-weight: 500; }


/* --- adresy w gminie: litery A–Z i karty ulic --- */
.posts .az { position: sticky; top: var(--top); z-index: 3; display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 12px; padding: 6px; background: rgba(20, 20, 20, .96); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(8px); }
.posts .az a { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 34px; border-radius: 8px; color: var(--fg2); font-size: 14px; font-weight: 600; text-decoration: none; }
.posts .az a:hover { background: var(--surface); color: var(--fg); }
.posts .street-box { margin: 0 0 10px; padding: 16px 20px; background: var(--card); border: 1px solid var(--card-line); border-radius: 12px; scroll-margin-top: calc(var(--top) + 64px); }
.posts .street-box h3 { margin: 0 0 6px; font-size: 22px; letter-spacing: 0; text-transform: none; color: var(--green); }
.posts .streets { list-style: none; padding: 0; margin: 0; columns: 3 240px; column-gap: 32px; }
.posts .streets li { break-inside: avoid; padding: 6px 0; border-bottom: 1px solid rgba(42, 42, 42, .8); font-size: 15px; line-height: 1.45; color: var(--fg2); font-variant-numeric: tabular-nums; }
.posts .az-groups { columns: 3 300px; column-gap: 10px; }
.posts .az-groups .street-box { break-inside: avoid; }
.posts .az-groups .streets { columns: 1; }
.posts .streets strong { font-weight: 600; margin-right: 4px; }

/* --- archiwum: karty dni i komunikatów, szczegół komunikatu --- */
.posts .posts .posts .posts .posts .posts .posts .posts .posts .post-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin: 0 0 28px; }
.posts .post-meta > div { padding: 14px 16px; background: var(--card); border: 1px solid var(--card-line); border-radius: 12px; }
.posts .post-meta dt { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.posts .post-meta dd { margin: 0; font-variant-numeric: tabular-nums; }
.posts .fulltext { max-width: 75ch; padding: 20px 24px; background: var(--card); border: 1px solid var(--card-line); border-radius: 12px; white-space: pre-wrap; line-height: 1.7; color: var(--fg); }
.posts .post-pagination .button { color: var(--fg); }
.posts .source-note { max-width: none; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.6; }
.posts .foot-links { margin: 24px 0 0; line-height: 2.2; }
.posts footer { border-top: 1px solid var(--line); }

@media (max-width: 860px) {
  .posts { --top: 0px; }
  .posts .topbar { position: static; flex-wrap: wrap; gap: 0; padding: 6px 16px 0; min-height: 0; }
  .posts .brand { min-height: 40px; }
  .posts .brand strong { font-size: 22px; }
  .posts .top-actions { width: calc(100% + 32px); margin: 0 -16px; padding: 2px 10px 6px; overflow-x: auto; scrollbar-width: none; }
  .posts .top-actions { flex-wrap: nowrap; }
  .posts .site-nav a { font-size: 14px; padding: 6px 10px; min-height: 36px; }
  .posts .wide { display: none; }
  .posts .az { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-radius: 0 0 12px 12px; }
  .posts .az a { flex: none; }
}
@media (max-width: 700px) {
  .posts .archive-main { padding: 18px 16px 48px; }
  .posts h2 { margin-top: 44px; }
  .posts .status-card, .posts .page-head { padding: 20px; border-radius: 14px; }
  .posts .status-card .lead, .posts .page-head p { font-size: 16px; }
  .posts .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; gap: 10px; }
  .posts .tile { padding: 14px 16px; }
  .posts .tile.big { grid-row: auto; padding: 20px; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
  .posts .tile.big .tile-label { width: 100%; }
  .posts .tile.big .tile-num { font-size: 56px; }
  .posts .tile-num { font-size: 32px; }
  .posts .plegend { grid-template-columns: 1fr; gap: 8px; }
  .posts .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .posts .card { padding: 12px 14px; }
  .posts .card-num strong { font-size: 19px; }
  .posts .street-box { padding: 12px 16px; }
  .posts .post-meta { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) { .posts .cards { grid-template-columns: 1fr; } }

/* --- archiwum RCB: kolumna 760 px, dni jako karty, wiersze z web/app.css --- */
.posts .col { max-width: 760px; margin-inline: auto; }
.posts { --day-top: var(--top); }
.posts h2.sec { margin: 36px 0 12px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.posts h2.sec .muted { letter-spacing: .02em; text-transform: none; font-weight: 500; }
.posts .day { margin: 0 0 32px; padding: 0 20px 4px; background: var(--card); border: 1px solid var(--card-line); border-radius: 12px; }
.posts .day-head { margin: 0 -20px; padding: 12px 20px 10px; background: var(--card); border-radius: 12px 12px 0 0; font-size: 13px; letter-spacing: .08em; }
.posts .row-text { max-width: none; }
@media (max-width: 700px) {
  .posts .day { padding: 0 16px 2px; }
  .posts .day-head { margin: 0 -16px; padding: 12px 16px 10px; }
  .posts .row-text { font-size: 15px; }
}

/* --- strona dnia: wpisy po kolei, kropka w kolorze typu (pusta = alarm, pełna = odwołanie) --- */
.posts .hist-note { max-width: none; margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.posts .day-page .hist-note { color: var(--orange); font-size: 14px; }
.posts .day-page .hist-note a { color: var(--orange); }
.posts .dtl-list { list-style: none; margin: 0; padding: 0; }
.posts .dtl { position: relative; padding: 0 0 22px 28px; }
.posts .dtl::before { content: ""; position: absolute; left: 5px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.posts .dtl:last-child::before { display: none; }
.posts .dtl::after { content: ""; position: absolute; left: 0; top: 6px; width: 12px; height: 12px; border: 2px solid var(--k); border-radius: 50%; background: var(--bg); }
.posts .dtl.k-odwolanie::after { background: var(--k); }
.posts .dtl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.posts .dtl-time { color: var(--fg); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.posts .dtl-quote { max-width: 68ch; margin: 6px 0 0; color: var(--fg2); font-size: 16px; line-height: 1.55; }
.posts .dtl-dur { margin: 6px 0 0; color: var(--green); font-size: 13px; font-weight: 600; }
.posts .dtl-dur.none { color: var(--muted); font-weight: 500; }
.posts .day-pager { display: flex; justify-content: space-between; gap: 16px; margin: 8px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; }
.posts .day-pager a { color: var(--fg); }

/* --- strona wpisu: plakietka, czytelny H1, cytat RCB, karty źródeł --- */
.posts .entry-kind { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 10px; }
.posts .entry-head h1 { max-width: none; margin-bottom: 6px; font-size: clamp(26px, 1.2vw + 20px, 34px); }
.posts .entry-sub { margin: 0 0 20px; font-size: 13px; }
.posts .entry-quote { max-width: 65ch; margin: 0 0 8px; padding: 2px 0 2px 18px; border-left: 3px solid var(--k); color: var(--fg); font-size: 20px; line-height: 1.5; }
.posts .src-cards { display: grid; gap: 10px; }
.posts .src-card { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--card); border: 1px solid var(--card-line); border-radius: 12px; }
.posts .src-card > div { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.4; }
.posts .src-card .muted { font-size: 13px; }
.posts .src-card .button { flex: none; }
.posts .src-card .source-icon { border-radius: 8px; }
.posts .same .rows { padding: 0 16px; background: var(--card); border: 1px solid var(--card-line); border-radius: 12px; }
.posts .entry ~ .foot-links, .posts .entry details { max-width: 760px; }
@media (max-width: 700px) { .posts .entry-quote { font-size: 18px; } .posts .src-card { flex-wrap: wrap; } }

/* --- oś czasu obowiązywania alertów: doba = pasek 24 h, alarm = odcinek od ogłoszenia do odwołania --- */
.posts .tl-wrap { margin: 0 0 32px; padding: 20px 20px 16px; background: var(--card); border: 1px solid var(--card-line); border-radius: 12px; }
.posts .tl-wrap h2 { margin: 0 0 4px; font-size: 20px; }
.posts .tl-range { margin: 0; color: var(--muted); font-size: 13px; }
.posts .tl-sum { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 14px 0 16px; padding: 0; list-style: none; color: var(--fg2); font-size: 14px; }
.posts .tl-sum strong { margin-right: 4px; font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.posts .tl-axis, .posts .tl-day { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 12px; align-items: center; }
.posts .tl-hours { position: relative; height: 16px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.posts .tl-hours span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.posts .tl-hours span:nth-child(1) { left: 0; transform: none; }
.posts .tl-hours span:nth-child(2) { left: 25%; }
.posts .tl-hours span:nth-child(3) { left: 50%; }
.posts .tl-hours span:nth-child(4) { left: 75%; }
.posts .tl-hours span:nth-child(5) { left: 100%; transform: translateX(-100%); }
.posts .tl-days { margin: 0; padding: 0; list-style: none; }
.posts .tl-day { position: relative; padding: 8px 0; border-top: 1px solid var(--line); }
.posts .tl-day:hover { background: rgba(255, 255, 255, .03); }
.posts .tl-date { color: var(--fg); font-size: 13px; font-weight: 600; text-decoration: none; }
.posts .tl-date::after { content: ""; position: absolute; inset: 0; }
.posts .tl-day:has(.tl-date:focus-visible) { outline: 2px solid var(--fg); outline-offset: -2px; border-radius: 6px; }
.posts .tl-track { position: relative; height: 14px; border-radius: 3px; background: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 25%), var(--surface); }
.posts .tl-bar { position: absolute; top: 2px; bottom: 2px; min-width: 3px; border-radius: 2px; background: var(--k); }
.posts .tl-bar.cont-r { border-radius: 2px 0 0 2px; }
.posts .tl-bar.cont-l { border-radius: 0 2px 2px 0; }
.posts .tl-pt { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--k); }
.posts .tl-pt.open { background: var(--card); border: 2px dashed var(--k); }
.posts .tl-cap { display: flex; flex-wrap: wrap; grid-column: 2; gap: 2px 14px; max-width: none; margin: 4px 0 0; color: var(--fg2); font-size: 12px; font-variant-numeric: tabular-nums; }
.posts .tl-cap .none { color: var(--muted); font-style: italic; }
.posts .tl-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; max-width: none; margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.posts .tl-key { display: inline-block; width: 18px; height: 8px; margin-right: 6px; border-radius: 2px; background: var(--k); vertical-align: middle; }
.posts .tl-key.pt { width: 10px; height: 10px; border-radius: 50%; }
.posts .tl-key.open { background: transparent; border: 2px dashed var(--k); }
@media (max-width: 700px) {
  .posts .tl-wrap { padding: 16px 14px 12px; }
  .posts .tl-axis, .posts .tl-day { grid-template-columns: minmax(0, 1fr); }
  .posts .tl-axis > span:first-child { display: none; }
  .posts .tl-date { margin-bottom: 4px; }
  .posts .tl-cap { grid-column: 1; }
}
/* /komunikaty: strumień, na szerokim ekranie jedna linia na wpis (godzina, typ, źródło, treść, ikony źródeł) */
.posts .tl-legend > span { white-space: nowrap; }
@media (min-width: 701px) {
  .posts .stream .row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 0; }
  .posts .stream .row-head { flex: 0 1 auto; flex-wrap: nowrap; min-width: 0; max-width: 50%; }
  .posts .stream .row-link { flex-wrap: nowrap; flex: none; }
  .posts .stream .row-zone { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .posts .stream .row-text { flex: 1; min-width: 0; margin: 0; font-size: 15px; -webkit-line-clamp: 1; line-clamp: 1; }
  .posts .stream .row-src { flex: none; margin: 0; gap: 6px; }
  .posts .stream .src span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* strona dnia: cały dzień Podkarpacia na pierwszym ekranie telefonu (kryterium odbioru 1) */
.posts .day-page .page-head { margin-bottom: 12px; }
.posts .day-page h2.sec { margin-top: 18px; }
