/*
Theme Name: RallyEngine
Description: Software price comparisons: hero search, most-compared grid, subcategory directory, two-column compare with try-the-cheaper-option CTAs.
Version: 1.12.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: rallyengine
*/

:root {
  --bg: #f3efe6;
  --surface: #faf8f3;
  --surface-soft: #f0e8dc;
  --ink: #1a1614;
  --muted: #5c534c;
  --faint: #8a8076;
  --line: #e2d6c8;
  --line-strong: #c4b5a4;
  --accent: #2a2624;
  --accent-hover: #151210;
  --accent-soft: #ebe6e0;
  --field: #faf8f3;
  --shadow: 0 1px 2px rgba(26, 22, 20, 0.04), 0 8px 24px rgba(26, 22, 20, 0.04);
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: #d8d4ce; color: var(--ink); }

a { color: inherit; }
a:focus-visible,
input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 6.5rem;
}

.wrap-wide { max-width: 68rem; }

/* —— Header —— */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-bottom: 4.25rem;
  padding: 0 0 1.35rem;
  border-bottom: 1px solid var(--line);
}

.mark {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: -0.055em;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.mark:hover { opacity: 0.85; }

.bar nav { display: flex; gap: 1.15rem; }
.bar nav a {
  padding: 0.25rem 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
}
.bar nav a:hover,
.bar nav a[aria-current="page"] { color: var(--accent); }
.bar nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }

/* —— Type —— */
.kicker {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

main.dir h1,
main.compare h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(2.15rem, 5.5vw, 3.15rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

main.compare h1 { margin-bottom: 0.4rem; }

main.record h1 {
  margin: 0 0 1.35rem;
  font-size: clamp(2.5rem, 7vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1.02;
}

.meta {
  margin: 0 0 1.5rem;
  color: var(--ink);
  font-size: 0.98rem;
}

.meta .label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.intro {
  max-width: 34rem;
  margin: 0 0 2.75rem;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.55;
  font-weight: 400;
}

.summary {
  max-width: 36rem;
  margin: 0 0 2.75rem;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.lede {
  margin: 0 0 1.85rem;
  color: var(--muted);
  font-size: 1.02rem;
}

/* —— Record table —— */
main.record table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

main.record caption {
  caption-side: bottom;
  margin-top: 1rem;
  padding-left: 0.15rem;
  color: var(--faint);
  font-size: 0.76rem;
  line-height: 1.45;
  text-align: left;
}

main.record th,
main.record td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
  text-align: left;
  font-weight: 400;
}

main.record tr:last-child th,
main.record tr:last-child td { border-bottom: 0; }

main.record th {
  width: 9.5rem;
  padding-right: 0.75rem;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

main.record td a,
.band a {
  color: var(--accent);
  text-decoration-color: #9a948c;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

main.record td a:hover,
.band a:hover { text-decoration-color: currentColor; }

.empty { color: var(--faint); font-style: italic; }

/* —— Search —— */
.search { margin: 0 0 3rem; }

.search label {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
}

.search-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 9.5rem;
  gap: 0.7rem;
  align-items: end;
}

.category-field {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.category-field label { margin: 0; }

.category-field select {
  width: 100%;
  padding: 1.05rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.category-field select:hover { border-color: #a99888; }

.category-field select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(42, 38, 36, 0.16);
}

.search-field { position: relative; display: block; }

.search-field::before,
.search-field::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.search-field::before {
  left: 1.05rem;
  top: 50%;
  width: 0.72rem;
  height: 0.72rem;
  margin-top: -0.46rem;
  border: 1.6px solid var(--muted);
  border-radius: 50%;
}

.search-field::after {
  left: 1.68rem;
  top: 60%;
  width: 0.38rem;
  height: 1.6px;
  background: var(--muted);
  transform: rotate(45deg);
}

.search input {
  width: 100%;
  padding: 1.05rem 1.1rem 1.05rem 2.65rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search input::placeholder { color: var(--faint); }
.search input:hover { border-color: #a99888; }

.search input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(42, 38, 36, 0.16);
}

/* —— Most compared (cards) —— */
.compared { margin: 0 0 2.5rem; }

.compared h2 {
  margin: 0;
  padding: 0 0 0.75rem;
  border-bottom: 1.5px solid var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.compare-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1.15rem 0 0;
  padding: 0;
  list-style: none;
}

.compare-cards > li { margin: 0; padding: 0; }

.compare-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title cta"
    "prices prices";
  gap: 0.85rem 1.1rem;
  align-items: center;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.compare-card:hover {
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(26, 22, 20, 0.05), 0 10px 28px rgba(26, 22, 20, 0.07);
  transform: translateY(-1px);
}

.compare-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.compare-card-title {
  grid-area: title;
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.compare-card-prices {
  grid-area: prices;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.price-chip {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.price-chip-label {
  color: var(--faint);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.price-chip-name {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-chip-amount {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-chip-cheaper {
  border-color: #d4cdc3;
  background: #f6f3ec;
}

.compare-card-cta {
  grid-area: cta;
  justify-self: end;
  align-self: start;
  display: inline-flex;
  align-items: center;
  padding: 0.48rem 0.85rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.compare-card:hover .compare-card-cta {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* —— Legacy band styles (unused on homepage; kept for safety) —— */
.band { margin: 0 0 2.8rem; }
.band h2 {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0;
  padding: 0 0 0.85rem;
  border-bottom: 2px solid var(--ink);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}
.band ul { margin: 0; padding: 0; list-style: none; }
.band li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.05rem 0.2rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.1rem;
  letter-spacing: -0.015em;
}
.band li::after { content: "↗"; color: var(--faint); font-size: 0.9rem; }

main.dir .note {
  margin: 1.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.76rem;
  line-height: 1.45;
}

/* —— Search / empty results —— */
.results-empty {
  margin: 0;
  padding: 1.5rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

/* —— Compare sheet —— */
.sheet {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sheet table {
  width: 100%;
  min-width: 36rem;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.sheet col.label { width: 9.5rem; }

.sheet th,
.sheet td {
  padding: 1.2rem 1.3rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  font-weight: 400;
}

.sheet thead th {
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.role {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.example {
  display: block;
  margin-top: 0.4rem;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.product-button {
  display: inline-block;
  margin-top: 0.95rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff !important;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.product-button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.product-button:active { transform: translateY(1px); }
.product-button:focus-visible { outline-color: var(--accent); }

.sheet thead th:first-child,
.sheet tbody th {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.sheet thead th:first-child,
.sheet tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface-soft);
}

.sheet th:last-child,
.sheet td:last-child { border-right: 0; }

.sheet tbody tr:last-child th,
.sheet tbody tr:last-child td { border-bottom: 0; }

.sheet a {
  color: var(--accent);
  text-decoration-color: #c99b8d;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.sheet a:hover { text-decoration-color: currentColor; }

.sheet small {
  display: inline-block;
  margin-top: 0.35rem;
  color: var(--faint);
  font-size: 0.78rem;
  line-height: 1.45;
}

main.compare .note {
  margin: 1.15rem 0 0;
  color: var(--faint);
  font-size: 0.76rem;
  line-height: 1.45;
}

@media (max-width: 38rem) {
  .search-controls { grid-template-columns: 1fr; gap: 0.85rem; }
  .category-field { gap: 0.3rem; }
  .wrap { padding: 1.25rem 1rem 4rem; }
  .bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2.85rem;
  }
  .bar nav { gap: 1.35rem; }
  main.record th { width: 7.5rem; }
  main.dir h1,
  main.compare h1 { font-size: clamp(1.85rem, 8vw, 2.4rem); }
  .mark { font-size: 1.28rem; }
  .compare-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "prices"
      "cta";
    gap: 0.75rem;
    padding: 1rem;
  }
  .compare-card-prices { grid-template-columns: 1fr; }
  .compare-card-cta { justify-self: start; }
}

/* —— Comparison: breadcrumb + related links (1.10.0) —— */
main.compare .crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.9rem;
  color: var(--faint);
  font-size: 0.8rem;
}
main.compare .crumbs a { color: var(--muted); text-decoration: none; }
main.compare .crumbs a:hover { color: var(--ink); text-decoration: underline; }
main.compare .related {
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
main.compare .related h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
}
.related-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.5rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.related-links a {
  color: var(--ink);
  font-size: 0.9rem;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.related-links a:hover { text-decoration-color: currentColor; }

/* ================================================================== */
/* 1.11.0 — Homepage for clicks + comparison CTAs                     */
/* ================================================================== */

.bar { margin-bottom: 3rem; }

/* —— Hero —— */
.home .hero { margin: 0 0 1.75rem; }
.home .hero h1 { margin-bottom: 0.7rem; }
.home .intro { margin-bottom: 1.6rem; }

.hero-search { position: relative; margin: 0 0 1rem; }
.hero-search > label {
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero-search-row {
  display: flex;
  gap: 0;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--field);
  box-shadow: 0 2px 4px rgba(26, 22, 20, 0.05), 0 14px 34px rgba(26, 22, 20, 0.08);
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}
.hero-search-row:focus-within { box-shadow: 0 0 0 4px rgba(42, 38, 36, 0.14), 0 14px 34px rgba(26, 22, 20, 0.08); }
.hero-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1.15rem 1.2rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 1.12rem;
  box-shadow: none;
}
.hero-search input[type="search"]:focus,
.hero-search input[type="search"]:hover { border: 0; box-shadow: none; outline: none; }
.search-submit {
  flex: 0 0 auto;
  margin: 0.4rem;
  padding: 0 1.4rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s ease;
}
.search-submit:hover { background: var(--accent-hover); }

.suggest {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  margin: 0.4rem 0 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(26, 22, 20, 0.16);
}
.suggest a {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
}
.suggest li.is-active a,
.suggest a:hover { background: var(--accent-soft); }
.suggest-title { font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; }
.suggest-meta { color: var(--muted); font-size: 0.8rem; line-height: 1.35; }

.search-status {
  min-height: 1.2em;
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.search-status:empty { min-height: 0; margin: 0; }

.popular {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.86rem;
}
.popular-label { color: var(--muted); font-weight: 600; margin-right: 0.15rem; }
.popular-term {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.popular-term:hover { border-color: var(--ink); background: #fff; }

/* —— Jump nav (sticky) —— */
.jump {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -1.5rem 2rem;
  padding: 0.65rem 1.5rem;
  background: rgba(243, 239, 230, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.jump ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.jump a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.jump a:hover { border-color: var(--ink); background: #fff; }
.jump-count { color: var(--faint); font-weight: 600; font-variant-numeric: tabular-nums; }
/* 1.12.0: plain-text group labels (Sales / Marketing) between chip groups; not links. */
.jump-group {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.15rem 0.32rem 0.35rem;
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: default;
  user-select: none;
}
.jump-group:not(:first-child) { margin-left: 0.6rem; }

.sub, .featured { scroll-margin-top: 7rem; }

/* —— Most compared grid —— */
.featured { margin: 0 0 3rem; }
.featured h2,
.sub-head h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.2;
}
.featured h2 { padding: 0 0 0.85rem; border-bottom: 1.5px solid var(--ink); }

.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}
.feature-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  height: 100%;
  padding: 1.05rem 1.1rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.feature-card:hover {
  border-color: var(--ink);
  box-shadow: 0 1px 2px rgba(26, 22, 20, 0.05), 0 12px 30px rgba(26, 22, 20, 0.09);
  transform: translateY(-2px);
}
.feature-sub {
  color: var(--faint);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.feature-title {
  margin-top: -0.3rem;
  font-size: 1.14rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.2;
}
.feature-line {
  display: grid;
  grid-template-columns: 4.1rem minmax(0, 1fr);
  gap: 0 0.5rem;
  align-items: baseline;
  font-size: 0.82rem;
  line-height: 1.35;
}
.feature-label {
  grid-row: span 2;
  color: var(--faint);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.feature-name { font-weight: 700; }
.feature-price { color: var(--muted); }
.feature-cheaper .feature-label { color: #2f6b3f; }
.feature-cheaper .feature-name { color: var(--ink); }
.feature-pricier { opacity: 0.8; }
.feature-cta {
  align-self: flex-start;
  margin-top: auto;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  transition: background 0.12s ease;
}
.feature-card:hover .feature-cta { background: var(--accent-hover); }

/* —— Subcategory sections —— */
.sub { margin: 0 0 2.6rem; }
.sub-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0 0.75rem;
  border-bottom: 1.5px solid var(--ink);
}
.sub-count {
  color: var(--faint);
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.row { margin: 0; border-bottom: 1px solid var(--line); }
.row-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: 100%;
  padding: 0.75rem 0.15rem;
  color: var(--ink);
  text-decoration: none;
}
.row-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.row-title { font-size: 0.97rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; }
.row-meta { color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.row-meta strong { color: var(--ink); font-weight: 600; }
.row-go { flex: 0 0 auto; color: var(--faint); font-size: 1rem; transition: transform 0.12s ease, color 0.12s ease; }
.row-link:hover .row-title { text-decoration: underline; text-underline-offset: 3px; }
.row-link:hover .row-go { color: var(--ink); transform: translateX(3px); }

.home:not(.is-searching) .sub.is-collapsed .row:nth-child(n+13) { display: none; }
.home.is-searching .show-all { display: none; }
.row.no-match,
.sub.no-match { display: none; }

.show-all {
  display: block;
  width: 100%;
  margin: 0.9rem 0 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.show-all:hover { border-color: var(--ink); background: #fff; }

.results-head {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.results-head a,
.results-empty a { color: var(--ink); font-weight: 600; }

/* —— Comparison page CTAs —— */
main.compare .crumbs a + .crumb-sep { margin: 0; }
.cta-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin: 0 0 1.75rem;
  padding: 1.15rem 1.3rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.cta-copy { display: flex; flex-direction: column; min-width: 0; }
.cta-kicker {
  color: #2f6b3f;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.cta-name { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.2; }
.cta-price { color: var(--muted); font-size: 0.9rem; }
.cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff !important;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-decoration: none !important;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(26, 22, 20, 0.18);
  transition: background 0.12s ease, transform 0.12s ease;
}
.cta-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.cta-secondary {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.cta-secondary:hover { color: var(--ink); text-decoration-color: currentColor; }

.cta-repeat {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 1.75rem 0 0;
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.cta-repeat p { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em; }
.related-more { margin: 0.9rem 0 0; font-size: 0.9rem; }
.related-more a { color: var(--ink); font-weight: 600; }

.cta-sticky { display: none; }

@media (max-width: 38rem) {
  .bar { margin-bottom: 2rem; }
  .hero-search input[type="search"] { padding: 1rem; font-size: 1.02rem; }
  .search-submit { padding: 0 1rem; }
  .jump { margin: 0 -1rem 1.5rem; padding: 0.55rem 1rem; }
  .sub, .featured { scroll-margin-top: 4rem; }
  .jump ul { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .jump ul::-webkit-scrollbar { display: none; }
  .featured-grid,
  .rows { grid-template-columns: 1fr; }
  .cta-box { padding: 1rem; }
  .cta-actions, .cta-primary { width: 100%; }
  .cta-primary { justify-content: center; }
  body.comparison { padding-bottom: 4.5rem; }
  .cta-sticky {
    position: fixed;
    z-index: 40;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom));
    background: rgba(250, 248, 243, 0.97);
    border-top: 1px solid var(--line-strong);
    box-shadow: 0 -8px 24px rgba(26, 22, 20, 0.08);
  }
  .cta-sticky-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.86rem; font-weight: 600; }
  .cta-sticky .cta-primary { width: auto; padding: 0.7rem 1.1rem; font-size: 0.92rem; }
}
