/* ============================================================
   Today in Cars — Homepage layout
   Depends on tokens.css (design-system variables + primitives).
   Derived from the design-system Homepage.html <style> block:
   the editor-only "Tweaks" panel chrome was removed; story-deck
   truncation (line-clamp) and the issue dateline were added.
   ============================================================ */

/* ---------- Page chrome ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: var(--fs-18);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--col-page);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

/* ---------- Masthead / eyebrow nav ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: var(--bw-hair) solid var(--rule);
}
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  height: 64px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-21);
  letter-spacing: var(--ls-tight);
  color: var(--ink);
  text-transform: uppercase;
  line-height: 1;
}
.nav {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}
.nav a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-14);
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  padding: 6px 0;
}
.nav a:not(.cta)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-fast) var(--ease-out);
}
.nav a:not(.cta):hover::after { transform: scaleX(1); }
.nav .cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: var(--r-1);
  font-size: var(--fs-14);
  transition: background var(--t-fast) var(--ease-out);
}
.nav .cta:hover { background: var(--signal); }
.nav .cta svg { width: 14px; height: 14px; }

/* ---------- Hero stripe ---------- */
.stripe {
  background: var(--signal);
  color: var(--paper);
  position: relative;
  overflow: hidden;
  border-bottom: var(--bw-rule) solid var(--ink);
}
.stripe-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--sp-9);
  align-items: center;
  padding-top: 48px;
  padding-bottom: 52px;
  position: relative;
  z-index: 1;
}
/* Headline column is a container so the tagline can size to ITS width (cqi),
   keeping it one line across the 2-col → 1-col breakpoint. */
.stripe-copy { container-type: inline-size; min-width: 0; }  /* min-width:0 so the nowrap h1 can't blow out the grid track */

.stripe h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(15px, 5cqi, 44px);   /* auto-shrinks to stay one line at any width */
  line-height: 1.05;
  letter-spacing: var(--ls-tight);
  color: var(--paper);
  margin: 0 0 var(--sp-5);
  white-space: nowrap;
}
.stripe p.desc {
  font-family: var(--font-body);
  font-size: clamp(17px, 3.9cqi, 24px);   /* scales with the column; stays within the line cap */
  line-height: 1.45;
  color: var(--paper);
  max-width: 52ch;
  margin: 0;
  /* Cap at 2 lines on desktop (3 on mobile, below) */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

/* Inline signup — lives directly on the red stripe */
.signup { display: grid; gap: 12px; min-width: 0; }   /* fills its column (desktop) / full width when stacked (mobile) */
.signup input[type="email"] {
  width: 100%;
  padding: 18px 20px;
  font-family: var(--font-body);
  font-size: var(--fs-18);
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--paper);
  border-radius: var(--r-1);
  outline: none;
  transition: border-color var(--t-fast) var(--ease-out);
}
.signup input[type="email"]::placeholder { color: var(--ash-500); }
.signup input[type="email"]:focus { border-color: var(--ink); }
.signup button {
  width: 100%;
  padding: 18px 20px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-16);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  border-radius: var(--r-1);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out),
              color      var(--t-fast) var(--ease-out);
}
.signup button:hover { background: var(--paper); color: var(--ink); }
.signup .fineprint {
  font-family: var(--font-body);
  font-size: var(--fs-12);
  color: rgba(246, 242, 233, 0.8);
  margin: 0;
}

/* ---------- Issue dateline ---------- */
.dateline {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding-top: var(--sp-6);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ash-500);
}
.dateline .red { color: var(--signal); font-weight: 700; }
.dateline a.red { text-decoration: none; }
.dateline a.red::after { content: " \2192"; }   /* → : marks it as the link to the issue page */
.dateline a.red:hover { text-decoration: underline; text-underline-offset: 3px; }
.dateline .grow { flex: 1; height: 1px; background: var(--rule-soft); }

/* ---------- Featured + Quick Links row ---------- */
.featured-row {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: var(--sp-9);
  padding-top: var(--sp-5);
  padding-bottom: 24px;
}

/* Featured (left) */
.feature .photo-frame {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--ash-100);
}
.feature .photo-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: filter var(--t-fast) var(--ease-out);
}
.feature:hover .photo-frame img { filter: brightness(1.06); }
.feature .caption {
  font-family: var(--font-body);
  font-size: var(--fs-12);
  color: var(--ash-500);
  margin-top: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.feature .caption b {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ash-700);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  font-style: normal;
}
.feature .eyebrow-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-6) 0 var(--sp-4);
}
.feature .eyebrow-row .accent-rule {
  width: 40px; height: 4px;
  background: var(--signal);
}
.feature .eyebrow-row .eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-12);
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  color: var(--signal);
}
.feature .eyebrow-row .eyebrow.green { color: var(--track); }
.feature .eyebrow-row .eyebrow.src { color: var(--ash-500); }
.feature .eyebrow-row .meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--ash-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.feature h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(36px, 3.4vw, 48px);
  line-height: 1.04;
  letter-spacing: var(--ls-tight);
  color: var(--ink);
  margin: 0 0 var(--sp-4);
  max-width: 18ch;
}
.feature h2 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.feature .deck {
  font-family: var(--font-body);
  font-size: var(--fs-21);
  line-height: 1.4;
  color: var(--ash-700);
  margin: 0 0 var(--sp-4);
  max-width: 56ch;
  /* Trail off after 3 lines */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.feature .byline {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ash-500);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.feature .byline .read-more {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--signal);
  letter-spacing: 0.04em;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.feature .byline .read-more:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Quick Links (right) */
.latest {
  border-top: 2px solid var(--ink);
  padding-top: var(--sp-4);
}
.latest-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
}
.latest-head h3 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-30);
  letter-spacing: var(--ls-tight);
  color: var(--ink);
  margin: 0;
}
.latest-head h3 .amp { color: var(--signal); font-style: italic; }
.latest-head a.all {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-12);
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.latest-head a.all:hover { color: var(--signal); }
.latest-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.latest-list > li {
  padding: var(--sp-5) 0;
  border-bottom: 1px solid var(--ash-200);
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: var(--sp-4);
  align-items: start;
}
.latest-list > li:last-child { border-bottom: 0; }
.latest-list .num {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--ash-500);
  padding-top: 4px;
  letter-spacing: 0.05em;
}
.latest-list .num .red { color: var(--signal); font-weight: 700; }
.latest-list .eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  color: var(--signal);
  margin-bottom: 6px;
  display: inline-block;
}
.latest-list .eyebrow.green { color: var(--track); }
.latest-list .eyebrow.src { color: var(--ash-500); }
.latest-list h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-18);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 6px;
  letter-spacing: -0.005em;
}
.latest-list h4 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.latest-list .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ash-500);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  margin: 0;
}
.latest-list .meta b { color: var(--ash-700); font-weight: 700; }

/* ---------- In Other News (3-up cards below the fold) ---------- */
.garage {
  border-top: 1px solid var(--ink);
  padding: var(--sp-7) 0 var(--sp-9);
  margin-top: var(--sp-6);
}
.garage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
  gap: var(--sp-5);
}
.garage-head h3 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-36);
  letter-spacing: var(--ls-tight);
  color: var(--ink);
  margin: 0;
}
.garage-head h3 .amp { color: var(--signal); font-style: italic; }
.garage-head .lede {
  max-width: 38ch;
  font-family: var(--font-body);
  font-size: var(--fs-16);
  color: var(--ash-700);
  line-height: 1.5;
  margin: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}
.card {
  background: var(--paper-pure);
  border: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  transition: transform var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out);
}
.card:hover,
.card:has(:focus-visible) {
  transform: translateY(-2px);
  border-color: var(--signal);
}
/* Whole card is the click target — one <a> wraps photo + body */
.card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
  text-decoration: none;
}
.card .photo-frame {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--ash-100);
  border-bottom: 1px solid var(--ink);
}
.card .photo-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: filter var(--t-fast) var(--ease-out);
}
.card:hover .photo-frame img { filter: brightness(1.06); }
.card .body {
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  flex: 1;
}
.card .eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-12);
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  color: var(--signal);
}
.card .eyebrow.green { color: var(--track); }
.card .eyebrow.src { color: var(--ash-500); }
.card h4 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-24);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  /* Trail off after 2 lines so cards in a row stay the same height */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.card:hover h4,
.card:has(:focus-visible) h4 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.card .deck {
  font-family: var(--font-body);
  font-size: var(--fs-16);
  line-height: 1.5;
  color: var(--ash-700);
  margin: 0;
  /* Trail off after 2 lines */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.card .meta {
  margin-top: auto;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--ash-200);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ash-500);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
}
.card .meta b { color: var(--ash-700); font-weight: 700; }

/* ---------- Closing signup ---------- */
.closer {
  background: var(--ink);
  color: var(--paper);
  padding: var(--sp-8) 0;
}
.closer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--sp-8);
  align-items: center;
}
.closer h3 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-36);
  line-height: 1.05;
  letter-spacing: var(--ls-tight);
  margin: 0 0 var(--sp-3);
}
.closer h3 .amp { color: var(--signal); font-style: italic; }
.closer p {
  color: rgba(246, 242, 233, 0.75);
  margin: 0;
  font-size: var(--fs-16);
  max-width: 50ch;
  line-height: 1.55;
}
.closer-form {
  display: flex;
  gap: var(--sp-2);
}
.closer-form input {
  flex: 1;
  padding: 14px 16px;
  border: 0;
  border-radius: var(--r-1);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: var(--fs-16);
  color: var(--ink);
}
.closer-form button {
  padding: 14px 20px;
  border: 0;
  border-radius: var(--r-1);
  background: var(--signal);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-14);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out);
}
.closer-form button:hover { background: var(--signal-hover); }

footer.foot {
  background: var(--ink);
  color: rgba(246, 242, 233, 0.55);
  border-top: 1px solid rgba(246, 242, 233, 0.08);
  padding: var(--sp-5) 0;
  font-family: var(--font-body);
  font-size: var(--fs-12);
}
footer.foot .container {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--sp-5);
}
footer.foot nav { display: flex; gap: var(--sp-5); }
footer.foot a:hover { color: var(--paper); }

/* ============================================================
   Theming hooks (optional) — set on <body data-stripe data-voice>
   Carried over from the design system so the page can be re-skinned
   without touching markup. Defaults: stripe=red, voice=sentence.
   ============================================================ */
body[data-stripe="ink"] .stripe { background: var(--ink); }
body[data-stripe="ink"] .signup button { background: var(--signal); }
body[data-stripe="ink"] .signup button:hover { background: var(--signal-hover); }
body[data-stripe="track"] .stripe { background: var(--track); }

body[data-voice="cover"] .stripe h1,
body[data-voice="cover"] .feature h2,
body[data-voice="cover"] .latest-head h3,
body[data-voice="cover"] .garage-head h3,
body[data-voice="cover"] .closer h3 {
  text-transform: uppercase;
  letter-spacing: -0.005em;
}
body[data-voice="cover"] .feature h2 { font-weight: 900; line-height: 0.98; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .stripe-inner, .featured-row, .closer-inner { grid-template-columns: 1fr; gap: var(--sp-7); }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .nav { gap: var(--sp-4); }
  .nav a:not(.cta) { font-size: var(--fs-12); }
}
@media (max-width: 640px) {
  .nav a:not(.cta) { display: none; }
  .stripe-inner { padding-top: 48px; padding-bottom: 48px; }
  .stripe p.desc { -webkit-line-clamp: 3; line-clamp: 3; }   /* max 3 lines on mobile */
  .feature h2 { font-size: 32px; }
  .card-grid { grid-template-columns: 1fr; }
  .latest-list > li { grid-template-columns: 1fr; gap: var(--sp-2); }
  .latest-list .num { display: none; }
}
