/* ==========================================================================
   MEDIGRAM HOSPITAL – DESIGN SYSTEM
   Logo palette: blue #177ED5 + parrot green #84C603 + emergency red
   Green is used for fills and accents; blue is used for readable text.
   ========================================================================== */

:root {
  /* ---- BLUE family: logo blue and supporting shades ---- */
  --navy-950: #062746;
  --navy-900: #0B3A66;
  --navy-800: #0F5A9C;
  --navy-700: #177ED5;
  --navy-600: #3C91DB;
  --navy-500: #68A9E5;
  --blue-200: #C7E1F7;
  --blue-100: #E0EFFB;
  --blue-50: #F2F8FC;

  /* ---- GREEN family: logo parrot green ---- */
  --teal-700: #5F9000;
  --teal-600: #84C603;
  --teal-500: #A0D63B;
  --mint: #B6E36B;
  --teal-100: #EAF5D2;
  --teal-50: #F5FAEB;

  /* ---- Emergency red ---- */
  --red-700: #B91C1C;
  --red-600: #E02424;
  --red-50: #FEF2F2;

  /* ---- Neutral family ---- */
  --slate-900: #0F172A;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748B;
  --slate-400: #94A3B8;
  --slate-300: #CBD5E1;
  --slate-200: #E2E8F0;
  --slate-100: #F1F5F9;
  --slate-50: #F8FAFC;
  --white: #FFFFFF;

  /* ---- Semantic aliases ---- */
  --primary-color: var(--teal-600); /* green backgrounds, icons and accents */
  --primary-text: var(--navy-900);  /* readable text on light backgrounds */
  --primary-dark: var(--teal-700);
  --primary-light: var(--teal-100);
  --primary-bg: var(--teal-50);
  --link-color: var(--navy-700);
  --link-hover: var(--navy-900);
  --navy-blue: var(--navy-700);
  --navy-dark: var(--navy-900);
  --accent-color: var(--red-600);
  --accent-dark: var(--red-700);
  --accent-light: var(--red-50);

  --heading-color: var(--navy-900);
  --text-color: var(--slate-700);
  --text-secondary: var(--slate-600);
  --muted-color: var(--slate-500);
  --border-color: var(--slate-200);
  --border-light: var(--slate-100);
  --surface: var(--white);
  --surface-alt: var(--blue-50);
  --surface-dark: var(--navy-900);

  /* ---- Typography ---- */
  --font-heading: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* ---- Radius ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* ---- Shadows ---- */
  --shadow-sm: 0 1px 2px rgba(11, 58, 102, 0.06);
  --shadow-md: 0 6px 18px -6px rgba(11, 58, 102, 0.14);
  --shadow-lg: 0 18px 40px -14px rgba(11, 58, 102, 0.25);
  --shadow-xl: 0 30px 60px -20px rgba(11, 58, 102, 0.35);

  /* ---- Layout ---- */
  --container: 1240px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --header-h: 76px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 180ms var(--ease);
  --t: 320ms var(--ease);
}

/* ==========================================================================
   RESET
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-color);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

img, svg, video, iframe { max-width: 100%; display: block; }
img { height: auto; }

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--link-hover); }

ul[class], ol[class] { list-style: none; margin: 0; padding: 0; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

table { border-collapse: collapse; width: 100%; }

[hidden] { display: none !important; }

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--heading-color);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 0.75rem;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
h3 { font-size: clamp(1.1rem, 1.6vw, 1.3rem); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1rem; }
strong, b { font-weight: 600; color: inherit; }

::selection { background: var(--mint); color: var(--navy-900); }

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-main { display: block; }

.section { padding-block: var(--section-y); position: relative; }
.section-white { background: var(--white); }
.section-alt { background: var(--surface-alt); }

.section-header {
  max-width: 720px;
  margin: 0 auto clamp(2rem, 4vw, 3rem);
  text-align: center;
}
.section-header.text-left { margin-left: 0; text-align: left; }

/* Eyebrow: blue text with green decorative lines */
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy-800);
  margin-bottom: 0.85rem;
}
.section-badge .bi { display: none; }
.section-badge::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--teal-600);
}
.section-header:not(.text-left) .section-badge::after {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--teal-600);
}

.section-badge.badge-emergency,
.section-badge.badge-success {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.08em;
}
.section-badge.badge-emergency { background: rgba(224, 36, 36, 0.12); color: var(--red-700); }
.section-badge.badge-success { background: var(--teal-100); color: var(--navy-900); }

.section-badge.badge-emergency::before,
.section-badge.badge-success::before,
.section-badge.badge-emergency::after,
.section-badge.badge-success::after { display: none; }
.section-badge.badge-emergency .bi,
.section-badge.badge-success .bi { display: inline-block; }

.section-title { margin-bottom: 0.85rem; }
.section-subtitle {
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  color: var(--muted-color);
  margin-bottom: 0;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  --btn-bg: var(--navy-800);
  --btn-fg: #fff;
  --btn-bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.8rem 1.4rem;
  min-height: 46px;
  border: 1.5px solid var(--btn-bd);
  border-radius: var(--radius-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.btn:hover { color: var(--btn-fg); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn .bi { font-size: 1.05em; }

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 700ms var(--ease);
}
.btn:hover::after { transform: translateX(120%); }

.btn-primary { --btn-bg: var(--navy-800); }
.btn-primary:hover { --btn-bg: var(--navy-900); }

.btn-teal { --btn-bg: var(--teal-600); --btn-fg: var(--navy-900); }
.btn-teal:hover { --btn-bg: var(--teal-500); --btn-fg: var(--navy-900); }

.btn-accent { --btn-bg: var(--red-600); }
.btn-accent:hover {
  --btn-bg: var(--red-700);
  box-shadow: 0 10px 24px -8px rgba(224, 36, 36, 0.55);
}

.btn-white { --btn-bg: #fff; --btn-fg: var(--navy-800); }
.btn-white:hover { --btn-fg: var(--navy-900); --btn-bg: #eef6fd; }
.btn-white::after { background: linear-gradient(110deg, transparent 30%, rgba(132,198,3,0.25) 50%, transparent 70%); }

.btn-outline { --btn-bg: transparent; --btn-fg: var(--navy-800); --btn-bd: var(--slate-300); }
.btn-outline:hover { --btn-bg: var(--navy-800); --btn-fg: #fff; --btn-bd: var(--navy-800); }

.btn-outline-white { --btn-bg: transparent; --btn-fg: #fff; --btn-bd: rgba(255,255,255,0.5); }
.btn-outline-white:hover { --btn-bg: #fff; --btn-fg: var(--navy-800); --btn-bd: #fff; }

.btn-sm { padding: 0.55rem 1rem; min-height: 38px; font-size: 0.875rem; }
.btn-lg { padding: 0.95rem 1.7rem; min-height: 52px; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-pulse { animation: btnPulse 2.2s infinite; }
@keyframes btnPulse {
  0% { box-shadow: 0 0 0 0 rgba(224, 36, 36, 0.55); }
  70% { box-shadow: 0 0 0 14px rgba(224, 36, 36, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 36, 36, 0); }
}

/* ==========================================================================
   CARDS
   ========================================================================== */
.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  color: var(--text-color);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  min-width: 0;
}
a.card:hover, .card.is-hoverable:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(132, 198, 3, 0.45);
  color: var(--text-color);
}
.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--teal-50);
  color: var(--navy-800);
  font-size: 1.4rem;
  margin-bottom: 1.1rem;
  transition: background var(--t), color var(--t), transform var(--t);
}
a.card:hover .card-icon { background: var(--primary-color); color: var(--navy-900); transform: rotate(-6deg) scale(1.05); }
.card-title { font-size: 1.12rem; margin-bottom: 0.5rem; color: var(--heading-color); }
.card-title a { color: inherit; }
.card-title a:hover { color: var(--navy-700); }
.card-text { font-size: 0.94rem; color: var(--muted-color); margin-bottom: 0; }

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.form-label { font-size: 0.86rem; font-weight: 600; color: var(--heading-color); }
.form-control,
.form-select {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #fff;
  color: var(--slate-900);
  font-size: 0.95rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  appearance: none;
  -webkit-appearance: none;
}
.form-select {
  padding-right: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 14px;
}
textarea.form-control { min-height: 110px; resize: vertical; }
.form-control::placeholder { color: var(--slate-400); }
.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--navy-700);
  box-shadow: 0 0 0 4px rgba(23, 126, 213, 0.18);
}

/* ==========================================================================
   GRID & FLEX UTILITIES
   ========================================================================== */
.grid { display: grid; gap: clamp(1.25rem, 2.5vw, 1.75rem); }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.flex { display: flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.text-center { text-align: center; }
.text-left { text-align: left; }
/* Keep this utility blue: green should not be used for small text on white. */
.text-primary { color: var(--primary-text) !important; }
.text-accent { color: var(--accent-color) !important; }
.text-muted { color: var(--muted-color) !important; }

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

/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
  color: var(--muted-color);
  margin-bottom: 1rem;
}
.breadcrumbs a { color: var(--muted-color); font-weight: 500; }
.breadcrumbs a:hover { color: var(--navy-700); }
.breadcrumbs span { opacity: 0.6; }
.breadcrumbs .current { opacity: 1; color: var(--heading-color); font-weight: 600; }

/* ==========================================================================
   ENTRY CONTENT (WordPress editor output)
   ========================================================================== */
.entry-content { color: var(--text-color); overflow-wrap: anywhere; }
.entry-content > * + * { margin-top: 1rem; }
.entry-content h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); margin-top: 2.25rem; }
.entry-content h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); margin-top: 1.75rem; }
.entry-content ul, .entry-content ol { padding-left: 1.3rem; margin: 0 0 1rem; }
.entry-content li { margin-bottom: 0.45rem; }
.entry-content ul li::marker { color: var(--teal-700); }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content img { border-radius: var(--radius-md); }
.entry-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--primary-color);
  background: var(--teal-50);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--navy-800);
}
.entry-content table { margin: 1.5rem 0; font-size: 0.95rem; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--border-color); padding: 0.65rem 0.85rem; text-align: left; }
.entry-content th { background: var(--surface-alt); color: var(--heading-color); }
.entry-content iframe { width: 100%; border-radius: var(--radius-md); }
.alignwide, .alignfull { max-width: 100%; }
.aligncenter { margin-inline: auto; }
.wp-caption-text, figcaption { font-size: 0.85rem; color: var(--muted-color); }

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 9999;
  padding: 0.75rem 1.1rem;
  background: var(--navy-900);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 600;
}
.skip-link:focus { top: 1rem; color: #fff; }

:focus-visible {
  outline: 3px solid var(--navy-700);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
