/* Typography/layout repairs from the 2026-10-09 audit. Copy and destinations unchanged. */
:root {
  --type-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  --type-heading: Lora, Georgia, "Times New Roman", serif;
  --type-prose: 1.0625rem;
  --type-h1: clamp(2rem, 1.4rem + 2vw, 3rem);
  --type-h2: clamp(1.625rem, 1.45rem + .6vw, 1.75rem);
  --type-h3: 1.375rem;
  --type-measure: 72ch;
}
html body { font-family: var(--type-body) !important; font-size: var(--type-prose); line-height: 1.75; }
html body :is(p, li, th, td, button, label) { font-family: var(--type-body); }
html body :is(h1,h2,h3,h4) { font-family: var(--type-heading) !important; text-wrap: balance; overflow-wrap: break-word; }
html body h1 { font-size: var(--type-h1) !important; font-weight: 700 !important; line-height: 1.2 !important; letter-spacing: -.01em !important; }
html body h2 { font-size: var(--type-h2) !important; font-weight: 600 !important; line-height: 1.3 !important; letter-spacing: 0 !important; }
html body h3 { font-size: var(--type-h3) !important; font-weight: 600 !important; line-height: 1.4 !important; letter-spacing: 0 !important; }
html body h4 { font-size: 1.125rem !important; line-height: 1.45 !important; letter-spacing: 0 !important; }
html body :is(.content,.article-content,.article-body,.main-column .section,.content-card) > :is(p,ul,ol),
html body .main-column .section > p { font-family: var(--type-body) !important; font-size: var(--type-prose) !important; line-height: 1.75 !important; margin-bottom: 1em !important; }
html body :is(.content,.article-content,.article-body) > :is(p,ul,ol) { max-width: var(--type-measure); }
html body :is(.content,.article-content,.article-body,.main-column .section,.content-card) > :is(h2,h3) { margin-top: 1.5em; margin-bottom: .6em; }
html body :is(.content,.article-content,.article-body,.main-column .section,.content-card) > :is(h2,h3):first-child { margin-top: 0; }
html body :is(.hero p.subtitle,.hero > .container > p,.profile-title) { font-family: var(--type-body) !important; font-size: 1.25rem !important; line-height: 1.65 !important; }
html body.doctor-profile-page .profile-info h1 { font-family: var(--type-heading) !important; font-size: var(--type-h1) !important; font-weight: 700 !important; line-height: 1.2 !important; letter-spacing: -.01em !important; }
html body.doctor-profile-page :is(.section,.content-section,.content-card,.doctor-service-routing) h2 { font-size: var(--type-h2) !important; line-height: 1.3 !important; letter-spacing: 0 !important; }
html body :is(.service-card,.route-card,.expertise-item,.article-card) h3 { font-size: 1.25rem !important; line-height: 1.4 !important; }
html body :is(.service-card,.route-card,.expertise-item,.article-card) p { font-family: var(--type-body) !important; font-size: 1rem !important; line-height: 1.65 !important; }
html body .section > .container > .content-card { width: 100%; max-width: var(--type-measure); margin-inline: auto; padding-inline: clamp(1rem,3vw,2rem); }
html body :is(.hero-content,.profile-info,.main-column,.sidebar,.content,.content-card,.service-card,.route-card,.article-card,.doctor-kicker,.footer-content > *) { min-width: 0; max-width: 100%; }
html body .profile-info { width: 100%; }
html body :is(.doctor-kicker,.highlight-badge,.doctor-btn,.hero-buttons a,.profile-info a.btn,.footer-actions a,.footer-btn) { max-width: 100%; white-space: normal; overflow-wrap: break-word; }
html body .doctor-kicker { flex-wrap: wrap; }
html body :is(.hero-buttons,.doctor-hero-actions,.profile-highlights,.footer-actions,.footer-buttons) { min-width: 0; flex-wrap: wrap; }
html body :is(.hero-buttons,.doctor-hero-actions,.profile-highlights,.footer-actions,.footer-buttons) > * { min-width: 0; }
html body .hero-container { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
html body .footer-content { grid-template-columns: minmax(0,1.4fr) repeat(2,minmax(0,1fr)); }
html body .footer-compact .footer-content { grid-template-columns: minmax(0,1.35fr) repeat(3,minmax(0,1fr)); }
html body .footer-content > * { overflow-wrap: break-word; }
html body .footer-content a[href^="mailto:"] { overflow-wrap: anywhere; }
html body .footer :is(h2,h3,h4) { font-family: var(--type-body) !important; font-size: 1rem !important; line-height: 1.5 !important; font-weight: 700 !important; letter-spacing: .04em !important; }
html body .footer :is(p,li) { font-family: var(--type-body) !important; font-size: 1rem !important; line-height: 1.65 !important; }
html body .footer-bottom p { font-size: .875rem !important; }
html body .reviewer-badge { flex-wrap: wrap; max-width: 100%; min-width: 0; }
/* A local scrolling region preserves table relationships without widening prose. */
.typography-table-scroll { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; }
.typography-table-scroll:focus-visible { outline: 3px solid #5933a6; outline-offset: 3px; }
.typography-table-scroll table { max-width: none; }
/* Keep action contrast sound while retaining the existing orange/green accents. */
html body #header .nav-menu .book-appointment-btn,
html body .header .nav-menu .book-appointment-btn,
html body .doctor-btn-primary,
html body.doctor-profile-page .sidebar .cta-section .cta-button { background: #ff6b35 !important; color: #1e293b !important; }
html body #header .nav-menu .book-appointment-btn:hover,
html body .header .nav-menu .book-appointment-btn:hover { background: #7a1f3d !important; color: #fff !important; }
html body .footer :is(.footer-btn-secondary,.footer-btn-tertiary) { color: #1e293b !important; }
html body .footer a[href="tel:108"], html body .footer a[href="tel:+917966770001"] { color: #fca5a5 !important; }
html body #emergencyBar.emergency-sticky { padding-inline: 2rem 4rem !important; min-height: 44px; }
html body #emergencyBar.emergency-sticky .close-btn { right: 8px; width: 44px; max-width: 44px; height: 44px; }
/* Localized glyph metrics and comfortable leading are independent of Latin tokens. */
html:lang(hi) body { --type-body: "Noto Sans Devanagari", Inter, sans-serif; --type-heading: "Noto Sans Devanagari", Inter, sans-serif; }
html:lang(gu) body { --type-body: "Noto Sans Gujarati", Inter, sans-serif; --type-heading: "Noto Sans Gujarati", Inter, sans-serif; }
html:lang(hi) body :is(h1,h2,h3,h4), html:lang(gu) body :is(h1,h2,h3,h4) { line-height: 1.6 !important; letter-spacing: normal !important; }
html:lang(hi) body :is(p,li), html:lang(gu) body :is(p,li) { line-height: 1.85 !important; letter-spacing: normal; }
@media (min-width: 1025px) {
  html body .hero-content h1 { font-size: clamp(3rem,3.8vw,3.5rem) !important; line-height: 1.15 !important; }
}
@media (max-width: 980px) {
  html body .hero-container, html body.doctor-profile-page .profile-content,
  html body.doctor-profile-page .content-grid { grid-template-columns: minmax(0,1fr) !important; }
  html body .footer-content, html body .footer-compact .footer-content { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 1260px) {
  html body #header .nav.container, html body .header .nav.container { display: grid !important; grid-template-columns: minmax(0,1fr) auto; gap: .5rem !important; padding: .75rem 1rem !important; width: 100% !important; max-width: 100% !important; min-height: 80px !important; }
  html body #header .logo, html body .header .logo { min-width: 0; max-width: 100%; gap: .5rem !important; }
  html body #header .logo-img, html body .header .logo-img { width: 40px !important; height: 44px !important; flex-shrink: 0; object-fit: contain; transform: none; }
  html body #header .logo-text, html body .header .logo-text { font-size: 1.1rem !important; white-space: normal !important; max-width: 100% !important; min-width: 0; line-height: 1.3 !important; letter-spacing: 0 !important; overflow-wrap: break-word; }
  html body .header .nav-right-controls { display: flex !important; flex-shrink: 0; gap: 0; grid-column: 2; }
  html body #header .hamburger, html body .header .hamburger, html body .header .mobile-search-btn { display: flex !important; min-width: 44px; min-height: 44px; padding: 8px; }
  html body #header .nav-menu:not(.active), html body .header .nav-menu:not(.active) { display: none !important; }
  html body #header .nav-menu.active, html body .header .nav-menu.active { display: flex !important; position: absolute !important; top: 100% !important; flex-direction: column !important; align-items: stretch !important; width: 100%; max-width: 100vw; right: 0; left: 0 !important; padding: 1rem !important; background: #fff !important; color: #1e293b !important; }
  html body #header .nav-menu .book-appointment-btn, html body .header .nav-menu .book-appointment-btn { white-space: normal !important; min-width: 0; max-width: 100% !important; text-align: center !important; }
}
@media (max-width: 640px) {
  html body .services-grid { grid-template-columns: minmax(0,1fr) !important; }
  html body .footer-content, html body .footer-compact .footer-content { grid-template-columns: minmax(0,1fr) !important; }
  html body :is(.hero p.subtitle,.hero > .container > p,.profile-title) { font-size: var(--type-prose) !important; line-height: 1.65 !important; }
  html body.doctor-profile-page .profile-title { font-size: var(--type-prose) !important; line-height: 1.65 !important; }
  html body :is(.content,.main-column,.content-card) { overflow-wrap: break-word; }
}

@media (min-width: 981px) { html body.homepage .footer-content, html body.homepage-redesign .footer-content { grid-template-columns: minmax(0,1.35fr) repeat(3,minmax(0,1fr)); } }
html body.doctor-profile-page .expertise-item h3 { font-size: 1.25rem !important; line-height: 1.4 !important; }
html body.doctor-profile-page .expertise-item p { font-size: 1rem !important; line-height: 1.65 !important; font-family: var(--type-body) !important; }

@media (min-width: 981px) { html:has(link[href^="/homepage.css"]) body .footer-content { grid-template-columns: minmax(0,1.35fr) repeat(3,minmax(0,1fr)); } }

html body :is(.resource-card,.resources-grid) { min-width: 0; max-width: 100%; overflow-wrap: break-word; }
@media (max-width: 640px) { html body .resources-grid { grid-template-columns: minmax(0,1fr) !important; } }

html body :is(.step-card,.articles-grid,.process-steps,.meta-strip-inner,.meta-pill) { min-width: 0; max-width: 100%; overflow-wrap: break-word; }
html body a[href^="mailto:"] { overflow-wrap: anywhere; }
html body .meta-pill { flex-wrap: wrap; white-space: normal; }
@media (max-width: 640px) { html body :is(.articles-grid,.process-steps) { grid-template-columns: minmax(0,1fr) !important; } }

html body .resource-card > div, html body .resource-card h3 { min-width: 0; max-width: 100%; overflow-wrap: break-word; }

/* Additional contrast checks of the same action and footer roles. */
html body .hero .btn-primary, html body .solid-action { color: #1e293b !important; }
html body.seizure-treatment-redesign .footer :is(p,li) { color: #d9ddeb !important; }
html body .section :is(h2,h3)[style*="#FF6B35"], html body .section h3[style*="var(--secondary)"] { color: #9a3412 !important; }
html body .section h3[style*="#10B981"] { color: #047857 !important; }
html body .section p[style*="#dc2626"], html body .section p[style*="#dc2626"] a { color: #b91c1c !important; }

/* Prevent legacy broad telephone-link rules from painting white text on white. */
html body .footer .footer-btn-primary { background: #7a1f3d !important; color: #fff !important; }
html body :is(.footer,.emergency-sticky) a[href^="tel:"]:not(.footer-btn):not(.btn) { background: transparent !important; min-height: 0; padding: 0; display: inline; }

html body .content-section > .container { max-width: calc(var(--type-measure) + 4rem); }
html body .content-section > .container > :is(p,ul,ol) { font-family: var(--type-body) !important; font-size: var(--type-prose) !important; line-height: 1.75 !important; margin-bottom: 1em !important; }
html body .stat-number { font-size: clamp(1.1rem,2vw,1.4rem) !important; line-height: 1.4 !important; color: #9a3412 !important; }
