/* ==========================================================================
   Navira Healthcare — custom CSS
   Tailwind (CDN, utility classes) handles layout/spacing/typography almost
   everywhere. This file only covers what Tailwind's utility classes can't:
   the heartbeat motif, mega-menu/mobile-nav behaviour, animated accordions,
   scroll-reveal + count-up hooks, and a few brand tokens used as CSS vars.
   ========================================================================== */

:root {
  --maroon-900: #5c1729;
  --maroon-800: #711d34;
  --maroon: #8e2542;
  --maroon-600: #a53a58;
  --rose: #d78d8e;
  --rose-600: #e0a3a3;
  --rose-tint: #f8e9e8;
  --rose-tint-2: #fbf1f0;
  --ivory: #fdf9f5;
  --paper: #ffffff;
  --ink: #2a1620;
  --ink-soft: #755d64;
  --ink-faint: #8a747a; /* darkened slightly from brief's #a68f95 to clear WCAG AA on ivory at small sizes */
  --line: #ece0dd;
  --live: #2f8f5b;
  --gold: #c99a4a;
}

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--ivory);
  color: var(--ink);
}

/* Visible keyboard focus everywhere — never remove without replacing. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Topbar live dot (pulsing ring)
   -------------------------------------------------------------------------- */
.live-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--live);
  flex-shrink: 0;
}
.live-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 1px solid var(--live);
  animation: live-ping 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@media (prefers-reduced-motion: reduce) {
  .live-dot::after { animation: none; opacity: 0.4; }
}
@keyframes live-ping {
  0% { transform: scale(0.9); opacity: 0.9; }
  75%, 100% { transform: scale(2.2); opacity: 0; }
}

/* --------------------------------------------------------------------------
   Heartbeat / ECG line motif
   -------------------------------------------------------------------------- */
.ecg-path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ecg-hero .ecg-path {
  stroke-dasharray: 620;
  stroke-dashoffset: 620;
  animation: ecg-draw 2.4s ease-out 0.3s forwards;
}
@media (prefers-reduced-motion: reduce) {
  .ecg-hero .ecg-path { animation: none; stroke-dashoffset: 0; }
}
@keyframes ecg-draw {
  to { stroke-dashoffset: 0; }
}
.ecg-divider { opacity: 0.35; }

/* --------------------------------------------------------------------------
   Header / sticky shadow
   -------------------------------------------------------------------------- */
#site-header {
  transition: box-shadow 0.25s ease, background-color 0.25s ease;
}
#site-header.is-scrolled {
  box-shadow: 0 6px 24px -12px rgba(92, 23, 41, 0.35);
}

/* --------------------------------------------------------------------------
   Mega menu (desktop)
   -------------------------------------------------------------------------- */
.mega-menu-wrap { position: relative; }
.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 40;
}
.mega-menu-wrap:hover .mega-menu,
.mega-menu-wrap:focus-within .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   Mobile nav panel
   IMPORTANT: base state must be display:none BEFORE the @media block that
   reveals the hamburger button, so source order can't fight the media query.
   -------------------------------------------------------------------------- */
#mobile-menu-btn { display: none; }

#mobile-nav-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(86vw, 360px);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 60;
  overflow-y: auto;
}
#mobile-nav-panel.is-open { transform: translateX(0); }

#mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 22, 32, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 55;
}
#mobile-nav-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

body.nav-open {
  overflow: hidden;
}

@media (max-width: 1023px) {
  #mobile-menu-btn { display: inline-flex; }
  .desktop-nav-links,
  .desktop-cta { display: none !important; }
}
@media (min-width: 1024px) {
  #mobile-nav-panel,
  #mobile-nav-backdrop { display: none; }
}

/* Mobile services accordion inside the slide-in panel */
#mobile-nav-panel details > summary {
  list-style: none;
  cursor: pointer;
}
#mobile-nav-panel details > summary::-webkit-details-marker { display: none; }
#mobile-nav-panel details[open] .accordion-chevron { transform: rotate(180deg); }
.accordion-chevron { transition: transform 0.2s ease; }

/* --------------------------------------------------------------------------
   Scroll reveal
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   FAQ accordion (animated max-height, single-open)
   -------------------------------------------------------------------------- */
.faq-item .faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq-item.is-open .faq-answer {
  max-height: 400px;
}
.faq-item .faq-icon { transition: transform 0.25s ease; }
.faq-item.is-open .faq-icon { transform: rotate(45deg); }

/* --------------------------------------------------------------------------
   Testimonials scroll-snap track
   -------------------------------------------------------------------------- */
.testimonial-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.testimonial-track > * {
  scroll-snap-align: start;
  flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   Floating buttons
   -------------------------------------------------------------------------- */
#back-to-top {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}
#back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Mobile sticky action bar spacing so content isn't hidden behind it */
@media (max-width: 767px) {
  body.has-mobile-actionbar { padding-bottom: 64px; }
}
@media (min-width: 768px) {
  #mobile-action-bar { display: none; }
}

/* --------------------------------------------------------------------------
   Values chain / timeline (About page) — heartbeat-style dashed connector
   -------------------------------------------------------------------------- */
.value-chain { position: relative; }
.value-node::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: -2rem;
  left: 1.25rem;
  width: 0;
  border-left: 2px dashed var(--rose-600);
}
.value-node:last-child::before { display: none; }

/* --------------------------------------------------------------------------
   Areas-served chip cloud
   -------------------------------------------------------------------------- */
.area-chip {
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* --------------------------------------------------------------------------
   Count-up stat numbers: reserve space to avoid layout shift pre-JS
   -------------------------------------------------------------------------- */
.stat-value { font-variant-numeric: tabular-nums; }
