/*
Theme Name:   BoughNest Child
Theme URI:    https://boughnest.com
Description:  Child theme for BoughNest (Baby Shower Block). Implements the brand design tokens as CSS custom properties and the UX component system. EN-only at launch; structured so a future multilingual return (FR/ES) needs no retro-fit. Parent theme to be confirmed at install (GeneratePress recommended — see docs/tech/setup-wordpress-o2switch.md).
Author:       BoughNest Tech Lead
Template:     generatepress
Version:      0.1.0
License:      GPL-2.0-or-later
Text Domain:  boughnest-child
*/

/* =========================================================================
   IMPORTANT
   - Design tokens live in assets/css/tokens.css, AUTO-GENERATED from
     docs/brand/design-tokens.json by docs/tech/tools/tokens_to_css.py.
     Do NOT hand-edit token values; change the JSON and regenerate.
   - tokens.css is enqueued separately (before this file) in functions.php.
   - This file consumes the --tokens and defines semantic component styles.
   - Accessibility rule (visual-identity.md §2): NEVER use --color-primary or
     --color-secondary for body/inline text. Use the *-strong variants.
   ========================================================================= */

/* -------------------------------------------------------------------------
   Base / typography
   ------------------------------------------------------------------------- */
:root {
  /* Semantic aliases layered on top of the generated tokens. */
  --bn-text-body: var(--color-text);            /* 13.8:1 on cream — AA */
  --bn-link: var(--color-link);                 /* primary-strong — AA inline */
  --bn-link-hover: var(--color-link-hover);
  --bn-measure: 68ch;                           /* readable line length (ux-spec §4.3) */
  --bn-container: 1200px;                        /* xl container (ux-spec §6) */
}

html {
  font-size: var(--base-font-size, 16px);
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--bn-text-body);
  background-color: var(--color-background);
}

h1, h2, h3, h4, h5, h6,
.bn-heading {
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  color: var(--color-text);
}

h1 { font-size: var(--fs-h1);    line-height: var(--lh-h1); }
h2 { font-size: var(--fs-h2);    line-height: var(--lh-h2); }
h3 { font-size: var(--fs-h3);    line-height: var(--lh-h3); }
h4 { font-size: var(--fs-h4);    line-height: var(--lh-h4); }

/* Hero H1 scales up on large screens (ux-spec §6 / hero-spec §2). */
@media (min-width: 1024px) {
  .bn-hero h1 { font-size: var(--fs-display); line-height: var(--lh-display); }
}

p { max-width: var(--bn-measure); }

a { color: var(--bn-link); text-decoration: underline; }
a:hover { color: var(--bn-link-hover); }

/* Visible focus on all interactive elements (a11y baseline, ux-spec §7). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.bn-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   Layout helpers
   ------------------------------------------------------------------------- */
.bn-container {
  max-width: var(--bn-container);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.bn-section { padding-block: var(--space-2xl); }
.bn-section--alt { background-color: var(--color-surface-alt); }

/* -------------------------------------------------------------------------
   Buttons (ux-spec §5.4) — all AA-verified pairings
   ------------------------------------------------------------------------- */
.bn-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 44px;            /* min touch target (ux-spec §6) */
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: var(--fs-body);
  line-height: 1.2;
  text-decoration: none;
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

/* Primary = marketplace CTA: primary bg + white (4.6:1 AA). */
.bn-btn--primary {
  background-color: var(--color-primary);
  color: var(--color-text-on-primary);
  box-shadow: var(--shadow-card);
}
.bn-btn--primary:hover {
  background-color: var(--color-primary-strong);
  box-shadow: var(--shadow-raised);
  transform: translateY(-1px);
  color: var(--color-text-on-primary);
}

/* Secondary = newsletter / non-commerce: secondary-strong + white (6.3:1 AA). */
.bn-btn--secondary {
  background-color: var(--color-secondary-strong);
  color: #fff;
}
.bn-btn--secondary:hover { background-color: var(--color-secondary); }

/* Tertiary / text link: primary-strong (5.3:1 AA inline). */
.bn-btn--tertiary,
.bn-link-cta {
  background: transparent;
  color: var(--color-primary-strong);
  font-weight: var(--fw-semibold);
  padding-inline: 0;
}

/* Ghost / outline: low-emphasis utility (e.g. "Load more"). */
.bn-btn--ghost {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: var(--radius-md);
}

/* -------------------------------------------------------------------------
   Article card (ux-spec §5.1)
   ------------------------------------------------------------------------- */
.bn-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow .15s ease, transform .15s ease;
}
.bn-card:hover { box-shadow: var(--shadow-raised); transform: translateY(-2px); }
.bn-card__media { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.bn-card__body { padding: var(--space-md); }
.bn-card__meta { font-size: var(--fs-small); color: var(--color-text-muted); }
.bn-card__title {
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-h4);
  margin-block: var(--space-xs) var(--space-sm);
}
.bn-card__title a { color: var(--color-text); text-decoration: none; }
.bn-card__excerpt { font-size: var(--fs-body); color: var(--color-text-muted); }

/* -------------------------------------------------------------------------
   Category chip / tag (ux-spec §5.5)
   ------------------------------------------------------------------------- */
.bn-chip {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  font-size: var(--fs-small);
  border-radius: var(--radius-pill);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
}
.bn-chip.is-active {
  background-color: var(--color-secondary-strong);
  color: #fff;
  border-color: var(--color-secondary-strong);
}

/* -------------------------------------------------------------------------
   Product CTA / callout (ux-spec §5.2) — reads MARKETPLACE_URL (functions.php)
   ------------------------------------------------------------------------- */
.bn-cta-callout {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
  margin-block: var(--space-xl);
}
.bn-cta-band {
  background-color: var(--color-surface-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
}
.bn-cta__title {
  font-family: var(--font-heading);
  font-size: var(--fs-h4);
  margin-bottom: var(--space-sm);
}
.bn-cta__disclosure {
  display: block;
  margin-top: var(--space-sm);
  font-size: var(--fs-xsmall);
  color: var(--color-text-muted);
}
.bn-cta__disclosure a { color: var(--color-text-muted); }

/* Step badge (hero-spec §4): accent amber + dark text (7.1:1 AA) — never white. */
.bn-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem; height: 2rem;
  border-radius: var(--radius-pill);
  background-color: var(--color-accent);
  color: var(--color-text-on-accent);
  font-weight: var(--fw-bold);
}

/* -------------------------------------------------------------------------
   Newsletter block (ux-spec §5.3)
   ------------------------------------------------------------------------- */
.bn-newsletter {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}
.bn-newsletter__note { font-size: var(--fs-small); color: var(--color-text-muted); }

/* -------------------------------------------------------------------------
   Skip link (a11y, ux-spec §7)
   ------------------------------------------------------------------------- */
.bn-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-surface);
  color: var(--color-text);
  padding: var(--space-sm) var(--space-md);
  z-index: 1000;
}
.bn-skip-link:focus { left: var(--space-md); }

/* -------------------------------------------------------------------------
   Hero decorative accent (illustration band, no text) — bottom of the hero.
   On-brand SVG by the illustrator; extra bottom padding keeps copy clear of
   the artwork. Cream base under it.
   ------------------------------------------------------------------------- */
.bn-hero {
  position: relative;
  background-color: var(--color-background);
  background-image: url("assets/img/hero-accent.svg");
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: 100% auto;
  padding-bottom: clamp(110px, 20vw, 240px);
}
