/* ==========================================================================
   Liverpool Business Services · "The Catalogue" design system (v2)
   Gallery-modern, seaside undertone, flat colour planes. Single CSS
   source for the whole platform. No frameworks, no gradients, no build.
   ========================================================================== */

/* ---------- Fonts (self-hosted, see tools/fetch_fonts.py) ---------------- */

@font-face {
  font-family: "General Sans";
  src: url("../fonts/general-sans-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("../fonts/general-sans-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("../fonts/general-sans-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("../fonts/general-sans-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-var.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-italic-var.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}

/* ---------- Design tokens ------------------------------------------------ */

:root {
  /* grounds: warm gallery paper, flat planes */
  --paper: #F6F2EA;
  --surface: #FCFAF5;
  --sand: #EBE4D6;
  --pool-tint: #DDEBE6;   /* sea-glass whisper: bands only, never a blue site */

  /* ink and accents */
  --ink: #21251F;         /* warm near-black, faint green cast */
  --ink-soft: #3C4136;
  --muted: #6B7065;
  --rust: #C05A38;        /* corten iron: fills, large accents */
  --rust-deep: #9C4426;   /* small text, links, buttons */
  --pool-deep: #37746C;   /* occasional quiet second accent */

  /* lines */
  --line: rgba(33, 37, 31, 0.14);
  --line-strong: rgba(33, 37, 31, 0.32);

  /* type */
  --font-sans: "General Sans", system-ui, sans-serif;
  --font-serif: "Fraunces", Georgia, serif;

  /* type scale (rem) */
  --fs-0: 0.64rem;
  --fs-1: 0.72rem;
  --fs-2: 0.84rem;
  --fs-3: 1rem;
  --fs-4: 1.2rem;
  --fs-5: 1.5rem;
  --fs-6: 1.9rem;
  --fs-7: 2.4rem;
  --fs-8: 3.2rem;
  --fs-display: clamp(2.4rem, 5.4vw, 5rem);

  /* spacing: 4px base */
  --s-1: 4px;  --s-2: 8px;   --s-3: 12px;  --s-4: 16px;  --s-5: 20px;
  --s-6: 24px; --s-8: 32px;  --s-10: 40px; --s-12: 48px; --s-16: 64px;
  --s-20: 80px; --s-24: 96px; --s-32: 128px;

  --radius: 3px;
  --radius-img: 6px;
}

/* ---------- Base --------------------------------------------------------- */

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-3);
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.022em;
  margin: 0 0 var(--s-4);
}

.serif-accent {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 480;
  letter-spacing: -0.01em;
}

p { max-width: 64ch; margin: 0 0 var(--s-4); }

a { color: var(--rust-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--rust); }

::selection { background: var(--rust); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--rust-deep);
  outline-offset: 2px;
  border-radius: 2px;
}

img, svg { max-width: 100%; height: auto; }

/* ---------- Grounds (flat planes, no gradients) --------------------------- */

.band-paper { background: var(--paper); color: var(--ink); }
.band-sand { background: var(--sand); color: var(--ink); }
.band-tide { background: var(--pool-tint); color: var(--ink); }
.band-ink { background: var(--ink); color: var(--paper); }
.band-ink h1, .band-ink h2, .band-ink h3 { color: var(--paper); }
.band-ink a { color: var(--sand); }
.band-ink .muted { color: rgba(246, 242, 234, 0.66); }

.muted { color: var(--muted); }

/* ---------- The horizon (signature motif) --------------------------------- */
/* A hairline with a small solid disc resting on it: sun on sea. */

.horizon {
  position: relative;
  border: 0;
  border-top: 1px solid var(--line-strong);
  margin: var(--s-16) 0;
  overflow: visible;
}
.horizon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -7px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--rust);
  transform: translateX(-50%);
}
.horizon-left::before { left: 0; transform: none; }

/* ---------- Kit: counters, catalogue numbers, chips ----------------------- */

.eyebrow {
  font-size: var(--fs-1);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.counter {                 /* section counters, units-style "(01)" */
  font-size: var(--fs-2);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--rust-deep);
  font-variant-numeric: tabular-nums;
}

.cat-no {                  /* catalogue number: No. 0417 */
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
  font-size: var(--fs-2);
  color: var(--muted);
}
.cat-no .no { font-family: var(--font-serif); font-style: italic; letter-spacing: 0; margin-right: 2px; }

.chip {
  display: inline-block;
  font-size: var(--fs-0);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 5px 10px 4px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  background: transparent;
}
.chip-new { background: var(--rust-deep); border-color: var(--rust-deep); color: var(--paper); }
.chip-quiet { border-color: var(--line); color: var(--muted); }

/* ---------- Buttons (rectangular, gallery-label) --------------------------- */

.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--fs-2);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 15px 26px 14px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease,
              color 160ms ease, transform 160ms ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--rust-deep); color: var(--paper); }
.btn-primary:hover { background: var(--ink); color: var(--paper); }

.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--paper); }
.band-ink .btn-secondary { color: var(--paper); border-color: var(--paper); }
.band-ink .btn-secondary:hover { background: var(--paper); color: var(--ink); }

.btn-ghost {
  background: transparent; color: var(--rust-deep);
  padding-inline: 4px;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}
.btn-ghost:hover { color: var(--ink); }

.btn[disabled], .btn.is-disabled { opacity: 0.4; pointer-events: none; }

/* ---------- The index (directory rows, units-style) ------------------------ */

.index { border-top: 1px solid var(--line-strong); }

.index-row {
  display: grid;
  grid-template-columns: 110px 1fr auto auto 28px;
  gap: var(--s-6);
  align-items: baseline;
  padding: var(--s-6) var(--s-2);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: background 180ms ease;
}
.index-row:hover { background: var(--surface); }

.index-row .name {
  font-size: var(--fs-5);
  font-weight: 600;
  letter-spacing: -0.015em;
  transition: transform 220ms ease;
}
.index-row:hover .name { transform: translateX(6px); }

.index-row .meta { font-size: var(--fs-2); color: var(--muted); }

.index-row .arrow {
  justify-self: end;
  color: var(--rust-deep);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 180ms ease, transform 220ms ease;
}
.index-row:hover .arrow { opacity: 1; transform: none; }

@media (max-width: 720px) {
  .index-row { grid-template-columns: 84px 1fr 20px; }
  .index-row .meta { display: none; }
}

/* Stacked variant: name gets the full width, metas sit beneath.
   For narrow contexts (home wire and datebook columns). */
.index-row.stack {
  grid-template-columns: 1fr 24px;
  grid-template-areas: "no arrow" "name arrow" "metas metas";
  row-gap: var(--s-1);
}
.index-row.stack .cat-no { grid-area: no; }
.index-row.stack .name { grid-area: name; font-size: var(--fs-4); line-height: 1.25; }
.index-row.stack .arrow { grid-area: arrow; align-self: center; }
.index-row.stack .metas { grid-area: metas; display: flex; gap: var(--s-4); font-size: var(--fs-2); color: var(--muted); flex-wrap: wrap; }

/* ---------- Entry card (for grids; hairline, not boxed) -------------------- */

.card-entry {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-5) 0 var(--s-6);
  border-top: 1px solid var(--line-strong);
  text-decoration: none;
  color: var(--ink);
}
.card-entry .card-head { display: flex; justify-content: space-between; align-items: baseline; }
.card-entry h3 { font-size: var(--fs-5); margin: 0; transition: color 160ms ease; }
.card-entry:hover h3 { color: var(--rust-deep); }
.card-entry .card-meta { color: var(--muted); font-size: var(--fs-2); margin: 0; }

/* ---------- Forms ----------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field label {
  font-size: var(--fs-1); font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}
.field input, .field select, .field textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 13px 14px;
  transition: border-color 160ms ease;
}
.field input:hover, .field textarea:hover { border-color: var(--ink-soft); }
.field input:focus-visible, .field textarea:focus-visible {
  outline: 2px solid var(--rust-deep); outline-offset: 1px; border-color: var(--rust-deep);
}

/* ---------- Ticker (quiet, hairline) ---------------------------------------- */

.ticker {
  overflow: hidden;
  white-space: nowrap;
  border-block: 1px solid var(--line);
  padding-block: var(--s-3);
}
.ticker-track {
  display: inline-flex;
  gap: var(--s-12);
  padding-right: var(--s-12);
  animation: ticker 30s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }
.ticker .tick {
  font-size: var(--fs-2); font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.ticker .tick b { color: var(--rust-deep); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

/* ---------- Imagery (flat art treatment) ------------------------------------ */

.figure-flat { margin: 0; }
.figure-flat img {
  display: block;
  width: 100%;
  border-radius: var(--radius-img);
}

/* The overlay treatment: any photograph sits under an ink wash with a
   breath of rust, so mixed-quality imagery reads as one voice. */
.img-band {
  position: relative;
  border-radius: var(--radius-img);
  overflow: hidden;
  margin: 0;
}
.img-band img {
  display: block; width: 100%;
  height: clamp(200px, 30vw, 340px);
  object-fit: cover;
}
.img-band::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(33, 37, 31, 0.08) 40%, rgba(33, 37, 31, 0.58)),
    rgba(192, 90, 56, 0.1);
}
.img-band figcaption {
  position: absolute; left: var(--s-5); right: var(--s-5); bottom: var(--s-4);
  z-index: 1;
  display: flex; justify-content: space-between;
  color: var(--paper);
  font-size: var(--fs-1); font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.img-band figcaption { text-shadow: 0 1px 8px rgba(33, 37, 31, 0.5); }

/* Pricing */
.tier-price {
  font-family: var(--font-serif); font-style: italic;
  font-size: var(--fs-6); margin: var(--s-2) 0 var(--s-3);
}
.tier-price span { font-family: var(--font-sans); font-style: normal; font-size: var(--fs-2); color: var(--muted); }
.figure-flat figcaption {
  display: flex;
  justify-content: space-between;
  padding-top: var(--s-3);
  font-size: var(--fs-1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Utilities --------------------------------------------------------- */

.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--s-6); }
.wrap-narrow { max-width: 880px; margin-inline: auto; padding-inline: var(--s-6); }

.display {
  font-size: var(--fs-display);
  font-weight: 600;
  line-height: 0.99;
  letter-spacing: -0.03em;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--rust-deep); color: var(--paper);
  padding: 10px 16px; z-index: 100; font-weight: 600;
}
.skip-link:focus { left: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ==========================================================================
   Site chrome and page components
   ========================================================================== */

.site-head { border-bottom: 1px solid var(--line); background: var(--paper); }
.head-row { display: flex; align-items: center; gap: var(--s-8); padding-block: var(--s-4); }
.head-brand {
  display: flex; align-items: center; gap: var(--s-3);
  color: var(--ink); text-decoration: none; flex: none;
}
.head-word {
  font-weight: 600; font-size: var(--fs-2); line-height: 1.15;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.head-nav { display: flex; gap: var(--s-5); flex-wrap: wrap; margin-left: auto; }
.head-nav a {
  color: var(--ink-soft); text-decoration: none;
  font-size: var(--fs-2); font-weight: 550; letter-spacing: 0.02em;
  padding-block: var(--s-2);
  border-bottom: 2px solid transparent;
}
.head-nav a:hover { color: var(--rust-deep); border-bottom-color: var(--rust); }
.head-cta { flex: none; }
@media (max-width: 900px) {
  .head-row { flex-wrap: wrap; }
  .head-nav { order: 3; width: 100%; margin: 0; padding-bottom: var(--s-3); }
  .head-cta { margin-left: auto; }
}

.site-foot { padding-block: var(--s-16) var(--s-8); }
.foot-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-10); align-items: start;
}
.foot-grid nav { display: flex; flex-direction: column; gap: var(--s-2); }
.foot-grid nav a { color: var(--paper-muted); text-decoration: none; font-size: var(--fs-2); }
.foot-grid nav a:hover { color: var(--paper); }
.foot-strap { font-weight: 600; margin-top: var(--s-4); }
.foot-legal { font-size: var(--fs-1); margin-top: var(--s-12); color: rgba(246, 242, 234, 0.5); }
.band-ink .foot-legal a { color: rgba(246, 242, 234, 0.7); }
:root { --paper-muted: rgba(246, 242, 234, 0.72); }

.crumbs { font-size: var(--fs-1); letter-spacing: 0.06em; padding-block: var(--s-4); color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--rust-deep); }

.dir-hero { padding-block: var(--s-16); }
.home-hero { padding-block: var(--s-20) var(--s-16); }

.listing-hero { padding-block: var(--s-8) var(--s-6); }
.listing-eyebrow { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-4); }
.listing-body { padding-block: var(--s-6) var(--s-20); }
.listing-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--s-16); align-items: start;
}
@media (max-width: 900px) { .listing-grid { grid-template-columns: 1fr; } }
.listing-lede { font-size: var(--fs-4); line-height: 1.55; }
.listing-ctas { display: flex; gap: var(--s-4); flex-wrap: wrap; margin-top: var(--s-8); align-items: center; }

.fact-panel {
  border-radius: var(--radius-img);
  padding: var(--s-8);
  position: sticky; top: var(--s-6);
}
.fact-panel h2 {
  font-size: var(--fs-1); letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(246, 242, 234, 0.6); margin-bottom: var(--s-5);
}
.fact-panel dl { margin: 0; }
.fact-panel .fact {
  display: grid; grid-template-columns: 110px 1fr; gap: var(--s-3);
  padding-block: var(--s-3);
  border-bottom: 1px solid rgba(246, 242, 234, 0.14);
}
.fact-panel .fact:last-child { border-bottom: 0; }
.fact-panel dt { font-size: var(--fs-1); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(246, 242, 234, 0.55); padding-top: 2px; }
.fact-panel dd { margin: 0; font-size: var(--fs-2); overflow-wrap: anywhere; }
.fact-panel dd a { color: var(--sand); }

.faq { margin: 0; }
.faq-item { border-top: 1px solid var(--line); padding-block: var(--s-5); }
.faq-item dt { font-weight: 600; margin-bottom: var(--s-2); }
.faq-item dd { margin: 0; color: var(--ink-soft); }

.filter-band {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-block: 1px solid var(--line);
}
.filter-row { display: flex; gap: var(--s-5); align-items: end; padding-block: var(--s-4); flex-wrap: wrap; }
.filter-row .grow { flex: 1 1 240px; }
.filter-count { margin: 0 0 10px; font-size: var(--fs-2); }

.pagination {
  display: flex; gap: var(--s-5); align-items: center; justify-content: center;
  padding-top: var(--s-10);
}

.listing-form { max-width: 760px; }
.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-5); margin-bottom: var(--s-6);
}

.audit-form { display: flex; gap: var(--s-4); align-items: end; flex-wrap: wrap; }
.audit-form .grow { flex: 1 1 280px; }
.audit-head { display: flex; gap: var(--s-8); align-items: center; margin-bottom: var(--s-8); }
.audit-ring {
  flex: none; width: 108px; height: 108px; border-radius: 50%;
  border: 3px solid var(--rust); display: grid; place-items: center;
  font-family: var(--font-serif); font-style: italic; font-size: var(--fs-8);
}
