/* ============================================================
   FLOW3D 2026 — TYPOGRAPHY
   /assets/css/typography.css
   
   Depends on: tokens.css
   
   Sections:
   1.  Base Body
   2.  Headings — Desktop
   3.  Headings — Mobile
   4.  Body Text & Paragraphs
   5.  Small Text & Utility
   6.  Links
   7.  Lists
   8.  Quote Blocks
   9.  Elementor Typography Overrides
   ============================================================ */


/* ------------------------------------------------------------
   1. BASE BODY
   ------------------------------------------------------------ */

body {
  font-family: var(--fs-font);
  font-size: var(--fs-font-size-base);
  font-weight: var(--fs-font-weight-regular);
  line-height: var(--fs-line-height-base);
  color: var(--fs-color-text);
  background-color: var(--fs-color-page-bg);
}


/* ------------------------------------------------------------
   2. HEADINGS — DESKTOP
   ------------------------------------------------------------ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--fs-font);
  color: var(--fs-color-text);
  margin-top: 0;
  margin-bottom: var(--fs-space-sm);
}

h1 {
  font-size: var(--fs-font-size-h1);
  line-height: var(--fs-line-height-h1);
  font-weight: var(--fs-font-weight-bold);
}

h2 {
  font-size: var(--fs-font-size-h2);
  line-height: var(--fs-line-height-h2);
  font-weight: var(--fs-font-weight-bold);
}

h3 {
  font-size: var(--fs-font-size-h3);
  line-height: var(--fs-line-height-h3);
  font-weight: var(--fs-font-weight-semibold);
}

h4 {
  font-size: var(--fs-font-size-h4);
  line-height: var(--fs-line-height-h4);
  font-weight: var(--fs-font-weight-semibold);
}

h5 {
  font-size: var(--fs-font-size-h5);
  line-height: var(--fs-line-height-h5);
  font-weight: var(--fs-font-weight-semibold);
}

h6 {
  font-size: var(--fs-font-size-h6);
  line-height: var(--fs-line-height-h6);
  font-weight: var(--fs-font-weight-semibold);
}


/* ------------------------------------------------------------
   3. HEADINGS — MOBILE
   H4–H6, body, and small stay the same as desktop.

   Mobile font-size tokens (--fs-font-size-h1/h2/h3) are
   overridden at the 768px breakpoint in tokens.css, so
   heading elements here automatically pick up mobile sizes
   via the token values — no duplicate media query needed.
   ------------------------------------------------------------ */


/* ------------------------------------------------------------
   4. BODY TEXT & PARAGRAPHS
   ------------------------------------------------------------ */

p {
  font-family: var(--fs-font);
  font-size: var(--fs-font-size-base);
  font-weight: var(--fs-font-weight-regular);
  line-height: var(--fs-line-height-base);
  color: var(--fs-color-text);
  margin-top: 0;
  margin-bottom: var(--fs-space-sm);
}

p:last-child {
  margin-bottom: 0;
}


/* ------------------------------------------------------------
   5. SMALL TEXT & UTILITY
   ------------------------------------------------------------ */

small,
.fs-text-sm {
  font-family: var(--fs-font);
  font-size: var(--fs-font-size-sm);
  line-height: var(--fs-line-height-sm);
  font-weight: var(--fs-font-weight-regular);
  color: var(--fs-color-text);
}

.fs-text-muted {
  color: var(--fs-color-text-muted);
}

caption,
figcaption {
  font-size: var(--fs-font-size-sm);
  line-height: var(--fs-line-height-sm);
  color: var(--fs-color-text-muted);
  margin-top: var(--fs-space-xs);
}


/* ------------------------------------------------------------
   6. LINKS
   ------------------------------------------------------------ */

a {
  color: var(--fs-color-accent);
  text-decoration: none;
  transition: color var(--fs-transition-base);
}

a:hover {
  color: var(--fs-color-primary);
}

a:focus-visible {
  outline: 2px solid var(--fs-color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}


/* ------------------------------------------------------------
   7. LISTS
   ------------------------------------------------------------ */

ul, ol {
  padding-left: var(--fs-space-md);
  margin-top: 0;
  margin-bottom: var(--fs-space-sm);
}

li {
  font-family: var(--fs-font);
  font-size: var(--fs-font-size-base);
  line-height: var(--fs-line-height-base);
  color: var(--fs-color-text);
  margin-bottom: var(--fs-space-xs);
}

li:last-child {
  margin-bottom: 0;
}

/* Accent-colored markers */
ul li::marker {
  color: var(--fs-color-accent);
  font-size: 1.2em;
}

ol li::marker {
  color: var(--fs-color-accent);
  font-weight: var(--fs-font-weight-semibold);
}

/* Nested lists */
ul ul,
ol ol,
ul ol,
ol ul {
  margin-top: var(--fs-space-xs);
  margin-bottom: 0;
}


/* ------------------------------------------------------------
   8. QUOTE BLOCKS
   ------------------------------------------------------------ */

blockquote {
  border-left: 4px solid var(--fs-color-border);
  background: #f5f5f5;
  padding: var(--fs-space-md);
  margin: var(--fs-space-md) 0;
  border-radius: var(--fs-radius-sm);
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--fs-color-text);
}

blockquote p {
  margin-bottom: 0;
  font-style: italic;
}

blockquote cite {
  display: block;
  margin-top: var(--fs-space-sm);
  font-size: var(--fs-font-size-sm);
  font-style: normal;
  color: var(--fs-color-neutral-5);
}


/* ------------------------------------------------------------
   9. ELEMENTOR TYPOGRAPHY OVERRIDES
   Removes !important font-family declarations that were in
   style.css, replacing them with lower-specificity rules that
   work with the Elementor token bridge in tokens.css.
   These selectors match Elementor's widget output structure.
   ------------------------------------------------------------ */

.elementor-widget-heading .elementor-heading-title,
.elementor-widget-text-editor,
.elementor-widget-text-editor p,
.elementor-widget-text-editor li {
  font-family: var(--fs-font);
}

.elementor-widget-heading .elementor-heading-title {
  color: var(--fs-color-text);
}

/* Ensure Elementor's inline font-family doesn't override tokens */
.elementor *,
.elementor-widget * {
  font-family: var(--fs-font);
}
