/* article.css — comparison pages: header block, quick-compare table,
   product modules (4/5/3 grid), FAQ, mobile patterns. */

/* Article pages read a bit more like a magazine: slightly narrower
   content column, generous signed header block, wider dek. */
body.article main .wrap { max-width: 1080px; }
body.article h1 { font-size: 48px; margin: 0 0 14px; }

.article-head { max-width: 780px; margin: 20px 0 44px; }
.article-head .dek { font-size: 20px; max-width: 640px; }
.article-head .meta-row { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin: 0 0 18px; }

/* ---- Quick-compare table: hairline, sticky head + first column ---- */
.no-crown {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 24px 0 12px;
}
.no-crown::before { content: "\2713"; color: var(--brand); font-weight: 700; }
.quick-compare {
  overflow: auto;
  margin: 0 0 40px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  background: var(--surface);
  max-height: 70vh;
}
.quick-compare table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14.5px; min-width: 560px; }
.quick-compare th, .quick-compare td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
.quick-compare thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}
.quick-compare td:first-child, .quick-compare th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  font-weight: 600;
}
.quick-compare thead th:first-child { z-index: 3; }
.quick-compare tbody tr:last-child td { border-bottom: none; }
.quick-compare td:first-child a { color: var(--ink); }
.quick-compare td:first-child a:hover { color: var(--brand); }
.quick-compare .price-cell { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.quick-compare .price-freshness { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---- Product module: media / main / buy panel ---- */
.product-block {
  display: grid;
  grid-template-columns: minmax(240px, 4fr) minmax(0, 5fr) minmax(220px, 3fr);
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  padding: 24px;
  margin: 24px 0;
  scroll-margin-top: 80px;
}
.product-block > h2 {
  grid-column: 1 / -1;
  grid-row: 1;
  font-size: 26px;
  margin: 0 0 4px;
  border-top: none;
  padding-top: 0;
}
.pb-media { grid-column: 1; grid-row: 2; align-self: start; }
.pb-main { grid-column: 2; grid-row: 2; min-width: 0; }
.pb-buy {
  grid-column: 3;
  grid-row: 2;
  align-self: start;
  position: sticky;
  top: 84px;
  background: var(--surface-2);
  border-radius: var(--r-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pb-buy .pb-price { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 700; }
.pb-buy .pb-price-link { color: var(--ink); align-self: flex-start; }
.pb-buy .pb-fresh { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 11.5px; color: var(--muted); }
.pb-buy .cta { justify-content: center; }
.pb-buy .pb-retailer { font-size: 12.5px; color: var(--muted); text-align: center; }
/* The generator's CTA paragraph becomes the buy-panel button: the first
   outbound link renders as a pill button, its "(paid link)" note as a
   quiet centered mono line. */
.pb-buy p { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.pb-buy p > a[target="_blank"] {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--r-chip);
  text-decoration: none;
  transition: background var(--t-fast) ease-out;
}
.pb-buy p > a[target="_blank"]:hover { background: #09573A; text-decoration: none; }
.pb-buy p > a[target="_blank"] em { font-style: normal; }
.pb-buy .affiliate-note { text-align: center; margin-top: -2px; }
.legacy-paid-cta .affiliate-note { margin-left: 6px; }
.quick-compare .paid-inline { display: block; margin: 2px 0 0; }
.product-block .p-gallery { margin: 0; }
.product-block .gallery-main-box { max-width: 100%; border: 1px solid var(--hairline); }
.product-block > .pb-main h2 { display: none; } /* fallback safety: h2 lives in grid row 1 */
.product-block .pb-main p { font-size: 16px; }
.product-block .pb-main details { background: var(--surface-2); border: none; }
.product-block .pb-main details summary { font-size: 14.5px; }
.product-block .pb-main details p, .product-block .pb-main details li { font-size: 15px; }
.pb-main .p-stale { font-size: 13px; color: var(--muted); }
.pb-main .p-rating { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 14px; color: var(--ink-soft); }
/* Deep-review short version (2026-09-23): teaser paragraphs injected at the
   end of the product's own specs <details> -- a bold lead + the dossier
   Summary's first 1-2 sentences, then the full-review link. */
.product-block details .short-version { margin: 14px 0 6px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.product-block details .short-version-link { margin: 0 0 4px; }
.product-block details .short-version-link a { font-weight: 600; }
/* Visible "Full review" button (2026-09-23): a secondary CTA in the buy
   panel itself -- the deep review used to hide behind the collapsed specs
   details, so most visitors never found it. Internal link, so it must NOT
   pick up the .pb-buy a[target="_blank"] affiliate styling. */
.pb-buy .full-review-cta { min-height: 42px; padding: 0 18px; font-size: 14px; justify-content: center; }

@media (max-width: 1024px) {
  .product-block { grid-template-columns: minmax(200px, 2fr) minmax(0, 3fr); }
  .pb-buy { grid-column: 1 / -1; grid-row: 3; position: static; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
}
@media (max-width: 768px) {
  body.article h1 { font-size: 32px; }
  .product-block { grid-template-columns: 1fr; padding: 16px; gap: 14px; }
  .pb-media, .pb-main, .pb-buy { grid-column: 1; }
  .pb-media { grid-row: 2; }
  .pb-main { grid-row: 3; }
  .pb-buy { grid-row: 4; flex-direction: column; align-items: stretch; text-align: center; }
  .quick-compare { max-height: none; }
  /* Table → horizontal scroll cards fallback: keep table scrollable, larger touch cells */
  .quick-compare th, .quick-compare td { padding: 14px 16px; font-size: 15px; }
  a.cta, button.cta { width: 100%; justify-content: center; min-height: 44px; }
}

.compare-bar { display: none; }

/* ---- Mobile: comparison table becomes stacked cards ---- */
@media (max-width: 768px) {
  .quick-compare { max-height: none; }
  .quick-compare thead { display: none; }
  .quick-compare table { min-width: 0; }
  .quick-compare table, .quick-compare tbody, .quick-compare tr { display: block; }
  .quick-compare tr { padding: 12px 16px; border-bottom: 1px solid var(--hairline); }
  .quick-compare tr:last-child { border-bottom: none; }
  .quick-compare td { display: block; padding: 2px 0; border-bottom: none; white-space: normal; }
  .quick-compare td.name-cell { position: static; background: none; font-weight: 600; margin-bottom: 4px; }
  .quick-compare td.price-cell, .quick-compare td.rating-cell {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    color: var(--ink-soft);
  }

  /* Sticky compare bar: one-thumb access to the table from anywhere on
     the page. */
  .compare-bar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--hairline);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  body.article, body.hub { padding-bottom: 84px; }
}

/* PHASE F: product images reserve a fixed 320x320 box via width/height
   attributes (zero CLS) and the real any-ratio image is contained inside
   it -- never cropped, never stretched. In dark theme the white JPEG
   packshots get an intentional light mat instead of a glowing white
   rectangle floating on dark. */
article img[width="320"] {
  height: 320px;
  object-fit: contain;
  border-radius: var(--r-line);
}
:root[data-theme="dark"] article img[width="320"],
:root:not([data-theme="light"]) article img[width="320"] {
  background: #F7F5EF;
  padding: 6px;
}

/* ---- Deep-review product pages (/products/<id>.html, owner request
   2026-09-23: "too narrow" -- a wide magazine column, not a reading strip.
   Hero photo ~55% left, thumbnail grid right; the dossier's own section
   headings get real page-scale h3/h4 sizing. ---- */
body.product main .wrap { max-width: 1000px; }
body.product h1 { font-size: 40px; margin: 0 0 14px; }
.product-gallery {
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(150px, 8fr);
  gap: 16px;
  align-items: start;
  margin: 0 0 26px;
}
.product-gallery .gallery-main-box { width: 100%; max-width: none; }
.product-gallery .gallery-main-box img { padding: 12px; }
.product-gallery .gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 10px;
  margin-top: 0;
}
.product-gallery .gallery-thumb { width: auto; }
.product-gallery--single { grid-template-columns: 1fr; max-width: 640px; }
.product-buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 16px 20px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  margin: 0 0 30px;
}
.product-buy .pb-buy-price { display: flex; align-items: baseline; gap: 10px; }
.product-buy .price-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.product-buy .price-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 700; color: var(--ink); }
.product-buy .affiliate-note { flex-basis: 100%; text-align: right; margin-top: -6px; }
.product-buy .cta { margin-left: auto; }
.product-review { margin: 0 0 30px; }
.product-review h2 { margin: 0 0 14px; }
/* The dossier body lands here with its headings demoted two levels
   (# title -> h3, ## sections -> h4): give them real page-scale heading
   typography -- the owner's complaint was exactly these reading like
   small print. */
.product-review h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 26px 0 12px;
}
.product-review h4 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 30px 0 10px;
}
.product-review h5 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 22px 0 8px; }
.honesty-note {
  margin: 30px 0 26px;
  padding: 18px 22px;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--hairline));
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  background: color-mix(in srgb, var(--mint) 44%, var(--surface));
}
.honesty-note h2 { font-size: 16px; margin: 0 0 8px; }
.honesty-note p { margin: 0; color: var(--ink-soft); font-size: 14.5px; line-height: 1.55; }
.back-link { margin: 26px 0; }
.back-link a { font-weight: 600; }
@media (max-width: 768px) {
  body.product h1 { font-size: 30px; }
  .product-gallery { grid-template-columns: 1fr; }
  .product-buy .cta { margin-left: 0; width: 100%; justify-content: center; }
  .product-buy .affiliate-note { text-align: left; }
}

/* Per-product fullscreen gallery. Each .p-gallery is an independent closed
   carousel: only that product's thumbnails enter the lightbox. */
.gallery-main-box--zoomable { position: relative; cursor: zoom-in; }
.gallery-main-box--zoomable::after {
  content: "↗"; position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 90%, transparent); color: var(--ink-soft);
  border: 1px solid var(--hairline); font-size: 14px;
}
body.product-lightbox-open { overflow: hidden; }
.product-lightbox[hidden] { display: none !important; }
.product-lightbox {
  position: fixed; inset: 0; z-index: 320; display: grid;
  grid-template-columns: minmax(48px, 8vw) minmax(0, 1fr) minmax(48px, 8vw);
  align-items: center; gap: 12px; padding: 24px;
  background: rgba(4, 10, 7, .9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.product-lightbox-figure { grid-column: 2; margin: 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.product-lightbox-image { max-width: min(1120px, 82vw); max-height: 82vh; width: auto; height: auto; object-fit: contain; border-radius: 14px; background: #fff; cursor: e-resize; }
.product-lightbox-caption { color: #fff; font-size: 14px; line-height: 1.35; text-align: center; max-width: 820px; }
.product-lightbox-close, .product-lightbox-nav {
  border: 1px solid rgba(255,255,255,.22); background: rgba(15,24,19,.82); color: #fff; cursor: pointer;
}
.product-lightbox-close { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; border-radius: 999px; font-size: 28px; line-height: 1; }
.product-lightbox-nav { width: 48px; height: 64px; border-radius: 14px; font-size: 40px; line-height: 1; justify-self: center; }
.product-lightbox-prev { grid-column: 1; }
.product-lightbox-next { grid-column: 3; }
@media (max-width: 600px) {
  .product-lightbox { grid-template-columns: 44px minmax(0,1fr) 44px; gap: 4px; padding: 12px 6px; }
  .product-lightbox-image { max-width: 84vw; max-height: 76vh; }
  .product-lightbox-nav { width: 40px; height: 54px; font-size: 34px; }
}

/* ---- WTB strip inside the article buy panel (2026-09-28): the same
   merchant-links data as the deep-review "Where to buy" block, compact
   for the narrow sticky column. Base .where-to-buy / .wtb-* styles live
   in components.css; these rules only re-scope them. ---- */
.pb-buy .where-to-buy {
  margin: 6px 0 0;
  padding: 12px 0 0;
  background: none;
  border: 0;
  border-top: 1px solid var(--hairline);
}
.pb-buy .wtb-heading { margin: 0 0 10px; font-size: 13.5px; }
.pb-buy .wtb-buttons { flex-direction: column; align-items: stretch; }
.pb-buy .where-to-buy .cta {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 13.5px;
}
/* .pb-buy p would otherwise flex the note (buy-panel paragraph rule). */
.pb-buy .wtb-note { display: block; margin: 10px 0 0; font-size: 12px; }
@media (max-width: 1024px) {
  /* Buy panel becomes a full-width flex row: give the strip its own row. */
  .pb-buy .where-to-buy { flex: 1 1 100%; }
  .pb-buy .wtb-buttons { flex-direction: row; }
}
