/* site.css — the Nourish base layer.
 *
 * Loaded by every page AFTER the Tailwind Play CDN and /js/tailwind.config.js.
 * Two jobs:
 *   1. Pull in the self-hosted webfonts (real font files, font-display: swap,
 *      no synthesized italic or bold - Brand Guide L578-580).
 *   2. Set the handful of global rules the Brand Guide asks for that are
 *      easier as CSS than as utilities on 11 pages.
 */

/* ---- 1. Webfonts ---------------------------------------------------- */
@import url('/css/fonts.css');

/* ---- 2. Base -------------------------------------------------------- */
:root {
  --color-brand: #5E3B8C;
  --color-brand-hover: #482A6B;
  --color-ink: #333333;
  --color-cream: #F7F3ED;
  --color-sage: #A8C8BE;
  --color-teal: #7FB7B5;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: Montserrat, system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-ink);
  /* Stop iOS Safari from inflating text in landscape. */
  -webkit-font-smoothing: antialiased;
}

/* Brand Guide L261: Body / FAQ / forms - Montserrat 400, 17px desktop / 16px
 * mobile, line-height 1.6. */
@media (min-width: 768px) {
  body { font-size: 17px; }
}

/* Brand Guide L270: Editorial accent - Playfair Display Italic 500, 28px
 * desktop / 24px mobile, line-height 1.3. For short phrases only. */
.font-accent {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  line-height: 1.3;
}

/* Brand Guide L481: form messages must state what happens next and
 * whether a request is still awaiting approval. The live form regions
 * carry .form-status / [role=status]; give them a visible, consistent
 * treatment so a failed submission is never silent. */
[role='status'],
.form-status {
  min-height: 1.25rem;
}

/* Brand Guide L475: "Provide a visible keyboard focus ring, such as a
 * 3 px purple outline with a 3 px white offset." Tailwind's ring utilities
 * cover most cases, but links inside prose and any element that suppresses
 * the default outline need this to guarantee the ring is never missing. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Respect a reduced-motion preference - the nav drawer and any scroll
 * behaviour should not animate for people who asked us not to. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---- 3. Brand Guide global rules that are easier as CSS ---------------- */

/* A17 — Container: 1200px max, 24px desktop / 20px mobile gutters.
 * The Tailwind Play CDN injects its own `.container` max-widths after this
 * file loads, so the override has to win on specificity. */
.container {
  max-width: 1200px !important;
  padding-left: 20px;
  padding-right: 20px;
}
@media (min-width: 768px) {
  .container {
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* A14 — Focus: a 3px purple outline with a 3px offset, always visible on
 * keyboard navigation. The utility classes on individual elements use
 * `focus:outline-none`, so the rule is declared with !important to make
 * sure a keyboard user is never left without a visible focus ring. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-brand) !important;
  outline-offset: 3px !important;
  border-radius: 4px;
}
