/* ==========================================================================
   home.css — layout that only the ranking page uses.

   Table mechanics live in global.css because the methodology page has a table
   too; only per-table column widths belong here.
   ========================================================================== */

/* ── Hero ──────────────────────────────────────────────────────────────────
   The ranking page opens on two halves rather than a stack: the claim on the
   left, and on the right the standfirst plus the three numbers that decide
   whether this page is worth a buyer's time -- how many providers, how many
   criteria, and how many placements were paid for. Every other page keeps the
   plain single-column .lede. */

.lede--split {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: minmax(0, 1fr);
}

.lede--split > * + * { margin-top: 0; }
.lede__main > * + * { margin-top: var(--s-2); }
.lede__main .lede__intro { max-width: var(--measure); }
.lede__main .lede__title { margin-bottom: var(--s-1); }

.lede__intro { color: var(--ink-variant); }

.lede__side {
  display: grid;
  gap: var(--s-3);
  align-content: start;
}

.lede__facts {
  margin: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}
.lede__facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2);
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--line);
}
.lede__facts dt {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.lede__facts dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1;
  color: var(--navy);
}

@media (min-width: 900px) {
  .lede--split {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
    column-gap: var(--s-8);
    align-items: start;
  }
}

/* ── Contents ──────────────────────────────────────────────────────────────
   A static list of same-page anchors. No scroll-spy, no sticky rail: this page
   is read top to bottom, and a jump list is enough. */

.toc {
  margin-top: var(--s-5);
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-3);
}

.toc__title {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  margin: 0 0 var(--s-2);
}

.toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  display: grid;
  gap: 0.625rem;
  font-size: 0.9375rem;
}

.toc__list li {
  counter-increment: toc;
  display: flex;
  gap: 0.625rem;
}
.toc__list li::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--orange-ink);
  padding-top: 0.25em;
}
.toc__list a {
  color: var(--navy);
  text-decoration: none;
}
.toc__list a:hover {
  color: var(--orange-ink);
  text-decoration: underline;
}

@media (min-width: 768px) {
  .toc { padding: var(--s-3) var(--s-4); }
  .toc__list {
    grid-template-columns: 1fr 1fr;
    column-gap: var(--s-4);
  }
}

/* ── Paired rows ───────────────────────────────────────────────────────────
   Prose is capped at the reading measure, which leaves the right half of the
   page empty in a text-only section -- and next to a full-width callout that
   empty half reads as a misalignment rather than as white space. So the two
   halves of these rows are set as a pair: the claim on the left, the evidence
   that supports it on the right, both starting and ending on the same line.
   Below 960px they stack in source order. */

.duo {
  display: grid;
  gap: var(--s-3);
  align-items: start;
}
.duo > * { min-width: 0; }

.duo__title {
  font-size: 1.0625rem;
  margin: 0 0 var(--s-2);
}

@media (min-width: 960px) {
  .duo {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--s-6);
  }
  /* The paragraph column keeps a comfortable line even at half width. */
  .duo__text > p { max-width: 34rem; }
}

/* ── Criteria cards ────────────────────────────────────────────────────── */

.criteria {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-2);
}

.criteria__card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-3);
}
.criteria__card p {
  font-size: 0.9375rem;
  color: var(--ink-variant);
  margin: 0;
}

.criteria__icon {
  display: block;
  width: 32px;
  height: 32px;
  color: var(--orange);
  margin-bottom: var(--s-2);
}
.criteria__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.criteria__name {
  font-size: 1.0625rem;
  margin: 0 0 0.5rem;
}

/* Seven cards never fill a two or three column grid evenly, and a single
   orphan on the last row makes the deck look unfinished. The seventh spans the
   row instead and lays itself out horizontally. */
@media (min-width: 620px) {
  .criteria { grid-template-columns: repeat(2, 1fr); }
  .criteria__card:last-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 14rem) minmax(0, 1fr);
    align-items: baseline;
    column-gap: var(--s-3);
  }
  .criteria__card:last-child .criteria__icon { margin-bottom: 0; }
  .criteria__card:last-child .criteria__name { margin-bottom: 0; }
}
@media (min-width: 1000px) {
  .criteria { grid-template-columns: repeat(3, 1fr); }
}

/* ── The ranking ───────────────────────────────────────────────────────────
   Ten entries, one shape. Same surface, border, radius, padding and heading
   weight for every one of them, and no modifier class on the card itself --
   the only thing that separates first place from tenth is which numeral is in
   the badge. */

.ranking {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-2);
  counter-reset: none;
}

.entry {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-3);
}

.entry__head {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--line);
}

/* Position marker, not a merit badge: the leading entry is the same box in
   solid navy instead of an outline, the way a current page number differs from
   the rest of a pagination row. No gold, no gradient, no glow -- and no orange,
   because orange is this site's call-to-action colour and would read as an
   endorsement rather than an ordinal. */
.entry__rank {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1.5px solid var(--navy);
  border-radius: var(--r);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--navy);
  background: transparent;
}
.entry__rank--lead {
  background: var(--navy);
  color: var(--ink-invert);
}

.entry__name {
  font-size: 1.25rem;
  margin: 0;
}

.entry__kind {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  margin: 0.25rem 0 0;
}

.entry__fields {
  margin: var(--s-2) 0 0;
  display: grid;
  gap: 0.375rem;
}

.entry__fields dt {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange-ink);
}
.entry__fields dt + dd { margin-top: 0; }
.entry__fields dt:not(:first-child) { margin-top: var(--s-2); }

.entry__fields dd {
  margin: 0;
  max-width: 68ch;
  color: var(--ink-variant);
}

.entry__fields ul {
  margin: 0;
  padding-left: 1.125rem;
}
.entry__fields li + li { margin-top: 0.5rem; }
.entry__fields li::marker { color: var(--orange); }

.entry__foot {
  margin: var(--s-3) 0 0;
  padding-top: var(--s-2);
  border-top: 1px solid var(--line);
}

.entry__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
}
.entry__link::after {
  content: '';
  width: 0.4375rem;
  height: 0.4375rem;
  border-right: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.entry__link:hover {
  color: var(--orange-ink);
  text-decoration: underline;
}

@media (min-width: 860px) {
  .entry {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    column-gap: var(--s-4);
    padding: var(--s-4);
  }
  /* The head becomes an identity column on the left; the fields stack on the
     right. Line length stays readable even though the card is full measure. */
  .entry__head {
    flex-direction: column;
    padding-bottom: 0;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    padding-right: var(--s-3);
    height: 100%;
  }
  .entry__fields { margin-top: 0; }
  .entry__foot {
    grid-column: 2;
    margin-top: var(--s-3);
  }
}

/* ── The attack lifecycle ──────────────────────────────────────────────────
   The one place on this page where numbering is honest: these seven stages are
   a sequence, and a buyer needs to know a provider covers the whole of it. The
   rail is the signature element of the page, so everything around it stays
   plain. The final stage -- did anyone notice? -- is marked, because the copy
   argues that is the part with the most value in it. */

.chain {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: chain;
  display: grid;
  gap: 0;
}

.chain__step {
  counter-increment: chain;
  position: relative;
  padding: 0 0 var(--s-3) 3.25rem;
}
.chain__step:last-child { padding-bottom: 0; }

/* the rail */
.chain__step::before {
  content: '';
  position: absolute;
  left: 1.0625rem;
  top: 1.75rem;
  bottom: 0;
  width: 2px;
  background: var(--line-strong);
}
.chain__step:last-child::before { display: none; }

/* the node */
.chain__step::after {
  content: counter(chain, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 2px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-quiet);
}

.chain__step--terminal::after {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--ink-invert);
}

.chain__stage {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--navy);
  margin: 0.375rem 0 0.25rem;
}

.chain__text {
  max-width: 60ch;
  font-size: 0.9375rem;
  color: var(--ink-variant);
  margin: 0;
}

.chain__step--terminal .chain__stage { color: var(--orange-deep); }

/* The rail segment leading into the last stage picks up the accent, so the
   sequence visibly arrives somewhere rather than just stopping. */
.chain__step:nth-last-child(2)::before { background: var(--orange-line); }

@media (min-width: 860px) {
  .chain__step {
    display: grid;
    grid-template-columns: 13rem minmax(0, 1fr);
    column-gap: var(--s-4);
    align-items: baseline;
    padding-bottom: var(--s-4);
  }
  .chain__stage { margin-top: 0.25rem; }
  .chain__text { margin-top: 0.25rem; }
  .chain__step::before { top: 2rem; }
}

/* ── Fit panels ────────────────────────────────────────────────────────── */

.fit {
  display: grid;
  gap: var(--s-2);
}

.fit__panel {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-3);
}
.fit__panel p:last-child {
  color: var(--ink-variant);
  margin: 0;
}

.fit__label {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 var(--s-1);
}
.fit__panel--yes { border-top: 3px solid var(--orange); }
.fit__panel--yes .fit__label { color: var(--orange-ink); }
.fit__panel--no { border-top: 3px solid var(--line-strong); }
.fit__panel--no .fit__label { color: var(--ink-quiet); }

@media (min-width: 760px) {
  .fit { grid-template-columns: 1fr 1fr; }
}

/* ── Per-table widths ──────────────────────────────────────────────────── */

.grid--quick { min-width: 52rem; }
.grid--quick th:first-child,
.grid--quick td:first-child { width: 3rem; }
.grid--quick td:nth-child(2) {
  min-width: 11rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
}

.grid--pricing { min-width: 44rem; }
.grid--pricing th:first-child { min-width: 15rem; }
.grid--pricing td:nth-child(2) {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

.grid--compare { min-width: 48rem; }
.grid--compare th:first-child { min-width: 12rem; }
