/* ============================================================
   aff-child / main.css — the fleet design system (niche-agnostic)
   RULE: no literal colors, fonts, or niche terms in this file.
   Every value reads a token from variables.css. A hex here is a bug.
   ============================================================ */

/* ---------- base ---------- */
/* The design never scrolls horizontally (perf baseline). clip guarantees a
   stray overflowing element can't widen the document and leave chrome bands
   (header/nav/hero/footer at 100%) looking cut short with a white strip. */
html { overflow-x: clip; }
body {
  background: var(--surface);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 1.0625rem; /* 17px, but scales with the user's text-size setting */
  line-height: 1.65;
}

h1, h2, h3, h4, h5, h6,
.site-branding .main-title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
}
/* size-specific tracking + inverse leading: large type tightens, body stays
   loose (1.65) at ~0 tracking; small UPPERCASE labels keep positive tracking */
h1 { line-height: 1.08; letter-spacing: -0.02em; }
h2 { line-height: 1.15; letter-spacing: -0.01em; }
h3, h4, h5, h6 { line-height: 1.25; letter-spacing: 0; }
.site-branding .main-title { line-height: 1.1; letter-spacing: -0.015em; }

.entry-content a,
.entry-summary a,
.comment-content a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--brand), transparent 55%);
  text-underline-offset: 2px;
}
.entry-content a:hover {
  color: color-mix(in srgb, var(--brand), var(--ink) 30%);
  text-decoration-color: currentColor;
}

/* readable measure inside posts/pages */
.entry-content > * { max-width: var(--content-width); margin-left: auto; margin-right: auto; }
.entry-content > .alignwide { max-width: calc(var(--content-width) + 240px); }
.entry-content > .alignfull { max-width: none; }
/* DESKTOP ONLY: GP sizes alignwide as calc(100% + padding) with negative
   margins that bleed into the article padding. Where we remove that padding
   (desktop), neutralize BOTH halves — width AND margins — or it overflows.
   On mobile GP's stock pairing is correct: leave it alone entirely. */
@media (min-width: 769px) {
  .entry-content > .wp-block-group.alignwide {
    width: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* vertical rhythm */
.entry-content > * + * { margin-top: calc(var(--space-unit) * 1.25); }
.entry-content h2 { margin-top: calc(var(--space-unit) * 2.5); }
.entry-content h3 { margin-top: calc(var(--space-unit) * 1.75); }

/* ---------- header / nav chrome ---------- */
/* The NAV is the sticky element (A1 spec) — the title banner scrolls away,
   the links stay. */
.site-header {
  background: var(--ink);
}
.main-navigation {
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--ink), transparent 70%);
}
.site-header .site-branding .main-title a,
.site-header .site-branding .main-title a:hover {
  color: var(--surface);
  font-family: var(--font-display);
}
.site-header .site-description { color: color-mix(in srgb, var(--surface), var(--ink) 35%); }

.main-navigation,
.main-navigation .navigation-branding .main-title a {
  background: var(--ink);
  color: var(--surface);
}
.main-navigation .main-nav ul li a {
  color: var(--surface);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
}
.main-navigation .main-nav ul li:hover > a,
.main-navigation .main-nav ul li.sfHover > a,
.main-navigation .main-nav ul li[class*="current-menu-"] > a {
  background: var(--brand);
  color: var(--surface);
}
.main-navigation .menu-toggle,
.main-navigation .menu-toggle:hover,
.main-navigation .mobile-bar-items a {
  color: var(--surface);
  background: var(--ink);
}
.main-navigation ul ul { background: var(--ink); }

/* ---------- footer chrome ---------- */
.site-footer,
.footer-widgets {
  background: var(--ink);
  color: color-mix(in srgb, var(--surface), var(--ink) 25%);
}
.site-footer a,
.footer-widgets a {
  color: color-mix(in srgb, var(--brand), var(--surface) 45%);
  text-decoration: none;
}
.site-footer a:hover,
.footer-widgets a:hover { color: var(--surface); }
.site-info { background: color-mix(in srgb, var(--ink), #000 20%); color: color-mix(in srgb, var(--surface), var(--ink) 35%); }

/* ---------- hero overlay treatment (uniform featured imagery) ---------- */
.aff-hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}
.aff-hero img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.aff-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--ink), transparent 55%) 0%,
    color-mix(in srgb, var(--brand), transparent 70%) 100%);
  pointer-events: none;
}

/* ---------- buttons: generic vs CTA ---------- */
/* generic buttons = brand (never the CTA color) */
.entry-content .wp-block-button__link,
button:not(.menu-toggle),
input[type="submit"] {
  background: var(--brand);
  color: var(--surface);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
}

/* CTA color is reserved for affiliate buttons ONLY (AAWP + aff-components) */
.aawp .aawp-button,
.aawp a.aawp-button,
.aawp a.aawp-button:visited,
.aff-cta {
  background: var(--cta) !important;
  border-color: color-mix(in srgb, var(--cta), #000 12%) !important;
  color: var(--cta-text) !important;
  font-family: var(--font-body);
  font-weight: 700;
  border-radius: var(--radius) !important;
  text-shadow: none !important;
  box-shadow: none !important;
}
.aawp .aawp-button:hover,
.aff-cta:hover {
  background: color-mix(in srgb, var(--cta), #000 10%) !important;
  color: var(--cta-text) !important;
}

/* ---------- AAWP boxes/tables themed to tokens + zero CLS ---------- */
.aawp {
  /* reserve space so the CTA never moves as live data loads */
  min-height: 230px;
  contain: layout;
}
.aawp .aawp-product,
.aawp .aawp-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.aawp .aawp-product__title,
.aawp .aawp-product__title a {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--ink);
}
.aawp .aawp-product__price--current { color: var(--body); font-weight: 700; }
/* Amazon marketing copy never renders — belt-and-braces with the
   description_items=0 filter in functions.php. Boxes show ONLY:
   image, linked title, price+prime, CTA. */
.aawp .aawp-product__description { display: none !important; }
@media (max-width: 640px) {
  .aawp { min-height: 320px; } /* stacked mobile layout is taller */
}

/* ---------- tables (comparison-friendly) ---------- */
.entry-content table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
}
.entry-content th {
  background: var(--ink);
  color: var(--surface);
  font-family: var(--font-body);
  font-weight: 600;
  text-align: left;
  padding: calc(var(--space-unit) * 0.6);
}
.entry-content td {
  border: 1px solid var(--border);
  padding: calc(var(--space-unit) * 0.6);
  background: #fff;
}
.entry-content tr:nth-child(even) td { background: color-mix(in srgb, #fff, var(--surface) 60%); }

/* ---------- quotes, meta, misc ---------- */
.entry-content blockquote {
  border-left: 4px solid var(--brand);
  background: color-mix(in srgb, var(--surface), #fff 40%);
  padding: var(--space-unit) calc(var(--space-unit) * 1.25);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: normal;
}
.entry-meta, .posted-on, .byline { color: color-mix(in srgb, var(--body), var(--surface) 35%); font-size: 0.875rem; }
/* post meta hidden for now (A1 round-1); author box arrives with aff-components */
.entry-header .entry-meta,
footer.entry-meta,
.cat-links, .tags-links { display: none; }
/* comments disabled portfolio-wide — remove all comment UI */
.comments-area, .comment-respond, #comments { display: none; }
.entry-title a { color: var(--ink); }
.entry-title a:hover { color: var(--brand); }
hr, .wp-block-separator { border-color: var(--border); }

/* ---------- breadcrumbs ---------- */
.aff-breadcrumbs {
  max-width: var(--content-width);
  margin: var(--space-unit) auto 0;
  font-size: 13px;
  color: color-mix(in srgb, var(--body), var(--surface) 40%);
}
.aff-breadcrumbs a { color: var(--brand); text-decoration: none; }
.aff-breadcrumbs a:hover { text-decoration: underline; }

/* ---------- press feedback (apple-design subset: respond on press) ---------- */
.aawp .aawp-button, .aff-cta-wrap a,
.entry-content .wp-block-button__link,
.aff-home-hero .wp-block-button__link { transition: transform 100ms ease-out; }
.aawp .aawp-button:active, .aff-cta-wrap a:active,
.entry-content .wp-block-button__link:active,
.aff-home-hero .wp-block-button__link:active { transform: scale(0.97); }
a.aff-card:active { transform: translateY(-1px) scale(0.98); }

/* ---------- preference fallbacks ---------- */
@media (prefers-reduced-motion: reduce) {
  .aff-card, .aawp .aawp-button, .aff-cta-wrap a,
  .entry-content .wp-block-button__link,
  .aff-home-hero .wp-block-button__link { transition: none; }
  .aff-card:hover, a.aff-card:active,
  .aawp .aawp-button:active, .aff-cta-wrap a:active,
  .entry-content .wp-block-button__link:active,
  .aff-home-hero .wp-block-button__link:active { transform: none; }
}
@media (prefers-contrast: more) {
  .aff-card, .aff-rubric, .aawp .aawp-product,
  .aff-disclosure, .aff-hub-empty { border-color: var(--body); }
  .aff-card__blurb, .aff-author__bio, .aff-reading-time,
  .aff-hub-guides__meta, .aff-disclosure, .entry-meta { color: var(--body); }
}

/* ---------- accessibility ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.aawp .aawp-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand), var(--surface) 20%);
  outline-offset: 2px;
}
.site-header a:focus-visible,
.main-navigation a:focus-visible {
  outline-color: var(--surface);
}

/* ---------- homepage ---------- */
/* Collapse ALL chrome above the hero: hidden H1's wrapper, article padding,
   container margins — the hero must sit flush under the nav (no white bar). */
.home.page .entry-header { display: none; }
/* vertical collapse only is global (kills the white bar above the hero on
   all viewports); SIDE padding stays GP-stock on mobile — GP's alignwide/full
   bleed system depends on it */
.home.page .inside-article { padding-top: 0; padding-bottom: 0; background: transparent; }
.home.page .entry-content { margin-top: 0; }
.home.page .entry-content > .aff-home-hero:first-child { margin-top: 0; }
@media (min-width: 769px) {
  .home.page .site-main { margin: 0; }
  .home.page .inside-article { padding: 0; }
}

/* One shared content edge for all homepage sections: every section fills
   the GP content container itself (~1100px) — a single true left edge.
   DESKTOP ONLY: on mobile the GP defaults (inner padding, natural widths)
   are what keep content off the screen edges and the grid single-column.
   Article pages keep the 720px reading measure. */
@media (min-width: 769px) {
  /* :not(.alignfull) is CRITICAL — the hero's full-bleed depends on GP's
     breakout margins; forcing margin:auto on it boxes the hero (regression
     caught 2026-07-31). */
  .home.page .entry-content > :not(.alignfull) {
    max-width: min(1080px, 100%); /* one shared edge; can never exceed the viewport */
    margin-left: auto;
    margin-right: auto;
  }
  .home.page .entry-content > .alignfull { max-width: none; }

  /* GP injects 40px padding + its own max-width into group inner containers —
     that indents grids relative to section headings. */
  .entry-content .wp-block-group__inner-container { padding: 0; max-width: none; }
}

.aff-home-hero {
  background: linear-gradient(150deg, var(--ink) 0%, color-mix(in srgb, var(--ink), var(--brand) 55%) 100%);
  color: var(--surface);
  text-align: center;
  padding: calc(var(--space-unit) * 4) var(--space-unit);
  margin-top: 0;
}
.aff-home-hero h1 { color: var(--surface); font-size: clamp(1.8rem, 4.5vw, 2.8rem); line-height: 1.05; margin: 0 auto; max-width: 720px; }
.aff-home-hero p { color: color-mix(in srgb, var(--surface), var(--ink) 20%); max-width: 560px; margin: var(--space-unit) auto; }
.aff-home-hero .wp-block-buttons { justify-content: center; }

/* hero buttons: white outline — presence on the dark gradient without
   touching CTA orange (reserved) or brand green (melts into the gradient) */
.aff-home-hero .wp-block-button__link {
  background: transparent !important;
  color: var(--surface) !important;
  border: 2px solid var(--surface) !important;
  border-radius: var(--radius) !important;
  font-weight: 600;
}
.aff-home-hero .wp-block-button__link:hover,
.aff-home-hero .wp-block-button__link:focus {
  background: var(--surface) !important;
  color: var(--ink) !important;
}
