/* ============================================================
   RESPONSIVE PARENTING HUB — Site Layout
   Base body styles, header/nav, footer, hero. Component classes
   live in components.css; brand values live in tokens.css.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--lh-body);
}

img { max-width: 100%; display: block; }

a { color: var(--sage-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: var(--lh-tight);
  margin: 0 0 var(--space-3);
}
h1 { font-size: var(--size-h1); }
h2 { font-size: var(--size-h2); }
h3 { font-size: var(--size-h3); }

p { margin: 0 0 var(--space-3); }

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--sage-dark);
  color: #fff;
  padding: 12px 20px;
  z-index: 1000;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus {
  left: 0;
  top: 0;
}

/* ---- Site header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 238, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  gap: var(--space-4);
}
.site-logo {
  text-decoration: none;
  display: block;
}
.site-logo__eyebrow {
  display: block;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: clamp(0.65rem, 1.6vw, 0.78rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2px;
}
.site-logo__main {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 4.2vw, 2.4rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--sage-dark);
}
.site-logo__tagline {
  display: block;
  font-family: var(--font-ui);
  font-weight: 400;
  font-style: italic;
  font-size: 0.74rem;
  color: var(--ink-faint);
  letter-spacing: 0.01em;
  margin-top: 5px;
}
@media (max-width: 560px) {
  /* The tagline is the first thing to go on narrow phones — the bigger
     wordmark plus hamburger already fills the row on its own. */
  .site-logo__tagline { display: none; }
  .site-logo__main { font-size: 1.4rem; }
  .site-logo__eyebrow { letter-spacing: 0.22em; }
}

.primary-nav { display: none; }
.primary-nav ul {
  list-style: none;
  display: flex;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
}
.primary-nav a {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  text-decoration: none;
  transition: color var(--transition);
  position: relative;
  padding-bottom: 3px;
}
.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition);
}
.primary-nav a:hover { color: var(--sage-dark); }
.primary-nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.header-cta { display: none; }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.search-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  flex-shrink: 0;
  transition: color var(--transition), border-color var(--transition);
}
.search-toggle:hover,
.search-toggle[aria-expanded="true"] {
  color: var(--sage-dark);
  border-color: var(--sage-dark);
}

.search-panel {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}
.search-panel.is-open { display: block; }
.search-panel__form {
  display: flex;
  gap: var(--space-3);
  max-width: 560px;
}
.search-panel__input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-ui);
  font-size: 1rem;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-white);
  color: var(--ink);
}
.search-panel__input:focus {
  outline: none;
  border-color: var(--sage-dark);
}
@media (max-width: 480px) {
  .search-panel__form { flex-direction: column; }
}

.nav-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  position: relative;
  transition: transform var(--transition);
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}
.mobile-nav.is-open { display: block; }
.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.mobile-nav a {
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
}
.mobile-nav .btn { margin-top: var(--space-2); width: 100%; }

@media (min-width: 1120px) {
  /* Six nav links + logo + CTA button need real room to breathe — at 900px
     they wrapped onto two lines. 1120px matches the container's own max
     width, so the full nav only appears once there's genuinely space for it. */
  .primary-nav { display: block; }
  .header-cta { display: inline-flex; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
  /* Testimonials still wrapped the desktop row onto two lines even at
     1120px once the search icon was added, so it's dropped from the
     desktop nav specifically (menu-item-62) — still reachable from the
     mobile nav and the footer. */
  .primary-nav .menu-item-62 { display: none; }
}

/* ---- Hero ---- */
.hero {
  padding: var(--space-7) 0;
  background: linear-gradient(180deg, var(--sage-lightest) 0%, var(--paper) 100%);
  position: relative;
  overflow: hidden;
}
.hero__grid {
  display: grid;
  gap: var(--space-6);
  align-items: center;
  grid-template-columns: 1fr;
  position: relative;
}
.hero__eyebrow { margin-bottom: var(--space-3); }
.hero__lede {
  font-family: var(--font-quote);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.15rem;
  max-width: 46ch;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
@media (max-width: 480px) {
  /* Full-width stacked CTAs read better than two half-shrunk pill buttons
     jammed onto one line on a small phone. */
  .hero__actions .btn { flex: 1 1 100%; }
}
.hero__image {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
  max-height: 60vh;
}
.hero__image img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease); }
.hero__image:hover img { transform: scale(1.035); }
.hero__image::before {
  content: "";
  position: absolute;
  inset: -10px auto auto -10px;
  width: clamp(50px, 10vw, 90px);
  height: clamp(50px, 10vw, 90px);
  border: 2px solid var(--gold-soft);
  border-radius: var(--radius-lg);
  z-index: -1;
}

@media (min-width: 960px) {
  .hero__grid { grid-template-columns: 1.1fr 0.9fr; }
  .hero__image {
    /* asymmetric offset only once there's room for it beside the text —
       reads as art-directed, not templated */
    margin: 0 0 0 var(--space-4);
    max-height: none;
  }
}

/* ---- Home top: stat strip sitting directly above the featured block,
   no section padding of its own — the parent .home-top section controls
   the outer top/bottom space so the two don't stack. ---- */
.home-top {
  padding: var(--space-4) 0 var(--space-6);
}
.credibility-strip {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.credibility-strip--divided .stat {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 0 clamp(8px, 3vw, var(--space-5));
}
.credibility-strip--divided .stat:first-child {
  padding-left: 0;
}
.credibility-strip--divided .stat:last-child {
  padding-right: 0;
}
.credibility-strip--divided .stat:not(:first-child)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: var(--line);
}
/* Smaller, competitor-style numbers — this strip reads as a compact stat
   bar, not a second hero headline. Sized to always fit on one line, even
   on small phones, instead of wrapping onto a second row. */
.credibility-strip .stat__number {
  font-size: clamp(1.05rem, 3.2vw, 1.5rem);
}
.credibility-strip .stat__label {
  font-size: clamp(0.68rem, 1.8vw, 0.8rem);
}

/* ---- Section header ---- */
.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-6);
}
.section-head .eyebrow { margin-bottom: var(--space-3); }

/* ---- Footer ---- */
.site-footer {
  background: var(--sage-dark);
  color: var(--paper);
  padding: var(--space-6) 0 var(--space-5);
}
.site-footer a { color: var(--paper); opacity: 0.85; text-decoration: none; }
.site-footer a:hover { opacity: 1; }
.footer-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
  padding-bottom: var(--space-5);
  border-bottom: 1px solid rgba(250, 246, 238, 0.15);
  margin-bottom: var(--space-4);
}
.footer-grid h4 {
  font-family: var(--font-ui);
  color: var(--gold-soft);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: 0.85rem;
  opacity: 0.75;
}

@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

/* ---- Blog article typography ---- */
.entry-content {
  font-family: var(--font-body);
  font-size: 1.05rem;
}
.entry-content a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.entry-content a:hover {
  color: var(--link-hover);
}
.entry-content h2 { margin-top: var(--space-6); }
.entry-content h3 { margin-top: var(--space-5); }
.entry-content blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--size-quote);
  color: var(--sage-dark);
  border-left: 3px solid var(--gold);
  margin: var(--space-5) 0;
  padding: 0 0 0 var(--space-4);
}
.entry-content img { border-radius: var(--radius-lg); margin: var(--space-4) 0; }
.entry-content strong { color: var(--sage-dark); }
.entry-content ol,
.entry-content ul {
  margin: 0 0 var(--space-4);
  padding-left: 1.4em;
}
.entry-content ol { counter-reset: rph-step; list-style: none; padding-left: 0; }
.entry-content ol > li {
  position: relative;
  padding-left: 2.6em;
  margin-bottom: var(--space-3);
  counter-increment: rph-step;
}
.entry-content ol > li::before {
  content: counter(rph-step);
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.entry-content ul > li { margin-bottom: var(--space-2); }
.entry-content ol > li > strong:first-child,
.entry-content ul > li > strong:first-child {
  display: inline-block;
  margin-bottom: 2px;
}

/* ---- Quick-answer / summary box at the top of a how-to post ---- */
.quick-answer {
  background: var(--sage-lightest);
  border: 1px solid var(--line);
  border-left: 4px solid var(--sage);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin: var(--space-5) 0;
}
.quick-answer__label {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sage-dark);
  display: block;
  margin-bottom: 8px;
}
.quick-answer ol,
.quick-answer ul { margin-bottom: 0; }

/* ---- FAQ ---- */
.entry-faq { margin-top: var(--space-6); }
.entry-faq h3 { font-size: 1.1rem; margin-top: var(--space-4); }

/* ---- Entry byline: avatar + "By Author" + date, under the post title ---- */
.entry-byline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.entry-byline__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.entry-byline__text {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}
.entry-byline__by {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  color: var(--ink);
}
.entry-byline__by a {
  color: var(--sage-dark);
  font-weight: 700;
  text-decoration: underline;
}
.entry-byline__date {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* ---- Affiliate disclosure ---- */
.affiliate-disclosure {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-bottom: var(--space-4);
}
.affiliate-disclosure a { color: var(--ink-faint); text-decoration: underline; }

/* ---- Author bio card ---- */
.author-bio {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  background: var(--sage-lightest);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}
.author-bio__photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.author-bio__label {
  display: block;
  font-family: var(--font-display);
  color: var(--sage-dark);
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.author-bio__body p {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 0 0 6px;
}
.author-bio__body a {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--gold);
}
@media (max-width: 480px) {
  .author-bio { flex-direction: column; align-items: center; text-align: center; }
}

/* ---- Entry layout: article content + author-bio sidebar ----
   Mobile-first default: single column, main content only. The desktop
   sidebar copy of the author-bio is hidden here; a second copy, sitting
   inside the Related Posts section (same sage background, right below the
   card grid), is shown instead — so on phones the bio reads as part of
   Related Posts, not as its own separate block between article and footer. */
.entry-layout {
  display: block;
}
.entry-layout__sidebar--desktop {
  display: none;
}

@media (min-width: 960px) {
  /* At desktop widths, the sidebar sits beside the article (this is the
     only place it renders); the copy inside Related Posts is hidden. */
  .entry-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: var(--space-6);
    align-items: start;
  }
  .entry-layout__sidebar--desktop {
    display: block;
    position: sticky;
    top: calc(var(--space-6) + 70px);
  }
  .entry-layout__sidebar--desktop .author-bio {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 0;
  }
  .entry-layout__sidebar--mobile-wrap {
    display: none;
  }
}

/* Sits inside the sage Related Posts section — give it a white card
   background so it reads as a distinct card, not the same sage-lightest
   tint as the section behind it. */
.entry-layout__sidebar--mobile-wrap .author-bio {
  background: var(--paper-white);
}

/* ---- Pin-style graphic (text overlay on image, for social sharing) ---- */
.pin-graphic {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-5) 0;
  box-shadow: var(--shadow-card);
}
.pin-graphic img { width: 100%; display: block; }
.pin-graphic__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(43,43,38,0.05) 0%, rgba(43,43,38,0.55) 100%);
  display: flex;
  align-items: flex-end;
  padding: var(--space-4);
}
.pin-graphic__text {
  font-family: var(--font-display);
  color: #fff;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  line-height: 1.2;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

/* ---- Utilities ---- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Subtle grain texture for solid-color sections ----
   Breaks up the flat-vector look of plain color blocks. Very low opacity —
   felt more than seen. */
.has-grain {
  position: relative;
}
.has-grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.section--dark.has-grain::after { opacity: 0.08; }

/* Scroll-reveal removed: all content is visible immediately on load, no scroll-triggered fade-in. */

/* ---- Leaf divider (matches the book project's gold-hairline-with-leaf motif) ---- */
.leaf-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 auto;
  max-width: 320px;
}
.leaf-divider::before,
.leaf-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.leaf-divider svg { flex-shrink: 0; color: var(--gold); }

/* ---- Asymmetric image+text section (philosophy, about supporting content) ---- */
.split-section {
  display: grid;
  gap: var(--space-6);
  align-items: center;
  grid-template-columns: 1fr;
}
.split-section__image {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.split-section__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 900ms var(--ease);
}
.split-section__image:hover img { transform: scale(1.04); }
.split-section__badge {
  position: absolute;
  bottom: -14px;
  right: 12px;
  left: 12px;
  background: var(--paper-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 12px 16px;
  font-family: var(--font-display);
  color: var(--sage-dark);
  font-size: 0.85rem;
  line-height: 1.3;
}
@media (min-width: 640px) {
  .split-section__badge {
    left: auto;
    right: -18px;
    bottom: -18px;
    padding: 14px 18px;
    font-size: 0.95rem;
    max-width: 200px;
  }
}
@media (min-width: 860px) {
  .split-section { grid-template-columns: 1fr 1fr; }
  .split-section--reverse .split-section__image { order: 2; }
}

/* ---- Animated stat number (JS toggles counting via data-count) ---- */
.stat__number[data-count] { font-variant-numeric: tabular-nums; }
