/* ============================================================
   THE WEIGHT CLINIC — design system v5 "Electric Optimism"
   Consolidated from the Shopify page exports. Drops all Dawn-theme
   overrides (we're not on Shopify any more). Page-specific tweaks
   live in <style> blocks inside individual templates.

   Color palette / fonts / scoping pattern are stable — anything
   substantial that's shared across pages belongs here.
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; }
img, svg { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------- Tokens ---------- */
:root {
  --c-cream:      #FBF8F4;
  --c-peach:      #FCEADD;
  --c-tangerine:  #F0641F;
  --c-plum:       #1E2640;
  --c-plum-soft:  #46506B;
  --c-plum-dark:  #141A2E;
  --c-ink:        #1E2640;
  --c-ink-muted:  rgba(30,38,64,0.62);
  --c-line:       rgba(30,38,64,0.12);
  --c-acid:       #F0641F;
  --c-coral:      #CE5212;

  --ff-display:   'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  --ff-serif:     'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  --ff-body:      'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, sans-serif;
}

/* ---------- Document ---------- */
html, body {
  font-family: var(--ff-body);
  color: var(--c-ink);
  background: linear-gradient(180deg, var(--c-cream) 0%, var(--c-peach) 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* All public pages get scoped under .twc5-wrap to keep the design language
   isolated from any future admin/portal markup we add later. */
.twc5-wrap {
  overflow-x: hidden;
}

.twc5-wrap section[id] { scroll-margin-top: 100px; }

.twc5-container { max-width: 1240px; margin: 0 auto; padding: 0 40px; }
@media (max-width: 960px) { .twc5-container { padding: 0 24px; } }

/* ============================================================
   HEADER (native — replaces Dawn header)
   ============================================================ */
.twc5-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--c-cream);
  padding: 18px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.twc5-header.scrolled {
  border-color: var(--c-line);
  box-shadow: 0 4px 24px rgba(43,29,62,0.04);
}
.twc5-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
/* Brand logo = approved PNG wordmark (replaces CSS text + ::after dot, whose vertical
   alignment kept drifting). twc.css loads on every layout, so this one block covers the
   public header/footer, portal + admin sidebars, and the consultation topbar. */
.twc5-brand img, .twc5-footer-brand img, .cf-brand img { height: 28px; width: auto; display: block; }
.pt-brand img, .ad-brand img { height: 24px; width: auto; display: block; }
.twc5-brand::after, .pt-brand::after, .cf-brand::after, .ad-brand::after { content: none !important; }

.twc5-brand {
  font-family: var(--ff-display);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 22px;
  color: var(--c-plum);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.twc5-brand::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--c-tangerine);
  border-radius: 50%;
}
.twc5-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.twc5-nav a {
  font-family: var(--ff-body);
  font-weight: 500;
  font-size: 14px;
  color: var(--c-plum);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.twc5-nav a:hover { color: var(--c-tangerine); }
.twc5-nav-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  background: var(--c-tangerine);
  color: var(--c-cream);
  border-radius: 999px;
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
  vertical-align: middle;
  transform: translateY(-1px);
}

/* ============================================================
   NAV DROPDOWN (Treatments)
   Hover/focus-within to reveal. An invisible "bridge" zone
   below the trigger keeps the menu open while the cursor
   travels from trigger to menu.
   ============================================================ */
.twc5-dropdown { position: relative; }
.twc5-dropdown-trigger {
  background: transparent;
  border: 0; padding: 0;
  font: inherit;
  color: var(--c-plum);
  font-family: var(--ff-body);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}
.twc5-dropdown-trigger:hover,
.twc5-dropdown.is-active .twc5-dropdown-trigger { color: var(--c-tangerine); }
.twc5-dropdown-chev {
  width: 10px; height: 10px;
  transition: transform 0.18s ease;
}
.twc5-dropdown:hover .twc5-dropdown-chev,
.twc5-dropdown:focus-within .twc5-dropdown-chev {
  transform: rotate(180deg);
}
/* Bridge: small invisible strip below the trigger so the cursor
   doesn't lose hover when crossing the gap to the menu. */
.twc5-dropdown::after {
  content: ""; position: absolute;
  top: 100%; left: -10px; right: -10px; height: 14px;
}
.twc5-dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 14px;
  padding: 8px;
  min-width: 280px;
  box-shadow: 0 18px 48px rgba(43,29,62,0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
  z-index: 60;
}
.twc5-dropdown:hover .twc5-dropdown-menu,
.twc5-dropdown:focus-within .twc5-dropdown-menu {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.twc5-dropdown-menu a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 9px;
  color: var(--c-plum) !important;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  font-size: 14px;
  font-weight: 500;
}
.twc5-dropdown-menu a:hover {
  background: var(--c-cream);
}
.twc5-dropdown-menu a:hover .twc5-dropdown-name { color: var(--c-tangerine); }
.twc5-dropdown-menu a[aria-current="page"] {
  background: var(--c-cream);
}
.twc5-dropdown-menu a[aria-current="page"] .twc5-dropdown-name {
  color: var(--c-tangerine);
}
.twc5-dropdown-name {
  font-family: var(--ff-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--c-plum);
  letter-spacing: 0.005em;
}
.twc5-dropdown-sub {
  font-family: var(--ff-body);
  font-weight: 400;
  font-size: 12px;
  color: var(--c-ink-muted);
  letter-spacing: 0;
}
.twc5-header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--c-tangerine);
  color: var(--c-cream) !important;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.twc5-header-cta:hover { background: var(--c-coral); color: var(--c-cream) !important; transform: translateY(-1px); }
.twc5-header-cta .arrow {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1;
}
/* Keep a heading on one line on desktop, but let it wrap on small screens
   instead of clipping off the viewport edge. */
.no-wrap-lg { white-space: nowrap; }
@media (max-width: 880px) { .no-wrap-lg { white-space: normal; } }

.twc5-burger {
  display: none;
  background: transparent;
  border: none;
  padding: 8px;
  margin: -8px;
  color: var(--c-plum);
}
@media (max-width: 760px) {
  .twc5-nav {
    position: fixed;
    inset: 64px 0 0 0; /* top is recomputed live in twc.js (banner/scroll aware) */
    background: var(--c-cream);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 24px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }
  .twc5-nav.open { transform: translateX(0); }
  .twc5-nav a {
    font-size: 18px;
    padding: 16px 0;
    border-bottom: 1px solid var(--c-line);
  }
  .twc5-header-cta {
    margin-top: 16px;
    justify-content: center;
  }
  .twc5-burger { display: inline-flex; }

  /* Mobile dropdown: stack the trigger as a category label and let the
     three medication items appear flat under it. Earlier we used
     display:contents which is flaky on iOS Safari — explicit flex layout
     is rock-solid across browsers. */
  .twc5-dropdown {
    display: flex;
    flex-direction: column;
    width: 100%;
  }
  .twc5-dropdown-trigger {
    display: block;
    width: 100%;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--c-ink-muted);
    padding: 22px 0 4px;
    border-bottom: 0 !important;
    cursor: default;
    pointer-events: none;
  }
  .twc5-dropdown-chev { display: none; }
  .twc5-dropdown-menu {
    position: static;
    transform: none;
    background: transparent;
    border: 0;
    padding: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    transition: none;
  }
  /* On mobile the menu is static; tapping a link fires :focus-within/:hover and the
     desktop reveal rule applies translateX(-50%), shifting it off-screen. Cancel it. */
  .twc5-dropdown:hover .twc5-dropdown-menu,
  .twc5-dropdown:focus-within .twc5-dropdown-menu { transform: none; }
  .twc5-dropdown-menu a {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 0;
    border-bottom: 1px solid var(--c-line);
    border-radius: 0;
    background: transparent !important;
    color: var(--c-plum) !important;
    text-decoration: none;
    font-size: 18px;
  }
  .twc5-dropdown-name { font-size: 18px; font-weight: 500; color: var(--c-plum); }
  .twc5-dropdown-sub  { font-size: 13px; opacity: 0.7; font-weight: 400; color: var(--c-ink-muted); }
}

/* ============================================================
   STICKY MOBILE CTA — orange "Check eligibility" pill anchored
   to the bottom of the viewport on the blog (index + post).
   Hidden above the 760px breakpoint; on mobile it floats above
   page content so the conversion path is always one tap away.
   ============================================================ */
/* Site-wide promo banner — admin-editable, top of every public page */
.twc5-topbanner {
  background: var(--c-tangerine);
  color: var(--c-cream);
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
  padding: 9px 18px;
}
@media (max-width: 600px) {
  .twc5-topbanner { font-size: 12.5px; padding: 8px 14px; }
}

.twc5-floatcta { display: none; }
@media (max-width: 760px) {
  .twc5-floatcta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 40;
    padding: 14px 22px;
    background: var(--c-tangerine);
    color: var(--c-cream);
    font-family: var(--ff-body);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.01em;
    text-decoration: none;
    border-radius: 999px;
    box-shadow: 0 12px 28px rgba(43,29,62,0.22);
    opacity: 0;
    transform: translateY(140%);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.32s cubic-bezier(0.2,0.7,0.2,1), background 0.15s ease;
  }
  /* revealed only after the user scrolls past the first screen (toggled by twc.js) */
  .twc5-floatcta.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .twc5-floatcta.is-visible:active { transform: translateY(1px); }
  .twc5-floatcta:hover  { background: var(--c-plum); color: var(--c-cream); }
  .twc5-floatcta .arrow {
    font-family: var(--ff-serif);
    font-style: italic;
    font-size: 17px;
    line-height: 1;
  }
  /* Pad the bottom of blog pages so the sticky CTA doesn't cover
     the final card / article footer. */
  body.page-blog,
  body.page-blog-post { padding-bottom: 88px; }
}

/* ============================================================
   TICKER / TOP BANNER
   ============================================================ */
.twc5-ticker {
  background: var(--c-plum);
  color: var(--c-cream);
  font-family: var(--ff-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 10px 20px;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}
.twc5-ticker-track { display: inline-block; animation: tickerScroll 40s linear infinite; }
.twc5-ticker-item  { display: inline-block; margin-right: 48px; }
.twc5-ticker-item .dot {
  display: inline-block; width: 6px; height: 6px;
  background: var(--c-acid); border-radius: 50%;
  margin: 0 20px 2px 0; vertical-align: middle;
}
.twc5-ticker.is-static { text-align: center; padding: 10px 20px; }
.twc5-ticker.is-static .dot { margin-right: 12px; }
@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   TYPOGRAPHY PRIMITIVES
   ============================================================ */
.twc5-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: var(--c-plum);
  color: var(--c-cream);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.twc5-h1, .twc5-h2, .twc5-h3 {
  font-family: var(--ff-display);
  letter-spacing: -0.04em;
  color: var(--c-ink);
  margin: 0;
}
.twc5-h1 {
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 700;
  line-height: 0.92;
  margin-bottom: 24px;
}
.twc5-h1.hero {
  font-size: clamp(64px, 9vw, 156px);
  line-height: 0.88;
  letter-spacing: -0.05em;
  font-variation-settings: 'opsz' 96;
}
.twc5-h2 {
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 700;
  line-height: 0.95;
  margin-bottom: 20px;
}
.twc5-h3 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  line-height: 1.15;
}
.twc5-h1 em, .twc5-h1 .arc,
.twc5-h2 em,
.twc5-h3 em {
  font-family: var(--ff-serif);
  font-style: italic;
  font-weight: 400;
  background: linear-gradient(120deg, var(--c-tangerine) 0%, var(--c-coral) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.twc5-lede {
  font-size: 20px;
  line-height: 1.45;
  color: var(--c-ink);
  margin: 0 0 32px;
  max-width: 500px;
}
.twc5-section-lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--c-ink);
  opacity: 0.75;
  max-width: 580px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.twc5-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 20px 36px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.01em;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s, border-color 0.15s;
}
.twc5-btn-primary {
  background: var(--c-plum);
  color: var(--c-cream);
  border-color: var(--c-plum);
}
.twc5-btn-primary:hover { background: var(--c-tangerine); border-color: var(--c-tangerine); transform: translateY(-1px); }
.twc5-btn-secondary {
  background: transparent;
  color: var(--c-plum);
  border-color: var(--c-plum);
}
.twc5-btn-secondary:hover { background: var(--c-plum); color: var(--c-cream); }
.twc5-btn-arrow {
  font-family: var(--ff-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  line-height: 1;
}

/* ============================================================
   SECTION SHELL
   ============================================================ */
.twc5-section { padding: 120px 0; position: relative; }
.twc5-section.tight { padding: 80px 0; }
.twc5-section-header { max-width: 780px; margin: 0 0 56px; }
@media (max-width: 960px) {
  .twc5-section { padding: 80px 0; }
  .twc5-section.tight { padding: 60px 0; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.twc5-footer {
  background: var(--c-plum);
  color: rgba(255,252,245,0.85);
  padding: 80px 0 32px;
}
.twc5-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 56px;
  margin-bottom: 56px;
}
.twc5-footer h4 {
  font-family: var(--ff-display);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-acid);
  font-weight: 600;
  margin: 0 0 18px;
}
.twc5-footer ul { list-style: none; padding: 0; margin: 0; }
.twc5-footer li { margin-bottom: 10px; font-size: 14px; }
.twc5-footer a { color: rgba(255,252,245,0.7); text-decoration: none; }
.twc5-footer a:hover { color: var(--c-acid); }
.twc5-footer-brand {
  font-family: var(--ff-display);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 24px;
  color: var(--c-cream);
  margin-bottom: 12px;
}
.twc5-footer-blurb {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,252,245,0.6);
  margin: 0;
}
.twc5-footer-legal {
  border-top: 1px solid rgba(255,252,245,0.12);
  padding-top: 28px;
  font-size: 12px;
  line-height: 1.7;
  color: rgba(255,252,245,0.5);
}
.twc5-footer-legal strong { color: inherit; font-weight: 400; }
.twc5-footer-legal a { color: inherit; text-decoration: underline; }
@media (max-width: 960px) {
  .twc5-footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 560px) {
  .twc5-footer-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   COOKIE BANNER
   ============================================================ */
.twc5-cookie {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 720px;
  margin: 0 auto;
  background: var(--c-plum);
  color: var(--c-cream);
  padding: 20px 24px;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(43,29,62,0.25);
  display: none;
  z-index: 100;
}
.twc5-cookie.show { display: block; }
.twc5-cookie-inner {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.twc5-cookie p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  flex: 1;
  min-width: 220px;
}
.twc5-cookie p a { color: var(--c-acid); text-decoration: underline; }
.twc5-cookie button {
  border: none;
  background: var(--c-tangerine);
  color: var(--c-cream);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 999px;
}
.twc5-cookie button:hover { background: var(--c-coral); }

/* Skip link for keyboard / screen reader users */
.twc5-skiplink {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--c-plum);
  color: var(--c-cream);
  padding: 12px 18px;
  z-index: 1000;
  text-decoration: none;
}
.twc5-skiplink:focus { left: 16px; top: 16px; }
