/* =============================================================
   Components — JSHW

   Discrete, reusable pieces: notices, metadata, definition lists,
   buttons, the FAQ accordion, photography, and the card grid.

   Structure only. Every value is a token from tokens.css — no
   hard-coded hex, spacing or type values in here (see CLAUDE.md).

   Load order: 5th, after typography.css. See the stylesheet block in
   _includes/layouts/base.njk for the full order and why it matters.
   ============================================================= */

/* --- Notices ------------------------------------------------------ */

.notice {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-bg-subtle);
  padding: var(--space-s) var(--space-m);
  margin: var(--space-l) 0;
  max-width: var(--measure);
}

/* Unresolved content that must not reach a live host. Deliberately loud:
   it is meant to be impossible to scroll past on staging. `npm run
   launch-check` fails the build output while any of these remain. */
.notice--outstanding {
  border-left: var(--space-3xs) solid var(--color-brand);
  background: var(--color-bg-subtle);
}

.meta {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* --- Detail list -------------------------------------------------- */

/* Label/value pairs for identity details (legal notice). A <dl> because
   these genuinely are term/definition pairs — the association is real,
   so a screen reader should get it rather than reading two loose
   columns of text. */
.detail-list {
  display: grid;
  grid-template-columns: minmax(10rem, auto) 1fr;
  gap: var(--space-2xs) var(--space-l);
  margin: var(--space-m) 0 var(--space-l);
  max-width: var(--measure);
}

.detail-list dt {
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
}

.detail-list dd {
  margin: 0;
}

.detail-list address {
  font-style: normal;
}

/* Stack on narrow screens — two columns at 320px would leave the value
   column unusably thin. */
@media (max-width: 30rem) {
  .detail-list {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .detail-list dd {
    margin-bottom: var(--space-s);
  }
}

/* --- Button ------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  background: var(--color-brand);
  color: var(--color-text);
  text-decoration: none;
  font-weight: var(--weight-medium);
  border-radius: var(--radius-pill);
  padding: var(--space-2xs) var(--space-m);
  min-height: var(--target-comfortable);
}

.button:hover {
  background: var(--color-brand-strong);
  color: var(--color-text-inverse);
}

/* --- FAQ / accordion --------------------------------------------- */

.faq {
  margin-top: var(--space-2xl);
}

.faq__item {
  border-bottom: 1px solid var(--color-border);
}

.faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  padding: var(--space-s) 0;
  font-weight: var(--weight-medium);
  cursor: pointer;
  list-style: none;
}

.faq__question::-webkit-details-marker {
  display: none;
}

.faq__marker {
  flex-shrink: 0;
  transition: transform var(--duration-base) var(--ease);
}

@media (prefers-reduced-motion: no-preference) {
  .faq__item[open] .faq__marker {
    transform: rotate(180deg);
  }
}

.faq__answer {
  padding: 0 0 var(--space-s);
}

/* --- Photography ---------------------------------------------------
   Real photos, added 27 Aug 2026 (docs/AUDIT.md section I) — Pexels,
   decorative/illustrative use only, never captioned as JSHW's actual
   team, office or clients. Styled to match the live site's own organic
   "blob" mask treatment on real figures, not a boring rectangle,
   because the mandate here is that the visual design stays even
   though the code doesn't. No box-shadow — the live site doesn't use
   one on these either. */
.photo {
  margin: var(--space-l) 0;
  max-width: none;
}

.photo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius-organic-1);
}

.photo--alt img {
  border-radius: var(--radius-organic-2);
}

.photo figcaption {
  margin-top: var(--space-2xs);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* --- Card grid (core values, expertise, services) ----------------- */

.card-grid {
  display: grid;
  gap: var(--space-l);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  margin: var(--space-l) 0 var(--space-xl);
  max-width: none;
}

.card-grid__item h3 {
  font-size: var(--text-lg);
  margin: 0 0 var(--space-2xs);
}

.card-grid__item p {
  margin: 0;
  max-width: none;
}

/* Sits INSIDE the heading it labels, as a block-level <span> — see A11Y-9.
   As a sibling <p> the label was visual only: a screen reader navigating by
   heading list never heard it, because it was not part of any heading's
   accessible name. Inside the <h3> it is, and the label reads as what it
   has always looked like.
   font-weight is pinned because the span now inherits the heading's 700.
   font-size, colour and line-height need no such guard — the first two are
   set here, and --leading-body is unitless so it re-resolves against this
   element's own font-size rather than the heading's. */
.card-grid__eyebrow {
  display: block;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-normal);
  margin: 0 0 var(--space-3xs);
}

/* --- Report components (/insights/) --------------------------------
   The editorial system for long-form audit articles: stat tiles,
   caveat callouts, data tables, pull quotes, status chips. Same rule
   as everything else here — every value a token, nothing invented
   outside tokens.css. */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  margin: var(--space-l) 0;
}

.stat-tile {
  background: var(--color-surface);
  padding: var(--space-m) var(--space-m) var(--space-l);
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
}

.stat-tile__num {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: 1;
  color: var(--color-text);
}

.stat-tile__num small {
  font-size: 0.5em;
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
}

.stat-tile__label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: var(--weight-medium);
}

.stat-tile__note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* The recurring device: state what a number does not prove, right next
   to the number, in its own persistent form rather than a footnote. */
.caveat {
  border-left: 3px solid var(--color-brand);
  background: var(--color-bg-subtle);
  padding: var(--space-s) var(--space-m);
  margin: var(--space-l) 0;
  max-width: var(--measure);
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.caveat__label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: var(--weight-medium);
  color: var(--color-brand-strong);
}

.caveat p {
  max-width: none;
  margin: 0;
}

.caveat strong {
  color: var(--color-text);
}

/* --- Data table ----------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  margin: var(--space-l) 0;
}

.data-table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--text-sm);
  min-width: 30rem;
}

.data-table caption {
  text-align: left;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: var(--space-s) var(--space-m) var(--space-2xs);
}

.data-table th,
.data-table td {
  text-align: left;
  padding: var(--space-2xs) var(--space-m);
  border-bottom: 1px solid var(--color-border);
  vertical-align: baseline;
}

.data-table thead th {
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table td.num,
.data-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table td.was {
  color: var(--color-error);
}

.data-table td.now {
  color: var(--color-success);
  font-weight: var(--weight-medium);
}

/* --- Status chip ------------------------------------------------------ */

.chip {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.1em 0.5em;
  border: 1px solid currentcolor;
  border-radius: var(--radius-s);
  white-space: nowrap;
}

.chip--pass {
  color: var(--color-success);
}

.chip--fail {
  color: var(--color-error);
}

.chip--open {
  color: var(--color-warning);
}

/* --- Pull quote (inside .report-band--pull) ------------------------ */

.pull-quote {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
  max-width: var(--measure);
}

/* --- Finding-count tiles (audit-section breakdown) ------------------ */

.finding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  margin: var(--space-l) 0;
}

.finding-tile {
  background: var(--color-surface);
  padding: var(--space-m);
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.finding-tile__code {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  color: var(--color-brand-strong);
  font-weight: var(--weight-medium);
}

.finding-tile__count {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  line-height: 1;
}

.finding-tile__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* --- Insights: series card (landing page) and article list (hub) --- */

.series-card {
  display: block;
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-brand-strong);
  background: var(--color-surface);
  padding: var(--space-l) var(--space-m);
  text-decoration: none;
  margin: var(--space-l) 0;
  max-width: none;
}

.series-card:hover {
  border-top-color: var(--color-brand);
}

.series-card__eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-2xs);
}

.series-card h2 {
  color: var(--color-text);
  margin: 0 0 var(--space-2xs);
}

.series-card p {
  color: var(--color-text-muted);
  max-width: var(--measure);
  margin: 0;
}

.article-list {
  list-style: none;
  margin: var(--space-l) 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
}

.article-list__item {
  background: var(--color-surface);
  padding: var(--space-m);
}

.article-list__num {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.article-list__item h3 {
  margin: var(--space-3xs) 0 var(--space-2xs);
}

.article-list__item h3 a {
  color: var(--color-text);
  text-decoration-color: var(--color-brand);
}

.article-list__item p {
  color: var(--color-text-muted);
  margin: 0;
  max-width: var(--measure);
}
