/* ============================================
   Gail Ruth Corson — Medical & Health Website
   Bold editorial style: midnight blue + mint
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: rgba(74, 222, 128, 0.25);
  color: #f0fdf4;
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

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

/* ---------- Utility ---------- */
.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;
}

/* ---------- Section Typography ---------- */
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4ade80;
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  color: #f0f3fa;
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #b3c0e0;
}

/* ---------- Input Fields ---------- */
.input-field {
  background: #0f1f40;
  border: 1px solid #1e3566;
  border-radius: 0.75rem;
  padding: 0.8rem 1rem;
  color: #f0f3fa;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.input-field::placeholder {
  color: #6780c0;
}

.input-field:focus {
  border-color: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12);
}

.input-field:hover:not(:focus) {
  border-color: #4160b0;
}

.input-field.error {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

.error-msg {
  color: #f87171;
  font-size: 0.8rem;
  margin-top: 0.4rem;
  display: none;
}

.error-msg.visible {
  display: block;
}

/* ---------- Primary Button ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #4ade80;
  color: #0a1628;
  font-weight: 700;
  font-size: 1rem;
  padding: 1rem 2rem;
  border-radius: 9999px;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  border: none;
  cursor: pointer;
  width: 100%;
}

.btn-primary:hover {
  background: #86efac;
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(74, 222, 128, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
}

/* ---------- Mobile Menu Toggle ---------- */
#menu-toggle {
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.menu-line-top,
.menu-line-mid,
.menu-line-bot {
  display: block;
}

#menu-toggle[aria-expanded="true"] .menu-line-top {
  transform: translateY(5.5px) rotate(45deg);
}

#menu-toggle[aria-expanded="true"] .menu-line-mid {
  opacity: 0;
  transform: scaleX(0);
}

#menu-toggle[aria-expanded="true"] .menu-line-bot {
  transform: translateY(-5.5px) rotate(-45deg);
}

/* ---------- Mobile Nav Links ---------- */
.mobile-nav-link {
  display: block;
}

/* ---------- Hero Animations ---------- */
.hero-eyebrow {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.7s 0.2s ease forwards;
}

.hero-headline {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.8s 0.4s ease forwards;
}

.hero-subhead {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 0.55s ease forwards;
}

.hero-ctas {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 0.7s ease forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Hero Glow Pulse ---------- */
.hero-glow {
  animation: glowPulse 6s ease-in-out infinite alternate;
}

.hero-glow--2 {
  animation-delay: -2s;
  animation-duration: 8s;
}

.hero-glow--3 {
  animation-delay: -4s;
  animation-duration: 7s;
}

@keyframes glowPulse {
  0%   { opacity: 0.6; transform: scale(1); }
  100% { opacity: 1;   transform: scale(1.08); }
}

/* ---------- CTA Glow ---------- */
.cta-glow {
  animation: ctaGlow 5s ease-in-out infinite alternate;
}

.cta-glow--2 {
  animation-delay: -2.5s;
}

@keyframes ctaGlow {
  0%   { opacity: 0.5; transform: scale(1); }
  100% { opacity: 1;   transform: scale(1.12); }
}

/* ---------- Scroll Reveal (progressive enhancement) ---------- */
.reveal-section {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Default: already visible (no-JS safe) */

/* When JS is enabled and reduced-motion is allowed, animate on scroll */
@media (prefers-reduced-motion: no-preference) {
  .js-enabled .reveal-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
  }

  .js-enabled .reveal-section.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* Stagger service cards */
  .js-enabled .service-card {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .js-enabled .service-card.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Header Scroll State ---------- */
#site-header.scrolled {
  background: rgba(10, 22, 40, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(30, 53, 102, 0.5);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

#site-header.scrolled .menu-line-top,
#site-header.scrolled .menu-line-mid,
#site-header.scrolled .menu-line-bot {
  background: #f0f3fa;
}

/* ---------- Service Card Tilt (subtle) ---------- */
.service-card .group:hover svg {
  filter: drop-shadow(0 0 6px rgba(74, 222, 128, 0.4));
}

/* ---------- Map Inversion Fix ---------- */
iframe[title*="Map"] {
  border-radius: 0 0 1rem 1rem;
}

/* ---------- Focus Visible ---------- */
:focus-visible {
  outline: 2px solid #4ade80;
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid #4ade80;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0a1628;
}

::-webkit-scrollbar-thumb {
  background: #1e3566;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2d4a8a;
}

/* ---------- Print ---------- */
@media print {
  #site-header,
  #mobile-menu,
  .reveal-section {
    opacity: 1 !important;
    transform: none !important;
  }

  body {
    background: white;
    color: black;
  }
}
