/*
 * AYU Foundation Child Theme — ayu-core.css
 * Design tokens, base reset/typography, and layout primitives.
 * Ported unchanged from the approved prototype's tokens.css + base.css + layout.css
 * (see prototype/css/ and README.md in this theme folder for the exact mapping).
 * LOCKED per Phase 1/2 approval — do not introduce new colors, radii, shadows, or type sizes here.
 */

/* ===== tokens.css ===== */
/*
  AYU Foundation — Design Tokens
  Source of truth for color, type, spacing, motion. Maps directly to
  Elementor Site Settings > Global Colors / Global Fonts / Theme Style
  in Phase 2 (see ELEMENTOR_MAPPING.md).
*/

:root {
  /* ============ COLOR — BRAND (verified against brand/ayu-foundation-logo.png) ============ */
  --ayu-purple: #3F2B70;
  --ayu-purple-dark: #2C1D53;
  --ayu-purple-light: #5B4B8A;
  --ayu-sky-blue: #70D0F6;
  --ayu-sky-blue-light: #AEE1F9;
  --ayu-sky-blue-dark: #1B9AD5;
  --ayu-coral: #F26334;
  --ayu-coral-light: #F79030;
  --ayu-coral-dark: #CB3627;

  /* Accessible text/UI variants (WCAG 2.2 AA verified, see ACCESSIBILITY_NOTES.md) */
  --ayu-blue-accessible: #0B6E99;   /* white-on-it 5.67:1 / on-white 5.67:1 */
  --ayu-coral-accessible: #B33B1F; /* white-on-it 5.90:1 / on-white 5.90:1 */

  /* Neutrals */
  --ayu-ink: #201A34;
  --ayu-ink-soft: #4A425E;
  --ayu-cream: #FFF8F2;
  --ayu-pale-blue: #EFFAFF;
  --ayu-pale-lavender: #F5F1FB;
  --ayu-white: #FFFFFF;
  --ayu-border: #E4DEF0;
  --ayu-border-soft: #ECE7F5;

  /* ============ SEMANTIC COLOR ROLES ============ */
  --color-bg: var(--ayu-white);
  --color-bg-cream: var(--ayu-cream);
  --color-bg-pale-blue: var(--ayu-pale-blue);
  --color-bg-pale-lavender: var(--ayu-pale-lavender);
  --color-bg-purple: var(--ayu-purple);
  --color-bg-ink: var(--ayu-ink);

  --color-text-primary: var(--ayu-ink);
  --color-text-secondary: var(--ayu-ink-soft);
  --color-text-on-purple: var(--ayu-white);
  --color-text-on-ink: var(--ayu-white);
  --color-text-link: var(--ayu-blue-accessible);
  --color-text-link-coral: var(--ayu-coral-accessible);

  --color-heading: var(--ayu-purple);
  --color-eyebrow: var(--ayu-blue-accessible);

  --color-btn-primary-bg: var(--ayu-purple);
  --color-btn-primary-bg-hover: var(--ayu-purple-dark);
  --color-btn-primary-text: var(--ayu-white);

  --color-btn-donate-bg: var(--ayu-coral-accessible);
  --color-btn-donate-bg-hover: var(--ayu-coral-dark);
  --color-btn-donate-text: var(--ayu-white);

  --color-btn-outline-border: var(--ayu-purple);
  --color-btn-outline-text: var(--ayu-purple);
  --color-btn-outline-bg-hover: var(--ayu-pale-lavender);

  --color-btn-outline-inverse-border: rgba(255,255,255,0.55);
  --color-btn-outline-inverse-text: var(--ayu-white);
  --color-btn-outline-inverse-bg-hover: rgba(255,255,255,0.12);

  --color-focus-ring: var(--ayu-blue-accessible);

  /* Gradients — used sparingly, only on ribbon/orbit graphics, never on text backgrounds */
  --gradient-ribbon-hero: linear-gradient(120deg, var(--ayu-purple) 0%, var(--ayu-sky-blue) 55%, var(--ayu-coral) 100%);
  --gradient-orbit-blue: radial-gradient(circle at 35% 30%, var(--ayu-sky-blue-light), var(--ayu-sky-blue) 55%, var(--ayu-sky-blue-dark) 100%);
  --gradient-orbit-coral: radial-gradient(circle at 35% 30%, var(--ayu-coral-light), var(--ayu-coral) 55%, var(--ayu-coral-dark) 100%);
  --gradient-cta-panel: linear-gradient(135deg, var(--ayu-purple) 0%, var(--ayu-purple-dark) 100%);

  /* ============ TYPOGRAPHY ============ */
  --font-heading: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  /* Fluid type scale — clamp(min, preferred, max) */
  --fs-display: clamp(2.75rem, 2rem + 3.2vw, 4.5rem);
  --fs-h1: clamp(2.25rem, 1.7rem + 2.4vw, 3.5rem);
  --fs-h2: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
  --fs-h3: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --fs-h4: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
  --fs-h5: 1.0625rem;
  --fs-body-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  --fs-body: 1rem;
  --fs-body-sm: 0.9375rem;
  --fs-eyebrow: 0.8125rem;
  --fs-nav: 0.9375rem;
  --fs-button: 1rem;
  --fs-caption: 0.8125rem;

  --lh-tight: 1.15;
  --lh-heading: 1.25;
  --lh-body: 1.6;
  --lh-loose: 1.75;

  --ls-eyebrow: 0.08em;
  --ls-tight: -0.01em;
  --ls-heading: -0.015em;

  /* ============ SPACING SCALE ============ */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 5.5rem;
  --space-4xl: 7.5rem;

  /* Section vertical rhythm */
  --section-pad-y: clamp(3.5rem, 3rem + 2.5vw, 6rem);
  --section-pad-y-tight: clamp(2.5rem, 2.2rem + 1.5vw, 4rem);

  /* ============ CONTAINERS ============ */
  --container-max: 1360px;
  --container-wide: 1560px; /* breakout container for photo/graphic compositions that may extend past the text grid */
  --container-narrow: 760px;
  --container-pad: clamp(1.25rem, 1rem + 2vw, 3rem);

  /* ============ RADIUS ============ */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --radius-frame: 40px;

  /* ============ BORDERS ============ */
  --border-width: 1px;
  --border-color: var(--ayu-border);
  --border-color-soft: var(--ayu-border-soft);

  /* ============ SHADOWS — restrained depth system ============
     Level 0: flat backgrounds, no shadow.
     Level 1 (--shadow-sm / --shadow-md on hover): normal cards, tiles, buttons.
     Level 2 (--shadow-lg): major photo frames (Mission, Early Intervention, Trust).
     Level 3 (--shadow-hero): the hero photo only — the one deliberately heaviest shadow on the page. */
  --shadow-sm: 0 2px 8px rgba(32, 26, 52, 0.06);
  --shadow-md: 0 10px 24px rgba(32, 26, 52, 0.08);
  --shadow-lg: 0 20px 44px rgba(63, 43, 112, 0.14);
  --shadow-hero: 0 40px 90px rgba(63, 43, 112, 0.22), 0 12px 32px rgba(63, 43, 112, 0.14);
  --shadow-focus: 0 0 0 3px rgba(11, 110, 153, 0.35);

  /* ============ SIZES ============ */
  --btn-height-sm: 40px;
  --btn-height-md: 48px;
  --btn-height-lg: 56px;
  --icon-size-sm: 20px;
  --icon-size-md: 28px;
  --icon-size-lg: 40px;
  --icon-chip-size: 56px;
  --touch-target-min: 44px;

  /* ============ MOTION ============ */
  --duration-micro: 180ms;
  --duration-card: 300ms;
  --duration-reveal: 550ms;
  --duration-ambient: 20s;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* ============ Z-INDEX ============ */
  --z-base: 1;
  --z-decoration: 2;
  --z-content: 10;
  --z-header: 100;
  --z-mobile-menu: 200;
  --z-modal: 300;
}

/* ===== base.css ===== */
/* AYU Foundation — Base reset & typography */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  margin: 0;
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  font-weight: var(--fw-bold);
}

h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); font-weight: var(--fw-semibold); }
h5 { font-size: var(--fs-h5); font-weight: var(--fw-semibold); }

p { margin: 0; }

a {
  color: var(--color-text-link);
  text-decoration: none;
}

ul, ol { margin: 0; padding: 0; list-style: none; }

button {
  font-family: inherit;
  cursor: pointer;
}

input, textarea, select, button {
  font-family: inherit;
  font-size: 1rem;
}

/* Accessible focus visibility across the whole site */
:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) {
  outline: none;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--space-sm);
  top: -60px;
  background: var(--ayu-purple);
  color: #fff;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  z-index: var(--z-modal);
  transition: top var(--duration-micro) var(--ease-standard);
  font-weight: var(--fw-semibold);
}
.skip-link:focus {
  top: var(--space-sm);
}

/* Visually-hidden utility (screen-reader only content) */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Selection color */
::selection {
  background: var(--ayu-sky-blue-light);
  color: var(--ayu-purple);
}

/* Typography utility classes */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--color-eyebrow);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--ayu-coral);
  flex: none;
}

.text-display { font-size: var(--fs-display); font-family: var(--font-heading); font-weight: var(--fw-extrabold); line-height: var(--lh-tight); letter-spacing: var(--ls-heading); color: var(--color-heading); }
.text-body-lg { font-size: var(--fs-body-lg); line-height: var(--lh-body); }
.text-body-sm { font-size: var(--fs-body-sm); line-height: var(--lh-body); }
.text-caption { font-size: var(--fs-caption); line-height: var(--lh-body); }
.text-muted { color: var(--color-text-secondary); }
.text-on-purple { color: var(--color-text-on-purple); }

/* ===== layout.css ===== */
/* AYU Foundation — Layout primitives */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container--narrow {
  max-width: var(--container-narrow);
}
.container--wide {
  max-width: var(--container-wide);
}

.section {
  position: relative;
  padding-block: var(--section-pad-y);
  overflow: hidden;
}
.section--tight { padding-block: var(--section-pad-y-tight); }

.section--white   { background: var(--color-bg); }
.section--cream   { background: var(--color-bg-cream); }
.section--pale-blue { background: var(--color-bg-pale-blue); }
.section--pale-lavender { background: var(--color-bg-pale-lavender); }
.section--purple  { background: var(--color-bg-purple); }
.section--ink     { background: var(--color-bg-ink); }

.section-head {
  max-width: 640px;
  margin-bottom: var(--space-xl);
}
.section-head--wide { max-width: 760px; }
.section-head > .eyebrow { margin-bottom: var(--space-sm); }
.section-head > h2 { margin-top: var(--space-2xs); }
.section-head > p { margin-top: var(--space-sm); }

.section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}

/* Generic responsive grid helpers */
.grid { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Editorial split (used by Hero, Mission, Signs, ABA, Early Intervention, Trust) */
.split {
  display: grid;
  gap: var(--space-2xl);
  align-items: center;
}
.split--55-45 { grid-template-columns: 1.15fr 0.9fr; }
.split--45-55 { grid-template-columns: 0.9fr 1.15fr; }
.split--35-65 { grid-template-columns: 0.65fr 1.15fr; }
.split--40-60 { grid-template-columns: 0.8fr 1.15fr; }
.split--hero { grid-template-columns: 1fr 1.17fr; } /* ~46/54 — photography as a major visual anchor, not a supporting rectangle */
.split--reverse { direction: rtl; }
.split--reverse > * { direction: ltr; }

.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--space-md); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
}

@media (max-width: 1024px) {
  .split--55-45, .split--45-55, .split--35-65, .split--40-60, .split--hero {
    grid-template-columns: 1fr;
  }
}
