/* -----------------------------
   Reset (light, not destructive)
------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

/* -----------------------------
   Typography
------------------------------ */

:root {
  /* Brand fonts (loaded via Google Fonts in src/layouts/index.html) --
     the source of truth for typography site-wide, including inside
     fandry-* primitives (see fandry/base's tokens.css, which reads these
     with its own fallback for contexts where this page-level :root isn't
     present, e.g. a standalone Salesforce org). */
  --font-heading: 'Sora', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-code: 'Geist Mono', monospace;

  /* Fonts */
  --fd-font-sans: var(--font-body), system-ui, -apple-system,
    BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --fd-font-mono: var(--font-code), ui-monospace, SFMono-Regular, Menlo,
    monospace;

  /* Font sizes */
  --fd-font-size-xs: 0.75rem;
  --fd-font-size-sm: 0.875rem;
  --fd-font-size-md: 1rem;
  --fd-font-size-lg: 1.125rem;
  --fd-font-size-xl: 1.25rem;

  /* Line heights */
  --fd-line-height-tight: 1.25;
  --fd-line-height-normal: 1.5;
  --fd-line-height-loose: 1.75;

  /* Font weights */
  --fd-font-weight-medium: 500;
  --fd-font-weight-semibold: 600;
  --fd-font-weight-bold: 700;
}

body {
  margin: 0;
  font-family: var(--fd-font-sans);
  font-size: var(--fd-font-size-md);
  line-height: var(--fd-line-height-normal);
  color: var(--fd-color-text);
  background: var(--fd-color-background);
}

/* Headings */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.5em;
  font-family: var(--font-heading), var(--fd-font-sans);
  font-weight: var(--fd-font-weight-semibold);
  line-height: var(--fd-line-height-tight);
}

h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: var(--fd-font-size-xl);
}
h4 {
  font-size: var(--fd-font-size-lg);
}
h5 {
  font-size: var(--fd-font-size-md);
}
h6 {
  font-size: var(--fd-font-size-sm);
}

/* Text elements */

p {
  margin: 0 0 1em;
}

small {
  font-size: var(--fd-font-size-sm);
}

code {
  font-family: var(--fd-font-mono);
  font-size: 0.875em;
}

/* -----------------------------
   Spacing scale
------------------------------ */

:root {
  --fd-space-0: 0;
  --fd-space-1: 4px;
  --fd-space-2: 8px;
  --fd-space-3: 12px;
  --fd-space-4: 16px;
  --fd-space-5: 20px;
  --fd-space-6: 24px;
}

/* -----------------------------
   Color tokens (minimal v0.1)
------------------------------ */

:root {
  --fd-color-text: #111827;
  --fd-color-muted: #6b7280;

  --fd-color-background: #ffffff;
  --fd-color-surface: #ffffff;

  --fd-color-border: #d1d5db;

  --fd-color-primary: #2563eb;
  --fd-color-on-primary: #ffffff;

  --fd-color-focus: #2563eb;

  --fd-radius-sm: 4px;
  --fd-radius-md: 6px;
  --fd-radius-lg: 8px;

  --fd-ring-width: 2px;
}

/* -----------------------------
   Focus visibility (important)
------------------------------ */

:focus-visible {
  outline: 2px solid var(--fd-color-focus);
  outline-offset: 2px;
}

/* -----------------------------
   Layout patterns

   Fandry keeps its component surface small: fandry-* primitives handle UI,
   behavior, and accessibility, but they don't own application layout.
   Composing a page (spacing, grids, max-width) is ordinary CSS the host
   application already knows, so instead of fandry-container/fandry-grid
   LWCs, Fandry documents these as plain classes -- same spacing tokens as
   everything else, no component API to learn. Use directly in light-DOM
   markup alongside fandry-* elements, e.g.:

     <div class="fandry-container">
       <fandry-heading level="1">Orders</fandry-heading>
       <div class="fandry-grid">
         <fandry-card>...</fandry-card>
         <fandry-card>...</fandry-card>
       </div>
     </div>

   A vertical stack needs no named class at all -- it's just
   `display: flex; flex-direction: column; gap: var(--fd-space-4);`
   (or var(--fd-space-*) at whatever step the layout calls for) applied to
   an ordinary wrapper.
------------------------------ */

/* Centers and caps page content. max-width matches the 72rem already used
   site-wide (see siteHeader/siteFooter/componentsIndex/dashboardExample,
   etc.) so a consumer adopting this class lines up with the rest of the
   site instead of introducing a second, competing max-width. */
.fandry-container {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--fd-space-6);
}

/* Responsive card/metric grid with no breakpoints to configure -- columns
   form and collapse on their own as the container's width changes.
   minmax(280px, 1fr) is wide enough that a fandry-card's content (a
   heading, a couple of stat lines, a badge) doesn't wrap awkwardly at the
   narrowest column width auto-fit will produce. Gap matches the
   container's own inline padding for a consistent rhythm between a page's
   outer gutter and the gutters between its grid items. */
.fandry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--fd-space-6);
}
