/*
 * Nest N Thrive — pillar landing pages.
 *
 * Spec: design/briefs/pillar-pages-redesign-2026-05.md (status: approved).
 * Loaded conditionally for is_page_template('template-pillar.php')
 * via $GLOBALS['nnt_extra_css'] = ['pillar'] (see template-pillar.php).
 *
 * Sections:
 *   1. Hero — full-bleed image + dark overlay + headline
 *   2. Editor's picks — 3 prominent cards
 *   3. Filter bar — sub-topic chips + price/refine chips, sticky on scroll
 *   4. Reviews grid — uses .review-card from chrome.css; pillar.css just lays
 *      out the surrounding section
 *   5. Empty state + newsletter
 */

.pillar-main {
  /* Pillar hero is full-bleed — no top padding here, the hero handles it */
  padding-bottom: var(--space-section-y-mobile);
}
@media (min-width: 1024px) {
  .pillar-main {
    padding-bottom: var(--space-section-y);
  }
}

/* ───────── 1. Hero ───────── */

.pillar-hero {
  position: relative;
  isolation: isolate;
  /* Mobile: shorter so the headline fits without being squashed against the image edge */
  min-height: 360px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: var(--space-8) 0 var(--space-6);
  margin-bottom: var(--space-section-y-mobile);
  /* Hardcoded deep forest as fallback — not the brand token, because the
     brand-deep token flips to bright mint in dark mode and would destroy
     the image's warm tones. Hero is brand-identity territory and needs to
     read the same in both themes. */
  background: #1F4538;
}
@media (min-width: 768px) {
  .pillar-hero {
    min-height: 420px;
    padding: var(--space-10) 0 var(--space-8);
  }
}
@media (min-width: 1024px) {
  .pillar-hero {
    min-height: 480px;
    margin-bottom: var(--space-section-y);
  }
}

.pillar-hero-image {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.pillar-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.pillar-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  /* Hardcoded #1F4538 (deep forest) — see note on .pillar-hero background.
     Mobile: vertical gradient that darkens toward the bottom so the headline
     sits on a high-contrast band while the upper part of the image breathes. */
  background: linear-gradient(
    to bottom,
    rgba(31, 69, 56, 0.45) 0%,
    rgba(31, 69, 56, 0.65) 50%,
    rgba(31, 69, 56, 0.85) 100%
  );
}
@media (min-width: 768px) {
  /* Tablet+: gradient on the left, image breathes on the right */
  .pillar-hero-overlay {
    background: linear-gradient(
      to right,
      rgba(31, 69, 56, 0.85) 0%,
      rgba(31, 69, 56, 0.70) 45%,
      rgba(31, 69, 56, 0.20) 80%,
      rgba(31, 69, 56, 0.00) 100%
    );
  }
}

.pillar-hero-content {
  /* Hardcoded warm white. Hero overlay is always dark forest (see notes
     on .pillar-hero), so text needs to be light regardless of theme. */
  color: #FAF8F5;
  position: relative;
  width: 100%;
}
.pillar-hero-content .breadcrumbs {
  /* Override the default colors so it reads on the dark overlay */
  color: color-mix(in srgb, #FAF8F5 75%, transparent);
  margin-bottom: var(--space-5);
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
}
.pillar-hero-content .breadcrumbs a {
  color: color-mix(in srgb, #FAF8F5 92%, transparent);
  text-decoration: none;
  white-space: nowrap;
  flex: 0 0 auto;
}
.pillar-hero-content .breadcrumbs a:hover {
  color: #FAF8F5;
  text-decoration: underline;
}
.pillar-hero-content .breadcrumbs span.sep {
  color: color-mix(in srgb, #FAF8F5 50%, transparent);
  flex: 0 0 auto;
}
.pillar-hero-content .breadcrumbs span.current {
  color: #FAF8F5;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}
.pillar-eyebrow {
  /* Hardcoded muted terracotta — same rationale as the rest of the hero
     text, this needs to read on the dark overlay regardless of theme. */
  color: #E8C9B4;
}
.pillar-title {
  font-family: var(--font-serif);
  font-weight: var(--weight-semibold);
  font-size: clamp(var(--text-4xl), 6vw, var(--text-6xl));
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: var(--space-2) 0 var(--space-4);
  max-width: 14ch;
}
.pillar-lead {
  font-family: var(--font-sans);
  font-size: clamp(var(--text-base), 1.6vw, var(--text-lg));
  line-height: var(--leading-relaxed);
  max-width: 50ch;
  color: color-mix(in srgb, #FAF8F5 90%, transparent);
  margin: 0;
}

/* ───────── 2. Editor's picks ───────── */

.pillar-picks {
  margin-bottom: var(--space-section-y-mobile);
}
@media (min-width: 1024px) {
  .pillar-picks {
    margin-bottom: var(--space-section-y);
  }
}
.pillar-picks .eyebrow {
  display: block;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}
.pillar-picks .section-heading {
  font-family: var(--font-serif);
  font-weight: var(--weight-semibold);
  font-size: clamp(var(--text-3xl), 3.5vw, var(--text-4xl));
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-6);
  color: var(--color-text);
}
.pillar-picks-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}
@media (min-width: 640px) {
  .pillar-picks-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .pillar-picks-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
  }
}

.pillar-pick-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--duration-fast) var(--easing-standard),
    box-shadow var(--duration-fast) var(--easing-standard),
    border-color var(--duration-fast) var(--easing-standard);
}
.pillar-pick-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
}
.pillar-pick-image {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--color-bg-subtle);
  overflow: hidden;
}
.pillar-pick-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pillar-pick-image--placeholder {
  width: 100%;
  height: 100%;
  background: var(--gradient-warm, var(--color-bg-subtle));
}
.pillar-pick-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  background: var(--color-accent);
  color: #FAF8F5;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.pillar-pick-body {
  padding: var(--space-4) var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}
.pillar-pick-body .eyebrow {
  display: block;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-1);
}
.pillar-pick-title {
  font-family: var(--font-serif);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  margin: 0;
  color: var(--color-text);
}
.pillar-pick-rating {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.pillar-pick-tldr {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-secondary);
  margin: 0;
  flex: 1;
}
.pillar-pick-price {
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-top: var(--space-2);
}

/* ───────── 3. Filter bar ───────── */

.pillar-reviews-section .section-heading {
  font-family: var(--font-serif);
  font-weight: var(--weight-semibold);
  font-size: clamp(var(--text-3xl), 3.5vw, var(--text-4xl));
  margin: 0 0 var(--space-5);
  color: var(--color-text);
}

.pillar-filter-bar {
  position: sticky;
  /* Sit a small gap below the site header instead of flush against it.
     --header-h auto-switches to --header-h-desktop at >= some breakpoint
     in chrome.css, but we explicitly override below to use the desktop
     value at >= 768px to keep this in lock-step. */
  top: calc(var(--header-h) + var(--space-3));
  z-index: 10;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin: 0 calc(-1 * var(--space-4)) var(--space-6);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  /* Subtle lift so the bar reads as floating once it's stuck, not just
     a recolored slab against the page. */
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
@media (min-width: 768px) {
  .pillar-filter-bar {
    /* Header grows from 64px to 80px at this breakpoint */
    top: calc(var(--header-h-desktop) + var(--space-3));
    margin-left: 0;
    margin-right: 0;
  }
}

.pillar-filter-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-2);
  /* Mobile: scroll horizontally instead of wrapping. Wrapping eats vertical
     space and the chips never align cleanly. */
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.pillar-filter-row::-webkit-scrollbar {
  display: none;
}
@media (min-width: 1024px) {
  .pillar-filter-row {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

.pillar-filter-row--refine {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-3);
}

.pillar-filter-label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-secondary);
  font-weight: var(--weight-medium);
  margin-right: var(--space-2);
  flex-shrink: 0;
}

.pillar-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-text-secondary);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background var(--duration-fast) var(--easing-standard),
    border-color var(--duration-fast) var(--easing-standard),
    color var(--duration-fast) var(--easing-standard);
}
.pillar-chip:hover {
  border-color: var(--color-brand);
  color: var(--color-text);
}
.pillar-chip:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
.pillar-chip.is-active {
  background: var(--color-brand);
  color: #FAF8F5;
  border-color: var(--color-brand);
}
.pillar-chip--refine.is-active {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.pillar-filter-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-3);
}
.pillar-filter-clear {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: var(--color-accent);
  cursor: pointer;
  padding: 0;
  font-weight: var(--weight-medium);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.pillar-filter-clear:hover {
  color: var(--color-accent-hover);
}

/* ───────── 4. Reviews grid (uses .review-card from chrome.css) ───────── */

/* Hide cards that don't match active filters. */
.review-card.is-filtered-out {
  display: none;
}

/* ───────── 5. Empty state ───────── */

.pillar-empty-state {
  background: var(--color-bg-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  margin-top: var(--space-6);
}
.pillar-empty-state p {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-4);
}

/* ───────── Coming soon (kept from previous) ───────── */

.pillar-coming-soon {
  margin-bottom: var(--space-section-y-mobile);
}
@media (min-width: 1024px) {
  .pillar-coming-soon {
    margin-bottom: var(--space-section-y);
  }
}
.pillar-coming-soon-card {
  background: var(--color-bg-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  max-width: var(--max-w-content);
  margin: 0 auto;
}

/* ───────── Newsletter (matches existing .newsletter-block) ───────── */

.pillar-newsletter {
  margin-top: var(--space-section-y-mobile);
}
@media (min-width: 1024px) {
  .pillar-newsletter {
    margin-top: var(--space-section-y);
  }
}
