/* ── EMS Hero: photo treatment ──
   Mirrors .cm-hero--with-photo (cm-home.css ~line 912) for division-hub
   symmetry; navy #0a1628 veil keeps the EMS identity color.
   Layering: photo z-0 (+ ::after veil) -> grid z-1 -> .hero__inner z-2
   (z-index:2 already set in styles.css). Section keeps class .hero so the
   scrollspy darkSelectors ('.hero, ...') and styles.css typography apply. */
.hero--photo {
  min-height: 90vh;                 /* match CM hub; base .hero is 100vh */
  background-color: #0a1628;        /* fallback while the photo loads */
}
.hero--photo .hero__photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.hero--photo .hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
/* Legibility veil — same 135deg ramp structure as CM's overlay, navy-tinted;
   center stop .84 (was .78) — the 2026-06-10 2560px re-render is busier behind
   the centered copy (harness fan reaches further left), so the veil darkens a notch */
.hero--photo .hero__photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(10, 22, 40, 0.93) 0%,
    rgba(10, 22, 40, 0.84) 55%,
    rgba(26, 63, 66, 0.62) 100%);
}
/* Precision grid over the photo (same pattern as .cm-hero__grid) */
.hero--photo .hero__grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
/* Tablet/phone: no room beside the subject — switch to a stronger uniform
   darken (same move as .gpw-hero__overlay at 900px, corporate-home.css ~704) */
@media (max-width: 900px) {
  .hero--photo .hero__photo::after {
    background: linear-gradient(rgba(10, 22, 40, 0.88), rgba(10, 22, 40, 0.93));
  }
}

/* ── Hero Centered Layout ── */
.hero__inner--centered {
  grid-template-columns: 1fr !important;
  text-align: center;
  justify-items: center;
}
.hero__content--centered {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero__content--centered .btn-group { justify-content: center; }
.hero__content--centered .hero__trust {
  justify-content: center;
  /* The 3-item row is slightly wider than the 720px content column; size it
     to its content so it stays on one line at desktop instead of wrapping
     2+1. max-width keeps flex-wrap as the fallback on narrow viewports. */
  width: max-content;
  max-width: calc(100vw - 2 * var(--space-xl));
}
.hero__content--centered .hero__label {
  justify-content: center;
  text-align: center;
}

/* ── Hero Mobile: centered layout fixes ── */
@media (max-width: 768px) {
  /* Fix 1: Header alignment (global styles handle logo size + header height) */
  .header__inner {
    align-items: center;
  }

  /* Quality carousel dots — mobile only */
  .quality-dots {
    display: none;
  }
  .quality-dots {
    justify-content: center;
    gap: 8px;
    margin-top: var(--space-lg);
  }
  .quality-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--light-gray);
    transition: background 0.25s ease, transform 0.25s ease;
  }
  .quality-dot.is-active {
    background: var(--coral);
    transform: scale(1.3);
  }
  @media (max-width: 768px) {
    .quality-dots { display: flex; }
  }

  /* Fix 3: Hide breadcrumb on mobile */
  .hero__inner--centered .breadcrumb {
    display: none !important;
  }

  /* Fix 4: Center the label line */
  .hero__content--centered .hero__label {
    justify-content: center;
    text-align: center;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
  }
  .hero__content--centered .hero__label::before {
    display: none;
  }

  /* Fix 5: Trust items — centered, no bullets on mobile */
  .hero__content--centered .hero__trust {
    justify-content: center;
    text-align: center;
    flex-direction: column;
    align-items: center;
  }
  .hero__content--centered .hero__trust-item::before {
    display: none;
  }

  /* General hero mobile refinements */
  .hero__content--centered {
    max-width: 100%;
    padding: 0 var(--space-md);
  }
  .hero__content--centered h1 {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
  }
  .hero__content--centered .hero__tagline {
    font-size: var(--text-lg);
    white-space: normal;
  }
  .hero__content--centered .hero__subtitle {
    font-size: var(--text-sm);
  }
}

/* ── Stats Bar ── */
.ems-stats-bar {
  background: var(--white);
  border-bottom: 1px solid var(--light-gray);
  padding: var(--space-xl) 0;
}
.ems-stats-bar__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}
.ems-stat-card {
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  transition: border-color var(--transition-base);
}
.ems-stat-card:hover { border-color: var(--teal); }
.ems-stat-card__number {
  display: block;
  font-size: clamp(1.8rem, 1.4rem + 1.5vw, 2.4rem);
  font-weight: 900;
  color: var(--teal);
  line-height: 1.1;
  margin-bottom: var(--space-xs);
}
.ems-stat-card__label {
  display: block;
  font-size: var(--text-sm);
  color: var(--mid-gray);
  line-height: 1.4;
}

@media (max-width: 768px) {
  .ems-stats-bar__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Mid-Page CTA ── */
.mid-cta {
  position: relative;
  overflow: hidden;
  padding: var(--space-3xl) 0;
  background: linear-gradient(135deg, var(--teal-dark, #1a3f43), var(--deep-blue));
  color: var(--white);
  text-align: center;
}
.mid-cta::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(173,207,145,0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(237,131,94,0.05) 0%, transparent 50%);
  pointer-events: none;
}
.mid-cta__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
  text-align: left;
}
.mid-cta__content h2 {
  color: var(--white);
  font-size: var(--text-3xl);
  margin-bottom: var(--space-md);
}
.mid-cta__content p {
  color: rgba(255,255,255,0.8);
  margin-bottom: var(--space-xl);
}
.mid-cta__stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}
.mid-cta__stat {
  text-align: center;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
}
.mid-cta__stat-number {
  display: block;
  font-size: var(--text-4xl);
  font-weight: 900;
  color: var(--white);
  line-height: 1;
}
.mid-cta__stat-label {
  display: block;
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.78);   /* #16 AA: was 0.6 (4.03:1 on teal) -> 0.78 (~5.6:1) */
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--space-xs);
}

@media (max-width: 768px) {
  .mid-cta__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .mid-cta__stats {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .mid-cta__stat { flex: 1 1 140px; }
}

/* ── Service Accordion: 5 Core Services ── */
.svc-accordion {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: start;
  margin-top: var(--space-3xl);
}
.svc-accordion__item {
  border-bottom: 1px solid var(--light-gray);
}
.svc-accordion__trigger {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  padding: var(--space-xl) 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-primary);
}
.svc-accordion__number {
  font-family: var(--font-mono);   /* #19: EMS service index -> mono */
  font-feature-settings: 'tnum' 1, 'zero' 1;
  font-size: var(--text-xs);
  color: var(--accent-on-light);   /* #19 AA: coral on .section--light #F4F6F7 fails (2.65:1) -> teal */
  font-weight: 600;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.svc-accordion__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--medium-gray);
  flex: 1;
  transition: color var(--transition-base);
}
.svc-accordion__item.is-active .svc-accordion__title {
  color: var(--dark-gray);
}
.svc-accordion__chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--mid-gray);
  transition: transform var(--transition-base);
}
.svc-accordion__item.is-active .svc-accordion__chevron {
  transform: rotate(180deg);
  color: var(--teal);
}
.svc-accordion__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 0 0 calc(var(--space-md) + 1.5em);
}
.svc-accordion__item.is-active .svc-accordion__body {
  max-height: 400px;
  padding-bottom: var(--space-xl);
}
.svc-accordion__body p {
  font-size: var(--text-base);
  color: var(--medium-gray);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}
.svc-accordion__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--accent-on-light);   /* #19 AA: coral link on .section--light fails (2.65:1) -> teal */
  transition: gap var(--transition-base);
}
.svc-accordion__link:hover {
  gap: var(--space-md);
}
.svc-accordion__link svg {
  width: 14px;
  height: 14px;
}
.svc-accordion__img-mobile {
  display: none;
}

/* Desktop preview image */
.svc-accordion__preview {
  position: sticky;
  top: 120px;
}
.svc-accordion__preview-inner {
  background: var(--off-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
}
.svc-accordion__preview-inner .img-placeholder {
  height: 100%;
  aspect-ratio: 4/3;
}

@media (max-width: 768px) {
  .svc-accordion {
    grid-template-columns: 1fr;
  }
  .svc-accordion__preview {
    display: none;
  }
  .svc-accordion__img-mobile {
    display: block;
    margin-top: var(--space-lg);
  }
  .svc-accordion__img-mobile .img-placeholder {
    aspect-ratio: 16/9;
    border-radius: var(--radius-md);
  }
}
/* ── Interactive Nearshore Map ── */
.nearshore-map {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: var(--space-3xl) auto 0;
  aspect-ratio: 2.2 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0a1628;
}
.nearshore-map__dots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.7;
}
.nearshore-map__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.nearshore-map__label {
  font-family: 'Lato', sans-serif;
  font-size: 1.4px;
  font-weight: 700;
  fill: var(--white);
  text-anchor: middle;
  pointer-events: none;
  opacity: 0;
  animation: mapLabelLoop 12s ease-in-out infinite;
}
.nearshore-map__label--origin {
  fill: var(--coral);
  font-size: 1.8px;
}
.nearshore-map__pulse {
  /* pulse handled via SVG <animate> */
}
.nearshore-map__path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: mapDrawLoop 12s ease-in-out infinite;
}
.nearshore-map__dot-travel {
  opacity: 0;
  animation: mapDotLoop 12s ease-in-out infinite;
}
.nearshore-map__legend {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  margin-top: var(--space-lg);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.6);
}
.nearshore-map__legend span {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.nearshore-map__legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.nearshore-map__legend-dot--origin { background: var(--coral); }
.nearshore-map__legend-dot--dest { background: var(--teal); }

/* Map loop: 12s total — draw (0-33%), hold (33-60%), fade out (60-70%), pause (70-100%) */
@keyframes mapDrawLoop {
  0%   { stroke-dashoffset: 1000; opacity: 0; }
  5%   { opacity: 1; }
  33%  { stroke-dashoffset: 0; opacity: 1; }
  60%  { stroke-dashoffset: 0; opacity: 1; }
  70%  { opacity: 0; }
  100% { stroke-dashoffset: 1000; opacity: 0; }
}
@keyframes mapLabelLoop {
  0%   { opacity: 0; }
  25%  { opacity: 0; }
  33%  { opacity: 1; }
  60%  { opacity: 1; }
  70%  { opacity: 0; }
  100% { opacity: 0; }
}
@keyframes mapDotLoop {
  0%   { opacity: 0; offset-distance: 0%; }
  5%   { opacity: 1; }
  33%  { opacity: 1; offset-distance: 100%; }
  60%  { opacity: 0; offset-distance: 100%; }
  100% { opacity: 0; offset-distance: 0%; }
}
@keyframes mapPulse {
  0%, 100% { r: 2.5; opacity: 0.6; }
  50% { r: 6; opacity: 0; }
}

@media (max-width: 768px) {
  .nearshore-map { aspect-ratio: 1.6 / 1; }
  .nearshore-map__legend { gap: var(--space-lg); flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .nearshore-map { aspect-ratio: 1.4 / 1; }
  .nearshore-map__legend { flex-direction: column; align-items: center; gap: var(--space-sm); }
}

/* ============================================
   SERVICE SELECTION GUIDE
   (rescued from the retired /ems/services/ hub — Phase 4 IA cleanup)
   ============================================ */
.selection-guide { padding: var(--space-4xl) 0; }
.selection-guide__header { text-align: center; margin-bottom: var(--space-3xl); }
.selection-guide__header p { max-width: 700px; margin: 0 auto; color: var(--mid-gray); }
.guide-table { overflow-x: auto; margin-bottom: var(--space-xl); }
.guide-table table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--light-gray); min-width: 640px; }
.guide-table thead { background: var(--teal); color: var(--white); }
.guide-table th { padding: var(--space-md) var(--space-lg); font-size: var(--text-sm); font-weight: 700; text-align: center; }
.guide-table th:first-child { text-align: left; }
.guide-table td { padding: var(--space-md) var(--space-lg); font-size: var(--text-sm); color: var(--dark-gray); border-bottom: 1px solid var(--warm-gray); text-align: center; }
.guide-table td:first-child { font-weight: 700; color: var(--charcoal); text-align: left; }
.guide-table tr:last-child td { border-bottom: none; }
.guide-table tbody tr:hover { background: rgba(35, 85, 90, 0.03); }
.guide-table .check { color: var(--teal); font-weight: 700; }
.guide-table .dash { color: var(--light-gray); }
.guide-note { font-size: var(--text-sm); color: var(--mid-gray); line-height: 1.7; max-width: 700px; }
@media (max-width: 768px) {
  .guide-table th, .guide-table td { padding: var(--space-sm) var(--space-md); font-size: var(--text-xs); }
}
