/* ════════════════════════════════════════════════════════════════════════════
   inspections.css — MODULE B2. The 68-A vehicle inspection booking page only.

   Loaded by services/render-hooks/inspections.js on
   /government/constables/precinct-1/vehicle-inspections (and its status
   subpaths) and nowhere else, so no other page on either host pays for it.
   It edits no file another module owns: site.css, tokens.css and public.js
   are untouched and the shared ASSET_VERSION stays put.

   It introduces NO new colours and NO new breakpoints. Every value is an
   existing token from tokens.css used in its annotated role (muted text is
   --color-text-muted = gray-600, 7.0:1 on white — well above the AA floor,
   per the county's contrast rule), which is what keeps the contrast
   guarantees in that file true here with nothing to register in
   tools/contrast-check.mjs. The chips themselves are site.css §26 `.chip`s —
   selected state comes from its [aria-pressed="true"] rule; this file only
   lays them out.

   The page works with this file absent: the picker chips are JS-built (no
   JS, no chips) and the native select needs no styling beyond site.css §24.
   The one rule that matters without JS is the honeypot's. */

/* ── honeypot ─────────────────────────────────────────────────────────────
   Copied from site.css's .uc-hp (the unclaimed claim form): off-screen but
   never display:none — a hidden-by-display field is skipped by some bots and
   by autofill, which is the opposite of what a honeypot needs. */
.insp-hp {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  overflow: hidden;
}

/* ── the page column ──────────────────────────────────────────────────────
   Everything on the booking and status pages lives in one measured column:
   --content-width is the site's own prose measure (the callout already caps
   itself to it), so paragraphs stop running the full 1280px container and
   the form stops floating in a sea of white. Fieldsets hug their controls
   (site.css .field caps inputs at 32rem) instead of drawing a page-wide
   box around a narrow stack of inputs. */

.insp-col { max-width: var(--content-width); }

.inspections-page form fieldset { max-width: 38rem; }

/* ── two-column booking layout ────────────────────────────────────────────
   Single column below 1024px in the natural reading order (the aside is
   FIRST in the markup: what to bring + where, then the notice and form).
   From 1024px the aside moves to a sticky right rail via grid areas —
   visual position only; DOM, reading and tab order never change.
   minmax(0,1fr), per the platform's 320px-reflow lesson. */

.insp-layout { display: grid; gap: var(--space-5); }

@media (min-width: 1024px) {
  .insp-layout {
    grid-template-columns: minmax(0, 1fr) 20rem;
    grid-template-areas: "main aside";
    gap: var(--space-6) var(--space-7, 3rem);
    align-items: start;
  }
  .insp-main { grid-area: main; min-width: 0; }
  .insp-aside {
    grid-area: aside;
    position: sticky;
    /* Clears the sticky site chrome (.header-sticky, 152px at this width) —
       10.5rem is the same clearance the unclaimed page uses for its anchor
       scroll-margin. At 16px the rail pinned BEHIND the header and appeared
       to start mid-list. */
    top: 10.5rem;
  }
  /* The rail is 20rem — let its card and rows fill it edge to edge. */
  .insp-aside .insp-where { max-width: none; }
  .insp-aside .insp-facts__row { grid-template-columns: 1fr; gap: 2px; }
  .insp-aside .insp-facts__row + .insp-facts__row { margin-top: var(--space-3); }
}

/* Breathing room around the notice — it renders flush against the Where card
   and the next section head otherwise. */
.insp-col .callout { margin: var(--space-5) 0 var(--space-6); }

/* ── label/value rows (the Where card + the status page) ────────────────── */

.insp-where { max-width: 38rem; }

.insp-facts {
  display: grid;
  gap: var(--space-2) var(--space-5);
  margin: 0;
}
/* Mobile-first: label stacked over value; side-by-side from the canonical
   480px breakpoint up (min-width only — the four site breakpoints). */
.insp-facts__row { display: grid; gap: 2px; }
.insp-facts__row + .insp-facts__row { margin-top: var(--space-3); }
.insp-facts dt {
  font-size: var(--fs-meta);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.insp-facts dd { margin: 0; }
@media (min-width: 480px) {
  .insp-facts__row {
    grid-template-columns: 6.5rem 1fr;
    gap: var(--space-2) var(--space-4);
    align-items: baseline;
  }
  .insp-facts__row + .insp-facts__row { margin-top: var(--space-2); }
}

/* ── the two-step slot picker (built by inspections.js) ─────────────────── */

.insp-picker { margin: var(--space-3) 0 var(--space-2); }

.insp-picker__label {
  margin: var(--space-3) 0 var(--space-2);
  font-weight: var(--fw-semibold);
  color: var(--color-heading);
}

.insp-picker .chip-group { margin-bottom: var(--space-3); }

.insp-picker__hint { color: var(--color-text-muted); }

/* ── the availability calendar (built by inspections.js) ──────────────────
   One card widget: month nav on top, the grid below. A real table; open days
   are .insp-cal__daybtn buttons whose selected state uses the exact chip
   tokens (site.css §26): navy fill, inverted text. Full and never-offered
   days are the same muted number by design — the privacy rule is that the
   public sees availability, never occupancy. Gaps come from border-spacing,
   so cells never draw doubled borders. */

.insp-cal {
  max-width: 26rem;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-1);
}

/* A little more room for the grid where the viewport affords it. */
@media (min-width: 768px) {
  .insp-cal { max-width: 30rem; padding: var(--space-5); }
}

.insp-cal__nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.insp-cal__month {
  flex: 1;
  margin: 0;
  text-align: center;
  font-weight: var(--fw-semibold);
  font-size: var(--fs-2);
  color: var(--color-heading);
}

.insp-cal__navbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-heading);
  font-size: var(--fs-3);
  line-height: 1;
  cursor: pointer;
}
.insp-cal__navbtn:hover:not(:disabled) { background: var(--color-surface-brand); }
.insp-cal__navbtn:disabled {
  color: var(--color-text-muted);
  border-color: var(--color-border);
  background: var(--color-surface-tint);
  cursor: default;
  opacity: 0.6;
}

.insp-cal__grid { overflow: hidden; }

.insp-cal__table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 3px;
  table-layout: fixed;
  margin: 0;
}

.insp-cal__table th {
  padding: var(--space-1) 0 var(--space-2);
  font-size: var(--fs-meta);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-align: center;
}

.insp-cal__table td {
  padding: 0;
  text-align: center;
  vertical-align: top;
}

.insp-cal__daybtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  min-height: 52px;
  padding: var(--space-1) 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-tint);
  color: var(--color-heading);
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.insp-cal__daybtn:hover {
  background: var(--color-surface-brand);
  border-color: var(--color-border-strong);
}
.insp-cal__daybtn[aria-pressed="true"] {
  background: var(--cc-navy);
  border-color: var(--cc-navy);
  color: var(--color-text-invert);
}

.insp-cal__num {
  font-weight: var(--fw-bold);
  font-size: var(--fs-1);
  line-height: 1.1;
}

/* The visible count. Inherits white when the day is selected; muted
   otherwise (gray-600 — 7.0:1, comfortably above the county's floor). */
.insp-cal__count {
  font-size: var(--fs-meta);
  line-height: 1.1;
  color: var(--color-text-muted);
}
.insp-cal__daybtn[aria-pressed="true"] .insp-cal__count { color: inherit; }

/* Days that offer nothing: quiet, clearly not controls. */
.insp-cal__off {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  color: var(--color-text-muted);
  font-size: var(--fs-meta);
}

@media (prefers-reduced-motion: reduce) {
  .insp-cal__daybtn { transition: none; }
}

@media (forced-colors: active) {
  .insp-cal__daybtn, .insp-cal__navbtn { border: 1px solid CanvasText;
    forced-color-adjust: none; background: Canvas; color: LinkText; }
}

/* The selection readback (role="status"). min-height keeps the form from
   jumping when the first selection lands. */
.insp-picker__status {
  min-height: 1.5em;
  font-weight: var(--fw-semibold);
  color: var(--color-text-muted);
}

/* ── privacy line above the submit button ─────────────────────────────────── */

.insp-privacy {
  max-width: 40rem;
  font-size: var(--fs-meta);
  color: var(--color-text-muted);
}
