/* Comparison pages (layouts/alternative.njk) and the /alternatives index. */

.alt-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Hero */
.alt-hero .lede { max-width: 780px; }
.alt-lede-break { display: block; height: 14px; }
.alt-reviewed { margin-top: 20px; font-size: 14px; color: var(--on-dark-muted); }
.alt-reviewed a { color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, .4); }
.alt-reviewed a:hover { text-decoration-color: #fff; }

/* Short answer */
.alt-verdict { margin-top: 16px; }
.alt-verdict p + p { margin-top: 12px; }
/* Match the comparison table: the alternative's card is gray, MultiModel's is blue. */
.alt-choose .card { background: var(--bg-subtle); }
.alt-choose .card:not(.is-us) li { color: #2b3142; }
.alt-choose .card.is-us { background: var(--blue-50); border-color: #a9b4f2; }
.alt-choose .check-list { margin-top: 12px; }

/* Side-by-side table. Below 768px each row becomes a stacked block, with the
   column name printed above each cell, so the page never scrolls sideways. */
.alt-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 15px; line-height: 1.55; }
.alt-table th, .alt-table td { text-align: left; vertical-align: top; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.alt-table tbody tr:last-child > * { border-bottom: 0; }
.alt-table thead th { font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--bg-subtle); }
.alt-table thead th:first-child { width: 22%; }
.alt-table thead th:last-child { color: var(--blue); background: #e9edff; }
.alt-table tbody th { font-weight: 600; color: var(--text); }
.alt-table td { color: var(--muted); }
.alt-table td:last-child { color: var(--text); background: var(--blue-50); }
.alt-table td a { color: var(--blue); }
/* Comparison pages: the alternative's column is gray, MultiModel's stays blue. */
.alt-table:not(.alt-matrix) thead th:nth-child(2) { color: var(--text); background: #eceef2; }
.alt-table:not(.alt-matrix) td:nth-child(2) { color: #2b3142; background: var(--bg-subtle); }
@media (max-width: 767px) {
  .alt-table, .alt-table tbody, .alt-table tr, .alt-table th, .alt-table td { display: block; width: auto; }
  .alt-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .alt-table tbody tr { border-bottom: 1px solid var(--line); }
  .alt-table tbody tr:last-child { border-bottom: 0; }
  .alt-table tbody th, .alt-table td { border-bottom: 0; }
  .alt-table tbody th { padding: 18px 18px 10px; font-size: 16px; }
  .alt-table td { padding: 10px 18px; }
  .alt-table td:last-child { padding-bottom: 16px; }
  .alt-table td::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .alt-table td:last-child::before { color: var(--blue); }
}

/* Strengths */
.alt-strengths { gap: 64px; }
.alt-points { margin-top: 28px; border-top: 1px solid var(--line); }
.alt-points li { padding: 20px 0; border-bottom: 1px solid var(--line); }
.alt-points h3 { font-size: 18px; letter-spacing: -.01em; margin-bottom: 6px; }
.alt-points p { color: var(--muted); font-size: 15px; }
.alt-points a, .alt-together a { color: var(--blue); }

/* Using both */
.alt-together { max-width: 820px; margin-bottom: 0; }
.alt-together p { margin-top: 16px; font-size: 17px; color: var(--muted); }

/* Sources */
.alt-sources .h3 { margin-bottom: 8px; }
.alt-sources ol { margin: 20px 0 0; padding-left: 22px; display: grid; gap: 6px; font-size: 15px; }
.alt-sources ol a { color: var(--blue); overflow-wrap: anywhere; }
.alt-sources ol a:hover { text-decoration: underline; }
.alt-disclaimer { margin-top: 24px; max-width: 820px; font-size: 14px; color: var(--muted); }
.alt-disclaimer a { color: var(--blue); }

/* More comparisons */
.alt-others-head { margin-bottom: 24px; }
.alt-others-links { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.alt-others { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.alt-others .card { padding: 20px 22px; }
.alt-others .card-tag { margin-bottom: 8px; }
.alt-others .h3 { font-size: 18px; margin: 0; }

/* Index: category groups and the all-vendor matrix */
.alt-group + .alt-group { margin-top: 56px; }
.alt-group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin-bottom: 20px; }
.alt-group-head .h3 { margin: 0; }
.alt-group-head p { color: var(--muted); font-size: 15px; }
.alt-index-card .h3 { margin-bottom: 10px; }
.alt-index-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.alt-index-brand img { width: 32px; height: 32px; object-fit: contain; flex: none; }
.alt-index-brand .card-tag { margin: 0; }
.alt-matrix thead th:first-child { width: 16%; }
/* Header row: the page hero's dark gradient, drawn once across the full row.
   Each cell paints the table-wide gradient offset by its own left edge
   (--alt-th-x and --alt-table-w come from alternatives.js). */
.alt-matrix thead th, .alt-matrix thead th:last-child {
  color: var(--on-dark); font-weight: 700; font-size: 14px;
  background: radial-gradient(farthest-side at 85% -60%, rgba(38, 61, 191, .55), transparent),
              radial-gradient(farthest-side at 10% 160%, rgba(242, 5, 92, .14), transparent),
              var(--ink);
  background-size: var(--alt-table-w, 100%) 100%;
  background-position: calc(-1 * var(--alt-th-x, 0px)) 0;
  background-repeat: no-repeat;
  border-bottom-color: var(--ink);
}
.alt-matrix td:last-child { color: var(--muted); background: transparent; }
.alt-matrix tr.is-us td, .alt-matrix tr.is-us th { background: var(--blue-50); color: var(--text); }
.alt-matrix tbody th a { color: var(--blue); }
.alt-matrix .alt-more { display: flex; width: fit-content; margin-top: 10px; font-size: 14px; }
/* The header and MultiModel rows stick below the nav while the table scrolls.
   Sticky cells can't live inside overflow: hidden, so the rounded corners move
   from the table onto its corner cells. alternatives.js sets --alt-nav-h and
   --alt-head-h from the rendered heights. */
@media (min-width: 768px) {
  .alt-matrix { overflow: visible; }
  .alt-matrix thead th { position: sticky; top: var(--alt-nav-h, 72px); z-index: 3; }
  .alt-matrix tr.is-us > * { position: sticky; top: calc(var(--alt-nav-h, 72px) + var(--alt-head-h, 50px)); z-index: 2; }
  .alt-matrix thead th:first-child { border-top-left-radius: var(--radius); }
  .alt-matrix thead th:last-child { border-top-right-radius: var(--radius); }
  .alt-matrix tbody tr:last-child > :first-child { border-bottom-left-radius: var(--radius); }
  .alt-matrix tbody tr:last-child > :last-child { border-bottom-right-radius: var(--radius); }
}
@media (max-width: 767px) {
  .alt-matrix td:last-child::before { color: var(--muted); }
}

/* "<Competitor> alternatives" pages: a short matrix (no sticky rows needed)
   with the product being replaced shaded, and "Best for" lines on the cards. */
.alt-matrix-short tr.is-them td, .alt-matrix-short tr.is-them th { background: #eceef2; color: var(--text); }
@media (min-width: 768px) {
  .alt-matrix-short tr.is-us > * { position: static; }
}
.alt-shortlist .card { display: flex; flex-direction: column; }
.alt-shortlist .card > p { margin-bottom: 14px; }
.alt-shortlist .card > .link-arrow { margin-top: auto; }
.alt-bestfor strong { color: var(--text); }
