/* /learn index and articles. Shared components come from site.css.
 *
 * Structure: one grid, `.learn-grid`, carries every band of an article
 * page so the hero, the rail, the body, and the FAQ share left edges.
 * Wide: a 220px rail (in-page contents) beside a 680px reading column.
 * Narrow: the rail stacks above the body in DOM order.
 */
:root {
  --learn-rail: 220px;
  --learn-measure: 680px; /* 17px Basis at 680px is a 72ch measure */
  --learn-gap: 72px;
}
.learn-grid {
  max-width: calc(
    var(--learn-rail) + var(--learn-gap) + var(--learn-measure) + 48px
  );
  margin: 0 auto;
  padding: 0 24px;
}
.learn-wrap.wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Hero (article) ─────────────────────────────────────────────────── */
.learn-hero {
  background: var(--night);
  color: var(--ghost);
  padding: 56px 0 52px;
}
.learn-hero h1 {
  font-size: clamp(34px, 4.6vw, 60px);
  max-width: 20ch;
  margin: 0 0 22px;
  color: var(--ghost);
}
.learn-meta {
  margin: 0;
  font-size: var(--text-ui);
  color: var(--ghost-65);
}
.crumbs {
  margin: 0 0 22px;
  font-size: var(--text-fine);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ghost-50);
}
.crumbs a {
  color: var(--ghost-72);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--coral);
}

/* ── Masthead (index) ───────────────────────────────────────────────── */
.learn-masthead {
  background: var(--night);
  color: var(--ghost);
  padding: 64px 0 60px;
}
.learn-masthead .learn-wrap.wide {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.6fr);
  gap: 40px 64px;
  align-items: end;
}
.learn-masthead h1 {
  font-size: clamp(38px, 5.4vw, 68px);
  max-width: 14ch;
  margin: 0 0 20px;
  color: var(--ghost);
}
.learn-masthead .learn-meta {
  max-width: 46ch;
  font-size: var(--text-hero);
  line-height: 1.5;
}
/* The readout: the index's own board. Facts about the shelf, in tabular
 * figures, so the right half of the masthead carries information rather
 * than air. */
.learn-readout {
  margin: 0;
  font-size: var(--text-ui);
}
.learn-readout > div {
  display: grid;
  grid-template-columns: 112px 1fr;
  column-gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(247, 246, 251, 0.18);
}
.learn-readout > div:first-child {
  border-top: 1px solid var(--ghost-72);
}
.learn-readout dt,
.learn-readout dd {
  margin: 0;
}
.learn-readout dt {
  font-size: var(--text-micro);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ghost-50);
  padding-top: 3px;
}
.learn-readout dd {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ghost);
}
.learn-readout a {
  color: var(--coral);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.learn-readout a:hover {
  color: var(--tomato);
}
.learn-readout dd small {
  display: block;
  font-size: var(--text-fine);
  font-weight: 400;
  color: var(--ghost-65);
  margin-top: 2px;
}

/* ── Article grid: rail + body ──────────────────────────────────────── */
.learn-article {
  padding: 48px 0 24px;
}
.learn-article .learn-grid,
.learn-faq .learn-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 36px var(--learn-gap);
  align-items: start;
}
.learn-rail {
  font-size: var(--text-small);
}
.toc-title {
  margin: 0 0 10px;
  font-size: var(--text-micro);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--charcoal);
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}
.toc li {
  margin: 0;
}
.learn-article .toc a {
  position: relative;
  display: block;
  padding: 6px 0 6px 16px;
  color: var(--charcoal);
  text-decoration: none;
  line-height: 1.4;
  text-wrap: pretty;
  transition: color 120ms ease;
}
.learn-article .toc a::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  transform: scale(0);
  transition: transform 180ms var(--ease-out);
}
.learn-article .toc a:hover {
  color: var(--ink);
}
.learn-article .toc a[aria-current="true"] {
  color: var(--ink);
  font-weight: 700;
}
.learn-article .toc a[aria-current="true"]::before {
  transform: scale(1);
}
.rail-meta {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: var(--text-fine);
  color: var(--charcoal);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
/* The rail is a route: the coral line draws down as the reader goes,
 * the dot marks the section they are in, and the fine print says how far
 * is left. Scroll-driven, so it plays the same with reduced motion. */
.learn-article .toc ol {
  position: relative;
}
.learn-article .toc ol::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 0;
  width: 1px;
  height: 100%;
  background: var(--coral);
  transform: scaleY(var(--read, 0));
  transform-origin: top;
}
.rail-left {
  flex-basis: 100%;
  font-variant-numeric: tabular-nums;
}
.rail-left.is-done {
  color: var(--success-deep);
  font-weight: 700;
}
.learn-article .rail-meta a {
  color: var(--charcoal);
  font-weight: 700;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.learn-article .rail-meta a:hover {
  color: var(--tomato-deep);
}

/* Article typography */
.learn-body {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  min-width: 0;
}
.learn-body > :first-child {
  margin-top: 0;
}
.learn-article .lede {
  font-size: 20px;
  line-height: 1.5;
  color: var(--charcoal);
  margin: 0 0 36px;
}
.learn-article h2 {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: 28px;
  line-height: 1.1;
  margin: 52px 0 14px;
  scroll-margin-top: 92px;
}
.learn-article h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 26px 0 8px;
}
.learn-article p {
  margin: 0 0 16px;
}
.learn-article ul,
.learn-article ol {
  margin: 0 0 18px;
  padding-left: 22px;
}
.learn-article li {
  margin-bottom: 8px;
}
.learn-article a {
  color: var(--tomato-deep);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  font-weight: 700;
}
.learn-article .callout {
  background: var(--honey-tile);
  border-radius: 18px;
  padding: 20px 24px;
  margin: 32px 0;
  font-size: 16px;
  line-height: 1.55;
}
.learn-article .callout strong {
  color: var(--honey-deep);
}
.learn-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 28px;
  font-size: 15px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.learn-article caption {
  caption-side: top;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: var(--charcoal);
  padding: 0 0 8px;
}
.learn-article th,
.learn-article td {
  text-align: left;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
.learn-article thead th {
  border-top: 0;
  background: var(--ghost);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--charcoal);
}
.learn-article td:not(:first-child) {
  font-variant-numeric: tabular-nums;
}
.table-scroll {
  overflow-x: auto;
}
.learn-article .disclaimer {
  font-size: 14px;
  color: var(--charcoal);
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 32px;
}
.learn-article .sources-title {
  font-family: var(--font-body);
  font-size: var(--text-micro);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--charcoal);
  margin: 36px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.learn-article .disclaimer + .sources-title {
  margin-top: 24px;
  padding-top: 0;
  border-top: 0;
}
.learn-article .sources {
  font-size: 14px;
  color: var(--charcoal);
}
.learn-article .sources a {
  font-weight: 500;
  color: var(--charcoal);
}
.learn-article .sources a:hover {
  color: var(--tomato-deep);
}

/* ── Your week: the mileage article prices the reader's own drive ─── */
@keyframes rvBump {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}
.drive-calc {
  background: var(--peach-tile);
  border-radius: 20px;
  padding: 24px 26px;
  margin: 4px 0 36px;
}
.drive-calc .drive-label {
  display: block;
  font-size: var(--text-small);
  font-weight: 700;
  margin: 0 0 6px;
}
.drive-row {
  display: flex;
  align-items: center;
  gap: 18px;
}
.drive-row input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--tomato);
  height: 28px;
  margin: 0;
}
.drive-row output {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  letter-spacing: -0.02em;
  line-height: 1;
  min-width: 6ch;
  text-align: right;
}
.drive-row output small {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-fine);
  letter-spacing: 0;
  color: var(--charcoal);
  margin-left: 4px;
}
.drive-out {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  margin: 18px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--ink-10);
}
.drive-out strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(34px, 4vw, 44px);
  line-height: 1;
  letter-spacing: -0.02em;
  transform-origin: left center;
}
.drive-out strong.is-bumping {
  animation: rvBump 320ms var(--ease-out);
}
.drive-out span {
  display: block;
  margin-top: 6px;
  font-size: var(--text-fine);
  line-height: 1.45;
  color: var(--charcoal);
}
.learn-article .drive-note {
  margin: 22px 0 0;
  font-size: var(--text-fine);
  color: var(--charcoal);
}
.learn-article .checklist-note {
  margin: 10px 0 18px;
  font-size: var(--text-fine);
  color: var(--charcoal);
}
@media (prefers-reduced-motion: reduce) {
  .drive-out strong.is-bumping {
    animation: none;
  }
}

/* ── First-month checklist: a list you can actually tick ───────────── */
.learn-article .checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}
.learn-article .checklist li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.learn-article .checklist li:last-child {
  border-bottom: 1px solid var(--line);
}
.checklist input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 24px;
  height: 24px;
  margin: 2px 0 0;
  border: 1.5px solid var(--charcoal);
  border-radius: 8px;
  background: var(--white);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease;
}
.checklist input::after {
  content: "";
  width: 11px;
  height: 6px;
  border: 2.5px solid var(--ink);
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) translate(1px, -2px) scale(0);
  transition: transform 180ms var(--ease-out);
}
.checklist input:checked {
  background: var(--coral);
  border-color: var(--coral);
}
.checklist input:checked::after {
  transform: rotate(-45deg) translate(1px, -2px) scale(1);
}
.checklist input:focus-visible {
  outline: 2px solid var(--tomato);
  outline-offset: 2px;
}
.checklist label {
  cursor: pointer;
  transition: color 140ms ease;
}
.checklist input:checked + label {
  color: var(--charcoal);
  text-decoration: line-through;
  text-decoration-color: var(--coral);
  text-decoration-thickness: 1.5px;
}
.checklist-done {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-weight: 700;
  color: var(--success-deep);
  animation: rvPop 480ms var(--ease-out) both;
}
.checklist-done i {
  font-size: 20px;
}
@media (prefers-reduced-motion: reduce) {
  .checklist-done {
    animation: none;
  }
}
@media (max-width: 480px) {
  .drive-out {
    grid-template-columns: 1fr;
  }
}

@media (pointer: coarse) {
  .crumbs a,
  .learn-article .rail-meta a {
    display: inline-block;
    padding: 12px 0;
    margin: -12px 0;
  }
  .crumbs a {
    padding: 16px 0;
    margin: -16px 0;
  }
  .drive-row input[type="range"] {
    height: 44px;
    margin: -8px 0;
  }
  .learn-article .toc a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .learn-article .toc a::before {
    top: 50%;
    margin-top: -4px;
  }
}

/* FAQ shares the article grid: the heading takes the rail column. */
.learn-faq {
  max-width: none;
  padding: 0;
}
.learn-faq .learn-grid {
  padding-top: var(--section-y-short);
  padding-bottom: var(--section-y);
}
.learn-faq h2 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 34px);
}
.learn-faq .faq-list {
  min-width: 0;
}

/* CTA reuses .signup; just restyle the button as a link */
.learn-cta {
  overflow: hidden;
}
.learn-cta .cta-mark {
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
}
.learn-cta .btn-coral {
  display: inline-block;
  text-decoration: none;
  padding: 15px 28px;
  font-size: 16px;
}

/* Article cards */
.learn-more {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 0 var(--section-y);
}
.learn-more.first {
  padding-top: 56px;
}
.learn-more .eyebrow {
  margin-bottom: 20px;
}

/* The lead: one article gets the front page. Its figure is the article's
 * own headline number, so the shelf opens on a fact, not a label. */
.learn-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 32px 48px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 40px;
  margin-bottom: 18px;
  color: var(--ink);
  text-decoration: none;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease;
}
.learn-lead:hover {
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(23, 23, 23, 0.08);
}
.learn-lead h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.learn-lead p {
  margin: 0 0 22px;
  font-size: var(--text-lede);
  line-height: 1.55;
  color: var(--charcoal);
  max-width: 48ch;
}
.lead-figure {
  background: var(--peach-tile);
  border-radius: 20px;
  padding: 32px 28px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.lead-figure strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(64px, 8vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.lead-figure span {
  display: block;
  margin-top: 12px;
  font-size: var(--text-small);
  line-height: 1.45;
  color: var(--tomato-deep);
  font-weight: 700;
  max-width: 28ch;
}
.more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 18px;
}
.more-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  color: var(--ink);
  text-decoration: none;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease;
}
.more-card:hover {
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(23, 23, 23, 0.08);
}
.more-card .meta,
.learn-lead .meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.learn-lead .meta {
  margin-top: 0;
}
.topic {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-micro);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--charcoal);
}
.topic svg {
  width: 13px;
  height: 14px;
  fill: var(--coral);
  flex: none;
}
.more-card h2,
.more-card h3 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}
.more-card p {
  margin: 0 0 6px;
  font-size: var(--text-ui);
  line-height: 1.5;
  color: var(--charcoal);
}
.more-card .go,
.learn-lead .go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 14px;
  color: var(--tomato-deep);
}
@media (min-width: 1024px) {
  .learn-article .learn-grid,
  .learn-faq .learn-grid {
    grid-template-columns: var(--learn-rail) minmax(0, var(--learn-measure));
    justify-content: start;
  }
  .learn-rail {
    position: sticky;
    top: 96px;
  }
  .learn-article {
    padding-top: 56px;
  }
  .learn-faq h2 {
    position: sticky;
    top: 96px;
  }
}
@media (max-width: 860px) {
  .learn-masthead .learn-wrap.wide {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .learn-masthead {
    padding: 52px 0 48px;
  }
  .learn-lead {
    grid-template-columns: 1fr;
    padding: 28px;
    gap: 24px;
  }
  .lead-figure {
    padding: 24px;
  }
}
@media (max-width: 600px) {
  .learn-hero {
    padding: 44px 0 40px;
  }
  .learn-article .learn-grid,
  .learn-faq .learn-grid {
    gap: 28px;
  }
  .learn-article table {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    white-space: nowrap;
  }
}
