/* =============================================================================
   Meadow Ridge Centre for Childcare Inc. — Design tokens (Meadow Ridge Design System v1.0)
   -----------------------------------------------------------------------------
   Every colour, type, shape, space and motion token lives here, once.
   Components read ROLE names (--page, --action, --room-a ...), never hex.
   Hex appears only in section 1 (primitives) and section 6 (staff inbox pills).

     <link rel="stylesheet" href="color-system.css">
     <link rel="stylesheet" href="styles.css">

   1. Primitives   2. Roles   3. Type   4. Shape, space, motion
   5. Legacy bridge (TEMPORARY: old names -> new roles, delete once the pages
      and admin stop using them)   6. Staff inbox pills   7. Forced colours
   ============================================================================= */


/* -----------------------------------------------------------------------------
   1. Primitives — the Meadow palette. Never used by components directly.
   -------------------------------------------------------------------------- */

:root {
  --cream-0: #fffdf7;
  --cream-50: #f7f4ea;
  --sage-100: #e6eedb;
  --sage-200: #cfe0bd;
  --sage-300: #b9d2a3;
  --meadow-600: #3e6b48;
  --meadow-700: #2f5538;
  --honey-100: #fbe9c6;
  --honey-300: #f2c86b;
  --clay-600: #b0612b;
  --moss-900: #2c3327;
  --moss-600: #5b6355;
  --forest-900: #2a3a2c;
  --linen-50: #f3f1e6;
  --lichen-200: #c9d1bf;
  --berry-600: #c8453a;
  --logo-white: #fffdf9;
  --action-on: #fffdf5;

  /* Street map (home page) */
  --m-ground: #eef1e4; --m-land: #dfe3cf; --m-land2: #e9dcc0; --m-farm: #eef0e0;
  --m-park: #cfe0bd; --m-park2: #b9d2a3; --m-water: #cfe2e6; --m-water2: #a9c9d0;
  --m-road: #c9c4ad; --m-road2: #a79f83; --m-trunk: #3e6b48; --m-pin: #b0612b; --m-ink: #4a5244;
}


/* -----------------------------------------------------------------------------
   2. Roles — the only colour names components use.
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light;

  --page: var(--cream-50);          /* page ground */
  --surface: var(--cream-0);        /* cards, lifted objects, fields */
  --ink: var(--moss-900);           /* primary text */
  --ink-soft: var(--moss-600);      /* supporting text, 5.9:1 on page */
  --action: var(--meadow-600);      /* the one solid button colour per area */
  --action-hover: var(--meadow-700);
  --action-text: var(--action-on);
  --accent: var(--clay-600);        /* headline emphasis and marks only */
  --room-a: var(--sage-100);        /* primary wash: featured card, selected, day section */
  --room-b: var(--honey-100);       /* secondary wash: notices, closing invitation */
  --highlight: var(--honey-300);    /* decorative suns, quote tile */
  --dark: var(--forest-900);        /* notice bar + footer ONLY */
  --on-dark: var(--linen-50);
  --on-dark-muted: var(--lichen-200);
  --rule: color-mix(in srgb, var(--moss-900) 14%, transparent);   /* hairlines, card outlines */
  --rule-on-dark: color-mix(in srgb, var(--linen-50) 18%, transparent);
  --full: var(--berry-600);         /* "currently full" status ONLY, always with words */
  --full-halo: color-mix(in srgb, var(--berry-600) 18%, transparent);
  --open-halo: color-mix(in srgb, var(--meadow-600) 20%, transparent);
  --focus-ring: var(--accent);
}


/* -----------------------------------------------------------------------------
   3. Type — three families, three jobs.
      Young Serif: the hero line only. Onest: headings, numerals, card titles.
      Golos Text: every fact, label, button and paragraph.
   -------------------------------------------------------------------------- */

:root {
  --font-hero: "Young Serif", Georgia, serif;
  --font-display: "Onest", system-ui, sans-serif;
  --font-body: "Golos Text", system-ui, sans-serif;

  --type-hero: clamp(3.2rem, 6.6vw, 6.2rem);
  --type-h2: clamp(2.5rem, 5vw, 4.6rem);
  --type-h2-sm: clamp(2.2rem, 3.6vw, 3.2rem);
  --type-h3: clamp(1.4rem, 2vw, 1.75rem);
  --type-numeral: clamp(2rem, 3vw, 2.6rem);
  --type-lede: clamp(1.06rem, 1.4vw, 1.25rem);
  --type-large: clamp(1.18rem, 1.8vw, 1.5rem);
  --type-body: 1rem;
  --type-small: .9rem;
  --type-label: .72rem;
  --type-fine: .82rem;

  --lh-tight: 1;
  --lh-hero: .98;
  --lh-title: 1.1;
  --lh-body: 1.6;
  --lh-compact: 1.45;
  --tracking-display: -.03em;
  --tracking-hero: -.028em;
  --tracking-label: .06em;
}


/* -----------------------------------------------------------------------------
   4. Shape, space, elevation, motion
   -------------------------------------------------------------------------- */

:root {
  --r-sm: 14px;
  --r-md: 18px;
  --r: 28px;
  --r-lg: 40px;
  --r-pill: 999px;

  --space-1: 8px;
  --space-2: 12px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 22px;
  --space-6: 28px;
  --space-7: 40px;
  --gutter: clamp(18px, 4vw, 40px);
  --section-y: clamp(56px, 7vw, 96px);
  --content-max: 1320px;

  --shadow-float: 0 24px 50px color-mix(in srgb, var(--ink) 14%, transparent), 0 4px 10px color-mix(in srgb, var(--ink) 6%, transparent);
  --shadow-label: 0 6px 15px color-mix(in srgb, var(--ink) 12%, transparent);

  --ease: cubic-bezier(.16, 1, .3, 1);
  --lift-hover: translateY(-2px);   /* buttons */
  --lift-card: translateY(-4px);    /* tiles */

  --button-height: 54px;
  --button-height-sm: 44px;
}


/* -----------------------------------------------------------------------------
   5. Legacy bridge — TEMPORARY
   The interior pages (not yet carried over) and admin/ still read the old token
   names. Each one now resolves to a role above, so nothing on the site is beige
   or brown. Delete a line once nothing reads it.
   -------------------------------------------------------------------------- */

:root {
  --radius: var(--r);

  /* old text / surface roles */
  --text: var(--ink);
  --text-muted: var(--ink-soft);
  --text-quiet: var(--ink-soft);
  --text-accent: var(--accent);
  --numerals: var(--action);
  --surface-raised: var(--surface);
  --surface-fresh: var(--surface);
  --surface-sunk: var(--page);
  --paper: var(--page);
  --paper-deep: var(--page);
  --oat: var(--page);
  --rule-strong: color-mix(in srgb, var(--ink) 26%, transparent);
  --rule-emphasis: var(--ink);
  --ink-quiet: var(--ink-soft);
  --on-dark-quiet: var(--on-dark-muted);
  --header-backdrop: color-mix(in srgb, var(--page) 92%, transparent);
  --selection-bg: var(--highlight);
  --selection-text: var(--ink);
  --scrollbar-track: var(--page);
  --scrollbar-thumb: var(--ink-soft);

  /* old action roles */
  --action-bg: var(--action);
  --action-bg-hover: var(--action-hover);
  --action-accent: var(--action-hover);
  --action-contrast-bg: var(--surface);
  --action-contrast-text: var(--ink);
  --action-contrast-bg-hover: var(--page);

  /* old status roles */
  --status-open: var(--action);
  --status-open-text: var(--action-hover);
  --status-full: var(--full);
  --status-full-text: var(--full);
  --wash-open: var(--room-a);
  --halo-open: 0 0 0 5px var(--open-halo);
  --halo-full: 0 0 0 5px var(--full-halo);
  --halo-sun: 0 0 0 18px color-mix(in srgb, var(--highlight) 35%, transparent);
  --ring-decor: color-mix(in srgb, var(--action) 10%, transparent);
  --shadow-lift: var(--shadow-float);
  --shadow-piece: var(--shadow-label);
  --shadow-note: 0 12px 28px color-mix(in srgb, var(--ink) 7%, transparent);

  /* old palette names (sand / clay / cocoa / sage ramps) */
  --sand-50: var(--page);
  --sand-100: var(--room-a);
  --sand-200: var(--room-a);
  --sand-300: var(--highlight);
  --sand-400: var(--sage-300);
  --sand-500: var(--sage-300);
  --sand-600: var(--ink-soft);
  --sand-700: var(--ink-soft);
  --sage-50: var(--room-a);
  --sage-400: var(--action);
  --sage-500: var(--action);
  --sage-600: var(--action);
  --sage-700: var(--action-hover);
  --clay-50: var(--room-b);
  --clay-100: var(--room-b);
  --clay-200: var(--room-b);
  --clay-300: var(--highlight);
  --clay-400: var(--accent);
  --clay-500: var(--accent);
  --clay-700: var(--accent);
  --clay-wash: var(--room-b);
  --cocoa: var(--action);
  --cocoa-deep: var(--action-hover);
  --cream: var(--action-text);
  --espresso: var(--dark);
  --leaf: var(--action);
  --open-ink: var(--action-hover);
  --sage-wash: var(--room-a);
  --full-ink: var(--full);
  --amber: var(--ink);
  --amber-wash: var(--room-b);
}

/* Old data-surface grounds, re-pointed at the new rooms. */
[data-surface] {
  background-color: var(--page);
  color: var(--ink);
}

[data-surface="raised"] { background-color: var(--surface); }
[data-surface="mint"],
[data-surface="sky"] { background-color: var(--room-a); }
[data-surface="peach"],
[data-surface="sun"] { background-color: var(--room-b); }


/* -----------------------------------------------------------------------------
   6. Staff inbox pills (admin only)
   One hue per waitlist status so the inbox scans at a glance. Literal hex on
   purpose: worker/test/status-colors.test.ts measures contrast on them.
   Contact statuses reuse these: read->waiting, replied->contacted,
   resolved->enrolled, archive->withdrawn. "Enrolled" is the action green.
   -------------------------------------------------------------------------- */

:root {
  --status-new-wash:       #f6e2b3; /* honey */
  --status-new-ink:        #6b4a12;
  --status-waiting-wash:   #dfe6ee; /* dusty blue */
  --status-waiting-ink:    #344a60;
  --status-contacted-wash: #f4d6c6; /* terracotta */
  --status-contacted-ink:  #7a3a22;
  --status-offered-wash:   #e9dcec; /* mauve */
  --status-offered-ink:    #5a3766;
  --status-enrolled-wash:  #3e6b48; /* action green (meadow-600) */
  --status-enrolled-ink:   #fffdf5; /* action text */
  --status-withdrawn-wash: #e8e3dd; /* warm grey */
  --status-withdrawn-ink:  #5c554e;
}


/* -----------------------------------------------------------------------------
   7. Forced colours — keep structure visible when the OS replaces the palette.
   -------------------------------------------------------------------------- */

@media (forced-colors: active) {
  :root {
    --rule: CanvasText;
    --rule-strong: CanvasText;
    --focus-ring: Highlight;
  }

  [data-surface] {
    background-color: Canvas;
    color: CanvasText;
    border-color: CanvasText;
  }
}
