/* =============================================================================
   MEDINTERACTIV — Design System
   CSS Custom Properties + Reset + Base Styles
   Font loaded via <link> in HTML head for performance (no @import blocking)
   ============================================================================= */

:root {
  /* ---- Brand Colors (DO NOT CHANGE) ---- */
  --color-brand-primary: #1B3477;
  --color-brand-secondary: #BBBBBF;

  /* ---- Extended Palette ---- */
  --color-black: #000000;
  --color-off-black: #140700;
  --color-white: #FFFFFF;
  --color-off-white: #F8F8F7;
  --color-dusty-rose: #EAC5CC;
  --color-accent-orange: #FF7600;

  /* ---- Neutral Scale ---- */
  --color-gray-900: #1D1D1D;
  --color-gray-700: #4C4C4C;
  --color-gray-600: #5E5855;
  --color-gray-500: #7A7A7A;
  --color-gray-300: #CCCCCC;
  --color-gray-200: #D0D0C8;
  --color-gray-100: #F7F7F7;

  /* ---- Typography ---- */
  --font-primary: 'Merriweather Sans', 'Helvetica Neue', Arial, sans-serif;

  /* Font Sizes */
  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.875rem;  /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg:   1.5rem;    /* 24px */
  --text-xl:   2.25rem;   /* 36px */
  --text-2xl:  3rem;      /* 48px */
  --text-3xl:  4.5rem;    /* 72px */

  /* Font Weights */
  --weight-light:     300;
  --weight-regular:   400;
  --weight-medium:    500;
  --weight-semibold:  600;
  --weight-bold:      700;
  --weight-extrabold: 800;

  /* Line Heights */
  --leading-none:    1.0;
  --leading-tight:   1.05;
  --leading-snug:    1.15;
  --leading-normal:  1.5;
  --leading-relaxed: 1.65;

  /* ---- Spacing (8px base) ---- */
  --space-1:  0.25rem;  /* 4px  */
  --space-2:  0.5rem;   /* 8px  */
  --space-4:  1rem;     /* 16px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */

  /* ---- Border Radius ---- */
  --radius-sm: 0.5rem;  /* 8px  */
  --radius-md: 1rem;    /* 16px */
  --radius-lg: 1.5rem;  /* 24px */

  /* ---- Shadows ---- */
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.05);
  --shadow-lg:  0 10px 30px rgba(0, 0, 0, 0.10), 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-xl:  0 20px 50px rgba(0, 0, 0, 0.14), 0 8px 20px rgba(0, 0, 0, 0.08);

  /* ---- Transitions ---- */
  --ease-primary:       cubic-bezier(0.5, 0.3, 0, 1);
  --transition-fast:    200ms var(--ease-primary);
  --transition-normal:  400ms var(--ease-primary);
  --transition-slow:    800ms var(--ease-primary);

  /* ---- Z-Index Scale ---- */
  --z-below:    -1;
  --z-base:      0;
  --z-raised:   10;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;

  /* ---- Layout ---- */
  --container-max:     1280px;
  --container-padding: var(--space-6);
  --nav-height:        4.5rem;
}

/* =============================================================================
   MODERN CSS RESET
   ============================================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-gray-900);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

address {
  font-style: normal;
}

/* =============================================================================
   BASE TYPOGRAPHY
   ============================================================================= */

h1 {
  font-weight: var(--weight-regular);
  line-height: var(--leading-none);
}

h2 {
  font-weight: var(--weight-regular);
  line-height: var(--leading-tight);
}

h3 {
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
}

h4 {
  font-weight: var(--weight-medium);
  line-height: 1.25;
}

p {
  line-height: var(--leading-relaxed);
}

/* =============================================================================
   LAYOUT UTILITIES
   ============================================================================= */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

/* Skip link (keyboard accessibility) */
.skip-link {
  position: absolute;
  top: -200%;
  left: var(--space-4);
  z-index: 999;
  padding: var(--space-2) var(--space-6);
  background: var(--color-brand-primary);
  color: var(--color-white);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Global focus style — double-ring: white closest, navy outer (passes Non-text Contrast 3:1 on any bg) */
:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
  border-radius: 2px;
  box-shadow: 0 0 0 4px var(--color-brand-primary);
}

/* =============================================================================
   BUTTON BASE STYLES
   ============================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.875rem var(--space-8);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: 0.03em;
  line-height: 1;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Primary: orange fill, dark text for WCAG contrast (#1D1D1D on #FF7600 = 6.07:1) */
.btn-primary {
  background-color: var(--color-accent-orange);
  color: var(--color-gray-900);
  border-color: var(--color-accent-orange);
}

.btn-primary:hover {
  background-color: #e06800;
  border-color: #e06800;
  color: var(--color-gray-900);
}

/* Outline white: for dark backgrounds */
.btn-outline {
  background-color: transparent;
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.6);
}

.btn-outline:hover {
  background-color: var(--color-white);
  color: var(--color-brand-primary);
  border-color: var(--color-white);
}

/* Outline dark: for light backgrounds */
.btn-outline-dark {
  background-color: transparent;
  color: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
}

.btn-outline-dark:hover {
  background-color: var(--color-brand-primary);
  color: var(--color-white);
}

/* =============================================================================
   SECTION SHARED STYLES
   ============================================================================= */

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

/* Default eyebrow on light backgrounds: navy (#1B3477 on white = 15.8:1) */
.section-eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-brand-primary);
  margin-bottom: var(--space-4);
}

.section-heading {
  font-size: clamp(2rem, 4vw, var(--text-2xl));
  color: var(--color-brand-primary);
  margin-bottom: var(--space-4);
}

.section-subheading {
  font-size: var(--text-base);
  color: var(--color-gray-600);
  max-width: 52ch;
  margin-inline: auto;
  line-height: var(--leading-relaxed);
}

/* On dark backgrounds: orange (#FF7600 on #1D1D1D = 6.07:1) */
.section-eyebrow--light {
  color: var(--color-accent-orange);
}

.section-heading--light {
  color: var(--color-white);
}

/* =============================================================================
   SCROLL REVEAL ANIMATION CLASSES
   Applied by IntersectionObserver in main.js
   ============================================================================= */

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--transition-slow),
    transform var(--transition-slow);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}
