/* 206 Equipment — sale catalogue
 *
 * Scoped CSS with tokens, no framework, no web fonts, no JavaScript anywhere.
 * Everything is sized in rem so browser and app zoom scale the page uniformly.
 *
 * The look is borrowed from a printed auction notice rather than a storefront
 * template: a hard terms band across the top, heavy rules, one accent, and
 * photographs given the room. It should read as a business clearing a suite.
 *
 * Colour pairs are verified by app/check_build.py against WCAG 2.2 AA — 4.5:1
 * for body text, 3:1 for large text and UI. Do not adjust a token here without
 * re-running the checker; it fails the build on a short ratio.
 */

:root {
  --paper:      #f6f4f1;
  --card:       #ffffff;
  --ink:        #17191c;
  --ink-2:      #55595f;
  --rule:       #d9d4cd;
  --rule-hard:  #17191c;
  --accent:     #9c3612;
  --accent-ink: #ffffff;
  --sold-ink:   #5b5f65;
  --sold-bg:    #ece9e5;
  --focus:      #0b4f9e;

  --radius: 0.25rem;
  --pad: 1.25rem;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #17191c;
    --card:       #212429;
    --ink:        #e4e2df;
    --ink-2:      #a9adb3;
    --rule:       #33373d;
    --rule-hard:  #6e747c;
    --accent:     #f0906a;
    --accent-ink: #17191c;
    --sold-ink:   #9ba0a6;
    --sold-bg:    #1c1f23;
    --focus:      #7fb4f5;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); }
a:focus-visible,
button:focus-visible,
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--card);
  color: var(--ink);
  padding: 0.75rem 1rem;
  z-index: 10;
}
.skip:focus { left: 0; }

.wrap {
  width: 100%;
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* --- terms band ---------------------------------------------------------- */
.band {
  background: var(--rule-hard);
  color: var(--paper);
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
}
@media (prefers-color-scheme: dark) {
  .band { background: #0e1013; color: #d8d6d3; }
}
.band ul {
  list-style: none;
  margin: 0;
  padding: 0.6rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
}
.band li { position: relative; }
.band li + li::before {
  content: "";
  position: absolute;
  left: -0.75rem;
  top: 0.45em;
  width: 1px;
  height: 1em;
  background: currentColor;
  opacity: 0.45;
}

/* --- preview banner ------------------------------------------------------
 * Carried by every page under /beta/ and by nothing else. It is a persistent
 * band rather than a dismissible notice on purpose: a fake catalogue one
 * directory deeper is still a fake catalogue, and the statement has to survive
 * a visitor who arrives on an item page from a pasted link.
 * --accent-ink on --accent is the same pair the checker already verifies at
 * 4.5:1 in both themes, so this band inherits a measured contrast rather than
 * introducing an unverified one. */
.preview {
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom: 3px solid var(--rule-hard);
}
.preview p {
  margin: 0;
  padding: 0.7rem 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  max-width: 80ch;
}
.preview b { font-weight: 800; letter-spacing: 0.02em; }

/* --- holding page --------------------------------------------------------
 * The whole of `/`. Body measure, generous spacing, one call to action. */
.holding { max-width: var(--measure); }
.holding > p {
  margin: 0 0 1.15rem;
  font-size: 1.125rem;
}
.holding__contact {
  margin: 2.25rem 0 0;
  padding: 1.5rem 0 0;
  border-top: 3px solid var(--rule-hard);
}
.holding__contact h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.holding__contact p { margin: 0 0 1.15rem; }
.holding__contact p:last-child { margin-bottom: 0; }

/* --- masthead ------------------------------------------------------------ */
.masthead {
  border-bottom: 3px solid var(--rule-hard);
  padding: 2rem 0 1.5rem;
}
.brand {
  display: inline-block;
  text-decoration: none;
  color: inherit;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.1;
}
.brand span { color: var(--accent); }
.brand-sub {
  margin: 0.3rem 0 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
}
.headline {
  margin: 1.5rem 0 0.5rem;
  font-size: clamp(1.85rem, 6vw, 2.85rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.015em;
  max-width: 20ch;
}
.standfirst {
  margin: 0;
  max-width: var(--measure);
  color: var(--ink-2);
  font-size: 1.0625rem;
}

/* --- tag nav ------------------------------------------------------------- */
.nav {
  border-bottom: 1px solid var(--rule);
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 5;
}
.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.nav a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 2rem;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  background: var(--card);
}
.nav a[aria-current="page"] {
  background: var(--rule-hard);
  border-color: var(--rule-hard);
  color: var(--paper);
}
@media (prefers-color-scheme: dark) {
  .nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
}
.nav .n { color: var(--ink-2); font-weight: 400; margin-left: 0.4rem; }
.nav a[aria-current="page"] .n { color: inherit; opacity: 0.75; }

/* --- section headings ---------------------------------------------------- */
main { padding: 1.75rem 0 3rem; }

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0 0 1.1rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.sec-head .count {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-2);
}

/* --- card grid — fixed column counts, never auto-fit --------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
@media (min-width: 34rem) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 58rem) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 80rem) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.card:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

.card__media {
  aspect-ratio: 4 / 3;
  background: var(--sold-bg);
  overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }

.ph {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--ink-2);
  background:
    repeating-linear-gradient(45deg,
      transparent 0 10px,
      color-mix(in srgb, var(--ink-2) 10%, transparent) 10px 20px);
  font-size: 0.9375rem;
  text-align: center;
  padding: 1rem;
}
.ph b { font-size: 1.5rem; font-weight: 800; letter-spacing: 0.08em; }

.card__body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}
.card__title { margin: 0; font-size: 1.125rem; line-height: 1.3; font-weight: 700; }
.card__title a {
  color: inherit;
  text-decoration: none;
  display: block;
  min-height: 1.5rem;
}
.card__title a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.card__title a:hover { color: var(--accent); }

.card__sum {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.4rem;
}
.price {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.price.ask { font-size: 1.15rem; font-weight: 700; color: var(--ink-2); }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 2rem;
  font-size: 0.875rem;
  color: var(--ink-2);
  white-space: nowrap;
}
.badge--hold {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

/* --- sold ---------------------------------------------------------------- */
.sold-sec { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
.card--sold { background: var(--sold-bg); }
.card--sold .card__media img { filter: grayscale(1); opacity: 0.55; }
.card--sold .card__title a { color: var(--sold-ink); text-decoration: line-through; }
.card--sold .price { color: var(--sold-ink); text-decoration: line-through; }
.card--sold .card__sum { color: var(--sold-ink); }
.stamp {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border: 2px solid var(--sold-ink);
  border-radius: 2px;
  color: var(--sold-ink);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* --- empty state --------------------------------------------------------- */
.empty {
  border: 2px dashed var(--rule);
  border-radius: var(--radius);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--ink-2);
  max-width: var(--measure);
}
.empty h2 { margin: 0 0 0.5rem; color: var(--ink); font-size: 1.25rem; }
.empty p { margin: 0; }

/* --- item page ----------------------------------------------------------- */
.crumb { padding: 1rem 0 0; font-size: 0.9375rem; }
.crumb a { display: inline-flex; align-items: center; min-height: 2.75rem; }

.item {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
  align-items: start;
}
@media (min-width: 58rem) {
  .item { grid-template-columns: repeat(2, 1fr); gap: 3rem; }
  .item__side { position: sticky; top: 5rem; }
}

.hero {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--sold-bg);
}
.hero .ph { aspect-ratio: 4 / 3; }

.thumbs {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}
@media (min-width: 34rem) { .thumbs { grid-template-columns: repeat(4, 1fr); } }
.thumbs a {
  display: block;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--sold-bg);
  min-height: 3rem;
}
.thumbs img { aspect-ratio: 1 / 1; width: 100%; object-fit: cover; }

.item h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 4.5vw, 2.15rem);
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.item__price {
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin: 0 0 0.25rem;
}
.item__price.ask { font-size: 1.5rem; color: var(--ink-2); }
.obo { color: var(--ink-2); font-size: 0.9375rem; margin: 0 0 1.25rem; }

.desc { max-width: var(--measure); }
/* pre-line honours the single newlines a human types inside a paragraph
 * without any markup ever being interpolated into the description. */
.desc p { margin: 0 0 1rem; overflow-wrap: anywhere; white-space: pre-line; }

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.6rem;
  background: var(--accent);
  color: var(--accent-ink);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  font-size: 1.0625rem;
  font-weight: 700;
  text-decoration: none;
}
.cta:hover { filter: brightness(1.08); }
.cta-note { margin: 0.75rem 0 0; color: var(--ink-2); font-size: 0.9375rem; max-width: 46ch; }

.spec {
  margin: 1.5rem 0 0;
  border-top: 1px solid var(--rule);
}
.spec div {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.spec dt { color: var(--ink-2); flex: 0 0 8.5rem; margin: 0; }
.spec dd { margin: 0; font-weight: 600; }

.sold-notice {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--sold-bg);
  border-left: 4px solid var(--sold-ink);
  color: var(--sold-ink);
  font-weight: 600;
}

/* --- footer -------------------------------------------------------------- */
.foot {
  border-top: 3px solid var(--rule-hard);
  padding: 2rem 0 3rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
}
.foot ul { list-style: none; margin: 0 0 1rem; padding: 0; }
.foot li { margin: 0 0 0.3rem; }
.foot .brand { font-size: 1.125rem; margin-bottom: 0.75rem; }
