/* BidGrid page. Loaded after the main site's styles.css and uses its colours, type and components. */
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.num, .closes, .count, .facts dd { font-variant-numeric: tabular-nums; }

nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; }

/* Heading band: the hero's pale ground and drafting grid at a fixed, smaller scale. */
.band { position: relative; background: var(--ground); border-block: 1px solid var(--line); overflow: hidden; }
.band::before { content: ''; position: absolute; inset: 0; background: url('drafting.svg') right center / 1440px 660px; opacity: .65; pointer-events: none; }
.band .wrap { position: relative; padding-block: 3.25rem 2.5rem; }
.band h1 { font-size: 2.75rem; line-height: 1.1; letter-spacing: -.025em; margin-bottom: 1.25rem; }
.intro { max-width: 62ch; color: var(--muted); }
.intro:first-of-type { color: var(--ink); }
.intro:last-child { margin-bottom: 0; }
.intro time { white-space: nowrap; }

.sheet { padding-block: 2.5rem 4.5rem; }

/* The grid: one five-column module shared by the filter strip, the column headings and every row.
   A 1px gap over the rule colour draws the lines between cells. */
.filters, .cols, .row, .placeholder, .tender-body { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; }
.filters, .cols, .row, .placeholder { background: var(--line); }

.notice { margin: 0 0 1rem; padding: .85rem 1.25rem; background: var(--ground); border: 1px solid var(--line); font-size: 1rem; }
.status:empty { display: none; }
.status .notice:last-child { margin-bottom: 1.5rem; }

.filters { border: 1px solid var(--line); }
.field { background: var(--paper); padding: .85rem 1rem 1rem; min-width: 0; }
.field label { display: block; margin-bottom: .4rem; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.field input, .field select { display: block; width: 100%; min-height: 44px; padding: .45rem .75rem; font: inherit; font-size: 1rem; line-height: 1.4; color: var(--ink); background-color: var(--paper); border: 1px solid var(--muted); border-radius: 0; appearance: none; }
.field select { padding-right: 2.25rem; cursor: pointer; text-overflow: ellipsis; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23252e37' stroke-width='1.5'/%3E%3C/svg%3E") right .6rem center / 20px 20px no-repeat; }
.field input:hover, .field select:hover { border-color: var(--ink); }
.field input:focus-visible, .field select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.count-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1.5rem; padding-block: 1.25rem .75rem; }
.count { margin: 0; font-size: 1rem; font-weight: 600; }
.text-button { padding: .35rem 0; font: inherit; font-size: 1rem; color: var(--accent); background: none; border: 0; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .25em; cursor: pointer; }
.text-button:hover { color: var(--accent-dark); }
.text-button:focus-visible, .more-button:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.cols { border: 1px solid var(--line); border-bottom: 0; }
.cols span { padding: .55rem 1rem; background: var(--ground); color: var(--muted); font-size: 1rem; font-weight: 600; }
.cols span:first-child { grid-column: span 2; padding-left: 2.75rem; }

.tenders { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); }
.tenders > li + li { border-top: 1px solid var(--line); }

/* Loading: grey bars in the shape of a row. No motion. */
.placeholder > span { position: relative; height: 4.75rem; background: var(--paper); }
.placeholder > span:first-child { grid-column: span 2; }
.placeholder > span::before { content: ''; position: absolute; top: 1.2rem; left: 1rem; width: 55%; height: .75rem; background: var(--line); }
.placeholder > span:first-child::before { left: 2.75rem; width: 70%; }
.placeholder > span:first-child::after { content: ''; position: absolute; top: 2.75rem; left: 2.75rem; width: 35%; height: .625rem; background: var(--line); }

.tender details { position: relative; }
.row { position: relative; cursor: pointer; list-style: none; }
.row::-webkit-details-marker { display: none; }
/* The ring is drawn on a layer above the cells, which would otherwise cover an inset outline. */
.row:focus-visible { outline: none; }
.row:focus-visible::after { content: ''; position: absolute; inset: 0; z-index: 1; outline: 3px solid var(--accent); outline-offset: -3px; pointer-events: none; }
.cell { min-width: 0; padding: 1rem; background: var(--paper); font-size: 1rem; line-height: 1.45; overflow-wrap: break-word; }
.cell-tender { grid-column: span 2; position: relative; padding-left: 2.75rem; }
.row:hover .cell, details[open] .cell { background: var(--ground); }
.t-title { display: block; font-size: 1.125rem; font-weight: 600; line-height: 1.35; }
.row:hover .t-title { color: var(--accent); }
.t-buyer { display: block; margin-top: .2rem; color: var(--muted); }
.cell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.is-application .cell-label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; display: block; color: var(--muted); font-size: 1rem; font-weight: 600; }
.sep { margin-right: .1em; color: var(--muted); }
.days { color: var(--muted); }

/* Open and close mark: a drafting cross that loses its upright when open. */
.toggle { position: absolute; top: 1.4rem; left: 1rem; width: 12px; height: 12px; }
.toggle::before, .toggle::after { content: ''; position: absolute; background: var(--accent); }
.toggle::before { left: 0; right: 0; top: 5.5px; height: 1px; }
.toggle::after { top: 0; bottom: 0; left: 5.5px; width: 1px; }
details[open] .toggle::after { display: none; }

/* The opened tender, on the about panel's ground with its corner registration mark. */
.tender-body { position: relative; grid-template-rows: auto 1fr; background: var(--ground); border-top: 1px solid var(--line); }
details[open]::after { content: ''; position: absolute; width: 24px; height: 24px; right: 12px; bottom: 12px; border-right: 1px solid var(--accent); border-bottom: 1px solid var(--accent); pointer-events: none; }
/* Two ruled cells: the description with its actions beneath, and the facts column, whose rule
   runs the full height of the panel on the line between Region and Value. */
.tender-text { grid-column: 1 / span 3; grid-row: 1; padding: 1.25rem 1rem 0 2.75rem; }
.tender-text > :last-child { margin-bottom: 0; }
.tender-summary { max-width: 68ch; }
.amendment-intro { margin-bottom: .35rem; font-size: 1rem; font-weight: 600; }
.amendment { max-width: 68ch; margin: 0 0 1.1em; padding-left: 1rem; border-left: 1px solid var(--muted); }
.sme { font-size: 1rem; font-weight: 600; }
.facts { position: relative; grid-column: 4 / span 2; grid-row: 1 / span 2; margin: 0; padding: 1.25rem 1rem 3.5rem; }
.facts::before { content: ''; position: absolute; top: 0; bottom: 0; left: -1px; border-left: 1px solid var(--line); }
.facts div + div { margin-top: .75rem; }
.facts dt { color: var(--muted); font-size: 1rem; font-weight: 600; }
.facts dd { margin: 0; font-size: 1rem; }
.actions { grid-column: 1 / span 3; grid-row: 2; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem 2.25rem; padding: 1.75rem 1rem 2.5rem 2.75rem; }
.hint { max-width: 32ch; margin: .5rem 0 0; color: var(--muted); font-size: 1rem; line-height: 1.45; }
.notice-link { display: inline-flex; align-items: center; min-height: 52px; color: var(--accent); font-size: 1rem; font-weight: 600; }
.notice-link:hover { color: var(--accent-dark); }

.empty { padding: 1.75rem 1.25rem; border: 1px solid var(--line); }
.empty p { margin: 0 0 .25rem; }
.is-empty .cols, .is-empty .tenders { display: none; }
.is-failed .filters, .is-failed .count-line, .is-failed .cols, .is-failed .tenders, .is-failed .more-button { display: none; }

.more-button { margin-top: 1.5rem; min-height: 52px; padding: .75rem 1.25rem; font: inherit; font-size: 1rem; font-weight: 600; color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 0; cursor: pointer; }
.more-button:hover { color: var(--accent); border-color: var(--accent); }

.coverage { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 1rem; }
.coverage p { max-width: 60ch; }
.coverage p:last-child { margin-bottom: 0; }

.contact h2 { font-size: 2rem; }

@media (max-width: 1000px) {
  .cell, .cols span, .field { padding-inline: .75rem; }
  .cell-tender, .cols span:first-child { padding-left: 2.5rem; }
  .toggle { left: .875rem; }
  .tender-text, .actions { padding-left: 2.5rem; }
  .facts { padding-inline: .75rem; }
}

@media (max-width: 700px) {
  .band .wrap { padding-block: 2.5rem 2rem; }
  .sheet { padding-block: 2rem 3.25rem; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-q { grid-column: 1 / -1; }
  .field select { padding-left: .6rem; padding-right: 1.9rem; background-position: right .4rem center; }
  .cols { display: none; }
  .tenders { border: 0; }
  .tenders > li { border: 1px solid var(--line); }
  .tenders > li + li { margin-top: .75rem; }
  .row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell-tender, .row .cell:last-child { grid-column: 1 / -1; }
  .cell { padding-block: .75rem; }
  .cell-label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; display: block; color: var(--muted); font-size: 1rem; font-weight: 600; }
  .tender-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .tender-text, .facts, .actions { grid-column: 1; grid-row: auto; }
  .tender-text, .actions { padding-left: .75rem; padding-right: .75rem; }
  .facts { margin-top: 1.25rem; padding: 1rem .75rem; }
  .facts::before { top: -1px; bottom: auto; left: 0; right: 0; border-left: 0; border-top: 1px solid var(--line); }
  .actions { padding-bottom: 3rem; }
}
