/* Clínica Medical — Colors & Typography
   Based on observation of clinicamedical.com.co
   Primary palette: deep institutional navy + medical red accent + clean neutrals.
*/

/* ---------- Fonts ---------- */
/* Primary: Montserrat (Google Fonts fallback for the site's humanist sans)
   Secondary/body: Open Sans — widely used on SP Page Builder / Joomla healthcare templates.
   Flagged substitutions — see README.md "Type substitutions". */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&family=Open+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* ---------- Brand colors ---------- */
  /* Brand blue sampled from the actual logo (#184898).
     The scale is built around it so 700 == the canonical brand color. */
  --cm-blue-900: #0B2156;      /* deepest, text-on-light */
  --cm-blue-800: #103372;      /* hover state */
  --cm-blue-700: #184898;      /* PRIMARY — brand blue, sampled from logo */
  --cm-blue-600: #2358B0;      /* active state */
  --cm-blue-500: #5B7DC6;      /* muted */
  --cm-blue-300: #A6B7DD;
  --cm-blue-200: #C8D2EA;
  --cm-blue-100: #E2E8F5;      /* tint bg */
  --cm-blue-050: #F2F5FB;      /* page tint */

  /* Legacy aliases (kept for backwards compatibility — prefer --cm-blue-*) */
  --cm-navy-900: var(--cm-blue-900);
  --cm-navy-800: var(--cm-blue-800);
  --cm-navy-700: var(--cm-blue-700);
  --cm-navy-600: var(--cm-blue-600);
  --cm-navy-500: var(--cm-blue-500);
  --cm-navy-200: var(--cm-blue-200);
  --cm-navy-100: var(--cm-blue-100);
  --cm-navy-050: var(--cm-blue-050);

  /* Red is used very sparingly on the live site (alerts only).
     Keep available as a semantic accent, but the primary brand is blue-only. */
  --cm-red-700:  #A10E26;
  --cm-red-600:  #C8102E;      /* alert / error / sparing emphasis */
  --cm-red-500:  #DC2541;
  --cm-red-100:  #FDE7EB;

  --cm-teal-700: #0E7C8A;      /* secondary — medical/clinical teal */
  --cm-teal-600: #12A0B2;
  --cm-teal-100: #D5F2F6;

  /* ---------- Neutrals ---------- */
  --cm-white:    #FFFFFF;
  --cm-grey-050: #FAFAFA;
  --cm-grey-100: #F2F3F5;
  --cm-grey-200: #E5E7EB;
  --cm-grey-300: #CFD3DB;
  --cm-grey-400: #9AA0AE;
  --cm-grey-500: #6B7280;
  --cm-grey-600: #4B5563;
  --cm-grey-700: #374151;
  --cm-grey-800: #1F2937;
  --cm-grey-900: #111827;

  /* ---------- Semantic ---------- */
  --cm-success: #1E8E4E;
  --cm-warning: #E2A43A;
  --cm-error:   #C8102E;
  --cm-info:    #12A0B2;

  /* Versión para TEXTO de los semánticos: los de arriba sirven de relleno o punto,
     pero sobre blanco quedan bajo AA (success 4.2:1, warning 2.2:1). Estos pasan
     4.5:1 y son los que deben usarse en cualquier texto o etiqueta de estado. */
  --cm-success-ink: #146B3A;
  --cm-warning-ink: #8A5A00;
  --cm-error-ink:   #B00C27;

  /* ---------- Foreground / background tokens ---------- */
  --fg-1: var(--cm-blue-900);     /* primary text */
  --fg-2: var(--cm-grey-700);     /* secondary text */
  --fg-3: var(--cm-grey-500);     /* tertiary / meta */
  --fg-on-dark: var(--cm-white);
  --fg-link: var(--cm-blue-700);
  --fg-link-hover: var(--cm-blue-800);

  --bg-1: var(--cm-white);        /* page */
  --bg-2: var(--cm-grey-050);     /* subtle panel */
  --bg-3: var(--cm-blue-050);     /* brand tinted panel */
  --bg-dark: var(--cm-blue-700);  /* footer / hero overlay */

  --border-1: var(--cm-grey-200);
  --border-2: var(--cm-grey-300);
  --border-strong: var(--cm-blue-700);

  /* ---------- Spacing (8pt scale) ---------- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;

  /* ---------- Radii ---------- */
  --r-sm: 3px;
  --r-md: 6px;
  --r-lg: 10px;
  --r-xl: 18px;
  --r-pill: 999px;

  /* ---------- Shadows ---------- */
  --sh-1: 0 1px 2px rgba(15, 27, 61, 0.06), 0 1px 1px rgba(15, 27, 61, 0.04);
  --sh-2: 0 4px 10px rgba(15, 27, 61, 0.08), 0 2px 4px rgba(15, 27, 61, 0.04);
  --sh-3: 0 12px 28px rgba(15, 27, 61, 0.14), 0 4px 8px rgba(15, 27, 61, 0.06);
  --sh-blue-glow: 0 10px 30px rgba(24, 72, 152, 0.25);
  --sh-navy-glow: var(--sh-blue-glow); /* legacy alias */

  /* ---------- Type foundation ---------- */
  --font-display: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --font-body:    'Open Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* ---------- Motion ---------- */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-med:  240ms;
  --dur-slow: 420ms;
}

/* ---------- Semantic typography ---------- */
.cm-h1, h1.cm {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--fg-1);
}
.cm-h2, h2.cm {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--fg-1);
}
.cm-h3, h3.cm {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.25;
  color: var(--fg-1);
}
.cm-h4, h4.cm {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.3;
  color: var(--fg-1);
}
.cm-eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cm-blue-700);
}
.cm-lead {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.5;
  color: var(--fg-2);
}
.cm-body, p.cm {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-2);
}
.cm-small {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-3);
}
.cm-quote {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: 20px;
  line-height: 1.4;
  color: var(--fg-1);
  border-left: 3px solid var(--cm-blue-700);
  padding-left: 16px;
}
.cm-stat-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 64px;
  line-height: 1;
  color: var(--cm-blue-700);
  letter-spacing: -0.02em;
}
.cm-link {
  color: var(--fg-link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.cm-link:hover {
  color: var(--fg-link-hover);
  border-bottom-color: currentColor;
}

/* ---------- Logo display ---------- */
.cm-logo {
  height: 56px;
  width: auto;
  display: block;
}
.cm-logo-on-dark {
  /* Inverts the blue logo to render in white on dark backgrounds.
     The brightness/contrast pair forces the blue regions to white
     while keeping silhouette edges clean. */
  filter: brightness(0) invert(1);
}
