/*
 * Single best-of listicle (single-best_list.php).
 *
 * Loaded only on best_list singulars (see functions.php).
 *
 * Sections:
 *   1. Hero — full-bleed image + brand overlay (matches pillar style)
 *   2. Body + sidebar (desktop) — methodology, content, sticky picks-nav
 *   3. Body — prose styling for the picks (H2 per pick)
 *   4. Methodology + What-to-consider callouts
 *   5. Related cards + newsletter
 */

.best-list-main {
  padding-bottom: var(--space-section-y-mobile);
}
@media (min-width: 1024px) {
  .best-list-main {
    padding-bottom: var(--space-section-y);
  }
}

/* ───────── 1. Hero ───────── */

.best-list-hero {
  position: relative;
  isolation: isolate;
  min-height: 360px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: var(--space-8) 0 var(--space-6);
  margin-bottom: var(--space-section-y-mobile);
  /* Hardcoded deep forest fallback — brand-deep token flips to bright
     mint in dark mode, so we lock the hero overlay independently of theme. */
  background: #1F4538;
}
@media (min-width: 768px) {
  .best-list-hero {
    min-height: 420px;
    padding: var(--space-10) 0 var(--space-8);
  }
}
@media (min-width: 1024px) {
  .best-list-hero {
    min-height: 460px;
    margin-bottom: var(--space-section-y);
  }
}

.best-list-hero-image {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.best-list-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.best-list-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    rgba(31, 69, 56, 0.45) 0%,
    rgba(31, 69, 56, 0.65) 50%,
    rgba(31, 69, 56, 0.85) 100%
  );
}
@media (min-width: 768px) {
  .best-list-hero-overlay {
    background: linear-gradient(
      to right,
      rgba(31, 69, 56, 0.85) 0%,
      rgba(31, 69, 56, 0.70) 50%,
      rgba(31, 69, 56, 0.20) 85%,
      rgba(31, 69, 56, 0.00) 100%
    );
  }
}

.best-list-hero-content {
  /* Hardcoded warm white — see hero overlay note */
  color: #FAF8F5;
  position: relative;
  width: 100%;
}
.best-list-hero-content .breadcrumbs {
  color: color-mix(in srgb, #FAF8F5 75%, transparent);
  margin-bottom: var(--space-5);
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
}
.best-list-hero-content .breadcrumbs a {
  color: color-mix(in srgb, #FAF8F5 92%, transparent);
  text-decoration: none;
  white-space: nowrap;
  flex: 0 0 auto;
}
.best-list-hero-content .breadcrumbs a:hover {
  color: #FAF8F5;
  text-decoration: underline;
}
.best-list-hero-content .breadcrumbs span.sep {
  color: color-mix(in srgb, #FAF8F5 50%, transparent);
  flex: 0 0 auto;
}
.best-list-hero-content .breadcrumbs span.current {
  color: #FAF8F5;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}

.best-list-eyebrow {
  /* Hardcoded muted terracotta */
  color: #E8C9B4;
}
.best-list-title {
  font-family: var(--font-serif);
  font-weight: var(--weight-semibold);
  font-size: clamp(var(--text-4xl), 5vw, var(--text-5xl));
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: var(--space-2) 0 var(--space-4);
  max-width: 22ch;
  text-wrap: balance;
}
.best-list-tldr {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(var(--text-lg), 1.6vw, var(--text-xl));
  line-height: var(--leading-snug);
  max-width: 60ch;
  color: color-mix(in srgb, #FAF8F5 92%, transparent);
  margin: 0 0 var(--space-4);
}
.best-list-meta {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: color-mix(in srgb, #FAF8F5 75%, transparent);
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

/* ───────── 2. Layout (body + sidebar) ───────── */

.best-list-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}
@media (min-width: 1024px) {
  .best-list-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: var(--space-10);
  }
}

.best-list-body-wrap {
  min-width: 0;
}

/* ───────── 3. Methodology + What to consider callouts ───────── */

.best-list-callout {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin: var(--space-6) 0;
  max-width: var(--max-w-prose);
}
.best-list-callout h2 {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-brand);
  margin: 0 0 var(--space-3);
}
.best-list-callout p {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text);
  line-height: var(--leading-relaxed);
  margin: 0;
}

/* ───────── 4. Body prose ───────── */

.best-list-body {
  max-width: var(--max-w-prose);
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
}

/* The first paragraph of the body content is the FTC disclosure (italicized). */
.best-list-body > p:first-child em {
  display: block;
  background: var(--color-bg-subtle);
  border-left: 3px solid var(--color-accent);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-6);
}

.best-list-body h2 {
  font-family: var(--font-serif);
  font-weight: var(--weight-semibold);
  font-size: clamp(var(--text-2xl), 3vw, var(--text-3xl));
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: var(--space-10) 0 var(--space-4);
  text-wrap: balance;
  color: var(--color-text);
  /* So sticky picks-nav anchor jumps don't hide the heading under the header */
  scroll-margin-top: calc(var(--header-h-desktop) + var(--space-4));
}
.best-list-body > h2:first-of-type {
  margin-top: var(--space-6);
}
.best-list-body h3 {
  font-family: var(--font-serif);
  font-weight: var(--weight-semibold);
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
  margin: var(--space-6) 0 var(--space-3);
}

.best-list-body p,
.best-list-body ul,
.best-list-body ol {
  margin: 0 0 var(--space-4);
}
.best-list-body ul,
.best-list-body ol { padding-left: var(--space-6); }
.best-list-body li {
  margin-bottom: var(--space-2);
  line-height: var(--leading-relaxed);
}

.best-list-body a {
  color: var(--color-brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.best-list-body a:hover { color: var(--color-brand-deep); }
.best-list-body strong {
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

/* Pros/cons lists in each pick — the JSON content uses standard <ul> with
 * <strong>Pros:</strong> / <strong>Cons:</strong> as the first list item.
 * Style them as gentle highlight blocks. */
.best-list-body ul li strong:first-child {
  color: var(--color-brand);
}

/* Tables (quick comparison) */
.best-list-body table {
  border-collapse: collapse;
  width: 100%;
  margin: var(--space-5) 0;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.best-list-body th,
.best-list-body td {
  border: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-4);
  text-align: left;
}
.best-list-body th {
  background: var(--color-bg-subtle);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

/* "Best for: ..." paragraph treatment — first paragraph after each H2 with
 * a leading <strong>. Surface as a callout. */
.best-list-body h2 + p > strong:first-child {
  display: block;
  background: var(--color-bg-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-brand);
}

/* ───────── 5. Sticky sidebar (desktop only) ───────── */

.best-list-sidebar {
  display: none;
}
@media (min-width: 1024px) {
  .best-list-sidebar {
    display: block;
    position: sticky;
    top: calc(var(--header-h-desktop) + var(--space-4));
    align-self: start;
    max-height: calc(100vh - var(--header-h-desktop) - var(--space-6));
    overflow: hidden;
  }
}

.best-list-sidebar-toc {
  background: var(--color-bg-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  max-height: 100%;
  overflow: hidden;
}
.best-list-sidebar-toc-label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-3);
  flex: 0 0 auto;
}
.best-list-sidebar-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  counter-reset: pick;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
.best-list-sidebar-toc-list::-webkit-scrollbar { width: 6px; }
.best-list-sidebar-toc-list::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 999px; }
.best-list-sidebar-toc-list::-webkit-scrollbar-track { background: transparent; }

.best-list-sidebar-toc-list li {
  counter-increment: pick;
}
.best-list-sidebar-toc-list a {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  line-height: var(--leading-snug);
  padding: var(--space-2) 0 var(--space-2) var(--space-3);
  border-left: 2px solid transparent;
  margin-left: calc(-1 * var(--space-3));
  transition:
    color var(--duration-fast) var(--easing-standard),
    border-color var(--duration-fast) var(--easing-standard);
}
.best-list-sidebar-toc-list a:hover {
  color: var(--color-text);
}
.best-list-sidebar-toc-list a.is-active {
  color: var(--color-text);
  font-weight: var(--weight-medium);
  border-left-color: var(--color-accent);
}

/* ───────── 6. Related cards ───────── */

.best-list-related {
  margin-top: var(--space-section-y-mobile);
}
@media (min-width: 1024px) {
  .best-list-related {
    margin-top: var(--space-section-y);
  }
}
.best-list-related .eyebrow {
  display: block;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}
.best-list-related .section-heading {
  font-family: var(--font-serif);
  font-weight: var(--weight-semibold);
  font-size: clamp(var(--text-3xl), 3.5vw, var(--text-4xl));
  margin: 0 0 var(--space-6);
  color: var(--color-text);
}

/* ───────── 7. Newsletter ───────── */

.best-list-newsletter {
  margin-top: var(--space-section-y-mobile);
}
@media (min-width: 1024px) {
  .best-list-newsletter {
    margin-top: var(--space-section-y);
  }
}
