/* Typography — the single source for every font in the site.
 *
 * Every stylesheet, page <style> block and inline style uses one of the
 * role tokens below instead of naming a font. To restyle text site-wide:
 *
 *   - swap a typeface everywhere it is used  -> edit a --typeface-* line
 *   - change one kind of text only           -> point its --font-* role at
 *                                               another typeface
 *
 * Roles
 *   --font-title      page titles, h1, brand / logo, hero headings
 *   --font-subheader  h2–h6, section / card / modal headings, names
 *   --font-body       paragraphs and running text (p, span, td)
 *   --font-table-head table column headers (th), always Bold
 *   --font-number     money, counts, stats, totals, dates-as-values
 *   --font-label      buttons, tabs, chips, form fields and their labels
 *   --font-ui         other interface text (marketing-page default, badges,
 *                     meta lines)
 *   --font-page       default text on planner pages that no other role
 *                     claims (planner-chrome.css body)
 *   --font-mono       codes, tokens, technical strings
 *   --font-button     every <button> without its own font (= label)
 *   --font-field      inputs, selects, textareas without their own font
 *                     (= label)
 *
 * Titles and subheaders use The Seasons; every other text role except mono
 * uses Canela, Light by default. All weights are real files: 100 Thin,
 * 300 Light, 400 Regular, 500 Medium, 700 Bold (600 requests use it),
 * 900 Black. Canela Text / Deck / Condensed are available as --typeface-*.
 *
 * Element defaults (body, h1–h6, p/label/span/td) are set below for every page.
 * New markup can opt into a role with the .type-* classes at the bottom.
 * A new font file needs an @font-face here (or a Google Fonts @import).
 * Email HTML (invitation-service.js) can't read CSS variables and keeps a
 * literal font stack. */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

@font-face {
  font-family: 'Nympha';
  src: url('/fonts/NymphaTrial-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* The Seasons - Light 300, Regular 400, Bold 700 (600 requests use Bold) */
@font-face {
  font-family: 'The Seasons';
  src: url('/fonts/The Seasons Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'The Seasons';
  src: url('/fonts/The Seasons Light Italic.ttf') format('truetype');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'The Seasons';
  src: url('/fonts/The Seasons Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'The Seasons';
  src: url('/fonts/The Seasons Italic.ttf') format('truetype');
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'The Seasons';
  src: url('/fonts/The Seasons Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'The Seasons';
  src: url('/fonts/The Seasons Bold Italic.ttf') format('truetype');
  font-weight: bold;
  font-style: italic;
  font-display: swap;
}

/* Canela (Trial) - Thin 100, Light 300, Regular 400, Medium 500, Bold 700,
 * Black 900, each with italic, in four optical cuts: Canela (display),
 * Canela Text (small sizes), Canela Deck (mid sizes), Canela Condensed. */
@font-face { font-family: 'Canela'; src: url('/fonts/Canela-Thin-Trial.otf') format('opentype'); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela'; src: url('/fonts/Canela-ThinItalic-Trial.otf') format('opentype'); font-weight: 100; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela'; src: url('/fonts/Canela-Light-Trial.otf') format('opentype'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela'; src: url('/fonts/Canela-LightItalic-Trial.otf') format('opentype'); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela'; src: url('/fonts/Canela-Regular-Trial.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela'; src: url('/fonts/Canela-RegularItalic-Trial.otf') format('opentype'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela'; src: url('/fonts/Canela-Medium-Trial.otf') format('opentype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela'; src: url('/fonts/Canela-MediumItalic-Trial.otf') format('opentype'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela'; src: url('/fonts/Canela-Bold-Trial.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela'; src: url('/fonts/Canela-BoldItalic-Trial.otf') format('opentype'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela'; src: url('/fonts/Canela-Black-Trial.otf') format('opentype'); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela'; src: url('/fonts/Canela-BlackItalic-Trial.otf') format('opentype'); font-weight: 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela Text'; src: url('/fonts/CanelaText-Thin-Trial.otf') format('opentype'); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela Text'; src: url('/fonts/CanelaText-ThinItalic-Trial.otf') format('opentype'); font-weight: 100; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela Text'; src: url('/fonts/CanelaText-Light-Trial.otf') format('opentype'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela Text'; src: url('/fonts/CanelaText-LightItalic-Trial.otf') format('opentype'); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela Text'; src: url('/fonts/CanelaText-Regular-Trial.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela Text'; src: url('/fonts/CanelaText-RegularItalic-Trial.otf') format('opentype'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela Text'; src: url('/fonts/CanelaText-Medium-Trial.otf') format('opentype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela Text'; src: url('/fonts/CanelaText-MediumItalic-Trial.otf') format('opentype'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela Text'; src: url('/fonts/CanelaText-Bold-Trial.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela Text'; src: url('/fonts/CanelaText-BoldItalic-Trial.otf') format('opentype'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela Text'; src: url('/fonts/CanelaText-Black-Trial.otf') format('opentype'); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela Text'; src: url('/fonts/CanelaText-BlackItalic-Trial.otf') format('opentype'); font-weight: 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela Deck'; src: url('/fonts/CanelaDeck-Thin-Trial.otf') format('opentype'); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela Deck'; src: url('/fonts/CanelaDeck-ThinItalic-Trial.otf') format('opentype'); font-weight: 100; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela Deck'; src: url('/fonts/CanelaDeck-Light-Trial.otf') format('opentype'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela Deck'; src: url('/fonts/CanelaDeck-LightItalic-Trial.otf') format('opentype'); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela Deck'; src: url('/fonts/CanelaDeck-Regular-Trial.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela Deck'; src: url('/fonts/CanelaDeck-RegularItalic-Trial.otf') format('opentype'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela Deck'; src: url('/fonts/CanelaDeck-Medium-Trial.otf') format('opentype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela Deck'; src: url('/fonts/CanelaDeck-MediumItalic-Trial.otf') format('opentype'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela Deck'; src: url('/fonts/CanelaDeck-Bold-Trial.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela Deck'; src: url('/fonts/CanelaDeck-BoldItalic-Trial.otf') format('opentype'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela Deck'; src: url('/fonts/CanelaDeck-Black-Trial.otf') format('opentype'); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela Deck'; src: url('/fonts/CanelaDeck-BlackItalic-Trial.otf') format('opentype'); font-weight: 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela Condensed'; src: url('/fonts/CanelaCondensed-Thin-Trial.otf') format('opentype'); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela Condensed'; src: url('/fonts/CanelaCondensed-ThinItalic-Trial.otf') format('opentype'); font-weight: 100; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela Condensed'; src: url('/fonts/CanelaCondensed-Light-Trial.otf') format('opentype'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela Condensed'; src: url('/fonts/CanelaCondensed-LightItalic-Trial.otf') format('opentype'); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela Condensed'; src: url('/fonts/CanelaCondensed-Regular-Trial.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela Condensed'; src: url('/fonts/CanelaCondensed-RegularItalic-Trial.otf') format('opentype'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela Condensed'; src: url('/fonts/CanelaCondensed-Medium-Trial.otf') format('opentype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela Condensed'; src: url('/fonts/CanelaCondensed-MediumItalic-Trial.otf') format('opentype'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela Condensed'; src: url('/fonts/CanelaCondensed-Bold-Trial.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela Condensed'; src: url('/fonts/CanelaCondensed-BoldItalic-Trial.otf') format('opentype'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Canela Condensed'; src: url('/fonts/CanelaCondensed-Black-Trial.otf') format('opentype'); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Canela Condensed'; src: url('/fonts/CanelaCondensed-BlackItalic-Trial.otf') format('opentype'); font-weight: 900; font-style: italic; font-display: swap; }

:root {
  /* Typefaces */
  --typeface-display: 'The Seasons', Georgia, serif;
  --typeface-nympha: 'Nympha', Georgia, serif;
  --typeface-serif: 'Canela', Georgia, serif;
  --typeface-canela-text: 'Canela Text', Georgia, serif;
  --typeface-canela-deck: 'Canela Deck', Georgia, serif;
  --typeface-canela-condensed: 'Canela Condensed', Georgia, serif;
  --typeface-sans: 'Montserrat', system-ui, sans-serif;
  --typeface-classic: Georgia, serif;
  --typeface-mono: 'SF Mono', Consolas, Monaco, 'Courier New', monospace;

  /* Roles */
  --font-title: var(--typeface-display);
  --font-subheader: var(--typeface-display);
  --font-body: var(--typeface-serif);
  --font-number: var(--typeface-serif);
  --font-label: var(--typeface-serif);
  --font-ui: var(--typeface-serif);
  --font-page: var(--typeface-serif);
  --font-table-head: var(--typeface-serif);
  --font-mono: var(--typeface-mono);
  --font-button: var(--font-label);
  --font-field: var(--font-label);
}

/* Browsers don't let form controls inherit the page font, so any button or
 * field without its own font-family fell back to the browser's sans-serif.
 * :where() keeps specificity at zero, so rules that set a font still win. */
:where(button) { font-family: var(--font-button); }
:where(input, select, textarea, optgroup) { font-family: var(--font-field); }

/* Element defaults for every page (planner, vendor and public): headings are
 * The Seasons Regular, running text is Canela Light. :where() keeps
 * specificity at zero, so any page or component rule still wins - but these
 * are set on the elements themselves, so a p/span/label/td doesn't pick up a
 * heavier weight from its parent. Give such text its own weight when it
 * should be bolder. */
:where(body) { font-family: var(--font-ui); font-weight: 300; }
:where(h1, h2, h3, h4, h5, h6) { font-weight: normal; }
:where(h1) { font-family: var(--font-title); }
:where(h2, h3, h4, h5, h6) { font-family: var(--font-subheader); }
:where(p, label, span, td) { font-family: var(--font-body); font-weight: 300; }

/* Sidebar, card and table text defaults to Canela Light. :where() keeps
 * specificity at zero, so a rule that sets its own weight (e.g. a bold total)
 * still gets that real Canela weight. */
:where(.sidebar, table, [class*="card"]:not([class*="discard"])) {
  font-weight: 300;
}

/* Table column headers are Canela Bold. The label span inside a sortable
 * header is named too, since base.css sets every span to Light. Page rules
 * that restyle a th keep font-weight: 700 so this isn't undone. */
th,
th .header-label {
  font-family: var(--font-table-head);
  font-weight: 700;
}

/* Opt-in role classes for new markup */
.type-title { font-family: var(--font-title); }
.type-subheader { font-family: var(--font-subheader); }
.type-body { font-family: var(--font-body); }
.type-number { font-family: var(--font-number); }
.type-label { font-family: var(--font-label); }
.type-ui { font-family: var(--font-ui); }
.type-page { font-family: var(--font-page); }
.type-mono { font-family: var(--font-mono); }
