/* ===========================================================================
   LIPEDEMA GURU — SHARED FOUNDATION
   Loaded by every page. Tokens, reset, typography and the primary control.
   Page-specific layout lives in booking.css / checkout.css.

   Transcribed from Figma 56FhHKq3ht4sy8XgE2jled and the existing brand system.

   PROVENANCE
     [FIGMA]    value taken from the design file
     [DERIVED]  computed from a transcribed value
     [PROPOSED] designed here because the brand has no answer

   Everything is scoped under `.lgb` so a WordPress theme's global styles
   cannot leak in and this cannot leak out. The only global declarations are
   the @font-face rules, which cannot be scoped — their family names are
   unique to the brand so they collide with nothing.
   =========================================================================== */

/* ---------------------------------------------------------------------------
   Fonts — PP Right, Pangram Pangram commercial licence (confirmed to cover
   this site). Paths are relative to THIS FILE, so assets/fonts/ sits beside it.
   --------------------------------------------------------------------------- */
@font-face {
  font-family: "PP Right Gothic";
  src: url("fonts/PPRightGothic-CompactRegular.woff2") format("woff2"),
       url("fonts/PPRightGothic-CompactRegular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PP Right Grotesk";
  src: url("fonts/PPRightGrotesk-Medium.woff2") format("woff2"),
       url("fonts/PPRightGrotesk-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PP Right Grotesk Text";
  src: url("fonts/PPRightGroteskText-Regular.woff2") format("woff2"),
       url("fonts/PPRightGroteskText-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------------------
   Tokens — scoped to the component root, not :root, so nothing on the host
   page inherits them.
   --------------------------------------------------------------------------- */
.lgb {
  /* Colour — brand primitives [FIGMA] */
  --ink: #372426;          /* R0 */
  --ink-soft: #6a534b;     /* Y0 */
  --sand: #d8c3b0;         /* Y1 — chosen row */
  --surface: #efe1d4;      /* Y2 — cards */
  --canvas: #fbf2e9;       /* Y3 — page ground */
  --white: #ffffff;        /* W White — quiz frame */
  --inactive: #f4f0ec;
  --inactive-text: #bebab5;
  --error: #b3261e;
  --success: #3e6b4f;      /* [PROPOSED] the brand has no success hue */

  /* Type [FIGMA] */
  --font-display: "PP Right Gothic", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-sans: "PP Right Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-text: "PP Right Grotesk Text", "Helvetica Neue", Arial, sans-serif;

  /* Radius [FIGMA] except --radius-sheet [PROPOSED] */
  --radius-check: 4px;
  --radius-tag: 10px;
  --radius-control: 12px;
  --radius-card: 15px;
  --radius-sheet: 20px;

  /* Spacing — the design runs on a 5pt rhythm (5/10/15/20/40) [FIGMA] */
  --hair: 5px;
  --tight: 10px;
  --card: 15px;
  --gutter: 20px;
  --gap: 40px;

  /* Motion [PROPOSED] — the design file carries no motion spec */
  --duration-micro: 120ms;
  --duration-control: 160ms;
  --duration-overlay: 320ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);

  /* Controls [FIGMA] Button 44 desktop / 30 mobile; 44 is also the tap min */
  --control-h: 44px;

  /* Elevation [PROPOSED] — nothing in the brand casts a shadow; surfaces
     separate by radius and fill. Tinted with brand ink so it reads warm. */
  --shadow-raised: 0 1px 2px rgb(55 36 38 / 0.06), 0 2px 8px rgb(55 36 38 / 0.04);
  --shadow-sheet: 0 4px 12px rgb(55 36 38 / 0.06), 0 24px 64px rgb(55 36 38 / 0.08);

  color: var(--ink);
  font-family: var(--font-text);
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: -0.06em;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  .lgb {
    /* 1ms not 0ms, so transitionend still fires */
    --duration-micro: 1ms;
    --duration-control: 1ms;
    --duration-overlay: 1ms;
    --ease-standard: linear;
  }
}

@media (min-width: 64rem) {
  .lgb { font-size: 18px; }
}

/* Scoped reset — only the elements these pages actually use.

   Wrapped in :where() so the whole block carries ZERO specificity. A plain
   `.lgb p { margin: 0 }` would out-specify every single-class component rule,
   silently killing their margins and list styling. */
.lgb *,
.lgb *::before,
.lgb *::after { box-sizing: border-box; }

:where(.lgb) :where(h1, h2, h3, h4, p, ul, li, figure) {
  margin: 0;
  padding: 0;
}
:where(.lgb) :where(ul) { list-style: none; }
:where(.lgb) :where(h1, h2, h3, h4) {
  font-weight: 400;
  text-wrap: balance;
}
:where(.lgb) :where(fieldset) {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
:where(.lgb) :where(img, svg) { display: block; max-width: 100%; }
:where(.lgb) :where(button) { font: inherit; color: inherit; }
:where(.lgb) :where(a) { color: inherit; }

/* `hidden` must beat the component's own `display` declarations — a plain
   [hidden] rule loses to any single-class rule that sets display. */
.lgb [hidden] { display: none; }

.lgb :focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 2px;
}

.lgb__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------------------
   Typography — the marketing scale [FIGMA], with the display step clamped.
   --------------------------------------------------------------------------- */

/* H1 is drawn at 160px on a fixed 1440 artboard. Flat 160px overflows any
   viewport under ~1200px, so it clamps; 160px is still reached at 1440. */
.lgb__display {
  font-family: var(--font-display);
  font-size: clamp(50px, 11.1vw, 160px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  text-align: center;
}

.lgb__h3 {
  font-family: var(--font-display);
  font-size: 34px;              /* [FIGMA] H3 mobile 1:12645 */
  line-height: 0.9;
  letter-spacing: -0.03em;
}
@media (min-width: 64rem) {
  .lgb__h3 { font-size: 54px; line-height: 1; }  /* [FIGMA] H3 desktop */
}

.lgb__h4 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 16px;              /* [FIGMA] H4 mobile */
  line-height: 1.05;
  letter-spacing: -0.01em;
}
@media (min-width: 64rem) {
  .lgb__h4 { font-size: 26px; }  /* [FIGMA] H4 desktop */
}

.lgb__body {
  font-family: var(--font-text);
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: -0.06em;
}
@media (min-width: 64rem) {
  .lgb__body { font-size: 18px; }
}

/* An eyebrow / field label. [PROPOSED] — built from the Tag type style, which
   is the only uppercase small step the brand defines. */
.lgb__eyebrow {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.lgb__soft { color: var(--ink-soft); }

/* Tag — [FIGMA] 1:1934. 14px at every width; the mobile sheet never
   respecifies it. */
.lgb__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border: 1px solid var(--ink);
  border-radius: var(--radius-tag);
  padding: var(--hair) var(--tight);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------------------
   Logo — [FIGMA] `Lipedema Horizontal` 1:4417. Two vectors: the wordmark, plus
   the Sign flourish that sits in the gap between the two words, pinned at
   58.54% / 0.62% of the lockup box. Positioned proportionally so both scale
   together. The exports use preserveAspectRatio="none", so the wrapper carries
   the ratio and each vector fills its inset box.
   --------------------------------------------------------------------------- */
.lgb__lockup {
  position: relative;
  width: 200px;
  aspect-ratio: 1396 / 190;
}
@media (min-width: 48rem) {
  .lgb__lockup { width: 260px; }
}
.lgb__lockup-mark {
  position: absolute;
  inset: 0 0.39% 0 0;
  width: 99.61%;
  height: 100%;
  max-width: none;
}
.lgb__lockup-sign {
  position: absolute;
  left: 58.54%;
  top: 0.62%;
  width: 11.63%;
  height: 85.41%;
}

/* ---------------------------------------------------------------------------
   Button — [FIGMA] 1:1929. Height steps 30 -> 44 at lg; the label size does
   not, because the type sheets give Button 18px at both breakpoints. That is
   intentional in the design: the control shrinks, the word does not.

   30px is below the 44px tap minimum, so that mobile step is NOT applied to
   these primary CTAs — they hold 44 at every width.
   --------------------------------------------------------------------------- */
.lgb__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--control-h);
  padding: var(--tight) var(--gutter);
  border: none;
  border-radius: var(--radius-control);
  background: var(--ink);
  color: var(--canvas);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration-control) var(--ease-standard);
}
.lgb__cta:hover { background: var(--ink-soft); }

.lgb__cta[aria-disabled="true"],
.lgb__cta:disabled {
  background: var(--inactive);
  color: var(--inactive-text);
  cursor: not-allowed;
  pointer-events: none;
}

.lgb__cta-arrow { width: 18px; height: 13px; flex-shrink: 0; }
.lgb__cta[aria-disabled="true"] .lgb__cta-arrow path,
.lgb__cta:disabled .lgb__cta-arrow path { fill: var(--inactive-text); }

/* Spinner shown while the payment confirms. The label is hidden rather than
   replaced, so the control's width never changes mid-submit. */
.lgb__cta[data-busy="true"] .lgb__cta-inner { visibility: hidden; }
.lgb__cta-inner { display: inline-flex; align-items: center; gap: 8px; }

.lgb__spinner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  animation: lgb-spin 700ms linear infinite;
}
.lgb__cta { position: relative; }

@keyframes lgb-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .lgb__spinner { animation-duration: 2s; }
}
