/*
 * cognavis — global.css
 * Shared tokens, resets, nav, footer, buttons, typography, layout primitives
 * Version 2.0 | September 2026
 *
 * ARCHITECTURE RULES
 * ------------------
 * • All colours MUST be referenced via CSS custom properties defined in :root.
 *   Never write a hardcoded hex value outside this :root block.
 * • All page-specific styles live in their own CSS file (index.css, beliefs.css, etc.).
 * • global.css is the single source of truth for: tokens, reset, nav, footer,
 *   buttons, shared typography utilities, and shared components (pull-quote, divider).
 * • handout.css is a standalone scope — it does not share .section or .section-label
 *   with global.css. Use .handout-section and .handout-section-label there.
 */

/* ─── RESET ──────────────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
/* ─── SCROLL OFFSET — fixed/sticky nav compensation ─────────────────────── */
/*
 * --nav-h: matches the height: 64px on the nav rule above.
 * Update this single token if the nav height ever changes.
 * --tab-h: the rendered height of .tab-nav-wrap on for-you.html.
 * Used by for-you.js — kept here as the CSS source of truth.
 */
:root {
  --nav-h: 64px;
  --tab-h: 53px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h); /* prevents anchors jumping under sticky nav */
}

/* All named anchor targets get matching scroll-margin-top for cross-browser safety */
section[id],
div[id] {
  scroll-margin-top: var(--nav-h);
}

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

/* ─── DESIGN TOKENS ──────────────────────────────────────────────────────── */
:root {
  /* ── Earth & Root ── */
  --cocoa:            #1A0905;
  --cocoa-60:         #493B37;
  --cocoa-40:         #776D6A;
  --cocoa-20:         #AFA9A7;
  --cocoa-10:         #DDD9D8;

  /* ── Light & Warmth ── */
  --linen:            #E3DFCE;
  --linen-light:      #EDEADD;
  --linen-50:         #F4F2E8;
  --cloud:            #F7F4ED;   /* PRIMARY PAGE BACKGROUND — always the default canvas */
  --white:            #FFFFFF;   /* High-contrast areas only — never the primary background */

  /* ── Sky & Trust ── */
  --slate:            #94B1C8;
  --slate-light:      #C9DCE8;
  --slate-bg:         #E9EFF3;
  --slate-50:         #F4F7F9;

  /* ── Heart & Healing ── */
  --burgundy:         #780813;
  --burg-bg:          #F5ECEC;
  --rose:             #CFAFA7;
  --rose-light:       #E9D8D5;

  /* ── Surface ── */
  --handout-page-bg:  #D6D3CB;   /* Background behind the handout page card */

  /* ── Radii ── */
  --r:                4px;
  --r-lg:             6px;

  /* ── Transitions ── */
  --t:                0.2s ease;
}

/* ─── BASE ───────────────────────────────────────────────────────────────── */
body {
  font-family: 'Nunito', 'Helvetica Neue', Arial, sans-serif;
  font-size: 18px;
  line-height: 1.8;
  background: var(--cloud);
  color: var(--cocoa);
  -webkit-font-smoothing: antialiased;
}

/* ─── NAV ────────────────────────────────────────────────────────────────── */
nav {
  background: var(--cocoa);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  font-family: 'Montserrat Underline', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 300;
  font-size: 40px;
  color: var(--linen-light);
  letter-spacing: 0;
  text-decoration: none;
  margin-right: auto; 
}
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cocoa-20);
  text-decoration: none;
  transition: color var(--t);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--rose);
  outline: 1px solid var(--rose);            /* ADD — frame */
  outline-offset: 6px;                       /* ADD — space between text and frame */
  border-radius: 2px;                        /* ADD — softens corners to match brand */
}

.nav-cta {
  background: var(--slate);
  color: var(--white);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  margin-left: 28px;
  padding: 10px 22px;
  border-radius: var(--r);
  border: none;
  text-decoration: none;
  transition: background var(--t), color var(--t);
  cursor: pointer;
}
.nav-cta:hover { background: var(--slate-light); color: var(--cocoa); }

/* ─── HERO (shared across pages) ────────────────────────────────────────── */
.hero {
  background: var(--cocoa);
  padding: 80px 32px 72px;
  text-align: center;
}
.hero h1 {
  font-size: 44px;
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--linen-light);
  max-width: 600px;
  margin: 0 auto 20px;
}
.hero-sub {
  font-size: 20px;
  font-weight: 300;
  font-style: italic;
  color: var(--rose);
  max-width: 520px;
  margin: 0 auto;
}
.hero-label { color: var(--rose) !important; }

/* ─── LAYOUT PRIMITIVES ──────────────────────────────────────────────────── */
.section  { padding: 36px 32px; }
.inner    { max-width: 760px; margin: 0 auto; }

/* ─── TYPOGRAPHY UTILITIES ───────────────────────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cocoa-40);
  margin-bottom: 12px;
}
/* Modifier — centred section label (replaces inline style="text-align:center") */
.section-label--center { text-align: center; }

.section-h2 {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--cocoa);
  margin-bottom: 12px;
}
.section-lead {
  font-size: 19px;
  font-weight: 300;
  font-style: italic;
  color: var(--cocoa-60);
  line-height: 1.65;
  margin-bottom: 40px;
}
.opener {
  font-size: 22px;
  font-weight: 300;
  font-style: italic;
  color: var(--cocoa-60);
  line-height: 1.65;
  margin-bottom: 28px;
}
.body-text {
  font-size: 18px;
  color: var(--cocoa-60);
  line-height: 1.85;
  margin-bottom: 20px;
}

/* ─── SHARED COMPONENTS ──────────────────────────────────────────────────── */

/* Pull quote */
.pull-quote {
  border-left: 3px solid var(--burgundy);
  background: var(--burg-bg);
  padding: 20px 28px;
  border-radius: 0 var(--r) var(--r) 0;
  font-style: italic;
  font-weight: 300;
  font-size: 19px;
  color: var(--cocoa);
  line-height: 1.7;
  margin: 36px 0;
}

/* Rose divider */
.rose-divider {
  width: 48px;
  height: 2px;
  background: var(--rose);
  border: none;
  margin: 64px auto;
}

/* Dark callout band */
.callout-dark {
  background: var(--cocoa);
  padding: 64px 32px;
  text-align: center;
}
.callout-dark-inner { max-width: 560px; margin: 0 auto; }
.callout-dark p {
  font-size: 22px;
  font-weight: 300;
  font-style: italic;
  color: var(--linen-light);
  line-height: 1.65;
  margin-bottom: 36px;
}

/* ─── BUTTONS ────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--slate);
  color: var(--white);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  padding: 14px 32px;
  border-radius: var(--r);
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background var(--t), color var(--t);
}
.btn-primary:hover { background: var(--slate-light); color: var(--cocoa); }

.btn-ghost {
  background: transparent;
  color: var(--rose);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  padding: 13px 32px;
  border-radius: var(--r);
  border: 2px solid var(--rose);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background var(--t), color var(--t);
}
.btn-ghost:hover { background: var(--rose); color: var(--cocoa); }

.btn-rose { background: var(--rose); color: var(--cocoa); }
.btn-rose:hover { background: var(--rose-light); color: var(--cocoa); }

/* Inline link */
.inline-link {
  color: var(--slate);
  font-style: normal;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.inline-link:hover { text-decoration: underline; }

/* ─── FOOTER ─────────────────────────────────────────────────────────────── */
footer { background: var(--cocoa); padding: 48px 32px 32px; }
.footer-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}
.footer-logo {
  font-family: 'Montserrat Underline', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 300;
  font-size: 30px;
  color: var(--linen-light);
  letter-spacing: 0;
  margin-bottom: 6px;
}
.footer-tagline-text {
  font-size: 13px;
  font-style: italic;
  font-weight: 300;
  color: var(--rose);
  letter-spacing: 0.2em;
}
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cocoa-40);
  text-decoration: none;
  transition: color var(--t);
}
.footer-links a:hover { color: var(--rose); }
.footer-base {
  max-width: 760px;
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(221,217,216,.15);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-base span { font-size: 12px; color: var(--cocoa-40); }

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */

/* ─── HAMBURGER — always hidden on desktop ──────────────────────────────── */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  color: var(--linen-light);
  flex-shrink: 0;
  line-height: 0;
}
.nav-hamburger svg        { display: block; width: 26px; height: 26px; pointer-events: none; }
.nav-hamburger-close      { display: none; }
.nav-mobile-panel         { display: none; }
.nav-mobile-links         { list-style: none; margin: 0; padding: 0; }
.nav-mobile-links li a {
  display: block;
  padding: 14px 24px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cocoa-20);
  text-decoration: none;
  transition: color var(--t);
}
.nav-mobile-links li a:hover { color: var(--rose); }
.nav-mobile-cta {
  display: block;
  margin: 10px 24px 0;
  background: var(--slate);
  color: var(--white);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 12px 24px;
  border-radius: var(--r);
  text-decoration: none;
  text-align: center;
  transition: background var(--t), color var(--t);
}
.nav-mobile-cta:hover { background: var(--slate-light); color: var(--cocoa); }

@media (max-width: 680px) {
  :root { --nav-h: 56px; }
  nav {
    padding: 0 20px;
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    align-items: stretch;
    overflow: visible;
  }
  .nav-logo { font-size: 30px; height: 56px; display: flex; align-items: center; }
  .nav-links  { display: none !important; }
  .nav-cta    { display: none !important; }
  .nav-hamburger { display: flex; align-items: center; justify-content: center; height: 56px; }
  nav.nav-open .nav-mobile-panel {
    display: flex;
    width: 100%;
    flex-direction: column;
    background: var(--cocoa);
    border-top: 1px solid rgba(221,217,216,.12);
    padding: 12px 0 20px;
  }
  nav.nav-open .nav-hamburger-bars  { display: none; }
  nav.nav-open .nav-hamburger-close { display: block; }
  .hero h1      { font-size: 30px; }
  .hero         { padding: 60px 20px 56px; }
  .section      { padding: 56px 20px; }
  .footer-inner { flex-direction: column; }
}

/* ─── BACK TO TOP ────────────────────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--cocoa);
  border: 1.5px solid var(--rose);
  color: var(--linen-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
}
.back-to-top svg { display: block; width: 18px; height: 18px; pointer-events: none; }
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { background: var(--cocoa-60); }
.back-to-top:focus-visible { outline: 2px solid var(--slate); outline-offset: 3px; }
@media (max-width: 680px) {
  .back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }
}


/* ── Anchor icon badge ──────────────────────────────────────────────────────
   Container for the locked inline SVG anchor icons.
   Used in: anchors-grid (index.html), handout cg-strip (handout-*.html).
   Icon sizing is CSS-only — never alter the SVG viewBox.
*/
.anchor-icon-badge {
  width: 56px;
  height: 56px;
  background: var(--slate-bg);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  flex-shrink: 0;
}

/* Dark-context colour flip — apply .dark-ctx to any dark container */
.dark-ctx .anchor-icon-badge {
  background: rgba(237, 234, 221, 0.08);
}
.dark-ctx .anchor-icon-badge svg path,
.dark-ctx .anchor-icon-badge svg line  { stroke: #EDEADD !important; }
.dark-ctx .anchor-icon-badge svg circle { stroke: #EDEADD !important; fill: #1A0905; }
.dark-ctx .anchor-icon-badge svg circle[fill="#493B37"] { fill: #EDEADD !important; stroke: none !important; }
