/* ============================================================================
   UPSIDE — global tokens, palette toggle, chrome
   Ported from upside-home-v5_1.html. Clinical = default (base layer);
   body.theme-warm = full v5_1 "editorial warm" treatment: cream care surfaces
   PLUS ochre eyebrows, underline hero tabs, hairline how-it-works steps, and
   floating white (unboxed) story/dual-member cards. (Goes beyond §3's minimal
   care-surface swap — built out 2026-06-16 per Josh.)
   Block-specific section CSS lives in each block's blocks/<name>/style.css.
   ========================================================================== */

:root {
  /* Brand core — identical in both palettes (§2) */
  --brand-primary: #2587E2;   /* CTAs, hero emphasis, the one hero stat */
  --dark:          #094C8A;   /* headlines, navy authority panels */
  --light:         #EAF4FD;   /* section tints, card surfaces */
  --cream:         #FDF6E9;   /* warm surface */
  --cream-deep:    #FBEFD8;
  --sec:           #6D788A;   /* supporting text / chrome */
  --secdark:       #414B5C;   /* body copy on light surfaces */
  --secl:          #BAC6DA;   /* dividers, inactive, illustration shadow */
  --black:         #202020;
  --grey:          #E4E4E4;
  --white:         #FFFFFF;
  --sky:           #DCEEFD;
  --leaf:          #7FB98E;
  --ochre:         #B8842E;

  /* Radii / layout */
  --r-sm: 12px;
  --r-md: 22px;
  --r-lg: 30px;
  --r-pill: 999px;
  --maxw: 1180px;
  --section-pad: 96px;

  /* The one font token — swap to Proxima Nova here, no template changes (§1) */
  --font: "DM Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Palette toggle: only the care/member surfaces respond (§3). */
body.theme-clinical {
  --surface-care: var(--white);
  --surface-care-soft: var(--light);
  --hero-care-from: #FFFFFF;
  --hero-care-to: var(--light);
}
body.theme-warm {
  --surface-care: var(--cream);
  --surface-care-soft: var(--cream-deep);
  --hero-care-from: #FFFDF8;
  --hero-care-to: var(--cream);
}

/* ---------------------------------------------------------------- base ---- */
.upside body,
body {
  font-family: var(--font);
  color: var(--black);
  background: var(--white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.theme-warm { background: #FFFDF8; }

html { scroll-behavior: smooth; }

/* Scrollbar — Brand Primary blue (A2). Overrides browser/OS yellow default. */
html { scrollbar-color: var(--brand-primary) var(--light); } /* Firefox */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--light); }
::-webkit-scrollbar-thumb { background: var(--brand-primary); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--dark); }

/* Typography scale (§2) — desktop; mobile handled in queries */
.upside-scope h1, .upside-scope h2, .upside-scope h3, .upside-scope h4,
.upside-rotating-hero h1, .upside-section h1, .upside-section h2, .upside-section h3, .upside-section h4 {
  color: var(--dark);
  font-weight: 700;
  line-height: 1.08;
}
.upside-section h1 { font-size: 58px; letter-spacing: -.025em; }
.upside-section h2 { font-size: 42px; letter-spacing: -.015em; }
.upside-section h3 { font-size: 21px; }
.upside-section h4 { font-size: 18px; }
.upside-section p  { color: var(--secdark); }
.upside-section .accent { color: var(--brand-primary); }

.upside-eyebrow {
  font-size: 13px;
  letter-spacing: .13em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--brand-primary);
  margin-bottom: 16px;
  display: block;
}
/* Editorial warm: ochre eyebrows, slightly wider tracking (v5_1). */
body.theme-warm .upside-eyebrow { color: var(--ochre); letter-spacing: .16em; }

/* Width container used inside Upside sections */
.upside-wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

.upside-section { padding: var(--section-pad) 0; position: relative; }

/* ------------------------------------------------------------- buttons ---- */
.upside-scope .btn,
.upside-section .btn,
.upside-header .btn,
.upside-footer .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  padding: 15px 28px;
  border-radius: var(--r-pill);
  transition: .2s;
  border: none;
  cursor: pointer;
  line-height: 1;
  text-decoration: none;
}
.btn-primary {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 8px 22px rgba(37, 135, 226, .26);
}
.btn-primary:hover { transform: translateY(-2px); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--dark);
  border: 1.5px solid var(--secl);
}
.btn-ghost:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
/* On navy surfaces, primary buttons invert to white */
.on-navy .btn-primary { background: #fff; color: var(--dark); box-shadow: none; }
.on-navy .btn-primary:hover { color: var(--dark); }
.arrow { font-size: 17px; }

/* --------------------------------------------------------- scroll reveal -- */
.upside-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1);
}
.upside-reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .upside-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ----------------------------------------------- labeled placeholder frame -*/
.upside-ph {
  position: relative;
  background: repeating-linear-gradient(45deg, #EAF4FD, #EAF4FD 12px, #e2eefb 12px, #e2eefb 24px);
  border: 1.5px dashed var(--brand-primary);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--dark);
  min-height: 120px;
  width: 100%;
}
.upside-ph span {
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, .85);
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: .02em;
}
.upside-img { display: block; max-width: 100%; height: auto; border-radius: var(--r-md); }

/* ============================================================ HEADER ====== */
.upside-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #eef2f6;
}
body.theme-warm .upside-header { background: rgba(255, 253, 248, .94); }

.upside-utilbar { background: var(--light); border-bottom: 1px solid #dce8f5; }
body.theme-warm .upside-utilbar { background: var(--cream-deep); border-bottom: 1px solid #EFE2C7; }
.upside-utilbar-inner {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  height: 38px;
  align-items: center;
}
/* wp_nav_menu emits <li> items — strip default list markers in both nav tiers */
.upside-utilbar-inner li,
.upside-nav-links li {
  list-style: none;
  margin: 0;
  padding: 0;
}
.upside-utilbar-inner ul,
.upside-nav-links ul { display: contents; }
.upside-utilbar a { font-size: 13px; font-weight: 600; color: var(--dark); letter-spacing: .01em; text-decoration: none; }
.upside-utilbar a:hover { color: var(--brand-primary); }
body.theme-warm .upside-utilbar a { color: #7a5a22; }

.upside-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 24px;
}
.upside-logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 21px; color: var(--dark); text-decoration: none; }
.upside-logo .pin { width: 26px; height: 33px; }
.upside-logo img { max-height: 38px; width: auto; }
.upside-nav-right { display: flex; align-items: center; gap: 28px; }
.upside-nav-links { display: flex; gap: 28px; font-size: 15px; font-weight: 600; }
.upside-nav-links a { color: var(--secdark); text-decoration: none; }
.upside-nav-links a:hover { color: var(--brand-primary); }
.upside-header .btn { padding: 11px 22px; font-size: 14px; }

/* Mobile hamburger */
.upside-burger { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.upside-burger span { display: block; width: 26px; height: 2.5px; background: var(--dark); border-radius: 2px; margin: 5px 0; transition: .3s; }
.upside-burger.is-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.upside-burger.is-open span:nth-child(2) { opacity: 0; }
.upside-burger.is-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.upside-mobile-panel {
  display: none;
  border-top: 1px solid #eef2f6;
  background: var(--white);
  padding: 18px 0 26px;
}
body.theme-warm .upside-mobile-panel { background: #FFFDF8; }
.upside-mobile-panel.is-open { display: block; }
.upside-mobile-panel a { display: block; padding: 12px 0; font-size: 16px; font-weight: 600; color: var(--dark); border-bottom: 1px solid #eef2f6; text-decoration: none; }
.upside-mobile-panel .upside-mobile-utility { margin-top: 16px; }
.upside-mobile-panel .upside-mobile-utility a { color: var(--sec); font-size: 14px; }
.upside-mobile-panel .btn { margin-top: 18px; }

/* ============================================================ FOOTER ====== */
.upside-footer { padding: 54px 0 32px; border-top: 1px solid #eef2f6; background: var(--white); }
body.theme-warm .upside-footer { background: #FFFDF8; }
/* Flex so the footer stays balanced for any number of link columns: the brand
   block grows to fill the left, link columns group together on the right. */
.upside-foot-grid { display: flex; flex-wrap: wrap; gap: 40px 64px; align-items: flex-start; }
.upside-foot-brand { flex: 1 1 300px; min-width: 260px; }
.upside-foot-col { flex: 0 0 auto; min-width: 130px; }
.upside-foot-grid > div p { font-size: 14px; color: var(--sec); max-width: 320px; margin-top: 12px; }
.upside-foot-col h4 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--sec); margin-bottom: 14px; font-weight: 600; }
.upside-foot-col a { display: block; font-size: 14.5px; color: var(--secdark); margin-bottom: 10px; text-decoration: none; }
.upside-foot-col a:hover { color: var(--brand-primary); }
.upside-foot-social { display: flex; gap: 14px; margin-top: 16px; }
.upside-foot-social a { color: var(--sec); font-size: 18px; }
.upside-foot-social a:hover { color: var(--brand-primary); }
.upside-foot-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid #eef2f6; font-size: 13px; color: var(--sec); text-align: center; }
.upside-foot-bottom a { color: var(--brand-primary); text-decoration: none; font-weight: 600; }
.upside-foot-bottom a:hover { text-decoration: underline; }

/* ============================================================ RESPONSIVE == */
@media (max-width: 1199px) {
  .upside-nav-links, .upside-header .btn.desktop-cta { display: none; }
  .upside-burger { display: block; }
}

@media (max-width: 767px) {
  :root { --section-pad: 64px; }
  .upside-section h1 { font-size: 40px; }
  .upside-section h2 { font-size: 30px; }
  .upside-wrap { padding: 0 22px; }
  .upside-foot-grid { flex-direction: column; gap: 28px; }
}
