/* Unwritten Health — shared site CSS (v21) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --cream: #FAF8F5; --green: #5B8170; --green-dark: #3f6152;
  --green-darker: #2e4a3c; --green-pale: #e4ece8;
  --charcoal: #37373B; --charcoal-soft: #5a5a5f;
  --white: #ffffff; --black: #0d0d0d;
  --amber: #b7791f; --red: #a02c1a; --gold: #b08a3c;
  --font-head: 'Bentham', Georgia, serif;
  --font-body: 'Manrope', sans-serif;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
html { scroll-behavior: smooth; font-size: 16px; }
body { background: var(--cream); color: var(--charcoal); font-family: var(--font-body); font-weight: 400; line-height: 1.7; overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 48px; }
.container-narrow { max-width: 860px; margin: 0 auto; padding: 0 48px; }
.section-label { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--green-dark); margin-bottom: 1.2rem; }
.section-label--light { color: #b8d0c6; }

/* Logo SVG sizing */
.logo-svg-wrap svg { height: 28px; width: auto; display: block; }
.logo-svg-wrap.logo-svg-invert svg { height: 28px; width: auto; display: block; filter: brightness(0) invert(1); opacity: 0.9; }
.footer-logo .logo-svg-wrap svg { height: 26px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 30px; border-radius: 100px; font-family: var(--font-body); font-weight: 600; font-size: 0.88rem; letter-spacing: 0.04em; cursor: pointer; border: none; transition: all 0.3s var(--ease); }
.btn-primary { background: var(--green-dark); color: var(--white); }
.btn-primary:hover { background: var(--green-darker); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(63,97,82,0.35); }
.btn-outline { background: transparent; color: var(--charcoal); border: 1.5px solid rgba(55,55,59,0.4); }
.btn-outline:hover { background: var(--charcoal); color: var(--white); transform: translateY(-2px); }
.btn-white { background: var(--white); color: var(--green-darker); font-weight: 700; }
.btn-white:hover { background: var(--cream); transform: translateY(-2px); }
.btn-outline-white { display: inline-flex; align-items: center; background: transparent; color: var(--white); border: 1.5px solid rgba(255,255,255,0.55); border-radius: 100px; padding: 14px 30px; font-family: var(--font-body); font-weight: 600; font-size: 0.88rem; letter-spacing: 0.04em; cursor: pointer; transition: all 0.3s var(--ease); }
.btn-outline-white:hover { background: rgba(255,255,255,0.1); }
.btn-small { padding: 10px 22px; font-size: 0.82rem; }

/* Reveal animation (opt-in via body.js-ready) */
.reveal { opacity: 1; transform: translateY(0); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js-ready .reveal { opacity: 0; transform: translateY(24px); }
.js-ready .reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.10s; } .reveal-delay-2 { transition-delay: 0.20s; }
.reveal-delay-3 { transition-delay: 0.30s; } .reveal-delay-4 { transition-delay: 0.40s; }

/* NAV (fixed) */
nav.site-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; padding: 0 48px; height: 72px; display: flex; align-items: center; justify-content: space-between; background: rgba(250,248,245,0.97); backdrop-filter: blur(16px); box-shadow: 0 1px 0 rgba(55,55,59,0.08); }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { font-size: 0.83rem; font-weight: 500; color: var(--charcoal-soft); transition: color 0.2s; }
.nav-links a:hover { color: var(--green-dark); }
.nav-links a.active { color: var(--green-dark); font-weight: 600; }
.nav-cta { display: inline-flex; align-items: center; padding: 10px 22px; border-radius: 100px; font-family: var(--font-body); font-weight: 600; font-size: 0.82rem; background: var(--green-dark); color: var(--white); transition: all 0.3s; }
.nav-cta:hover { background: var(--green-darker); transform: translateY(-1px); }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--charcoal); border-radius: 2px; }
.mobile-menu { display: none; position: fixed; top: 72px; left: 0; right: 0; background: var(--cream); padding: 24px 32px 32px; flex-direction: column; gap: 16px; border-top: 1px solid rgba(55,55,59,0.08); box-shadow: 0 8px 32px rgba(0,0,0,0.06); z-index: 999; }
.mobile-menu.open { display: flex; }
.mobile-menu a { font-size: 1rem; font-weight: 500; color: var(--charcoal); padding: 8px 0; border-bottom: 1px solid rgba(55,55,59,0.06); }
.mobile-menu a.cta { color: var(--green-dark); font-weight: 700; }

/* Sub-page nav shorthand (nav-back left, ctas right) */
nav.doc-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; padding: 0 48px; height: 72px; display: flex; align-items: center; justify-content: space-between; background: rgba(250,248,245,0.97); backdrop-filter: blur(16px); box-shadow: 0 1px 0 rgba(55,55,59,0.08); gap: 12px; }
nav.doc-nav .nav-logo { flex-shrink: 0; }
nav.doc-nav .nav-logo img { max-width: 130px; }
.nav-right { display: flex; align-items: center; gap: 24px; flex-shrink: 1; min-width: 0; }
.nav-back { font-size: 0.83rem; font-weight: 500; color: var(--charcoal-soft); transition: color 0.2s; white-space: nowrap; }
.nav-back:hover { color: var(--green-dark); }
@media (max-width: 640px) {
  nav.doc-nav { padding: 0 14px; gap: 10px; }
  nav.doc-nav .nav-logo img { height: 24px; max-width: 110px; }
  .nav-right { gap: 12px; }
  .nav-back { font-size: 0.78rem; }
  /* Hide secondary nav-back links, keep only the first (typically "Back to site") */
  .nav-right .nav-back ~ .nav-back { display: none; }
  .nav-right .nav-cta { padding: 8px 14px; font-size: 0.76rem; }
}
@media (max-width: 400px) {
  nav.doc-nav .nav-logo img { max-width: 90px; }
  /* Ultra-narrow: hide all nav-back text, keep only logo + CTA */
  .nav-right .nav-back { display: none; }
}

/* FOOTER */
footer.site-footer { background: var(--charcoal); color: rgba(255,255,255,0.7); padding: 72px 0 32px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 56px; }
.footer-brand .footer-logo svg { filter: brightness(0) invert(1); opacity: 0.9; }
.footer-tagline { margin-top: 18px; font-size: 0.76rem; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(255,255,255,0.55); }
.footer-desc { margin-top: 14px; font-size: 0.86rem; color: rgba(255,255,255,0.55); line-height: 1.7; max-width: 340px; }
.footer-socials { display: flex; gap: 12px; margin-top: 20px; }
.footer-social { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.08); transition: all 0.2s; }
.footer-social:hover { background: var(--green-dark); }
.footer-social svg { width: 15px; height: 15px; fill: rgba(255,255,255,0.7); stroke: rgba(255,255,255,0.7); stroke-width: 0; }
.footer-col-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 20px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a { font-size: 0.88rem; color: rgba(255,255,255,0.7); transition: color 0.2s; }
.footer-col a:hover { color: var(--white); }
.footer-address { font-size: 0.86rem; color: rgba(255,255,255,0.55); line-height: 1.7; margin-top: 8px; }
.footer-bottom { padding-top: 28px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-copy { font-size: 0.78rem; color: rgba(255,255,255,0.4); }
.footer-links-bottom { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links-bottom a { font-size: 0.78rem; color: rgba(255,255,255,0.4); transition: color 0.2s; }
.footer-links-bottom a:hover { color: rgba(255,255,255,0.75); }

/* Utility spacing */
.py-xl { padding: 72px 0; }
.py-lg { padding: 56px 0; }
.py-md { padding: 40px 0; }
.mt-xl { margin-top: 3rem; } .mt-lg { margin-top: 2rem; } .mt-md { margin-top: 1.2rem; }

/* Accessibility: skip link */
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--charcoal); color: #fff; padding: 12px 20px; border-radius: 0 0 8px 0; z-index: 10000; font-weight: 700; font-size: 0.85rem; }
.skip-link:focus { left: 0; outline: 2px solid var(--green); outline-offset: 2px; }

/* Halved section padding per UX report */
section { --sec-pad: 72px; }
@media (max-width: 900px) { section { --sec-pad: 48px; } }

/* Ghost button (matches btn-primary size, transparent bg) */
.btn-ghost { display: inline-flex; align-items: center; gap: 8px; padding: 14px 26px; border-radius: 100px; background: transparent; color: var(--green-darker); border: 1.5px solid rgba(63,97,82,0.35); font-family: var(--font-body); font-weight: 600; font-size: 0.88rem; letter-spacing: 0.04em; cursor: pointer; transition: all 0.3s var(--ease); }
.btn-ghost:hover { background: rgba(63,97,82,0.08); border-color: var(--green-dark); color: var(--green-darker); transform: translateY(-1px); }

/* Nav dropdowns */
.nav-links .has-dd { position: relative; }
.nav-links .has-dd > a { display: inline-flex; align-items: center; gap: 4px; }
.nav-links .has-dd > a::after { content: "▾"; font-size: 0.7em; color: var(--charcoal-soft); margin-left: 4px; }
.nav-dropdown { position: absolute; top: calc(100% + 12px); left: -12px; min-width: 240px; background: var(--white); border: 1px solid rgba(91,129,112,0.14); border-radius: 12px; padding: 8px; box-shadow: 0 12px 32px rgba(63,97,82,0.12); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all 0.2s var(--ease); z-index: 1001; }
.nav-links .has-dd:hover > .nav-dropdown, .nav-links .has-dd:focus-within > .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dropdown::before { content: ""; position: absolute; top: -8px; left: 0; right: 0; height: 8px; }
.nav-dropdown a { display: block; padding: 10px 14px; border-radius: 8px; font-size: 0.84rem; color: var(--charcoal); font-weight: 500; }
.nav-dropdown a:hover { background: var(--green-pale); color: var(--green-darker); }
.nav-dropdown .dd-lab { display: block; padding: 8px 14px 4px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--charcoal-soft); }
.nav-dropdown .dd-sep { display: block; height: 1px; margin: 4px 8px; background: rgba(55,55,59,0.08); }

/* Sticky mobile bottom CTA */
.sticky-mobile-cta { display: none; }
@media (max-width: 900px) {
  .sticky-mobile-cta { display: block; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 998; }
  .sticky-mobile-cta a { display: block; text-align: center; padding: 14px 20px; border-radius: 100px; background: var(--green-dark); color: var(--white); font-weight: 700; font-size: 0.94rem; box-shadow: 0 6px 24px rgba(63,97,82,0.35); }
  .sticky-mobile-cta a:hover { background: var(--green-darker); }
  body.has-sticky-cta { padding-bottom: 72px; }
}

/* Body-copy line-length constraint */
.prose { max-width: 65ch; }
.prose p { max-width: 65ch; }

/* Mid-page Scorecard CTA (used site-wide) */
.midpage-scorecard { padding: 56px 0; background: var(--cream); text-align: center; }
.midpage-scorecard .box { max-width: 720px; margin: 0 auto; padding: 32px 30px; background: var(--green-pale); border-radius: 20px; }
.midpage-scorecard h3 { font-family: var(--font-head); font-size: 1.5rem; color: var(--green-darker); margin-bottom: 8px; }
.midpage-scorecard p { font-size: 0.94rem; color: var(--charcoal); margin-bottom: 16px; }
.midpage-scorecard a { display: inline-flex; align-items: center; gap: 8px; padding: 12px 26px; border-radius: 100px; background: var(--green-dark); color: var(--white); font-weight: 700; font-size: 0.9rem; }
.midpage-scorecard a:hover { background: var(--green-darker); }

/* Focus states for keyboard users (WCAG 2.4.11) */
a:focus-visible, button:focus-visible, .btn:focus-visible, .nav-cta:focus-visible { outline: 2px solid var(--green-dark); outline-offset: 2px; border-radius: 4px; }

/* Typography helpers */
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 400; color: var(--charcoal); line-height: 1.2; }
h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); }
h2 { font-size: clamp(1.8rem, 2.8vw, 2.4rem); }
h3 { font-size: 1.5rem; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--green-dark); margin-bottom: 1rem; }
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* Card patterns */
.card { background: var(--white); border-radius: 20px; padding: 32px; border: 1px solid rgba(91,129,112,0.14); transition: all 0.3s var(--ease); }
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(91,129,112,0.14); }
.card-dark { background: var(--charcoal); color: rgba(255,255,255,0.8); border-radius: 20px; padding: 32px; }
.card-dark h3 { color: var(--white); }

/* Chip / tag */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 100px; background: var(--green-pale); color: var(--green-darker); font-size: 0.76rem; font-weight: 600; }
.chip-outline { background: transparent; border: 1px solid rgba(91,129,112,0.3); color: var(--green-dark); }

/* Regulatory pill (used across many pages) */
.reg-pill { display: inline-block; padding: 4px 12px; border-radius: 6px; background: rgba(63,97,82,0.09); color: var(--green-darker); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; }

/* Responsive */
@media (max-width: 900px) {
  .container, .container-narrow { padding: 0 24px; }
  nav.site-nav, nav.doc-nav { padding: 0 20px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  footer.site-footer { padding: 56px 0 24px; }
  .py-xl { padding: 72px 0; } .py-lg { padding: 56px 0; }
}
@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .nav-cta { padding: 8px 14px; font-size: 0.74rem; }
}
/* Guard against flex-collapse: nav-logo anchor must not shrink to zero on narrow widths */
nav.site-nav .nav-logo { flex-shrink: 0; display: inline-flex; align-items: center; }
nav.site-nav .nav-logo img { height: 28px !important; width: auto; min-width: 100px; display: block; }
/* Homepage nav CTA overlapping the "Health" of the logo on iPhone SE / 12 mini / 12/13/14 (375-414px) */
@media (max-width: 440px) {
  nav.site-nav { padding: 0 12px; gap: 8px; }
  nav.site-nav .nav-logo img { height: 24px !important; min-width: 96px; max-width: 130px; }
  nav.site-nav .nav-cta { padding: 7px 12px; font-size: 0.7rem; letter-spacing: 0; }
}
@media (max-width: 380px) {
  nav.site-nav .nav-logo img { height: 22px !important; min-width: 90px; max-width: 110px; }
  nav.site-nav .nav-cta { padding: 6px 10px; font-size: 0.68rem; }
}
