/* home.css — V4 homepage: editorial hero with real-product composition,
   Featured comparisons (3, editorial panels), Explore categories (8,
   compact nav grid), Buying guides (3, editorial), Deals (4, commerce
   cards via the .deal-card--home modifier of components.css .deal-card),
   Trust band (single dark section), plus the full comparisons directory.
   Layout contract (Phase C): every homepage section is a full-bleed
   <section class="sec"> band -- tinted backgrounds honestly reach the
   viewport edges -- and each band carries its own inner <div class="wrap">
   (see base.html.j2). The former "FINAL POLISH PASS" override layer has
   been folded into the base rules below; there is no second declaration
   block for the same selector in this file. */

/* ============ A. HERO ============ */
.hero {
  position: relative;
  min-height: 640px;
  background: linear-gradient(135deg, #FBF8F1 0%, #F3F7F0 48%, #E8F4ED 100%);
  overflow: hidden;
}
:root[data-theme="dark"] .hero,
:root:not([data-theme="light"]) .hero {
  background: linear-gradient(135deg, #101812 0%, #12211A 55%, #16352A 100%);
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: center;
}
.hero-copy { grid-column: 1 / span 6; padding: 72px 0 64px; position: relative; z-index: 2; }
.hero-copy h1 {
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.0;
  margin: 0 0 22px;
}
.hero-copy .hero-sub { font-size: 19px; line-height: 1.55; color: var(--ink-soft); max-width: 560px; margin: 0 0 30px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.hero-stats {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 13px; color: var(--muted); margin: 0;
}
.hero-visual {
  grid-column: 7 / span 6;
  position: relative;
  min-height: 520px;
  z-index: 1;
}
.hero-visual .orbits {
  position: absolute; inset: -8% -12%;
  background: url("/static/svg/hero-orbits.svg") center / contain no-repeat;
  pointer-events: none;
}
.hero-visual .blobs {
  position: absolute; inset: -12%;
  background: url("/static/svg/organic-blobs.svg") center / contain no-repeat;
  pointer-events: none;
  opacity: 0.9;
}
.hv-fig { position: absolute; display: flex; align-items: center; justify-content: center; margin: 0; }
.hv-fig img {
  max-height: 100%; max-width: 100%; object-fit: contain;
  filter: drop-shadow(0 24px 40px rgba(20, 35, 25, 0.16));
  /* Unified image-well treatment: the soft neutral gradient lives on the
     image itself, so a white packshot blends in instead of sitting on a
     second white box. */
  background: linear-gradient(180deg, var(--image-well-a) 0%, var(--image-well-b) 100%);
  border-radius: 12px;
}
/* Secondary products are pure floating cutouts -- no card shells; shadows
   live only on the images themselves (drop-shadow above). */
.hv-main { left: 4%; right: 18%; top: 8%; bottom: 16%; }
.hv-main img { max-height: 450px; }
.hv-a { left: -1%; top: 10%; width: 24%; height: 30%; }
.hv-b { right: 1%; bottom: 10%; width: 27%; height: 32%; }
.hv-a img, .hv-b img { filter: drop-shadow(0 12px 22px rgba(20, 35, 25, 0.14)); }

/* ============ Section shell: full-bleed bands ============ */
.sec { padding: 72px 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 8px; }
.sec-head h2 { font-size: 38px; }
.sec-sub { font-size: 16px; color: var(--muted); margin: 0 0 32px; max-width: 640px; }
.sec-link { font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.arrow-link { font-weight: 600; font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px; }
.arrow-link::after { content: "→"; transition: transform var(--t-fast) ease-out; display: inline-block; }
.arrow-link:hover::after { transform: translateX(4px); }

/* ============ B. PRODUCT RAILS — large commerce cards ============ */
.sec-product-rail { overflow: hidden; }
.sec-value { background: var(--canvas); padding-top: 58px; padding-bottom: 64px; }
.sec-discovery { background: var(--surface-soft); padding-top: 58px; padding-bottom: 64px; }
.rail-head { align-items: flex-end; margin-bottom: 24px; }
.rail-head .sec-sub { margin: 8px 0 0; max-width: 760px; }
.rail-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.rail-btn {
  width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: 18px; cursor: pointer;
  transition: border-color var(--t-fast) ease-out, background var(--t-fast) ease-out, transform var(--t-fast) ease-out;
}
.rail-btn:hover { border-color: rgba(11,107,73,.38); background: var(--surface-soft); transform: translateY(-1px); }
.product-rail {
  display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity; scroll-behavior: smooth;
  padding: 2px 2px 16px; margin: 0 -2px -16px;
  scrollbar-width: none; overscroll-behavior-inline: contain;
}
.product-rail::-webkit-scrollbar { display: none; }
.product-card {
  flex: 0 0 clamp(210px, 18vw, 236px); scroll-snap-align: start;
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); color: inherit; text-decoration: none;
  border: 1px solid var(--hairline-soft); border-radius: 18px; overflow: hidden;
  transition: transform var(--t-fast) ease-out, box-shadow var(--t-fast) ease-out, border-color var(--t-fast) ease-out;
}
.product-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-pop); border-color: rgba(11,107,73,.28); }
.product-media {
  aspect-ratio: 1 / 1; min-height: 0; padding: 12px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: linear-gradient(180deg, var(--image-well-a), var(--image-well-b));
  border-bottom: 1px solid var(--hairline-soft);
}
.product-media img {
  width: 100%; height: 100%; object-fit: contain;
  transition: transform var(--t-med) ease-out;
}
.product-card:hover .product-media img { transform: scale(1.025); }
.product-card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 15px 15px; min-height: 154px; }
.product-badge {
  align-self: flex-start; padding: 5px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand);
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
}
.product-name {
  font-family: var(--font-display); font-size: 16px; line-height: 1.25; font-weight: 650; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-category { font-size: 12.5px; color: var(--muted); }
.product-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; }
.product-price { font-family: var(--font-display); font-size: 20px; letter-spacing: -0.02em; color: var(--ink); }
.product-rating { font-size: 12px; color: var(--muted); white-space: nowrap; }
.product-cta { font-size: 12.5px; font-weight: 650; color: var(--brand); margin-top: 2px; }
.product-card--value { border-color: color-mix(in srgb, var(--brand) 20%, var(--hairline-soft)); }

/* ============ C. FEATURED COMPARISONS — three full editorial cards ============ */
.sec-featured { position: relative; background: var(--home-featured-bg); }
.sec-featured::before {
  content: ""; position: absolute; top: -140px; right: -160px; width: 640px; height: 520px;
  background: radial-gradient(closest-side, rgba(221, 243, 232, 0.75), rgba(221, 243, 232, 0));
  pointer-events: none;
}
.featured-grid {
  position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px;
}
.feat-card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  border-radius: 18px; overflow: hidden; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--hairline-soft);
  transition: transform var(--t-fast) ease-out, box-shadow var(--t-fast) ease-out, border-color var(--t-fast) ease-out;
}
.feat-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-pop); border-color: rgba(11,107,73,.25); }
.feat-card:hover .feat-body h3 { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.feat-a .feat-media { background: linear-gradient(160deg, var(--feat-mint-a) 0%, var(--feat-mint-b) 70%); }
.feat-b .feat-media { background: linear-gradient(160deg, var(--feat-warm-a) 0%, var(--feat-warm-b) 70%); }
.feat-c .feat-media { background: linear-gradient(160deg, var(--feat-cool-a) 0%, var(--feat-cool-b) 70%); }
.feat-media {
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow: hidden; border-bottom: 1px solid var(--hairline-soft);
}
.feat-media img {
  width: 100%; height: 100%; object-fit: contain;
  transition: transform var(--t-med) ease-out;
  background: linear-gradient(180deg, var(--image-well-a) 0%, var(--image-well-b) 100%);
  border-radius: 12px; padding: 8px;
}
.feat-card:hover .feat-media img { transform: scale(1.025); }
.feat-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.feat-body .f-kind { font-size: 11px; font-weight: 650; letter-spacing: 0.09em; text-transform: uppercase; color: var(--brand); margin-bottom: 7px; }
.feat-body h3, .feat-lg .feat-body h3 { font-size: 24px; line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 8px; }
.feat-body .f-dek { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 0 0 14px; }
.feat-body .f-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 14px; margin-top: auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.feat-body .arrow-link { color: var(--brand); }

/* ============ C. EXPLORE CATEGORIES (8, compact nav grid) ============ */
.sec-categories { background: var(--home-category-bg); position: relative; }
.sec-categories::after {
  content: ""; position: absolute; right: 40px; top: 44px; width: 220px; height: 160px;
  background: url("/static/svg/dot-grid.svg") repeat; opacity: 0.5; pointer-events: none;
}
.cat-grid { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cat-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card-translucent); border: 1px solid rgba(20, 32, 25, 0.06);
  border-radius: 12px; padding: 12px 14px;
  text-decoration: none; color: inherit;
  transition: border-color var(--t-fast) ease-out, background var(--t-fast) ease-out;
}
.cat-card:hover { border-color: rgba(11, 107, 73, 0.35); background: var(--surface); text-decoration: none; }
.cat-thumb {
  width: 44px; height: 44px; flex: none; border-radius: 10px;
  background: linear-gradient(180deg, var(--image-well-a) 0%, var(--image-well-b) 100%);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.cat-thumb img { max-width: 72%; max-height: 72%; object-fit: contain; }
.cat-meta { min-width: 0; flex: 1; }
.cat-name { display: block; font-family: var(--font-display); font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; color: var(--ink); }
.cat-count { display: block; font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 2px; }
.cat-arrow { color: var(--brand); font-size: 17px; opacity: 0; transform: translateX(-4px); transition: all var(--t-fast) ease-out; }
.cat-card:hover .cat-arrow { opacity: 1; transform: none; }
.cat-more { display: flex; align-items: center; justify-content: flex-end; margin-top: 20px; }

/* ============ D. BUYING GUIDES (3 editorial, warm) ============ */
.sec-guides {
  position: relative;
  background: linear-gradient(180deg, var(--home-guide-bg) 0%, var(--canvas) 100%);
  overflow: hidden;
}
.sec-guides::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 240px;
  background: url("/static/svg/contour-lines.svg") bottom / cover no-repeat;
  opacity: 0.6; pointer-events: none;
}
.sec-guides .wrap { position: relative; z-index: 1; }
.guide-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px 24px; align-items: start; position: relative; z-index: 1; }
/* Editorial cards, not clones of the category card: open text under a
   rounded media block, hairline-free, hover = underline on the title. */
.guide-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.guide-card:hover { text-decoration: none; }
.guide-card:hover .gc-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.gcm {
  aspect-ratio: 16 / 10; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  overflow: hidden;
}
.guide-card:nth-child(1) .gcm { background: linear-gradient(160deg, var(--guide-media-1-a) 0%, var(--guide-media-1-b) 90%); }
.guide-card:nth-child(2) .gcm { background: linear-gradient(160deg, var(--guide-media-2-a) 0%, var(--guide-media-2-b) 90%); }
.guide-card:nth-child(3) .gcm { background: linear-gradient(160deg, var(--guide-media-3-a) 0%, var(--guide-media-3-b) 90%); }
.gcm img {
  max-height: 100%; max-width: 92%; object-fit: contain;
  background: linear-gradient(180deg, var(--image-well-a) 0%, var(--image-well-b) 100%);
  border-radius: 12px; padding: 6px 10px;
}
.gc-body { padding: 16px 2px 0; }
.gc-kind { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--brand); margin-bottom: 7px; }
.gc-title { display: block; font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.22; letter-spacing: -0.02em; color: var(--ink); }
.guide-row .guide-card:first-child .gc-title { font-size: 25px; }
.gc-dek {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 14px; color: var(--ink-soft); margin-top: 8px; line-height: 1.5;
}
.gc-meta { display: block; font-size: 12.5px; color: var(--muted); margin-top: 10px; }

/* ============ F. TRUST BAND (single dark section) ============ */
.trust-band {
  position: relative;
  background: linear-gradient(145deg, #0C1712 0%, #10261C 55%, #17422F 100%);
  color: var(--dark-ink);
  border-radius: 24px; overflow: hidden;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px;
  padding: 56px;
}
.trust-band::after {
  content: ""; position: absolute; inset: 0;
  background: url("/static/svg/contour-lines.svg") center / cover no-repeat;
  opacity: 0.35; pointer-events: none;
}
.trust-col { position: relative; z-index: 1; }
.trust-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 40px; font-weight: 700; letter-spacing: -0.03em; color: #fff; display: block; margin-bottom: 8px; }
.trust-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--dark-ink); margin: 0 0 8px; }
.trust-body { font-size: 14px; line-height: 1.5; color: var(--dark-muted); margin: 0; }

/* ============ Full comparisons directory ============ */
.comp-group { margin-top: 34px; }
.comp-group-name {
  font-family: var(--font-display); font-size: 13px; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 10px;
}
.comp-list { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
.comp-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--hairline-soft);
  border-radius: 14px; padding: 12px 16px;
  text-decoration: none; color: inherit;
  transition: border-color var(--t-fast) ease-out, box-shadow var(--t-fast) ease-out;
}
.comp-row:hover { border-color: rgba(11, 107, 73, 0.35); box-shadow: var(--shadow-pop); text-decoration: none; }
.comp-thumb {
  width: 54px; height: 54px; flex: none; border-radius: 10px; background: linear-gradient(180deg, var(--image-well-a), var(--image-well-b));
  border: 1px solid var(--hairline-soft);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.comp-thumb img { max-width: 76%; max-height: 76%; object-fit: contain; }
.comp-main { flex: 1; min-width: 0; }
.comp-name { display: block; font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--ink); }
.comp-meta-line {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 12px; color: var(--muted); margin-top: 3px;
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .hero-copy h1 { font-size: 46px; }
  .hero-copy { grid-column: 1 / span 12; padding: 48px 0 8px; }
  .hero-visual { grid-column: 1 / span 12; min-height: 360px; }
  .featured-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .feat-body h3, .feat-lg .feat-body h3 { font-size: 21px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .guide-row { grid-template-columns: 1fr 1fr; }
  .guide-row .guide-card:first-child { grid-column: span 2; }
  .trust-band { grid-template-columns: 1fr 1fr; padding: 40px; }
}
@media (max-width: 768px) {
  .hero { min-height: 0; }
  .hero-copy { padding: 28px 0 8px; }
  .hero-copy h1 { font-size: 38px; }
  .hero-visual { min-height: 300px; }
  .hv-main { left: 2%; right: 2%; }
  .hv-main img { max-height: 240px; }
  .hv-a { width: 26%; height: 26%; }
  .hv-b { width: 28%; height: 28%; }
  .sec { padding: 48px 0; }
  .sec-head h2 { font-size: 27px; }
  .rail-head { align-items: flex-end; }
  .product-card { flex-basis: min(68vw, 250px); }
  .featured-grid { grid-template-columns: 1fr; gap: 16px; }
  .feat-media { aspect-ratio: 16 / 10; min-height: 220px; }
  .feat-body { padding: 18px 20px 20px; }
  .feat-body h3, .feat-lg .feat-body h3 { font-size: 22px; }
  .feat-body .f-meta { flex-wrap: wrap; row-gap: 4px; }
  .feat-body .arrow-link { white-space: nowrap; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-thumb { width: 40px; height: 40px; }
  .cat-name { font-size: 13px; }
  .guide-row { grid-template-columns: 1fr; }
  .guide-row .guide-card:first-child { grid-column: auto; }
  .trust-band { grid-template-columns: 1fr; gap: 28px; padding: 32px 24px; border-radius: 18px; }
}
@media (max-width: 520px) {
  .rail-head { align-items: flex-start; }
  .rail-head .sec-link { display: none; }
  .rail-btn { display: none; }
  .product-rail { gap: 12px; padding-right: 16px; }
  .product-card { flex-basis: 76vw; max-width: 270px; }
  .product-media { padding: 14px; }
}

/* Dark: lift decorative SVG visibility slightly (lines are green-on-dark) */
:root[data-theme="dark"] .sec-categories::after { opacity: 0.95; }
:root[data-theme="dark"] .sec-guides::after { opacity: 0.85; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sec-categories::after { opacity: 0.95; }
  :root:not([data-theme="light"]) .sec-guides::after { opacity: 0.85; }
}
