/* ==========================================================================
   Sections – page-level layout: hero, generic section, entry, archive, footer
   ========================================================================== */

.section { padding: var(--s8) 0; }
.section-body { margin-top: var(--s4); }

@media (max-width: 700px) {
  .section { padding: var(--s6) 0; }
}

/* Hero -------------------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  padding: var(--s12) 0;
  background: var(--bg);
}

/* Grid backdrop, faded out towards every edge. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--s6) var(--s6);
  background-position: center center;
  -webkit-mask-image: radial-gradient(ellipse 65% 75% at 50% 50%, #000 35%, transparent 85%);
  mask-image: radial-gradient(ellipse 65% 75% at 50% 50%, #000 35%, transparent 85%);
}
.hero-inner { display: flex; flex-direction: column; align-items: center; max-width: 1000px; }
.hero-search { margin-top: 40px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--s1);
  margin-top: 22px;
}
.chips-label { margin-right: 4px; font-size: var(--text-sm); color: var(--text-subtle); }

@media (max-width: 700px) {
  .hero { padding: 64px 0; }
}

/* Entry (posts/pages, temporary reading layout) --------------------------- */

.entry { padding: var(--s8) 0; }
.entry-header, .entry-content { max-width: calc(760px + 2 * var(--gutter)); }
.entry-content { margin-top: var(--s4); }
.entry-content > * + * { margin-top: var(--s2); }
.entry-content h2 { margin-top: var(--s6); font-size: 34px; }
.entry-content h3 { margin-top: var(--s4); font-size: 24px; font-weight: 500; }
.entry-content a { color: var(--eyebrow); text-underline-offset: 3px; }

/* Archive ----------------------------------------------------------------- */

.empty-state { color: var(--text-muted); }

.pagination { margin-top: var(--s4); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: var(--s1); }
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  text-decoration: none;
}
.pagination .page-numbers.current { border-color: var(--accent); background: var(--accent); }

/* Footer ------------------------------------------------------------------ */

.site-footer {
  margin-top: var(--s4);
  padding: 63px 0 var(--s4);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  background: var(--inverse-bg);
  color: var(--inverse-ink);
}
.site-footer .logo { color: var(--inverse-ink); }

.footer-cols {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
  gap: var(--s4);
}
.footer-tagline { max-width: 320px; margin-top: var(--s2); color: var(--inverse-muted); font-size: 16px; }
.footer-heading {
  margin-bottom: 14px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--inverse-accent);
}
.footer-links { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: var(--inverse-ink); font-size: 16px; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 4px; }

.footer-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 45px;
  padding-top: var(--s2);
  border-top: 1px solid var(--inverse-line);
  color: var(--inverse-muted);
  font-size: 14px;
}

@media (max-width: 700px) {
  .footer-cols { grid-template-columns: minmax(0, 1fr); }
}

/* Search results (search.php) --------------------------------------------- */

.search-hero {
  position: relative;
  isolation: isolate;
  padding: var(--s8) 0 var(--s6);
  border-bottom: 1px solid var(--line);
}
.search-hero::before { /* the front page's grid, faded towards the edges */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--s6) var(--s6);
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 30% 50%, #000 30%, transparent 85%);
  mask-image: radial-gradient(ellipse 70% 90% at 30% 50%, #000 30%, transparent 85%);
}
.search-title { margin-top: 10px; font-size: var(--title-md); text-wrap: balance; overflow-wrap: anywhere; }
.search-lead { margin-top: 12px; max-width: 60ch; color: var(--text-muted); }
.search-page-form { margin-top: var(--s3); }
.search-hero .chips { justify-content: flex-start; }
.search-section + .search-section { padding-top: 0; }

.search-guides { display: flex; flex-direction: column; gap: var(--s3); }
.search-guide { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); overflow: hidden; }
.search-guide-media { display: block; min-height: 100%; }
.search-guide-media img { width: 100%; height: 100%; object-fit: cover; }
.search-guide-body { display: flex; flex-direction: column; gap: 8px; padding: var(--s3); }
.search-guide-title { font-size: 30px; font-weight: 500; line-height: 1.15; }
.search-guide-title a { color: inherit; text-decoration: none; }
.search-guide-title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.search-guide-meta { font-size: 14px; color: var(--text-subtle); }
.search-guide-top { margin-top: 10px; border-top: 1px solid var(--line); }
.search-guide-row { display: grid; grid-template-columns: 22px 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.search-guide-row:hover .search-guide-row-name { text-decoration: underline; text-underline-offset: 3px; }
.search-guide-row .product-media--thumb { width: 56px; height: 56px; }
.search-guide-rank { font-family: var(--font-display); font-size: 20px; font-weight: 500; text-align: center; }
.search-guide-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.search-guide-row-name { font-weight: 600; }
.search-guide-row-role { font-size: 13px; font-weight: 700; color: var(--eyebrow); }
.search-guide-more { align-self: flex-start; margin-top: 8px; font-size: 15px; font-weight: 600; color: var(--eyebrow); }

.best-for-row.search-product { grid-template-columns: 72px minmax(0, 1fr) auto auto; }
.search-chip-rank { background: var(--score-bg); }
.search-chip-guide { color: inherit; text-decoration: none; }
.search-chip-guide:hover { text-decoration: underline; }
.search-product .stars { font-size: 13px; }

@media (max-width: 860px) {
  .search-guide { grid-template-columns: 1fr; }
  .search-guide-media { aspect-ratio: 2 / 1; }
  .search-guide-body { padding: var(--s2) 18px 22px; }
  .search-guide-title { font-size: 24px; }
}
@media (max-width: 760px) {
  .search-hero { padding: var(--s6) 0 var(--s4); }
  .best-for-row.search-product { grid-template-columns: 56px minmax(0, 1fr); row-gap: 10px; }
  .search-product .score, .search-product .best-for-row-action { grid-column: 2; justify-self: start; }
  .search-product .product-media--thumb { width: 56px; height: 56px; }
}
.search-in { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); margin-top: var(--s3); }
.search-in + .search-products { margin-top: var(--s2); }
.search-in-count { margin-left: 4px; font-size: 13px; color: var(--text-subtle); }

.search-needs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: var(--s3); }
.search-need { display: flex; flex-direction: column; gap: 8px; padding: var(--s3); }
.search-need-head { display: flex; align-items: flex-start; gap: 14px; }
.search-need-title { font-size: 24px; font-weight: 500; line-height: 1.2; }
.search-need-title a { color: inherit; text-decoration: none; }
.search-need-title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.search-guide-row-note { font-size: 13px; color: var(--text-subtle); }
.search-need + .search-need { margin-top: 0; }

/* Front page (front-page.php) ------------------------------------------- */

.hero--front { padding-bottom: var(--s8); }
.front-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline; /* the numbers are larger: line the words up on their baseline */
  gap: 6px 22px;
  margin-top: var(--s4);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.front-stats strong { font-family: var(--font-display); font-size: 17px; font-weight: 500; color: var(--ink); }
.front-stats a { color: var(--eyebrow); font-weight: 600; text-decoration: none; }
.front-stats a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* The grid as a faint texture behind the front page's search. */
.hero--front::before { opacity: .5; background-size: 72px 72px; -webkit-mask-image: radial-gradient(ellipse 55% 60% at 50% 45%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse 55% 60% at 50% 45%, #000 20%, transparent 75%); }

.front-group + .front-group { padding-top: 0; }

/* Guide card led by its winner. The title's link covers the card; the price link sits above it. */
.fg { position: relative; display: flex; overflow: hidden; }
.fg-link { color: inherit; text-decoration: none; }
.fg-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.fg-media { border-radius: 0; }
.fg-body { display: flex; flex: 1; flex-direction: column; gap: 6px; min-width: 0; }
.fg-meta { font-size: 13px; font-weight: 700; color: var(--eyebrow); }
.fg-title { font-size: var(--title-sm); font-weight: 500; line-height: 1.15; }
.fg-role { font-size: 11px; font-weight: 700; color: var(--text-subtle); text-transform: uppercase; letter-spacing: .04em; }
.fg-name { font-size: 14px; line-height: 1.3; }
.fg { flex-direction: column; }
.fg .fg-media { aspect-ratio: 4 / 3; }

/* The guide on top, its winner in a footer strip of its own. */
.fg-media--guide { display: flex; overflow: hidden; }
.fg-media--guide img { width: 100%; height: 100%; object-fit: cover; }
.fg-body { padding: var(--s2) var(--s2) 14px; }
.fg-go { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px; font-size: var(--text-sm); font-weight: 600; color: var(--eyebrow); }
.fg:hover .fg-go .icon { transform: translateX(3px); }
.fg-go .icon { transition: transform .2s cubic-bezier(.22, 1, .36, 1); }
.fg-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 12px var(--s2); border-top: 1px solid var(--line); background: var(--surface-soft); }
.fg-foot-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fg-price {
  position: relative;
  z-index: 2;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line-strong);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background .2s cubic-bezier(.22, 1, .36, 1), box-shadow .2s cubic-bezier(.22, 1, .36, 1);
}
.fg-price:hover { background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* Price drops (front page and /prisfall/): rows, two per row on wide screens. */
.drops-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px var(--s3); }
.drop-card { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius-card); background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.drop-card .product-media--thumb { width: 56px; height: 56px; }
.drop-card-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.drop-card-name { font-size: 16px; font-weight: 600; line-height: 1.25; color: inherit; text-decoration: none; }
.drop-card-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.drop-card-guide { font-size: var(--text-sm); color: var(--text-subtle); }
.drop-card-price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.drop-card-now { display: flex; align-items: center; gap: 8px; }
.drop-card-now strong { font-family: var(--font-display); font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.drop-card-pct { padding: 2px 8px; border-radius: var(--radius-pill); background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700; white-space: nowrap; }
.drop-card-usual { font-size: var(--text-xs); color: var(--text-subtle); white-space: nowrap; }

/* /prisfall/ */
.prisfall-hero { padding-bottom: var(--s4); }
.prisfall-hero .section-lead { max-width: 60ch; }
.prisfall { padding-top: 0; }
.prisfall-filter { justify-content: flex-start; margin: 0 0 var(--s3); }
.prisfall-filter .chip { cursor: pointer; font: inherit; }
.prisfall-filter .chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--inverse-ink); }
.prisfall-note { max-width: 65ch; margin-top: var(--s4); font-size: var(--text-sm); color: var(--text-subtle); }
.prisfall-empty { max-width: 60ch; margin: 0 auto; padding: var(--s6) var(--s4); border-radius: var(--radius-card); background: var(--surface); box-shadow: 0 0 0 1px var(--line); text-align: center; }
.prisfall-empty h2 { font-size: var(--title-sm); font-weight: 500; }
.prisfall-empty p { margin-top: 10px; color: var(--text-muted); }

/* How we choose: the four steps, then the rules and the editor in 2 x 2 tiles. */
.fe-steps { position: relative; }
.fe-steps::before { content: ""; position: absolute; top: 27px; left: 27px; right: 10%; border-top: 2px dashed var(--line-strong); }
.fe-steps li { position: relative; }
.fe-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-top: var(--s6); }
.fe-tile { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-card); background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.fe-tile-text { padding: var(--s3) var(--s3) var(--s2); }
.fe-tile h3 { font-size: 22px; font-weight: 500; line-height: 1.2; text-wrap: balance; }
.fe-tile p { margin-top: 6px; max-width: 52ch; font-size: 16px; color: var(--text-muted); }
.fe-tile .pv { flex: 1; min-height: 300px; margin: 0 var(--s1) var(--s1); padding: var(--s4) var(--s6) var(--s3); border-radius: calc(var(--radius-card) - 6px); }
.fe-tile--roles .pv { padding-bottom: 0; }
.fe-tile--score .pv { justify-content: center; }

/* The editor: a dark card, the photo large, the logo icon faint behind. */
.fe-dark { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--s6); margin-top: var(--s3); padding: var(--s6); border-radius: var(--radius-card); background: var(--inverse-bg); color: var(--inverse-ink); }
.fe-dark-motif { right: -150px; bottom: -170px; width: 440px; fill: color-mix(in srgb, var(--inverse-ink) 5%, transparent); }
.fe-dark-photo { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 35%, transparent); }
.fe-dark .eyebrow { color: var(--accent); }
.fe-dark-name { margin-top: 6px; font-family: var(--font-display); font-size: var(--title-md); font-weight: 400; line-height: 1.1; }
.fe-dark-name a { color: inherit; text-decoration: none; }
.fe-dark-name a:hover { text-decoration: underline; text-underline-offset: 4px; }
.fe-dark .fe-bio { max-width: 58ch; margin-top: 12px; color: color-mix(in srgb, var(--inverse-ink) 78%, transparent); }
.fe-dark-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: var(--s3); }
.fe-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.fe-links a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; }
.fe-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.fe-dark .fe-links a { color: var(--accent); }
.fe-social { display: flex; gap: 10px; }
.fe-social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--inverse-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--inverse-ink) 30%, transparent); transition: background .15s, color .15s; }
.fe-social a:hover { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 1000px) {
  .fe-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fe-steps::before { display: none; }
}

@media (max-width: 700px) {
  .front-stats { gap: 4px 14px; }
  .fg { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; } /* 92 px picture + its 9 px margins */
  .fg .fg-media { width: 92px; min-height: 0; aspect-ratio: 1; margin: var(--s1); border-radius: 12px; }
  .fg .fg-body { padding: var(--s1) var(--s2) var(--s1) 4px; gap: 3px; }
  .fg-title { font-size: var(--text-lg); }
  .fg-go { display: none; }
  .fg-foot { grid-column: 1 / -1; padding: 8px 14px; }
  .fe-steps, .fe-tiles, .drops-grid { grid-template-columns: minmax(0, 1fr); }
  .drop-card { grid-template-columns: 56px minmax(0, 1fr) auto; row-gap: 10px; }
  .drop-card-main { grid-column: 2 / -1; }
  .drop-card-price { grid-column: 2; align-items: flex-start; }
  .drop-card-btn { grid-column: 3; }
  .fe-steps li { display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 14px; }
  .fe-steps .pb-step-num { grid-row: span 2; width: 48px; height: 48px; font-size: 20px; }
  .fe-steps h3 { margin-top: 0; }
  .fe-tile-text { padding: var(--s2) var(--s2) 12px; }
  .fe-tile .pv { min-height: 0; padding: var(--s3) var(--s2) var(--s2); }
  .fe-tile--roles .pv { padding-bottom: 0; }
  .fe-dark { grid-template-columns: minmax(0, 1fr); gap: var(--s3); padding: var(--s4) var(--s3); }
  .fe-dark-photo { width: 96px; height: 96px; }
  .fe-dark-name { font-size: 32px; }
  .fe-dark-motif { width: 300px; right: -80px; bottom: -110px; }
}
