/* ============================================================
   Tyagi Imaging and Diagnostic Centre — styles.css
   Clean, clinical-modern design system. Mobile-first (~360px),
   enhanced at 768px and 1024px. No external fonts, images,
   or other resources.
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Color — calm teal / slate. Every text/background pair used in
     this sheet meets WCAG AA (>= 4.5:1): muted on bg 5.2:1,
     muted on bg-soft 4.9:1, ink on bg-soft 13.1:1, white on
     primary 5.5:1, on-dark on ink 9.9:1. */
  --c-primary: #0f766e;
  --c-primary-dark: #0b5a54;
  --c-ink: #16303a;
  --c-muted: #5b7078;
  --c-bg: #ffffff;
  --c-bg-soft: #f4faf9;
  --c-border: #dce8e6;
  --c-on-dark: #cfdde0;

  /* Type — fluid, calm hierarchy */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-h1: clamp(2rem, 1rem + 4vw, 3rem);
  --fs-h2: clamp(1.5rem, 1rem + 2.5vw, 2.125rem);
  --fs-h3: 1.25rem;

  /* Rhythm */
  --radius-card: 12px;
  --radius-btn: 8px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --container: 1080px;
  --header-h: 64px;
  --shadow-card: 0 1px 3px rgb(22 48 58 / 6%), 0 4px 12px rgb(22 48 58 / 5%);
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-bg);
  padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px)); /* room for the mobile bottom sticky-bar, incl. notch/home-indicator inset */
}

h1, h2, h3 { margin: 0 0 var(--space-2); line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 var(--space-2); }
a { color: var(--c-primary-dark); }
a:hover { color: var(--c-primary); }

:focus-visible { outline: 3px solid var(--c-primary); outline-offset: 2px; }
address { font-style: normal; }
ul { margin: 0; padding: 0; }

/* Anchored sections clear the sticky header when jumped to. */
section[id] { scroll-margin-top: calc(var(--header-h) + 16px); padding-block: var(--space-5); padding-inline: var(--space-2); }

/* Alternate section backgrounds for calm visual rhythm:
   hero soft, services white, doctors soft, visit white,
   contact soft, footer dark ink. */
#hero-shell, #doctors, #contact { background: var(--c-bg-soft); }
#services, #visit { background: var(--c-bg); }

/* Constrain and center section content at all widths. */
section > * { max-width: var(--container); margin-left: auto; margin-right: auto; }

/* ---------- 3. Sticky header & zero-JS nav ---------- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: var(--header-h);
  padding: var(--space-1) var(--space-2);
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}

.wordmark { display: flex; align-items: center; gap: var(--space-1); min-width: 0; color: var(--c-ink); text-decoration: none; }
/* Brand mark: the 8px wordmark gap is its margin from the wordmark text.
   Alpha PNG, so it sits directly on light or dark backgrounds, no chip. */
.logo { display: block; flex: 0 0 auto; width: 40px; height: 40px; object-fit: contain; }
.wordmark-abbr { font-weight: 800; font-size: 1.25rem; color: var(--c-primary); letter-spacing: 0.02em; }
/* Full name is too wide for 360px; revealed from 768px up. */
.wordmark-full { display: none; }

#main-nav { position: relative; }

#main-nav summary {
  display: inline-flex; align-items: center; gap: var(--space-1); min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-btn);
  background: var(--c-bg);
  color: var(--c-ink);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

#main-nav summary::-webkit-details-marker { display: none; }
/* "+" affordance that rotates to "x" when open. */
#main-nav summary::after { content: "+"; color: var(--c-primary); font-weight: 700; transition: transform 150ms ease; }
#main-nav[open] summary::after { transform: rotate(45deg); }

#main-nav nav {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 176px;
  padding: var(--space-1);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

#main-nav nav a {
  display: flex; align-items: center; min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-btn);
  color: var(--c-ink);
  font-weight: 500;
  text-decoration: none;
}

#main-nav nav a:hover { background: var(--c-bg-soft); color: var(--c-primary-dark); }

/* ---------- 4. Hero ---------- */
#hero-shell { padding-block: var(--space-6) var(--space-5); text-align: center; }
#hero-shell h1 { margin-bottom: var(--space-2); }

.hero-promise { max-width: 42ch; margin-left: auto; margin-right: auto; font-size: 1.125rem; color: var(--c-muted); }

.hero-actions { display: flex; flex-direction: column; gap: var(--space-2); margin-block: var(--space-4); }
.hero-actions .btn-call, .hero-actions .btn-directions { width: 100%; }

/* ---------- Buttons ---------- */
.btn-call, .btn-directions {
  display: flex; align-items: center; justify-content: center;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.btn-call { background: var(--c-primary); color: #ffffff; }
.btn-call:hover { background: var(--c-primary-dark); color: #ffffff; }
.btn-directions { border: 1.5px solid var(--c-primary); background: var(--c-bg); color: var(--c-primary); }
.btn-directions:hover { border-color: var(--c-primary-dark); background: var(--c-bg-soft); color: var(--c-primary-dark); }

/* Persistent call action in the header: hidden on mobile (the hero
   CTA and the sticky bar cover phones), appears from 768px up. */
.header-call { display: none; }

/* ---------- Trust strip ---------- */
.trust-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-1); list-style: none; }
.trust-strip li { padding: 8px 14px; border: 1px solid var(--c-border); border-radius: 999px; background: var(--c-bg); font-size: 0.875rem; color: var(--c-muted); }

/* ---------- 5. Services, doctors, visit ---------- */
.services-intro, .doctors-intro, .contact-intro { max-width: 65ch; color: var(--c-muted); }

.services-grid, .doctors-grid, .visit-list, .contact-grid {
  display: grid; grid-template-columns: 1fr; gap: var(--space-3); margin-block: var(--space-4);
}

.visit-list { margin-inline: 0; padding: 0; list-style: none; }

.service-card, .doctor-card {
  padding: var(--space-3);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.service-card h3, .doctor-card h3 { margin-bottom: var(--space-2); }

.service-icon { display: block; width: 56px; height: 56px; padding: 8px; margin-bottom: var(--space-2); color: var(--c-primary); background: var(--c-bg-soft); border-radius: var(--radius-card); }
.service-for { margin-bottom: var(--space-2); }
.service-expect { margin-bottom: 0; padding-top: var(--space-2); border-top: 1px solid var(--c-border); color: var(--c-muted); }

.doctor-avatar { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: var(--space-2); border-radius: 50%; background: var(--c-primary); color: #ffffff; font-size: 1.25rem; font-weight: 700; }
.doctor-role { margin-bottom: var(--space-1); color: var(--c-primary-dark); font-weight: 600; }
.doctor-bio { margin-bottom: 0; color: var(--c-muted); }

/* Visit steps keep the old why-us card rhythm: same tokens, same
   20px/24px padding, same border and shadow; the checkmark is pinned
   to the left so the step name and line stack beside it. */
.visit-step {
  position: relative;
  padding: 20px var(--space-3) 20px calc(var(--space-3) + 28px);
  list-style: none;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.visit-step::before { content: "\2713"; position: absolute; top: 20px; left: var(--space-3); color: var(--c-primary); font-weight: 700; }
.visit-step h3 { margin-bottom: var(--space-1); }
.visit-step p { margin-bottom: 0; color: var(--c-muted); }

/* ---------- 6. Contact ---------- */
/* Storefront photo above the contact grid: single column at all
   widths. 16:9 crop (3:2 from 1024px) with object-position nudged
   down so the facade signboard — lower-center of the portrait
   source — stays in frame. */
.front-photo { margin: 0 auto; }
.front-photo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 16 / 9;
  object-position: center 85%;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
}
.front-photo figcaption { margin-top: var(--space-1); font-size: 0.875rem; color: var(--c-muted); text-align: left; }

.contact-info h3 { margin-bottom: var(--space-1); font-size: 1.125rem; }
.contact-phone { margin-bottom: var(--space-2); }
.contact-phone a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.contact-hours { margin-bottom: var(--space-3); color: var(--c-muted); }

.contact-whatsapp {
  display: inline-flex; align-items: center;
  min-height: 44px;
  padding: 10px 20px;
  border: 1.5px solid var(--c-primary);
  border-radius: var(--radius-btn);
  background: var(--c-bg);
  color: var(--c-primary);
  font-weight: 600;
  text-decoration: none;
}

.contact-whatsapp:hover { border-color: var(--c-primary-dark); background: var(--c-bg-soft); color: var(--c-primary-dark); }
/* The map box is the positioning context: the in-container fallback
   fills it while the embed is slow or blocked, and the loaded iframe
   covers it. */
.contact-map { position: relative; min-height: 320px; }

#map { display: block; position: absolute; inset: 0; width: 100%; height: 100%; border: 1px solid var(--c-border); border-radius: var(--radius-card); }

.map-fallback { position: absolute; inset: 0; display: grid; place-content: center; gap: var(--space-2); text-align: center; padding: var(--space-3); }
.map-fallback-address { margin-bottom: 0; }

/* ---------- 7. Footer ---------- */
#site-footer { padding: var(--space-5) var(--space-2); background: var(--c-ink); color: var(--c-on-dark); text-align: center; }
#site-footer a { color: #ffffff; }
#site-footer a:hover { color: #ffffff; text-decoration: underline; }
.footer-name { margin-bottom: var(--space-1); color: #ffffff; font-weight: 700; }
.footer-address, .footer-phone, .footer-hours { margin-bottom: var(--space-2); }
#site-footer .logo { margin: 0 auto; }

.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; text-decoration: none; }

/* ---------- 8. Mobile bottom sticky-bar ---------- */
.sticky-bar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 50;
  display: flex;
  gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--c-bg);
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -2px 12px rgb(22 48 58 / 10%);
}

/* nowrap keeps both labels on one line so the bar stays at its
   single-line 48px height within the 75px body reservation. */
.sticky-bar .btn-call, .sticky-bar .btn-directions { flex: 1 1 0; min-width: 0; white-space: nowrap; }

/* ============================================================
   Breakpoints (mobile-first enhancements)
   ============================================================ */

@media (min-width: 768px) {
  body { padding-bottom: 0; }

  /* Bottom bar is mobile-only; the header owns quick actions. */
  .sticky-bar { display: none; }

  .wordmark-full { display: inline; }

  .logo { width: 48px; height: 48px; }

  /* Header owns quick actions on larger screens. */
  .header-call { display: inline-flex; white-space: nowrap; flex: 0 0 auto; }

  section[id] { padding-block: var(--space-6); }
  #hero-shell { padding-block: var(--space-6); }

  .hero-actions { flex-direction: row; justify-content: center; }
  .hero-actions .btn-call, .hero-actions .btn-directions { width: auto; }

  /* Nav dropdown becomes a horizontal panel; nowrap + max-content
     keep the panel at its natural width so no link text wraps. */
  #main-nav nav { display: flex; flex-direction: row; width: max-content; }
  #main-nav nav a { min-height: 48px; white-space: nowrap; }

  .doctors-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .contact-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    align-items: stretch;
  }

  /* #map fills the box (position: absolute; inset: 0), so only the
     container needs the taller minimum at this width. */
  .contact-map { min-height: 380px; }
}

@media (min-width: 1024px) {
  section[id] { padding-block: 80px; }
  #hero-shell { padding-block: 88px 80px; }
  .services-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .front-photo img { aspect-ratio: 3 / 2; }
}
