/* The episode page: a car review as the written edition of its episode, in a
   magazine register (docs/episode-page/SPEC.md). Loaded after style.css on
   pages whose <body> carries class="episode"; the site header and footer keep
   their dark chrome, the article runs on paper. This file is not one the
   end-card or deck renderers hash, so a change here re-renders nothing. */

body.episode {
  background: #FFFFFF;
  color: #1C1B19;
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  font-size: 1.1rem;
  line-height: 1.62;
}
body.episode .episode-wrap {
  max-width: 68ch;
  margin: 0 auto;
  padding: 2.2rem 16px 3rem;
}
body.episode .ep-eyebrow {
  font-family: 'Archivo', system-ui, sans-serif;
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #B3200E;
  margin: 0 0 .5rem;
}
body.episode h1 {
  font-family: 'Archivo', system-ui, sans-serif;
  font-stretch: 88%;
  font-weight: 800;
  font-size: clamp(2.2rem, 6.5vw, 3.6rem);
  line-height: .98;
  letter-spacing: -.015em;
  color: #1C1B19;
  margin: 0 0 .7rem;
  text-wrap: balance;
}
body.episode .tb-dek {
  font-size: 1.25rem;
  line-height: 1.4;
  margin: 0 0 1rem;
}
body.episode .tb-dek .tb-scope { display: inline; }
body.episode .tb-dek b {
  font-family: 'Archivo', system-ui, sans-serif;
  font-weight: 800;
  color: #1F6F43;
}
body.episode .car-byline,
body.episode .car-made {
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: .82rem;
  color: #6B6761;
  line-height: 1.6;
  margin: 0 0 .3rem;
}
body.episode .car-made { margin-bottom: 1.4rem; }
body.episode .car-byline b { color: #1C1B19; font-weight: 700; }
body.episode .car-byline a,
body.episode .car-made a { color: #B3200E; text-decoration: none; font-weight: 700; }
/* The hand-written first-hand line sits just after the generated byline. */
body.episode .car-firsthand {
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: 0;
  color: #1C1B19;
  margin: -1.1rem 0 1.4rem;
}

body.episode .video-embed { margin: 0 0 1.6rem; }
body.episode .video-frame { position: relative; padding-top: 56.25%; }
body.episode .video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

body.episode .tb-figure { margin: 1.6rem 0; }
body.episode .tb-figure img { display: block; width: 100%; height: auto; border-radius: 0; }
body.episode .tb-figure figcaption {
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: .78rem;
  color: #6B6761;
  line-height: 1.5;
  margin-top: .5rem;
}
body.episode .tb-figure figcaption a { color: #6B6761; }
/* style.css colours these spans for the dark theme; on paper they vanish. */
body.episode .tb-figure figcaption .tb-figcap { font-size: .78rem; color: #3A3833; }
body.episode .tb-figure figcaption .tb-figcredit {
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: .7rem;
  letter-spacing: 0;
  color: #6B6761;
}
/* The generated video section carries the site's .wrap; inside the reading
   column it should take the column's width, not add its own gutter. */
body.episode .episode-wrap > section.wrap { max-width: none; padding: 0; }

body.episode .tb-lede {
  font-size: 1.32rem;
  line-height: 1.42;
  margin: 0 0 1.5rem;
  text-wrap: balance;
}
body.episode .tb-lede::first-letter {
  font-family: 'Archivo', system-ui, sans-serif;
  font-weight: 800;
  font-size: 3.2em;
  float: left;
  line-height: .85;
  padding: .08em .12em 0 0;
  color: #B3200E;
}
body.episode h2 {
  font-family: 'Archivo', system-ui, sans-serif;
  font-stretch: 90%;
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.12;
  letter-spacing: -.01em;
  color: #1C1B19;
  margin: 2.4rem 0 .7rem;
  text-wrap: balance;
}
body.episode p { margin: 0 0 1rem; }
body.episode :where(.episode-wrap) a { color: #1C1B19; }
/* The site header and footer stay as they are on every other page: their
   own sans face and link colours, not the article's serif and ink. */
body.episode .site-header,
body.episode .site-footer { font-family: 'Archivo', sans-serif; }

body.episode .tb-pull {
  margin: 1.6rem 0;
  padding: 1rem 0 .9rem;
  border-top: 1px solid #DCD8D0;
  border-bottom: 1px solid #DCD8D0;
}
body.episode .tb-pull p {
  font-style: italic;
  font-size: 1.28rem;
  line-height: 1.4;
  margin: 0 0 .4rem;
  text-wrap: pretty;
}
body.episode .tb-pull cite {
  font-family: 'Archivo', system-ui, sans-serif;
  font-style: normal;
  font-size: .76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6B6761;
}
body.episode .tb-pull cite a { color: #B3200E; text-decoration: none; }

body.episode .tb-sidenote {
  background: #F6F4EF;
  padding: 1rem 1.2rem;
  margin: 1.4rem 0;
  font-size: 1rem;
  line-height: 1.55;
}
body.episode .tb-sidenote .k {
  font-family: 'Archivo', system-ui, sans-serif;
  font-weight: 800;
  font-size: .76rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #B3200E;
  margin-bottom: .35rem;
}
body.episode .tb-sidenote p { margin: 0; }
body.episode .tb-ppi ol { margin: .4rem 0 0; padding-left: 1.25rem; }
body.episode .tb-ppi li { margin: 0 0 .35rem; }

body.episode .tb-verdict-line {
  font-family: 'Archivo', system-ui, sans-serif;
  font-stretch: 88%;
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1.15;
  color: #1F6F43;
  margin: 0 0 .8rem;
}

body.episode .tb-numbers-wrap { overflow-x: auto; background: #F6F4EF; padding: .4rem .8rem; margin: .6rem 0 .8rem; }
body.episode .tb-numbers { border-collapse: collapse; width: 100%; font-size: .95rem; font-variant-numeric: tabular-nums; }
body.episode .tb-numbers th,
body.episode .tb-numbers td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid #DCD8D0; vertical-align: top; }
body.episode .tb-numbers tr:last-child td { border-bottom: 0; }
body.episode .tb-numbers th {
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #6B6761;
  font-weight: 700;
}
body.episode .tb-numbers td.c { font-family: 'Archivo', system-ui, sans-serif; font-weight: 700; white-space: nowrap; }
body.episode .tb-numbers td.s { font-family: 'Archivo', system-ui, sans-serif; font-weight: 800; font-size: 1.15rem; text-align: center; }
body.episode .tb-numbers tr.total td { font-weight: 600; }
body.episode .tb-fine,
body.episode .tb-marks {
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: .8rem;
  color: #6B6761;
  line-height: 1.6;
}

body.episode .tb-log { list-style: none; padding: 0; margin: .3rem 0 0; font-size: .95rem; }
body.episode .tb-log li {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: .7rem;
  padding: .4rem 0;
  border-top: 1px solid #DCD8D0;
}
body.episode .tb-log li span {
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: .78rem;
  color: #6B6761;
  padding-top: .25rem;
}
@media (max-width: 480px) {
  body.episode .tb-log li { grid-template-columns: 1fr; gap: .1rem; }
}
body.episode .tb-ad { margin: 1.6rem 0; }
body.episode .tb-dek p { margin: .3rem 0 0; }
body.episode .tb-dek .tier-big { font-size: inherit; line-height: inherit; display: inline; }
body.episode .tb-numbers .tb-cat,
body.episode .tb-numbers .tb-val { display: inline; font: inherit; color: inherit; }
body.episode .tb-numbers .n { font-family: 'Archivo', system-ui, sans-serif; font-weight: 800; font-size: 1.15rem; }
body.episode .tb-numbers .d { font-family: 'Archivo', system-ui, sans-serif; font-weight: 700; font-size: .8rem; color: #6B6761; }
body.episode .tb-numbers .tb-figs { display: block; margin-top: .3rem; font-family: 'Archivo', system-ui, sans-serif; font-size: .82rem; color: #6B6761; }
body.episode .tb-numbers .tb-figs b { color: #1C1B19; font-weight: 600; }

/* The jump bar under the byline: the parts a buyer comes back for sit at the
   far end of a long read. Short labels, one row on a desktop, wrapping on a
   phone rather than scrolling sideways. */
body.episode .tb-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .9rem;
  margin: -.6rem 0 1.6rem;
  padding: .55rem 0;
  border-top: 1px solid #DCD8D0;
  border-bottom: 1px solid #DCD8D0;
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: .82rem;
  font-weight: 700;
}
body.episode .tb-jump .k {
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #6B6761;
}
body.episode .episode-wrap .tb-jump a { color: #B3200E; text-decoration: none; }
body.episode .episode-wrap .tb-jump a:hover { text-decoration: underline; }
/* A jump lands the heading clear of the sticky header, the way #board does
   on the front page. site.js keeps --header-h at the header's real height. */
body.episode .episode-wrap [id] { scroll-margin-top: calc(var(--header-h) + 14px); }

/* Where it sits on the Board: the class in Board order, this car marked. */
body.episode .tb-ranks-k,
body.episode .tb-ranks-rivals,
body.episode .tb-ranks-more {
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: .85rem;
  color: #6B6761;
  line-height: 1.55;
  margin: 0 0 .5rem;
}
body.episode .tb-ranks-rivals a,
body.episode .tb-ranks-more a { color: #B3200E; font-weight: 700; text-decoration: none; }
body.episode .tb-ranks { border-collapse: collapse; width: 100%; font-size: .95rem; font-variant-numeric: tabular-nums; }
body.episode .tb-ranks th,
body.episode .tb-ranks td { text-align: left; padding: .5rem .5rem; border-bottom: 1px solid #DCD8D0; vertical-align: top; }
body.episode .tb-ranks tr:last-child td { border-bottom: 0; }
body.episode .tb-ranks th {
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #6B6761;
  font-weight: 700;
  white-space: nowrap;
}
body.episode .tb-ranks td.r,
body.episode .tb-ranks td.s { font-family: 'Archivo', system-ui, sans-serif; font-weight: 800; white-space: nowrap; }
body.episode .tb-ranks td.r { color: #6B6761; width: 2.2rem; }
body.episode .tb-ranks td.m { font-family: 'Archivo', system-ui, sans-serif; white-space: nowrap; }
body.episode .tb-ranks td.s { font-size: 1.1rem; }
body.episode .tb-ranks .d { font-weight: 700; font-size: .75rem; color: #6B6761; }
body.episode .tb-ranks a { font-weight: 700; text-decoration: none; border-bottom: 1px solid #DCD8D0; }
body.episode .tb-ranks a:hover { border-bottom-color: #B3200E; }
body.episode .tb-ranks .v {
  display: block;
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: .78rem;
  color: #6B6761;
  margin-top: .15rem;
}
body.episode .tb-ranks tr.me td { background: #FFFFFF; }
body.episode .tb-ranks tr.me td.r { color: #B3200E; }

/* Each category's sources, under its figures in the numbers table. */
body.episode .tb-numbers .tb-src {
  display: block;
  margin-top: .25rem;
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: .76rem;
  color: #6B6761;
}
body.episode .episode-wrap .tb-numbers .tb-src a { color: #6B6761; text-decoration: underline; text-decoration-color: #C9C4BA; }
body.episode .episode-wrap .tb-numbers .tb-src a:hover { color: #B3200E; }

/* Every figure and its source, folded away under one line. */
body.episode .tb-sources { background: #F6F4EF; padding: .2rem 1rem; margin: .6rem 0 .8rem; }
body.episode .tb-sources summary {
  cursor: pointer;
  padding: .6rem 0;
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: .88rem;
  font-weight: 700;
  color: #1C1B19;
}
body.episode .tb-sources[open] summary { border-bottom: 1px solid #DCD8D0; }
body.episode .tb-sources h3 {
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #B3200E;
  margin: 1rem 0 .2rem;
}
body.episode .tb-sources table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 .6rem;
  background: transparent;
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: .8rem;
  color: #1C1B19;
  font-variant-numeric: tabular-nums;
}
body.episode .tb-sources th,
body.episode .tb-sources td { text-align: left; padding: .35rem .4rem; border-bottom: 1px solid #DCD8D0; vertical-align: top; background: transparent; color: inherit; }
body.episode .tb-sources th { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: #6B6761; font-weight: 700; }
body.episode .episode-wrap .tb-sources td a { color: #1C1B19; text-decoration: underline; text-decoration-color: #C9C4BA; }
@media (max-width: 480px) {
  body.episode .tb-sources { padding: .2rem .6rem; }
  body.episode .tb-sources th,
  body.episode .tb-sources td { padding: .3rem .25rem; }
}
