/* ==========================================================================
   CarCatalog.co.za — homepage
   Design tokens and layout follow design_handoff_carcatalog_homepage/README.md
   ========================================================================== */

:root {
  /* Colour */
  --ink: #16181d;
  --ink-soft: #22242b;
  --body: #4e535c;
  --muted: #6b7078;
  --faint: #9aa0aa;
  --line: #dcdee4;
  --line-soft: #e6e8ed;
  --rule: #cfd3da;
  --rule-mid: #b9bec7;
  --surface: #fbfbfc;
  --surface-alt: #f4f5f7;
  --surface-hover: #ffffff;
  --accent: oklch(0.5 0.16 310);
  --accent-bright: oklch(0.62 0.17 310);

  --on-dark: #fbfbfc;
  --on-dark-78: rgba(251, 251, 252, 0.78);
  --on-dark-60: rgba(251, 251, 252, 0.6);
  --on-dark-45: rgba(251, 251, 252, 0.45);

  /* Type */
  --font-ui: "Instrument Sans", Helvetica, Arial, sans-serif;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Structure */
  --gutter: 40px;
  --list-gutter: 44px;
  --card-gutter: 52px;

  --transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

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

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--surface-alt);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  text-decoration: none;
  transition: var(--transition);
}
a:hover { color: var(--accent); }

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

/* Shared meta/label treatment -------------------------------------------- */
.chip,
.chip-note,
.latest__label,
.latest__count,
.latest__all,
.post__meta,
.section-card__eyebrow,
.btn-subscribe,
.hero__link,
.site-footer {
  font-family: var(--font-mono);
  text-transform: uppercase;
}

/* Header ------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 22px var(--gutter);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

/* Logo — approved mark 2b, "filled tab" plate */
.logo {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--ink);
}
.logo:hover { color: var(--ink); }

.logo__tab {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  background: var(--ink);
  color: var(--surface);
}

.logo__name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 0 13px;
  white-space: nowrap;
}

.logo__word {
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.05em;
  line-height: 1;
}

.logo__tld {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 8px;
  letter-spacing: 0.22em;
  line-height: 1;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 14px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.btn-subscribe {
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 9px 14px;
  border: 1px solid var(--ink);
}
.btn-subscribe:hover {
  background: var(--ink);
  color: var(--surface);
}

/* Menu affordance — hidden until the nav no longer fits (see Responsive) */
.nav-toggle {
  display: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: none;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 9px 14px;
  cursor: pointer;
  transition: var(--transition);
}
.nav-toggle:hover {
  background: var(--ink);
  color: var(--surface);
}

/* Hero -------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}

.hero__feature {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  background: var(--ink-soft);
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(16, 17, 21, 0.88) 0%,
    rgba(16, 17, 21, 0.15) 55%,
    rgba(16, 17, 21, 0.3) 100%
  );
}

.hero__body {
  position: relative;
  min-height: 620px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px var(--card-gutter) 46px;
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.chip {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--on-dark);
  background: var(--accent);
  padding: 5px 9px;
}

.chip-note {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--on-dark-60);
}

.hero__title {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 58px;
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--on-dark);
  max-width: 15ch;
  text-wrap: pretty;
}

.hero__standfirst {
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--on-dark-78);
  max-width: 52ch;
  text-wrap: pretty;
}

.hero__link {
  align-self: flex-start;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--on-dark);
  border-bottom: 1px solid var(--on-dark-45);
  padding-bottom: 5px;
}
.hero__link:hover {
  color: var(--on-dark);
  border-bottom-color: var(--on-dark);
}

/* Latest writing list ----------------------------------------------------- */
.latest {
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.latest__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 26px var(--list-gutter) 18px;
  border-bottom: 1px solid var(--line-soft);
}

.latest__label {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

/* Must equal the number of real rows below. */
.latest__count {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.post {
  display: block;
  padding: 30px var(--list-gutter);
  border-bottom: 1px solid var(--line-soft);
}
.post:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.post__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 10px;
  letter-spacing: 0.14em;
}

.post__category { color: var(--accent); }

.post__rule {
  width: 14px;
  height: 1px;
  background: var(--rule);
}

.post__time { color: var(--faint); }

.post__title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 31px;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.post__excerpt {
  margin: 0;
  font-size: 15px;
  line-height: 1.62;
  color: var(--body);
  text-wrap: pretty;
}

.latest__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px var(--list-gutter) 30px;
  background: var(--surface-alt);
  border-top: 1px solid var(--line-soft);
}

.latest__tagline {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--body);
  max-width: 34ch;
}

.latest__all {
  font-size: 11px;
  letter-spacing: 0.12em;
  border-bottom: 1px solid var(--rule-mid);
  padding-bottom: 5px;
  white-space: nowrap;
}
.latest__all:hover { border-bottom-color: var(--ink); }

/* Section cards ----------------------------------------------------------- */
.sections {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-bottom: 1px solid var(--line);
}

.section-card {
  display: block;
  padding: 46px var(--card-gutter);
  background: var(--surface);
}
.section-card:first-child { border-right: 1px solid var(--line); }
.section-card:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.section-card__eyebrow {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--faint);
}

.section-card__title {
  margin: 14px 0 12px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 38px;
  line-height: 1.1;
}

.section-card__body {
  margin: 0;
  font-size: 15px;
  line-height: 1.62;
  color: var(--body);
  max-width: 44ch;
}

/* Footer ------------------------------------------------------------------ */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px var(--gutter);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.site-footer__links {
  display: flex;
  gap: 24px;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ==========================================================================
   Responsive — NOT part of the approved desktop design.
   Implements the intent sketched in the handoff README; flag for design review.
   ========================================================================== */
@media (max-width: 1100px) {
  :root {
    --gutter: 20px;
    --list-gutter: 20px;
    --card-gutter: 24px;
  }

  .site-header {
    flex-wrap: wrap;
    gap: 16px;
  }

  .nav-toggle { display: block; }

  .site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding-top: 4px;
  }
  .site-nav.is-open { display: flex; }

  .hero { grid-template-columns: 1fr; }

  .hero__feature,
  .hero__body { min-height: 440px; }

  .hero__body { padding: 40px var(--card-gutter) 36px; }

  .hero__title { font-size: clamp(34px, 7vw, 58px); }

  .post { padding: 24px var(--list-gutter); }

  .sections { grid-template-columns: 1fr; }
  .section-card:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .latest__foot,
  .site-footer { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ==========================================================================
   Article pages — NOT part of the approved homepage handoff.
   Built from the same tokens and type scale; flag for design review.
   ========================================================================== */
.article {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.article__head {
  padding: 56px var(--gutter) 34px;
  border-bottom: 1px solid var(--line-soft);
}

.article__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.article__category { color: var(--accent); }

.article__rule {
  width: 14px;
  height: 1px;
  background: var(--rule);
}

.article__time { color: var(--faint); }

.article__title {
  margin: 0;
  max-width: 20ch;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 58px;
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}

.article__body {
  padding: 40px var(--gutter) 56px;
  max-width: 74ch;
  font-size: 17px;
  line-height: 1.7;
  color: var(--body);
  text-wrap: pretty;
}

.article__body p { margin: 0 0 22px; }

.article__body a {
  color: var(--accent);
  border-bottom: 1px solid var(--rule-mid);
  padding-bottom: 1px;
}
.article__body a:hover { border-bottom-color: var(--accent); }

.article__body ul {
  margin: 0 0 22px;
  padding-left: 20px;
}
.article__body li { margin-bottom: 8px; }

.article__caption {
  margin: 0 0 22px;
  padding: 14px 0 14px 18px;
  border-left: 2px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--muted);
}

.article__further {
  margin: 40px 0 0;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
}

.article__further-label {
  display: block;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

.article__further ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.article__further li { margin-bottom: 10px; }

.article__further a {
  font-size: 15px;
  word-break: break-word;
}

.article__back {
  display: block;
  padding: 30px var(--gutter);
  background: var(--surface-alt);
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.article__back:hover { color: var(--accent); }

@media (max-width: 1100px) {
  .article__head { padding: 36px var(--gutter) 26px; }
  .article__title { font-size: clamp(30px, 7vw, 58px); }
  .article__body { padding: 30px var(--gutter) 40px; }
}

.article__figure {
  margin: 0 0 22px;
  padding: 0;
}

.article__figure img {
  width: 100%;
  height: auto;
  background: var(--surface-alt);
}

.article__figure .article__caption {
  margin: 0;
  border-left: 0;
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 0 14px;
}

/* ==========================================================================
   Section pages (Car Insurance, Motor Spares) — NOT part of the approved
   homepage handoff. Built from the same tokens; flag for design review.
   ========================================================================== */
.section-page {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.section-page__head {
  padding: 56px var(--gutter) 34px;
  border-bottom: 1px solid var(--line-soft);
}

.section-page__eyebrow {
  display: block;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

.section-page__title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 58px;
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.section-page__intro {
  margin: 0;
  max-width: 58ch;
  font-size: 17px;
  line-height: 1.7;
  color: var(--body);
  text-wrap: pretty;
}

.providers {
  display: flex;
  flex-direction: column;
}

.providers__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 26px var(--list-gutter) 18px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.providers__label {
  letter-spacing: 0.18em;
  color: var(--muted);
}

/* Must equal the number of provider rows below. */
.providers__count {
  letter-spacing: 0.1em;
  color: var(--faint);
}

.provider {
  display: block;
  padding: 30px var(--list-gutter);
  border-bottom: 1px solid var(--line-soft);
}
.provider:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.provider__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.provider__rule {
  width: 14px;
  height: 1px;
  background: var(--rule);
}

.provider__domain {
  color: var(--faint);
  text-transform: none;
  letter-spacing: 0.06em;
}

.provider__name {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 31px;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.provider__body {
  margin: 0;
  max-width: 62ch;
  font-size: 15px;
  line-height: 1.62;
  color: var(--body);
  text-wrap: pretty;
}

.section-page__note {
  padding: 28px var(--gutter) 30px;
  background: var(--surface-alt);
  border-top: 1px solid var(--line-soft);
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 70ch;
}

@media (max-width: 1100px) {
  .section-page__head { padding: 36px var(--gutter) 26px; }
  .section-page__title { font-size: clamp(30px, 7vw, 58px); }
  .provider { padding: 24px var(--list-gutter); }
}

/* Article featured image ---------------------------------------------------
   Sits between the article head and body, full-bleed to the page gutters. */
.article__lede {
  margin: 0;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-alt);
}

.article__lede img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
}

/* Provider banner ---------------------------------------------------------- */
.provider__banner {
  margin: 0 0 18px;
  border: 1px solid var(--line-soft);
  background: var(--surface-hover);
}

.provider__banner img {
  width: 100%;
  height: auto;
}

/* Logo-only variant: brand marks sit at their natural size on the surface,
   rather than being stretched to the full row width like a wide banner. */
.provider__banner--logo {
  display: inline-block;
  border: 0;
  background: none;
  padding: 4px 0 2px;
}

.provider__banner--logo img {
  width: auto;
  max-height: 46px;
}
