/* zbytnik.pl, the property-tender site: a register of municipal property, read like an official
   document. Cool survey-paper neutrals and a near-navy ink; one orange, the marking paint of a
   surveyor's boundary stake, spent in few places: the logo, the primary button, the dashed plot
   outline around the tender's day and price, the days-left marker, focus and the current nav
   item. Links stay ink with an underline. A serif for the notices' own words, the system sans
   for everything the site says. Fonts: system only, nothing downloaded.

   Contrast (WCAG): light: white on --brand-strong 5.0, --brand-text on --paper 4.9 and on
   --sheet 5.4, --brand-strong on --paper 4.5; dark: --on-brand on --brand 8.0, --brand on
   --paper 7.8. --brand in light is decoration only (2.95 on paper). Tested in
   tests/test_property_web.py. */

:root {
  color-scheme: light dark;
  --paper: #F2F4F6; --sheet: #FFFFFF; --ink: #16202B; --muted: #536070;
  --rule: #D3D9E0; --soft: #E8ECF0;
  --brand: #F2600C; --brand-strong: #C2470A; --brand-text: #B8440A; --on-brand: #FFFFFF;
  --tint: #FDEBDD; --past: #6B7684;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, "Noto Serif", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
/* Dark: the system's setting, unless the header's switch chose a theme (theme.js sets
   data-theme before the first paint). The two blocks hold the same values. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F151B; --sheet: #141B22; --ink: #E4E9EE; --muted: #9AA6B2;
    --rule: #2A333D; --soft: #1B232C;
    --brand: #FF8A3D; --brand-strong: #FF8A3D; --brand-text: #FF8A3D; --on-brand: #1A0F06;
    --tint: #3A2416; --past: #8995A1;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0F151B; --sheet: #141B22; --ink: #E4E9EE; --muted: #9AA6B2;
  --rule: #2A333D; --soft: #1B232C;
  --brand: #FF8A3D; --brand-strong: #FF8A3D; --brand-text: #FF8A3D; --on-brand: #1A0F06;
  --tint: #3A2416; --past: #8995A1;
}
:root[data-theme="light"] { color-scheme: light; }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.5 var(--sans); font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}
a { color: var(--ink); text-decoration-color: var(--muted); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--brand); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brand-strong); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
h1 { font-size: clamp(24px, 4.2vw, 32px); line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 20px; line-height: 1.3; }
p, ul, ol, dl, dd { margin: 0; }
p { text-wrap: pretty; }
.vh {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--sheet); padding: 8px 12px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.print-only { display: none; }

/* Header: logo, nav that scrolls in its own box on a phone, search on wide screens */
.top { border-bottom: 1px solid var(--rule); background: var(--sheet); }
.top-in { display: flex; align-items: center; gap: 0 20px; flex-wrap: wrap; min-height: 60px; }
.logo {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-right: auto;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -0.01em;
}
.logo svg { width: 30px; height: 30px; }
.logo .lot { fill: var(--tint); stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; stroke-dasharray: 3.5 2.2; }
.logo .stake { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.logo .flag { fill: var(--brand); }
.nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.nav::-webkit-scrollbar { display: none; }
.nav ul { display: flex; gap: 0 22px; padding: 0; list-style: none; white-space: nowrap; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; color: var(--ink);
  text-decoration: none; font-size: 15px; box-shadow: inset 0 -3px 0 transparent;
}
.nav a:hover { box-shadow: inset 0 -3px 0 var(--rule); }
.nav a[aria-current] { box-shadow: inset 0 -3px 0 var(--brand-strong); font-weight: 600; }
@media (min-width: 720px) {
  .nav { order: 0; width: auto; margin: 0; padding: 0; overflow: visible; }
}
.theme {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--rule); border-radius: 50%; background: none; color: var(--ink); cursor: pointer;
}
.theme[hidden] { display: none; }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.theme .moon { fill: currentColor; stroke: none; }
.theme[aria-pressed="true"] .moon, .theme[aria-pressed="false"] .sun { display: none; }
.search.search-head { display: none; }
@media (min-width: 1000px) {
  .search.search-head { display: flex; gap: 6px; width: 260px; margin: 0; }
  .search-head input { padding: 8px 10px; }
  .search-head button { padding: 8px 12px; }
}

main { padding-block: 24px 56px; }

/* Crumbs */
.crumbs ol { display: flex; flex-wrap: wrap; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.crumbs li { min-width: 0; }
.crumbs li + li::before { content: "/"; margin: 0 8px; color: var(--rule); }
.crumbs a { color: var(--muted); display: inline-block; padding-block: 6px; }
.crumbs [aria-current] { overflow-wrap: anywhere; }
.crumbs + * { margin-top: 12px; }

/* Shared bits */
.intro { margin-top: 10px; max-width: 42em; color: var(--muted); font-size: 17px; }
.tally { margin-top: 14px; color: var(--muted); font-size: 15px; }
.note { font-size: 14px; color: var(--muted); }
.nil { color: var(--muted); }
.sub { margin-top: 4px; color: var(--muted); font-size: 15px; }
.more { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 15px; }
.more a { display: inline-block; padding-block: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  padding: 12px 20px; border-radius: 6px; background: var(--brand-strong); color: var(--on-brand);
  font-weight: 650; text-decoration: none; text-align: center;
}
.btn:hover { color: var(--on-brand); filter: brightness(1.08); }

.search { display: flex; gap: 8px; margin-top: 18px; max-width: 34em; }
/* Controls drop the browser's own look (Safari keeps it otherwise) and are drawn here. */
.search input, .filters select {
  -webkit-appearance: none; appearance: none;
  flex: 1; min-width: 0; min-height: 44px; margin: 0; padding: 10px 12px; font: inherit; color: var(--ink);
  background-color: var(--sheet); border: 1px solid var(--muted); border-radius: 6px;
  transition: border-color .12s, box-shadow .12s;
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input::-webkit-search-decoration, .search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search input:hover, .filters select:hover { border-color: var(--ink); }
.search input:focus-visible, .filters select:focus-visible {
  outline: 0; border-color: var(--brand-strong); box-shadow: 0 0 0 3px var(--tint), 0 0 0 1px var(--brand-strong);
}
.filters select {
  padding-right: 38px; cursor: pointer; text-overflow: ellipsis;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: right 19px top 50%, right 13px top 50%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
.search button, .filters .apply {
  -webkit-appearance: none; appearance: none;
  min-height: 44px; margin: 0; padding: 10px 16px; font: inherit; font-weight: 600; border: 0; border-radius: 6px;
  background: var(--ink); color: var(--paper); cursor: pointer;
}
.search button:hover, .filters .apply:hover { filter: brightness(1.15); }

/* The facts in a row: the tender's day with the days left, and the starting price */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.fact { min-width: 0; }
.fact dt { font-size: 13px; color: var(--muted); }
.fact dd { display: flex; flex-direction: column; gap: 2px; font-weight: 650; }
.price { white-space: nowrap; }
.state { font-weight: 650; font-size: 14px; color: var(--brand-text); }
.is-past .state, .is-past .fact time { color: var(--past); font-weight: 400; }
.ocr { font-weight: 400; font-size: 13px; color: var(--muted); font-style: italic; }
.dash { color: var(--past); font-weight: 400; }

/* Lists of notices */
.entries { list-style: none; padding: 0; margin-top: 12px; border-top: 1px solid var(--rule); }
.entry {
  display: grid; gap: 10px 28px; padding: 16px 0; border-bottom: 1px solid var(--rule);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 760px) {
  .entry { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
}
.et { font-size: 17px; font-weight: 600; line-height: 1.35; }
.et a { text-decoration: none; overflow-wrap: anywhere; }
.et a:hover { text-decoration: underline; text-decoration-color: var(--brand); }
.entry .meta { margin-top: 6px; }
.meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; font-size: 14px; color: var(--muted); }
.meta > * { overflow-wrap: anywhere; }
.meta .ptype { color: var(--ink); font-weight: 600; }
.meta .town a { color: var(--ink); }
.meta .office { color: var(--muted); }
/* the kind: told by its word, in a neutral outline, never by colour */
.meta .kind, .notice-head .kind {
  font-size: 12px; padding: 1px 7px; border: 1px solid var(--rule); border-radius: 3px;
  color: var(--muted); text-decoration: none;
}
.entry .facts { padding-left: 12px; border-left: 2px dashed var(--rule); }
.entry.is-soon .facts, .entry.is-open .facts { border-left-color: var(--brand); }
.entry.is-past .et a { color: var(--muted); }

/* Filters on a kind's listing */
.filters {
  display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; margin-top: 18px;
  padding: 14px 16px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px;
}
.filters .field { display: grid; gap: 4px; flex: 1 1 200px; min-width: 0; }
.filters label { font-size: 14px; color: var(--muted); }
.filters .reset { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; }
.js .filters .apply { display: none; }

/* Pages */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 24px; }
.pages { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; }
.pg {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
  padding: 0 14px; border: 1px solid var(--rule); border-radius: 6px; background: var(--sheet); text-decoration: none;
}
.pg[aria-current] { border-color: var(--brand-strong); box-shadow: inset 0 0 0 1px var(--brand-strong); font-weight: 700; }
.pg[aria-disabled] { color: var(--past); }
.gap { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--muted); }
.empty { margin-top: 20px; padding: 20px; border: 1px dashed var(--rule); border-radius: 8px; background: var(--sheet); }
.empty-h { font-weight: 650; margin-bottom: 6px; overflow-wrap: anywhere; }
.onward { display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 10px; padding: 0; list-style: none; }
.onward a { display: inline-block; padding-block: 10px; }

/* Home: the search is the main action */
.lead { padding: 12px 0 4px; max-width: 46em; }
.lead h1 { font-size: clamp(26px, 5vw, 38px); }
.search-hero { display: block; max-width: none; margin-top: 22px; }
.search-hero label { display: block; font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.search-row { display: flex; gap: 8px; }
.search-hero input { min-height: 56px; font-size: 18px; border-width: 2px; border-color: var(--ink); }
.search-hero button { min-height: 56px; padding: 0 24px; font-size: 17px; background: var(--brand-strong); color: var(--on-brand); }
.quick { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 0 18px; color: var(--muted); font-size: 15px; }
.quick a { display: inline-block; padding-block: 10px; font-weight: 600; }
.lead .tally { font-size: 16px; color: var(--ink); max-width: 40em; }
.num { font-size: 1.3em; font-weight: 750; letter-spacing: -0.01em; }
.block { margin-top: 44px; }
.names { list-style: none; padding: 0; margin-top: 12px; columns: 220px 3; column-gap: 32px; }
.names li { break-inside: avoid; padding: 6px 0; }
.names a { display: inline-block; padding-block: 4px; font-weight: 600; }
.names .n, .names .where { color: var(--muted); font-size: 14px; }

/* A notice: text on the left, a sticky panel of facts on the right from 960 px */
.notice { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.notice-head .meta { margin-bottom: 10px; }
.notice h1 { font-size: clamp(22px, 3.6vw, 28px); max-width: 34em; }
@media (min-width: 960px) {
  .notice {
    grid-template-columns: minmax(0, 1fr) 340px; column-gap: 48px;
    /* the panel spans both rows: the text's row takes its extra height, not the title's */
    grid-template-rows: auto 1fr;
    grid-template-areas: "head panel" "main panel";
  }
  .notice-head { grid-area: head; }
  .notice-main { grid-area: main; }
  .panel { grid-area: panel; align-self: start; position: sticky; top: 16px; }
}
.panel { display: grid; gap: 16px; }
/* the plot outline: the panel's facts inside a dashed boundary in stake orange */
.sheet {
  display: grid; gap: 12px; padding: 18px; background: var(--sheet);
  border: 2px dashed var(--brand); border-radius: 4px;
}
.sheet .fact dd { font-weight: 500; }
.sheet .fact:not(.fact-key) dd { display: block; }
.sheet .fact-key dd { font-size: clamp(20px, 4.4vw, 24px); font-weight: 700; line-height: 1.2; }
.sheet .wd { font-size: 15px; font-weight: 400; color: var(--muted); }
.sheet .fact-key + .fact:not(.fact-key) { padding-top: 12px; border-top: 1px solid var(--rule); }
.notice.is-past .sheet { border-color: var(--rule); }
.source { display: grid; gap: 10px; }
.source .btn { width: 100%; }
.files-box h2 { font-size: 16px; margin-bottom: 6px; }
.files { padding-left: 1.2em; }
.files li { margin: 2px 0; overflow-wrap: anywhere; }
.files a { display: inline-block; padding-block: 6px; }
.files + .note { margin-top: 4px; }
.aside { padding: 12px 14px; background: var(--soft); border-radius: 4px; margin-bottom: 20px; }
.notice-main > section + section { margin-top: 32px; }
.text h2 { margin-bottom: 10px; }
.text .note { margin-bottom: 10px; }
.prose {
  font-family: var(--serif); font-size: 17px; line-height: 1.65; max-width: 70ch;
  overflow-wrap: anywhere; word-break: break-word;
}
.prose p { white-space: pre-line; }
.prose p + p { margin-top: 0.9em; }
/* the rest of a long text: a checkbox and its label, so print shows it without scripts */
.fold { margin-top: 0.9em; }
.fold-label {
  display: inline-flex; align-items: center; min-height: 44px; cursor: pointer;
  font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.fold-toggle:focus-visible + .fold-label { outline: 3px solid var(--brand-strong); outline-offset: 2px; }
.fold-toggle:checked + .fold-label { display: none; }
.fold-rest { display: none; }
.fold-toggle:checked ~ .fold-rest { display: block; }
.related { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--rule); }

/* Plain pages */
.page { max-width: 42em; }
.page h2 { margin: 28px 0 8px; }
.page p + p { margin-top: 10px; }
.page ul { padding-left: 1.2em; }
.page li { margin: 6px 0; }
.page .onward { padding: 0; }

/* Footer */
.foot { border-top: 1px solid var(--rule); background: var(--sheet); font-size: 14px; color: var(--muted); }
.foot-in { display: grid; gap: 20px; padding-block: 28px; }
@media (min-width: 720px) { .foot-in { grid-template-columns: 2fr 1fr 1fr; } }
.foot-name { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.foot-about p + p { margin-top: 6px; }
.foot ul { list-style: none; padding: 0; }
.foot a { color: var(--muted); display: inline-block; padding-block: 8px; }

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

/* Print: the notice as title, facts, text and the source's address */
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .top, .foot, .crumbs, .skip, .related, .btn, .search, .filters, .pager, .fold-label,
  .theme, .files-box .note { display: none !important; }
  .fold-rest { display: block !important; }
  .print-only { display: block; }
  .notice { display: block; }
  .panel { position: static; margin: 12pt 0; }
  .sheet { border: 1px solid #000; }
  .prose { font-size: 11pt; max-width: none; }
  a { color: #000; text-decoration: none; }
}
