/* ==========================================================================
   Ventis Heating & Air Conditioning — global.css
   Design tokens, base reset, typography and layout primitives.
   Mobile-first. Load order: global.css -> components.css -> responsive.css
   WordPress: tokens map to GeneratePress Global Colors + Typography (see
   documentation/generateblocks-mapping.md).
   ========================================================================== */

/* ---------- Self-hosted fonts (variable WOFF2, latin subset) ---------- */
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin-wght.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  /* Brand palette (from master brief) */
  --ventis-navy: #0B2447;          /* Deep Navy: header text, headings, footer */
  --ventis-navy-dark: #07182E;     /* Dark Navy: dark sections, utility bar */
  --ventis-blue: #62B5E5;          /* Light Blue: icons, accents (on navy only for text) */
  --ventis-gold: #D4A64A;          /* Warm Gold: primary CTA buttons */
  --ventis-off-white: #F5F8FB;     /* alternating section background */
  --ventis-white: #FFFFFF;
  --ventis-charcoal: #273444;      /* paragraph text */

  /* Accessible support shades (derived; see documentation/design-system.md) */
  --ventis-gold-hover: #E2BA66;    /* button hover (navy text 8.3:1) */
  --ventis-gold-text: #8A6516;     /* gold-family text on light bg, 5.31:1 */
  --ventis-blue-text: #1F6E9C;     /* link/accent text on light bg, 5.57:1 */
  --ventis-blue-soft: #E6F3FB;     /* icon tiles, subtle fills */
  --ventis-muted: #4A5A6E;         /* secondary text on light bg, 7.05:1 */
  --ventis-muted-on-dark: #C9D6E3; /* secondary text on navy, 10.47:1 */
  --ventis-border: #D7E0EA;
  --ventis-border-strong: #8395A8; /* form field borders, 3:1+ non-text */
  --ventis-error: #B3261E;
  --ventis-success: #1E6B3A;
  --ventis-focus: #1F6E9C;

  /* Typography */
  --ventis-font-heading: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ventis-font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* Fluid type scale: 360px -> 1440px viewport */
  --ventis-fs-h1: clamp(2.125rem, 1.45rem + 2.9vw, 3.5rem);    /* 34 -> 56px (spec 48–60 desktop) */
  --ventis-fs-h2: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);      /* 28 -> 40px (spec 34–42 desktop) */
  --ventis-fs-h3: clamp(1.3125rem, 1.1rem + 0.7vw, 1.625rem);  /* 21 -> 26px (spec 24–28 desktop) */
  --ventis-fs-h4: clamp(1.125rem, 1.02rem + 0.35vw, 1.3125rem); /* 18 -> 21px (spec 20–22 desktop) */
  --ventis-fs-lead: clamp(1.1875rem, 1.13rem + 0.28vw, 1.375rem); /* 19 -> 22px */
  --ventis-fs-body: 1.125rem;   /* 18px — enlarged for 55+ readability */
  --ventis-fs-small: 1rem;      /* 16px — smallest text on the site */
  --ventis-fs-eyebrow: 0.9375rem;
  --ventis-lh-tight: 1.15;
  --ventis-lh-heading: 1.22;
  --ventis-lh-body: 1.7;

  /* Spacing scale (4px base) */
  --ventis-space-1: 0.25rem;
  --ventis-space-2: 0.5rem;
  --ventis-space-3: 0.75rem;
  --ventis-space-4: 1rem;
  --ventis-space-5: 1.5rem;
  --ventis-space-6: 2rem;
  --ventis-space-7: 2.5rem;
  --ventis-space-8: 3rem;
  --ventis-space-9: 4rem;
  --ventis-space-10: 5rem;
  --ventis-section-y: clamp(2.5rem, 1.35rem + 4.4vw, 5.75rem); /* mobile ~40, tablet ~60, desktop 80–92px */
  --ventis-gutter: clamp(1.125rem, 0.8rem + 1.6vw, 2rem);

  /* Layout */
  --ventis-container: 80rem;        /* 1280px content max (spec) */
  --ventis-container-wide: 90rem;   /* 1440px wide max (spec) */
  --ventis-container-narrow: 48rem; /* 768px reading width */
  --ventis-header-h: 4.75rem;
  --ventis-mobile-bar-h: 4.25rem;

  /* Radius, shadow, motion */
  --ventis-radius-sm: 6px;
  --ventis-radius: 8px;
  --ventis-radius-lg: 12px;
  --ventis-radius-pill: 999px;
  --ventis-shadow-sm: 0 1px 2px rgb(7 24 46 / 0.08), 0 1px 3px rgb(7 24 46 / 0.06);
  --ventis-shadow: 0 10px 30px -12px rgb(7 24 46 / 0.22);
  --ventis-shadow-lg: 0 24px 60px -20px rgb(7 24 46 / 0.35);
  --ventis-ease: cubic-bezier(.2, .7, .2, 1);
  --ventis-speed: 180ms;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--ventis-header-h) + 1rem); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: var(--ventis-font-body);
  font-size: var(--ventis-fs-body);
  line-height: var(--ventis-lh-body);
  color: var(--ventis-charcoal);
  background: var(--ventis-white);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
img { font-style: italic; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
p, li, dd, figcaption, blockquote { overflow-wrap: break-word; }
p { margin: 0 0 var(--ventis-space-4); max-width: 72ch; }
ul, ol { margin: 0 0 var(--ventis-space-4); padding-left: 1.25em; }
li + li { margin-top: var(--ventis-space-2); }
hr { border: 0; border-top: 1px solid var(--ventis-border); margin: var(--ventis-space-6) 0; }
table { border-collapse: collapse; width: 100%; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ventis-font-heading);
  color: var(--ventis-navy);
  line-height: var(--ventis-lh-heading);
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0 0 var(--ventis-space-4);
  text-wrap: balance;
}
h1 { font-size: var(--ventis-fs-h1); line-height: var(--ventis-lh-tight); letter-spacing: -0.025em; }
h2 { font-size: var(--ventis-fs-h2); }
h3 { font-size: var(--ventis-fs-h3); font-weight: 700; }
h4 { font-size: var(--ventis-fs-h4); font-weight: 700; letter-spacing: 0; }
.ventis-lead { font-size: var(--ventis-fs-lead); line-height: 1.6; color: var(--ventis-charcoal); }
.ventis-small { font-size: var(--ventis-fs-small); }
strong, b { font-weight: 650; color: inherit; }

a { color: var(--ventis-blue-text); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--ventis-navy); text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--ventis-focus);
  outline-offset: 3px;
  border-radius: 4px;
}
.ventis-on-dark :focus-visible, .ventis-section--dark :focus-visible { outline-color: var(--ventis-gold); }

::selection { background: var(--ventis-gold); color: var(--ventis-navy-dark); }

/* ---------- Accessibility helpers ---------- */
.ventis-sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ventis-skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 1000;
  background: var(--ventis-gold); color: var(--ventis-navy-dark);
  padding: 0.75rem 1.25rem; border-radius: var(--ventis-radius-sm); font-weight: 700;
  text-decoration: none;
}
.ventis-skip-link:focus { top: 1rem; }

/* ---------- Layout primitives ---------- */
.ventis-container { width: 100%; max-width: var(--ventis-container); margin-inline: auto; padding-inline: var(--ventis-gutter); }
.ventis-container--wide { max-width: var(--ventis-container-wide); }
.ventis-container--narrow { max-width: var(--ventis-container-narrow); }

.ventis-section { padding-block: var(--ventis-section-y); position: relative; }
.ventis-section--tight { padding-block: calc(var(--ventis-section-y) * 0.6); }
.ventis-section--alt { background: var(--ventis-off-white); }
.ventis-section--dark { background: var(--ventis-navy-dark); color: var(--ventis-muted-on-dark); }
.ventis-section--navy { background: var(--ventis-navy); color: var(--ventis-muted-on-dark); }
.ventis-section--dark h2, .ventis-section--dark h3, .ventis-section--dark h4,
.ventis-section--navy h2, .ventis-section--navy h3, .ventis-section--navy h4 { color: var(--ventis-white); }
.ventis-section--dark a:not(.ventis-btn), .ventis-section--navy a:not(.ventis-btn) { color: var(--ventis-blue); }
.ventis-section--dark a:not(.ventis-btn):hover, .ventis-section--navy a:not(.ventis-btn):hover { color: var(--ventis-white); }

.ventis-section__header { max-width: 46rem; margin-bottom: var(--ventis-space-8); }
.ventis-section__header--center { margin-inline: auto; text-align: center; }
.ventis-section__header--center p { margin-inline: auto; }
.ventis-section__header p:last-child { margin-bottom: 0; }

.ventis-eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--ventis-font-heading); font-size: var(--ventis-fs-eyebrow);
  font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ventis-gold-text); margin: 0 0 var(--ventis-space-3);
}
.ventis-eyebrow::before { content: ""; width: 1.75rem; height: 2px; background: currentColor; border-radius: 2px; }
.ventis-section--dark .ventis-eyebrow, .ventis-section--navy .ventis-eyebrow, .ventis-on-dark .ventis-eyebrow { color: var(--ventis-gold); }

/* Responsive grid (mobile = 1 column; columns added in responsive.css) */
.ventis-grid { display: grid; gap: var(--ventis-space-5); grid-template-columns: minmax(0, 1fr); }
.ventis-grid--gap-lg { gap: var(--ventis-space-6); }
.ventis-split { display: grid; gap: var(--ventis-space-7); grid-template-columns: minmax(0, 1fr); align-items: center; }

.ventis-stack > * + * { margin-top: var(--ventis-space-4); }
.ventis-flow > :last-child { margin-bottom: 0; }
.ventis-center { text-align: center; }
.ventis-mt-0 { margin-top: 0 !important; }
.ventis-mb-0 { margin-bottom: 0 !important; }
.ventis-mt-6 { margin-top: var(--ventis-space-6); }
