/* Public open-bid pages (/bids, /bids/<state>/...), server-rendered by functions/_lib/bids.js. Loaded after styles.css and built
   from its tokens and components (header, footer, buttons, pills, data-table, FAQ, CTA band). */

/* ------------------------------------------------------------------ header: the current section */
.site-nav a[aria-current] { color: var(--primary); border-bottom-color: var(--primary); }
.site-menu a[aria-current]:not(.btn) { color: var(--primary); }

/* ------------------------------------------------------------------ page head */
.bids-hero { background: var(--surface); padding: var(--s-5) 0 var(--s-10); border-bottom: 1px solid var(--border); }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; list-style: none; font-size: 14px; line-height: 1.4; color: var(--text-2); }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.crumbs a { display: inline-flex; align-items: center; min-height: 32px; color: var(--primary); font-weight: 600; text-decoration: none; }
.crumbs a:hover { color: var(--primary-hover); text-decoration: underline; }
.crumbs .icon { margin: 0 6px; color: var(--text-muted); }
.crumbs [aria-current] { color: var(--text-2); }

.bids-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--s-12); align-items: start; margin-top: var(--s-3); }
.bids-hero-copy { min-width: 0; }
.bids-hero h1 { max-width: 760px; font-size: 40px; line-height: 1.15; overflow-wrap: break-word; }
.bids-updated { display: flex; align-items: flex-start; gap: 8px; margin-top: var(--s-3); font-size: 15px; line-height: 1.45; color: var(--text-2); }
.bids-updated .icon { margin-top: 2px; color: var(--primary); }
.bids-updated time { font-weight: 700; color: var(--text); }
.bids-intro { margin-top: var(--s-4); max-width: 72ch; font-size: 18px; line-height: 1.6; color: var(--text); }

/* "at a glance" panel: the page's numbers (a KPI row) and the first call to action */
.glance { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-card); overflow: hidden; }
.glance-head { padding: 10px 16px; background: var(--navy); color: #fff; font-weight: 700; font-size: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--border); border-bottom: 1px solid var(--border); }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; min-width: 0; padding: 12px 16px; background: var(--surface); }
.stat dt { font-size: 14px; line-height: 1.35; color: var(--text-2); }
.stat dd { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.glance-cta { padding: 16px; background: var(--primary-subtle); }
.glance-title { font-weight: 700; font-size: 17px; line-height: 1.35; color: var(--navy); }
.glance-cta p + p { margin-top: 4px; font-size: 15px; line-height: 1.45; color: var(--text-2); }
.glance-cta .btn { margin-top: 14px; }
.btn-wrap { white-space: normal; text-wrap: balance; line-height: 1.25; padding-top: 10px; padding-bottom: 10px; }

/* ------------------------------------------------------------------ bid lists */
.bids-list { padding-top: var(--s-10); }
.jump-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: var(--s-6); }
.jump-label { margin-right: 4px; font: 700 14px/1.4 var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.jump-nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 6px 0 12px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-ctl); color: var(--primary); font-weight: 600; font-size: 15px; text-decoration: none; }
.jump-nav a:hover { border-color: var(--primary); background: var(--primary-subtle); color: var(--primary-hover); }

.bid-table-wrap { scroll-margin-top: calc(var(--header-h) + 16px); }
.bid-table-wrap + .bid-table-wrap { margin-top: var(--s-8); }
.table-heading { margin: 0; color: #fff; font-size: 18px; line-height: 1.3; }
.caption-count { margin-left: 6px; font-size: 15px; font-weight: 400; color: #DCE4EF; }
.caption-note { font-size: 14px; font-weight: 400; color: #DCE4EF; }
.caption-link { display: inline-flex; align-items: center; gap: 2px; min-height: 32px; color: #fff; font-size: 15px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.caption-link:hover { color: #fff; text-decoration-thickness: 2px; }

.bid-table { table-layout: fixed; }
.bid-table .col-main { width: 35%; }
.bid-table .col-agency { width: 19%; }
.bid-table .col-loc { width: 14%; }
.bid-table .col-due { width: 13%; }
.bid-table .col-sa { width: 11%; }
.bid-table .col-level { width: 8%; }
.bid-table td { overflow-wrap: anywhere; }
.bid-title { display: block; font-weight: 700; line-height: 1.35; color: var(--navy); overflow-wrap: break-word; }
.bid-sol { display: block; margin-top: 2px; font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.bid-link { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; margin-top: 2px; font-size: 15px; font-weight: 600; }
.bid-link .icon { width: 15px; height: 15px; }
.due { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.due time { white-space: nowrap; }

.method-note { display: flex; align-items: flex-start; gap: 8px; max-width: 880px; margin-top: var(--s-5); font-size: 14px; line-height: 1.5; color: var(--text-2); }
.method-note .icon { margin-top: 2px; color: var(--navy); }
.source-line { max-width: 880px; margin-top: var(--s-3); font-size: 14px; line-height: 1.5; color: var(--text-muted); }
.empty-note { display: flex; align-items: flex-start; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--navy);
  border-radius: var(--r-card); font-size: 16px; }
.empty-note .icon { margin-top: 2px; color: var(--navy); }

/* ------------------------------------------------------------------ internal links */
.links-title { margin-bottom: var(--s-6); }
.links-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-8) var(--s-10); }
.link-block { min-width: 0; }
.link-block h3, .link-block .h3 { margin-bottom: var(--s-3); font-size: 18px; line-height: 1.3; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 40px; padding: 0 6px 0 12px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-ctl); color: var(--primary); font-weight: 600; font-size: 15px; line-height: 1.3; text-decoration: none; }
.chip:hover { border-color: var(--primary); background: var(--primary-subtle); color: var(--primary-hover); }
.chip-count { display: inline-grid; place-items: center; flex: none; min-width: 26px; height: 24px; padding: 0 6px; background: var(--surface-2); border-radius: var(--r-tag);
  color: var(--text-2); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chip:hover .chip-count, .jump-nav a:hover .chip-count { background: var(--surface); }
.chip-more { display: inline-flex; align-items: center; min-height: 40px; font-size: 14px; color: var(--text-2); }

/* ------------------------------------------------------------------ hub: states and trades */
.state-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); list-style: none; }
.state-card { position: relative; display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 18px 52px 18px 20px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--r-card); color: var(--text); text-decoration: none; transition: border-color .12s ease, box-shadow .12s ease; }
a.state-card:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(22, 46, 81, .10); color: var(--text); }
.state-card.is-empty { background: var(--surface-2); }
.state-name { font-size: 20px; line-height: 1.25; font-weight: 700; color: var(--navy); }
.state-count { font-size: 16px; font-weight: 700; color: var(--primary); }
a.state-card:hover .state-count { color: var(--primary-hover); }
.state-split { font-size: 14px; color: var(--text-2); }
.state-arrow { position: absolute; right: 18px; top: 50%; width: 24px; height: 24px; margin-top: -12px; color: var(--primary); }
.hub-fed { margin-top: var(--s-8); }

.trade-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); list-style: none; }
.trade-row { min-width: 0; padding: 16px 20px 18px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card); }
.trade-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 10px; }
.trade-head h3 { font-size: 18px; }
.trade-total { font-size: 14px; font-weight: 700; color: var(--text-2); white-space: nowrap; }

/* ------------------------------------------------------------------ closing call to action */
.bids-cta { text-align: center; }
.bids-cta h2 { max-width: 760px; margin: 0 auto; }
.bids-cta-lead { max-width: 680px; margin: var(--s-3) auto 0; font-size: 18px; line-height: 1.55; color: var(--text-2); }
.bids-cta .btn { margin-top: var(--s-6); white-space: normal; text-wrap: balance; }
.bids-cta-points { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin-top: var(--s-5); list-style: none; font-size: 15px; font-weight: 600; }
.bids-cta-points li { display: inline-flex; align-items: center; gap: 6px; }
.bids-cta-points .icon { width: 18px; height: 18px; color: var(--success); stroke-width: 2.5; }

/* ------------------------------------------------------------------ 404 */
.notfound { padding: var(--s-12) 0 var(--s-16); }
.notfound h1 { margin-top: var(--s-2); }
.notfound .link-block { margin-top: var(--s-8); }
.notfound-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--s-8); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1279px) {
  .bids-hero h1 { font-size: 36px; }
  .bids-hero-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-10); }
}
@media (max-width: 1023px) {
  .bids-hero-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .glance-cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-6); align-items: center; }
  .glance-cta .btn { grid-column: 2; grid-row: 1 / span 2; width: auto; max-width: 300px; margin-top: 0; }
  .state-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* bid tables become cards below 960px: two columns of fields on tablets, one on phones */
@media (max-width: 959px) {
  .bid-table, .bid-table tbody { display: block; width: 100%; }
  .bid-table thead { display: none; }
  .bid-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .bid-table tbody tr:last-child { border-bottom: 0; }
  .bid-table tbody tr:hover td { background: transparent; }
  .bid-table td { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; width: auto; padding: 0; border: 0; }
  .bid-table td::before { content: attr(data-label); font: 600 14px/1.5 var(--font); color: var(--text-muted); }
  .bid-table td > .pill, .bid-table td > .due { justify-self: start; align-self: start; }
  .bid-table td.cell-main { display: block; grid-column: 1 / -1; padding-bottom: 4px; }
  .bid-table td.cell-main::before { display: none; }
  .bid-table td.is-empty { display: none; }
  .due { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
}
@media (max-width: 767px) {
  .bids-hero { padding-bottom: var(--s-8); }
  .bids-hero h1 { font-size: 30px; line-height: 1.2; }
  .bids-intro, .bids-cta-lead { font-size: 17px; }
  .links-grid, .trade-rows { grid-template-columns: minmax(0, 1fr); }
  .bid-table tr { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .bid-table td { grid-template-columns: 104px minmax(0, 1fr); }
}
@media (max-width: 639px) {
  .bids-hero { padding-top: var(--s-3); }
  .bids-hero h1 { font-size: 27px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat dd { font-size: 24px; }
  .glance-cta { display: block; }
  .glance-cta .btn { width: 100%; max-width: none; margin-top: 14px; }
  .state-grid { grid-template-columns: minmax(0, 1fr); }
  .table-caption { padding: 10px 14px; }
  .bid-table tr { padding: 14px; }
  .bids-cta .btn { width: 100%; }
  .notfound-actions .btn { width: 100%; }
}
@media (max-width: 380px) {
  .bid-table td { grid-template-columns: 92px minmax(0, 1fr); }
}
