/* ==========================================================================
   Dr. Charu Women's Clinic — global styles
   Loaded on every page (after Bootstrap) via includes/head-common.php
   ========================================================================== */

:root {
  --brand: #ed1c94;
  --brand-600: #c9157c;
  --brand-700: #a3105f;
  --brand-50: #fff1f8;
  --brand-100: #ffe1f0;
  --navy: #1b2559;
  --navy-800: #151d48;
  --navy-900: #0f1536;
  --ink: #1d2233;
  --muted: #5d6478;
  --line: #ebe4ea;
  --soft: #fbf6f9;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(17, 21, 54, .06), 0 2px 8px rgba(17, 21, 54, .05);
  --shadow: 0 10px 30px -12px rgba(17, 21, 54, .22);
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-heading: "Fraunces", Georgia, "Times New Roman", serif;
  --header-h: 76px;

  /* Bootstrap overrides */
  --bs-body-font-family: var(--font-body);
  --bs-body-color: var(--ink);
  --bs-link-color: var(--brand-600);
  --bs-link-hover-color: var(--brand-700);
  --site-brand: var(--brand);
}

html { scroll-padding-top: calc(var(--header-h) + 16px); }

html,
body {
  max-width: 100%;
  overflow-x: clip;               /* clip (not hidden) keeps position:sticky working */
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Legacy pages carry pt-5 for the old fixed header; the new header is sticky. */
html body.pt-5,
html body.pt-md-0 { padding-top: 0 !important; }

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: inherit;
  letter-spacing: -0.01em;
  font-optical-sizing: auto;
}

h1, .h1 { font-size: clamp(1.6rem, 3vw, 2.5rem); line-height: 1.2; }
h2, .h2 { font-size: clamp(1.35rem, 2.4vw, 2rem); line-height: 1.25; }
h3, .h3 { font-size: clamp(1.2rem, 1.8vw, 1.5rem); line-height: 1.3; }

p, li { line-height: 1.75; }

b, strong { font-weight: 700; }

.accordion-button,
.btn,
.nav-link,
.dropdown-item,
.form-control,
.form-select,
label {
  font-family: var(--font-body);
}

.accordion-button { font-weight: 600; line-height: 1.45; }

img, video, iframe { max-width: 100%; }

/* Legacy content tables scroll on small screens */
table { display: block; width: 100%; overflow-x: auto; }

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

:focus-visible { outline: 3px solid rgba(237, 28, 148, .45); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn-brand {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--brand-600);
  --bs-btn-hover-border-color: var(--brand-600);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--brand-700);
  --bs-btn-active-border-color: var(--brand-700);
  --bs-btn-focus-shadow-rgb: 237, 28, 148;
  font-weight: 600;
  border-radius: 999px;
  padding: .62rem 1.35rem;
  box-shadow: 0 8px 20px -10px rgba(237, 28, 148, .8);
}

.btn-navy {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--navy);
  --bs-btn-border-color: var(--navy);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--navy-800);
  --bs-btn-hover-border-color: var(--navy-800);
  font-weight: 600;
  border-radius: 999px;
  padding: .62rem 1.35rem;
}

.btn-outline-brand {
  --bs-btn-color: var(--brand-600);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
  font-weight: 600;
  border-radius: 999px;
  padding: .62rem 1.35rem;
}

.btn-whatsapp {
  --bs-btn-color: #fff;
  --bs-btn-bg: #1faa59;
  --bs-btn-border-color: #1faa59;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #178a47;
  --bs-btn-hover-border-color: #178a47;
  font-weight: 600;
  border-radius: 999px;
  padding: .62rem 1.35rem;
}

.icon { width: 1em; height: 1em; flex-shrink: 0; vertical-align: -0.125em; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: #fff;
  transition: box-shadow .2s ease;
}

.site-header.is-scrolled { box-shadow: 0 6px 24px -14px rgba(17, 21, 54, .35); }

.site-topbar {
  background: var(--navy);
  color: rgba(255, 255, 255, .86);
  font-size: .82rem;
  line-height: 1.4;
}

.site-topbar .container-xl { min-height: 38px; }

.site-topbar a { color: inherit; text-decoration: none; }
.site-topbar a:hover { color: #fff; }

.topbar-item { display: inline-flex; align-items: center; gap: .45rem; }
.topbar-item .icon { color: #ff7cc2; }

.site-nav {
  padding-top: .55rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--line);
}

.site-nav .navbar-brand { padding: 0; margin-right: 1.5rem; }
.site-nav .navbar-brand img { height: 56px; width: auto; display: block; }

.site-nav .nav-link {
  color: var(--navy);
  font-weight: 600;
  font-size: .94rem;
  padding: .55rem .85rem !important;
  border-radius: 999px;
  transition: color .15s ease, background-color .15s ease;
}

.site-nav .nav-link:hover,
.site-nav .nav-link:focus-visible,
.site-nav .nav-item.show > .nav-link { color: var(--brand-600); }

.site-nav .nav-link.active { color: var(--brand-600); background: var(--brand-50); }

.site-nav .dropdown-toggle::after {
  border: 0;
  width: .5em;
  height: .5em;
  margin-left: .45em;
  vertical-align: .18em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.site-nav .dropdown-menu {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .5rem;
}

.site-nav .dropdown-item {
  border-radius: 8px;
  padding: .5rem .75rem;
  font-size: .92rem;
  color: var(--ink);
  white-space: normal;
}

.site-nav .dropdown-item:hover,
.site-nav .dropdown-item:focus { background: var(--brand-50); color: var(--brand-700); }
.site-nav .dropdown-item.active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }

.mega-title {
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .35rem .75rem .25rem;
  margin: 0;
}

.nav-call {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--navy);
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
  white-space: nowrap;
}

.nav-call span.icon-circle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand);
}

.nav-call small { display: block; font-size: .7rem; font-weight: 600; color: var(--muted); line-height: 1.1; }
.nav-call:hover { color: var(--brand-600); }

.site-nav .navbar-toggler {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .5rem .6rem;
  box-shadow: none;
}

.hamburger { display: grid; gap: 5px; width: 22px; }
.hamburger span { display: block; height: 2px; border-radius: 2px; background: var(--navy); transition: transform .2s ease, opacity .2s ease; }
.navbar-toggler[aria-expanded="true"] .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-toggler[aria-expanded="true"] .hamburger span:nth-child(2) { opacity: 0; }
.navbar-toggler[aria-expanded="true"] .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-call {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--brand-50);
  color: var(--brand);
}

@media (min-width: 992px) {
  .site-nav .dropdown:hover > .dropdown-menu,
  .site-nav .dropdown:focus-within > .dropdown-menu { display: block; margin-top: 0; }

  .site-nav .dropdown-menu { top: 100%; }

  .mega-menu {
    width: min(780px, 92vw);
    left: 50% !important;
    transform: translateX(-38%);
    padding: 1rem !important;
  }

  .mega-menu .row { --bs-gutter-x: .5rem; }
}

@media (max-width: 1199.98px) and (min-width: 992px) {
  .site-nav .nav-link { padding: .5rem .55rem !important; font-size: .9rem; }
  .nav-call .nav-call-text { display: none; }
}

@media (max-width: 991.98px) {
  :root { --header-h: 66px; }

  .site-nav .navbar-brand img { height: 46px; }

  .site-nav .navbar-collapse {
    margin: .6rem -.25rem 0;
    padding: .5rem;
    border-top: 1px solid var(--line);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  .site-nav .nav-link { padding: .7rem .75rem !important; border-radius: 10px; }

  .site-nav .dropdown-menu {
    border: 0;
    box-shadow: none;
    padding: 0 0 .35rem .5rem;
    margin: 0;
    background: transparent;
  }

  .mega-menu .col-md-4 + .col-md-4 { margin-top: .25rem; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer-cta {
  background: linear-gradient(120deg, var(--brand) 0%, #d9168a 45%, var(--navy) 140%);
  color: #fff;
}

.footer-cta h2 { color: #fff; font-size: clamp(1.4rem, 2.6vw, 2rem); margin: 0; }
.footer-cta p { color: rgba(255, 255, 255, .88); margin: .35rem 0 0; }

.footer-cta .btn-light { border-radius: 999px; font-weight: 700; color: var(--brand-700); padding: .62rem 1.35rem; }
.footer-cta .btn-outline-light { border-radius: 999px; font-weight: 600; padding: .62rem 1.35rem; }

.site-footer {
  background: var(--navy-900);
  color: rgba(255, 255, 255, .74);
  font-size: .94rem;
}

.site-footer a { color: rgba(255, 255, 255, .78); text-decoration: none; }
.site-footer a:hover { color: #fff; }

.footer-logo {
  display: inline-block;
  background: #fff;
  border-radius: 12px;
  padding: .5rem .8rem;
}

.footer-logo img { height: 52px; width: auto; display: block; }

.footer-heading {
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 1.1rem;
}

.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .55rem; line-height: 1.5; }
.footer-links a { display: inline-flex; gap: .4rem; align-items: baseline; }
.footer-links a::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); transform: translateY(-2px); flex-shrink: 0; }

.footer-contact { list-style: none; padding: 0; margin: 0; }
.footer-contact li { display: flex; gap: .7rem; margin-bottom: .9rem; line-height: 1.55; }
.footer-contact .icon { color: #ff7cc2; margin-top: .3rem; }

.social-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.social-links a {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  transition: background-color .15s ease, transform .15s ease;
}
.social-links a:hover { background: var(--brand); transform: translateY(-2px); }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: .85rem;
  color: rgba(255, 255, 255, .6);
}

/* --------------------------------------------------------------------------
   Appointment modal + forms
   -------------------------------------------------------------------------- */
.modal-backdrop { z-index: 1990 !important; }
.modal { z-index: 2000 !important; }

.appt-modal .modal-content { border: 0; border-radius: 20px; overflow: hidden; }
.appt-modal .modal-header {
  background: linear-gradient(135deg, var(--brand-50), #fff);
  border-bottom: 1px solid var(--line);
  padding: 1.25rem 1.5rem;
}
.appt-modal .modal-title { color: var(--navy); font-size: 1.45rem; margin: 0; }
.appt-modal .modal-body { padding: 1.25rem 1.5rem 1.5rem; }

.form-label { font-weight: 600; font-size: .88rem; color: var(--navy); margin-bottom: .3rem; }

.form-control,
.form-select {
  border-radius: 10px;
  border-color: #dcd5dc;
  padding: .62rem .85rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem rgba(237, 28, 148, .15);
}

.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.form-note { font-size: .8rem; color: var(--muted); }

/* --------------------------------------------------------------------------
   YouTube click-to-load facade (avoids ~1MB of player JS per embed)
   -------------------------------------------------------------------------- */
.yt-facade {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
  overflow: hidden;
}
.yt-facade img { width: 100%; height: 100%; object-fit: cover; opacity: .9; transition: opacity .2s ease; }
.yt-facade:hover img { opacity: 1; }
.yt-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 48px;
  transform: translate(-50%, -50%);
  border-radius: 14px;
  background: rgba(237, 28, 148, .92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
.yt-play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent #fff;
}

/* --------------------------------------------------------------------------
   Legacy page fixes (moved from the old header include)
   -------------------------------------------------------------------------- */
#about .about-title { margin-top: 0; line-height: 1.2; letter-spacing: 0.1px; }

#slider .carousel { margin-top: 0 !important; }

@media (min-width: 992px) {
  /* The old header was position:fixed and pages padded for it; the new one is sticky. */
  .site-header + section:not(#slider) { padding-top: 1.5rem !important; }
  .site-header + section > .container.py-lg-5 { padding-top: 1.5rem !important; }
  .site-header + main { padding-top: 0 !important; }

  #about .about-title { font-size: clamp(2rem, 2vw, 2.35rem); }
}

@media (max-width: 991.98px) {
  .site-header + main { padding-top: 0 !important; }

  .accordion-button { padding: .85rem .95rem; font-size: .95rem; }

  .carousel-control-prev,
  .carousel-control-next { width: 12%; }

  #formpage .col-6,
  #contact .col-6,
  #formpage .col-3 { width: 100%; }

  #formpage .col-3 .btn,
  #formpage .col-3 button { width: 100%; }

  /* Many pages use inline fixed 260/360 gallery cards; reset for fluid layouts. */
  [style*="max-width: 260px"] { max-width: 100% !important; }
  [style*="height: 360px"] { height: auto !important; min-height: 240px; }
  [style*="height: 400px"] { height: auto !important; max-height: 70vh; }

  .nav-pills { row-gap: 0.45rem !important; column-gap: 0.45rem !important; }
  .nav-pills .nav-link { font-size: 0.92rem; }

  #about { margin-top: 0 !important; padding-top: 1rem !important; }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  #about .about-title { font-size: 1.9rem; line-height: 1.22; }
}

@media (max-width: 575.98px) {
  .container,
  .container-fluid { padding-left: 0.9rem; padding-right: 0.9rem; }

  p, li, label, input, textarea, .btn { font-size: 0.95rem; }

  #heading img[style*="height: 400px"] { height: auto !important; max-height: 320px; width: auto; max-width: 100%; }

  .nav-pills { display: flex; flex-wrap: wrap; }
  .nav-pills .nav-item { flex: 1 1 100%; }
  .nav-pills .nav-link { width: 100%; text-align: center; }

  .appt-modal .modal-dialog { margin: .75rem auto; width: calc(100% - 1.5rem); }
  .appt-modal .modal-body,
  .appt-modal .modal-header { padding-left: 1rem; padding-right: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
