/* ===== Cape Cod Endodontics — design tokens ===== */
:root {
  --teal-deep: #0d4f4a;
  --teal: #14746f;
  --teal-light: #e5f1ef;
  --navy: #16303a;
  --gold: #c69a4e;
  --gold-light: #e8cd94;
  --cream: #faf7f1;
  --cream-alt: #f1ece1;
  --ink: #1c2b2c;
  --muted: #5b6d6c;
  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--navy);
  font-weight: 600;
}

a { color: var(--teal-deep); }
a:hover { color: var(--gold); }

.section-eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  margin-bottom: 1.25rem;
}

.section-intro {
  max-width: 720px;
  margin: 0 auto 2.5rem;
  color: var(--muted);
}
.section-intro-sm {
  max-width: 640px;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

section { padding: 5.5rem 0; scroll-margin-top: 76px; }

/* ===== Navbar ===== */
#mainNav {
  background: rgba(250, 247, 241, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 14px rgba(22, 48, 58, 0.08);
  padding: 0.6rem 0;
  transition: padding 0.2s ease;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.navbar-logo-img { height: 36px; width: auto; }
.navbar-brand-text {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--navy);
  white-space: nowrap;
}
.navbar-nav .nav-link {
  color: var(--navy);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.85rem !important;
}
.navbar-nav .nav-link:hover { color: var(--teal-deep); }
.nav-cta {
  background: var(--teal-deep);
  color: #fff !important;
  border-radius: 6px;
  margin-left: 0.4rem;
}
.nav-cta:hover { background: var(--gold); color: var(--navy) !important; }

/* ===== Hero — compact, curved bottom edge, teal duotone wash ===== */
.hero {
  position: relative;
  min-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('img/hero.webp') center/cover no-repeat;
  clip-path: ellipse(140% 100% at 50% 0%);
  padding-top: 90px;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 65% at 50% 48%, rgba(13, 40, 38, 0.55) 0%, rgba(13, 40, 38, 0.10) 100%),
    linear-gradient(to bottom, rgba(13, 42, 45, 0.55) 0%, rgba(15, 55, 58, 0.35) 45%, rgba(10, 35, 40, 0.65) 100%),
    linear-gradient(160deg, rgba(20, 116, 111, 0.35), rgba(22, 48, 58, 0.45));
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 780px;
  background: rgba(10, 35, 34, 0.20);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border-radius: 18px;
  padding: 2.5rem 2rem;
}
.hero-eyebrow {
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-shadow: 0 0 3px rgba(0,0,0,1), 0 1px 12px rgba(0,0,0,0.95), 0 0 30px rgba(0,0,0,0.8);
}
.hero-title {
  font-family: var(--font-head);
  color: #fff;
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 0 0 4px rgba(0,0,0,1), 0 2px 20px rgba(0,0,0,0.95), 0 0 60px rgba(0,0,0,0.8);
}
.hero-subtitle {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 3px rgba(0,0,0,1), 0 2px 16px rgba(0,0,0,0.95), 0 0 40px rgba(0,0,0,0.85);
}
.hero-tagline {
  color: #f0ece2;
  font-size: 1rem;
  margin-bottom: 2rem;
  text-shadow: 0 0 3px rgba(0,0,0,1), 0 1px 12px rgba(0,0,0,0.95), 0 0 30px rgba(0,0,0,0.9);
}
.hero-cta-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-cta {
  background: var(--gold);
  color: var(--navy);
  border: none;
  font-weight: 600;
  padding: 0.75rem 1.6rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.btn-cta:hover { background: #d9b56c; color: var(--navy); transform: translateY(-1px); }

.btn-cta-outline {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.8);
  font-weight: 600;
  padding: 0.75rem 1.6rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.btn-cta-outline:hover { background: rgba(255,255,255,0.15); color: #fff; }

.btn-outline-procedures {
  border: 1.5px solid var(--teal-deep);
  color: var(--teal-deep);
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: 6px;
  background: transparent;
}
.btn-outline-procedures:hover { background: var(--teal-deep); color: #fff; }

/* ===== About ===== */
.section-about { background: var(--cream); }
.lead-text {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--teal-deep);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.stat-cell {
  background: var(--teal-light);
  border-radius: 12px;
  padding: 1.75rem 1.25rem;
  text-align: center;
  border: 1px solid rgba(20, 116, 111, 0.15);
}
.stat-cell i {
  font-size: 1.6rem;
  color: var(--teal-deep);
  margin-bottom: 0.6rem;
  display: block;
}
.stat-num {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
}
.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* ===== Doctors ===== */
.section-doctors { background: var(--cream-alt); }
.doctor-card {
  background: #fff;
  border-radius: 14px;
  padding: 2rem 1.5rem;
  text-align: center;
  height: 100%;
  box-shadow: 0 6px 24px rgba(22, 48, 58, 0.07);
}
.doctor-photo {
  width: 128px;
  height: 152px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  border: 3px solid var(--teal-light);
}
.doctor-card h3 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.doctor-credential {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.doctor-card p:not(.doctor-credential) { color: var(--muted); font-size: 0.94rem; }

/* ===== Comfort / Anxiety ===== */
.section-comfort { background: var(--cream); }
.comfort-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 4rem;
}
.comfort-cell {
  background: var(--navy);
  color: #f0ece2;
  border-radius: 12px;
  padding: 1.75rem 1.25rem;
  text-align: center;
}
.comfort-cell i {
  font-size: 1.8rem;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
  display: block;
}
.comfort-cell h3 {
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}
.comfort-cell p { font-size: 0.87rem; color: #cfd9d8; margin: 0; }

.forms-heading {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.forms-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.form-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  background: #fff;
  border: 1px solid rgba(20, 116, 111, 0.18);
  border-radius: 10px;
  padding: 1.4rem 0.75rem;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.88rem;
  transition: all 0.2s ease;
}
.form-card i { font-size: 1.4rem; color: var(--teal-deep); }
.form-card:hover {
  background: var(--teal-deep);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(13, 79, 74, 0.25);
}
.form-card:hover i { color: var(--gold-light); }

/* ===== Referring Doctors ===== */
.section-referring { background: var(--navy); color: #e6ece9; }
.section-referring .section-eyebrow { color: var(--gold-light); }
.section-referring .section-title { color: #fff; }
.section-referring p { color: #cdd8d5; }
.referring-panel {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 2rem;
}
.referring-panel h3 { color: #fff; font-size: 1.15rem; margin-bottom: 1.25rem; }
.referring-panel ul { padding-left: 1.2rem; margin-bottom: 1.75rem; }
.referring-panel li { margin-bottom: 0.6rem; color: #cdd8d5; }
.referring-panel li strong { color: #fff; }
.referring-panel h4 { color: var(--gold-light); font-size: 1rem; margin-bottom: 0.5rem; }
.small-note { font-size: 0.87rem; color: #b9c6c3; }

/* ===== Financial ===== */
.section-financial { background: var(--cream-alt); }
.financial-card {
  background: #fff;
  border-radius: 14px;
  padding: 2rem 1.75rem;
  height: 100%;
  box-shadow: 0 6px 24px rgba(22, 48, 58, 0.06);
}
.financial-card h3 { font-size: 1.2rem; margin-bottom: 0.75rem; color: var(--teal-deep); }
.financial-card p { color: var(--muted); font-size: 0.94rem; }
.payment-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}
.badge-pill {
  background: var(--teal-light);
  color: var(--teal-deep);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}
.carecredit-link {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gold);
  text-decoration: none;
}
.carecredit-link:hover { text-decoration: underline; }

/* ===== Locations ===== */
.section-locations { background: var(--cream); }
.location-card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 6px 28px rgba(22, 48, 58, 0.08);
  height: 100%;
}
.location-card h3 {
  font-size: 1.3rem;
  color: var(--teal-deep);
  margin-bottom: 1rem;
}
.location-card h3 i { margin-right: 0.4rem; }
.location-address { font-weight: 600; color: var(--navy); }
.location-card a { text-decoration: none; color: var(--ink); }
.location-card a:hover { color: var(--teal-deep); }
.location-card p i { color: var(--teal); width: 1.2rem; }

.directions-toggle {
  margin: 1rem 0;
  font-size: 0.88rem;
}
.directions-toggle summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--teal-deep);
}
.directions-toggle ul {
  margin-top: 0.75rem;
  padding-left: 1.1rem;
  color: var(--muted);
}
.directions-toggle li { margin-bottom: 0.4rem; }

.map-embed {
  border-radius: 10px;
  overflow: hidden;
  margin: 1rem 0;
  border: 1px solid rgba(20, 116, 111, 0.15);
}
.map-embed iframe { border: 0; }

.staff-photo {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
  max-height: 260px;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--navy);
  color: #cdd8d5;
  padding: 4rem 0 2rem;
}
.footer-logo-chip {
  background: #f6f1e4;
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  display: inline-block;
  margin-bottom: 1rem;
}
.footer-logo-chip img { height: 32px; width: auto; display: block; }
.footer-tagline { font-size: 0.88rem; color: #a9bab6; max-width: 280px; }
.site-footer h4 {
  color: #fff;
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.55rem; }
.footer-links a { color: #cdd8d5; text-decoration: none; font-size: 0.92rem; }
.footer-links a:hover { color: var(--gold-light); }
.footer-office { font-size: 0.92rem; margin-bottom: 0.4rem; }
.footer-office a { color: #cdd8d5; text-decoration: none; }
.footer-office a:hover { color: var(--gold-light); }
.footer-divider { border-color: rgba(255,255,255,0.12); margin: 2rem 0 1.5rem; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #93a6a2;
}
.powered-by a { color: var(--gold-light); font-weight: 600; text-decoration: none; }
.powered-by a:hover { text-decoration: underline; }

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: var(--cream);
    margin-top: 0.75rem;
    padding: 1rem;
    border-radius: 10px;
  }
  .nav-cta { display: inline-block; margin-top: 0.5rem; }
  .comfort-grid { grid-template-columns: 1fr 1fr; }
  .forms-grid { grid-template-columns: 1fr 1fr; }
  .hero { clip-path: ellipse(180% 100% at 50% 0%); }
}

@media (max-width: 575.98px) {
  section { padding: 3.75rem 0; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .comfort-grid { grid-template-columns: 1fr; }
  .forms-grid { grid-template-columns: 1fr; }
  .hero-content { padding: 1.75rem 1.25rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
