/* Metric lists: big rank numbers and a bar for the stated metric (a picture of the
   value, not a score; RANKING_METHODOLOGY). Builds on table.css (.catalog.ranking). */

@layer components {
.ranking {
  & td:first-child { font-size: 1.6rem; font-weight: 800; font-stretch: var(--narrow); color: var(--rank); line-height: 1.1; width: 3.5rem; }
  & tbody td.rank--1 { color: var(--gold); }
  & tbody td.rank--2 { color: var(--silver); }
  & tbody td.rank--3 { color: var(--bronze); }
  & .value { font-weight: 800; white-space: nowrap; }

  /* Phones: the rank is a number before the product, without a label; the value and
     the offer sit under it, label above value. */
  @media (max-width: 48rem) {
    & tbody tr { display: grid; grid-template-columns: 2.25rem 1fr; gap: var(--space-2) var(--space-2); align-items: center; }
    & tbody td:first-child { width: auto; font-size: 1.5rem; &::before { content: none; } }
    & tbody tr > :not(:first-child, th) { grid-column: 1 / -1; flex-direction: column; justify-content: flex-start; gap: 0.15rem; }
    & tbody td::before { font-size: 0.75rem; }
    & .value { align-self: flex-start; }
    & .bar { min-width: 0; max-width: 10rem; }
  }
}

/* Short: a hint of the value next to the others, not a chart. */
.bar {
  display: block; height: 0.35rem; margin-top: var(--space-2); width: 100%; max-width: 7rem;
  background: var(--track); border-radius: 3px; overflow: hidden;
  & i { display: block; height: 100%; width: var(--share); background: var(--orange); border-radius: 3px; }
}
}

@layer components {
/* Home page: three short facts about how the site works. */
.how-it-works {
  list-style: none; padding: 0; margin: var(--space-5) 0 var(--space-6); display: grid; gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  & li { padding-left: var(--space-3); border-left: 3px solid var(--orange); color: var(--muted); line-height: 1.5; }
  & strong { display: block; color: var(--text); }
}
.home-title { max-width: 22ch; text-wrap: balance; }

.category-links {
  display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: var(--space-4) 0;
  & a {
    display: inline-block; padding: var(--space-2) var(--space-4); border: 2px solid var(--line-strong); color: var(--text);
    border-radius: 999px; font-weight: 700; text-decoration: none;
  }
  & a:hover { background: var(--line-strong); color: var(--bg); }
}

/* "Full list →" under a ranking: a clear next step, the arrow moves on hover. */
.more-link {
  display: inline-flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.85rem;
  color: var(--text); text-decoration: none;
  border-bottom: 2px solid var(--orange); padding-bottom: 2px;
  & [aria-hidden] { color: var(--accent-text); transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1); }
  &:hover [aria-hidden] { transform: translateX(4px); }
}
}

/* Home page (owner, 2026-12-04: less at first sight). A photo behind the heading,
   cropped around its focal point; navy shade on the text side for contrast. Without a
   photo the heading stands on the page as before. */
@layer components {
.hero { margin: var(--space-3) 0 var(--space-6); }
.hero--photo {
  position: relative; isolation: isolate; overflow: hidden; border-radius: var(--radius);
  min-height: clamp(17rem, 26vw, 21rem); display: grid; align-items: center;
  color: #fff; background: var(--navy);
  &::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    /* Text side kept dark well past the text's right edge (contrast ≥ 4.5:1 for the
       intro over bright parts of a photo); the photo shows on the right. */
    background: linear-gradient(90deg, rgb(20 33 61 / 0.94) 0%, rgb(20 33 61 / 0.86) 42%, rgb(20 33 61 / 0.45) 62%, rgb(20 33 61 / 0) 85%),
                linear-gradient(0deg, rgb(20 33 61 / 0.6) 0%, transparent 40%);
  }
  & .home-title { color: #fff; margin-top: 0; }
  & .hero__lede { color: #fff; text-shadow: 0 1px 2px rgb(20 33 61 / 0.5); }
  /* Phones: no photo, so the heading, actions and shortcuts fit the first screen. */
  @media (max-width: 48rem) {
    min-height: 0;
    &::before { display: none; }
    & .hero__image, & .hero__credit { display: none; }
    & .hero__body { padding: var(--space-5) var(--space-4); }
  }
}
.hero__image { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.hero__body { padding: var(--space-5); max-width: 38rem; }
.home-title { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); margin-bottom: var(--space-3); }
.hero__lede { font-size: 1.05rem; line-height: 1.5; font-weight: 450; max-width: 34rem; margin-bottom: var(--space-4); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: 0; }
.hero__credit { position: absolute; right: var(--space-3); bottom: var(--space-2); margin: 0; color: rgb(255 255 255 / 0.75); font-size: 0.75rem; }
.btn--ghost {
  background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor;
  &:hover { box-shadow: inset 0 0 0 2px currentColor; background: rgb(255 255 255 / 0.12); }
}
.home-section { margin-block: var(--space-6); }
.home-section > h2 { margin-top: 0; }
}

/* Index pages (rankings, knowledge): a low photo band behind the heading (HeroPage).
   Lower than the home hero, so the cards still start in the first view. */
@layer components {
.banner--photo {
  position: relative; isolation: isolate; overflow: hidden; border-radius: var(--radius);
  min-height: clamp(12rem, 20vw, 15rem); display: grid; align-items: end;
  margin-block: var(--space-3) var(--space-5); color: #fff; background: var(--navy);
  &::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(90deg, rgb(20 33 61 / 0.92) 0%, rgb(20 33 61 / 0.8) 45%, rgb(20 33 61 / 0.3) 75%, rgb(20 33 61 / 0.1) 100%);
  }
  & h1 { color: #fff; margin-top: 0; }
  & .lede { color: #fff; margin-bottom: 0; }
  @media (max-width: 48rem) {
    min-height: 0; align-items: start;
    &::before { display: none; }
    & .banner__image { position: static; z-index: auto; aspect-ratio: 16 / 7; height: auto; }
    & .banner__body { padding: var(--space-4); }
    & .banner__credit { top: var(--space-2); bottom: auto; text-shadow: 0 1px 2px rgb(0 0 0 / 0.6); }
  }
}
.banner__image { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.banner--photo .banner__body { padding: var(--space-5); max-width: 44rem; }
.banner__credit { position: absolute; right: var(--space-3); bottom: var(--space-2); margin: 0; color: rgb(255 255 255 / 0.75); font-size: 0.75rem; }
}

/* Shortcuts under the home actions, and the "find a product" form (review, 2026-12-04). */
@layer components {
.quick-links { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: var(--space-4) 0 0;
  & a { display: inline-block; padding: 0.3rem 0.75rem; border: 1px solid currentColor; border-radius: 999px; font-size: 0.85rem; font-weight: 600; color: inherit; text-decoration: none; opacity: 0.9; }
  & a:hover { opacity: 1; background: rgb(255 255 255 / 0.12); } }
.hero:not(.hero--photo) .quick-links a:hover { background: var(--surface); }
.finder__form { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--space-3); align-items: end;
  padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  & label { display: flex; flex-direction: column; gap: var(--space-1); font-weight: 600; font-size: 0.9rem; }
  & :is(select, input, .btn) { width: 100%; box-sizing: border-box; height: 2.75rem; margin: 0; font: inherit; font-weight: 400; }
  & .btn { font-weight: 700; padding-block: 0; } }
}
