/* Dr. Surajit Hazra - homepage responsive repair.
   Load AFTER main.css and all existing homepage styles.
   No copy, image/video sources, service URLs or metadata are changed. */

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

/* A grid track must be allowed to shrink without collapsing its content. */
.hero-inner > *,
.intro-grid > *,
.feature > *,
.why-grid > *,
.clinic-wrap > *,
.core-care > *,
.treatment-grid > *,
.why-list > *,
.stories-strip > *,
.media-video-feature > *,
.clinical-grid > *,
.review-top > *,
.review-grid > *,
.cta-inner > *,
.footer-grid-optimized > * {
  min-width: 0;
}

/* This qualified rule intentionally wins over the late desktop hero override. */
.hero .hero-inner {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .82fr);
}
.hero .hero-copy {
  width: 100%;
  min-width: 0;
}
.hero .hero-title {
  width: 100%;
  max-width: 100%;
  line-height: 1.15;
}
.hero .hero-title-service,
.hero .hero-title-doctor {
  max-width: 100%;
  word-break: normal;
  overflow-wrap: normal;
}
.hero .hero-title-doctor {
  font-size: clamp(32px, 3.25vw, 46px);
  line-height: 1.15;
  white-space: normal;
}
.hero .hero-copy .lead {
  width: 100%;
  min-width: 0;
  word-break: normal;
  overflow-wrap: break-word;
}
.hero .eyebrow::before,
.check-list li::before {
  flex-shrink: 0;
}
.hero .hero-visual {
  min-width: 0;
  max-width: 100%;
}
.hero .hero-visual img {
  max-width: 100%;
  height: auto;
}
.hero .hero-chip,
.qualification {
  max-width: 100%;
  white-space: normal;
  line-height: 1.45;
}
.btn,
.footer-contact-btn {
  max-width: 100%;
  text-align: center;
  white-space: normal;
}

/* Preserve the site's single desktop row without squeezing the logo. */
.site-header .nav {
  min-width: 0;
}
.site-header .logo {
  min-width: 0;
}
.site-header .nav-links {
  min-width: 0;
}
.site-header .nav-dropdown-menu a {
  overflow-wrap: break-word;
}

/* Do not let unbreakable content enlarge smaller grid/flex items. */
.clinic-row > div,
.review-source > div,
.gbp-address > div {
  min-width: 0;
  overflow-wrap: break-word;
}
.clinic-row > span {
  flex: 0 0 22px;
}
.field,
.field input,
.field select,
.field textarea {
  min-width: 0;
  max-width: 100%;
}
.feature-media,
.media-card,
.media-video-frame,
.clinical-video {
  min-width: 0;
  max-width: 100%;
}
.feature-media video,
.media-video-frame video,
.clinical-video video {
  max-width: 100%;
}
.media-card {
  margin-inline: 0;
}
.footer .footer-column,
.footer .footer-clinic-card,
.footer .footer-bottom > * {
  min-width: 0;
}
.footer .footer-phone,
.footer .footer-map-link {
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Internal section links must not place the heading under the sticky header. */
main section[id],
main article[id],
.google-location[id] {
  scroll-margin-top: 96px;
}

@media (max-width: 1180px) {
  .footer .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .footer .footer-credit {
    white-space: normal;
    text-align: left;
    overflow-wrap: break-word;
  }
}

@media (max-width: 1160px) {
  .site-header .nav-links {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  .site-header .nav-links a:not(.btn) {
    white-space: normal;
  }
}

@media (max-width: 1040px) {
  /* The missing single-column declaration was the main mobile failure. */
  .hero .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    gap: 28px;
    padding: 44px 0 0;
    align-items: start;
  }
  .hero .hero-copy {
    max-width: 720px;
    justify-self: center;
    padding-bottom: 0;
  }
  .hero .hero-copy .lead {
    max-width: 100%;
  }
  .hero .hero-title-doctor {
    font-size: clamp(32px, 5vw, 42px);
  }
  .hero .hero-visual {
    width: 100%;
    min-height: 0;
    align-self: auto;
    justify-self: center;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    padding: 0 0 28px;
  }
  .hero .hero-visual::before {
    width: min(440px, 90%);
    height: auto;
    aspect-ratio: 1;
    inset: 28px auto auto 50%;
    transform: translateX(-50%);
  }
  .hero .hero-visual img {
    width: min(410px, 100%);
    max-height: none;
    object-fit: contain;
    border-radius: 24px;
  }
  .hero .hero-note {
    position: relative;
    inset: auto;
    width: calc(100% - 24px);
    max-width: 360px;
    margin: -26px auto 0;
  }
  .intro-grid,
  .feature,
  .feature.reverse,
  .why-grid,
  .clinic-wrap,
  .media-video-feature {
    grid-template-columns: minmax(0, 1fr);
  }
  .intro-grid,
  .feature,
  .feature.reverse,
  .why-grid,
  .clinic-wrap {
    gap: 32px;
  }
  .portrait-card {
    width: 100%;
    max-width: 580px;
    margin-inline: auto;
  }
  .core-care {
    grid-template-columns: minmax(0, 1fr);
  }
  .media-video-frame video {
    width: min(320px, 100%);
    height: auto;
  }
}

@media (max-width: 860px) {
  .review-top,
  .cta-inner {
    grid-template-columns: minmax(0, 1fr);
  }
  .review-actions {
    justify-content: flex-start;
  }
  .cta-inner .btn {
    justify-self: start;
  }
  .footer .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 680px) {
  .wrap {
    width: calc(100% - 32px);
    max-width: var(--max);
  }
  .topbar-inner {
    min-height: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 14px;
    padding: 6px 0;
    font-size: 12px;
    line-height: 1.6;
  }
  .topbar-inner > span:first-child {
    flex-basis: 100%;
  }
  .topbar-inner > span:last-child {
    white-space: nowrap;
  }
  .site-header .logo img {
    width: 184px;
    max-width: 55vw;
    height: auto;
  }
  .site-header .menu-btn {
    flex-shrink: 0;
  }
  .site-header .nav-links {
    /* Leave space for the initial top bar, header and bottom action bar. */
    max-height: calc(100vh - 200px);
    max-height: calc(100dvh - 200px - env(safe-area-inset-bottom, 0px));
  }
  .hero .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    padding: 30px 0 0;
    gap: 26px;
  }
  .hero .hero-copy {
    max-width: 100%;
    padding: 0;
  }
  .hero .hero-copy .eyebrow {
    display: flex;
    align-items: center;
    width: 100%;
    font-size: 10px;
    line-height: 1.6;
    letter-spacing: .12em;
    margin-bottom: 16px;
  }
  .hero .hero-copy .eyebrow::before {
    width: 24px;
  }
  .hero .hero-title {
    display: block;
    margin: 0 0 18px;
  }
  .hero .hero-title-service {
    font-size: clamp(20px, 4.8vw, 26px);
    line-height: 1.3;
    letter-spacing: -.01em;
  }
  .hero .hero-title-doctor {
    margin-top: 7px;
    font-size: clamp(20px, 6.25vw, 40px);
    line-height: 1.2;
    letter-spacing: 0;
    /* Sized to fit on normal phones; may wrap rather than clip at high text zoom. */
    white-space: normal;
  }
  .hero .hero-copy .lead {
    max-width: 100%;
    font-size: 16px;
    line-height: 1.65;
    margin-bottom: 0;
  }
  .hero .hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    margin-top: 22px;
    gap: 10px;
  }
  .hero .hero-actions .btn {
    width: 100%;
    min-height: 48px;
    padding-inline: 14px;
  }
  .hero .hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    margin-top: 20px;
  }
  .hero .hero-chip {
    width: auto;
    font-size: 12px;
    padding: 8px 10px;
    line-height: 1.5;
  }
  .hero .hero-visual img {
    width: min(350px, 100%);
    max-height: none;
    height: auto;
  }
  .hero .hero-note {
    max-width: 326px;
    padding: 16px;
    margin-top: -22px;
  }
  .section {
    padding-block: 54px;
  }
  h2 {
    font-size: clamp(26px, 7.2vw, 34px);
    line-height: 1.2;
    overflow-wrap: break-word;
  }
  .section-head {
    margin-bottom: 28px;
  }
  .section-head .lead {
    font-size: 16px;
  }
  .intro-grid,
  .feature,
  .feature.reverse,
  .why-grid,
  .clinic-wrap {
    gap: 28px;
  }
  .core-care,
  .treatment-grid,
  .why-list,
  .stories-strip,
  .review-grid,
  .clinical-grid,
  .cta-inner {
    grid-template-columns: minmax(0, 1fr);
  }
  .portrait-card {
    padding: 12px;
  }
  .qualification {
    font-size: 12px;
  }
  .feature-badge {
    max-width: calc(100% - 24px);
    right: 12px;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
  }
  .media-video-feature {
    padding: 18px;
    gap: 24px;
    margin-bottom: 30px;
  }
  .media-subhead h3,
  .media-feature-copy h3 {
    font-size: 26px;
    line-height: 1.25;
  }
  .clinical-details summary {
    padding: 16px;
    gap: 10px;
  }
  .clinical-details summary > span:last-child {
    min-width: 0;
  }
  .clinical-content {
    padding: 0 14px 18px;
  }
  .review-top,
  .review-card,
  .clinic-card,
  .contact-panel {
    padding: 22px;
  }
  .review-source {
    align-items: flex-start;
    gap: 12px;
  }
  .review-source > div:last-child {
    min-width: 0;
  }
  .review-source strong {
    font-size: 17px;
  }
  .review-actions,
  .review-actions .btn {
    width: 100%;
  }
  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }
  .cta-inner .btn {
    width: 100%;
  }
  /* Show the map and business card separately instead of covering the whole map. */
  .google-location {
    min-height: 0;
  }
  .google-location-map {
    position: relative;
    inset: auto;
    display: block;
    height: 280px;
    width: 100%;
  }
  .google-location-shade {
    display: none;
  }
  .google-location-inner {
    display: block;
    width: calc(100% - 32px);
    min-height: 0;
    padding: 20px 0;
  }
  .gbp-card {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
  }
  .gbp-name {
    font-size: 23px;
    line-height: 1.2;
  }
  .footer {
    padding-top: 44px;
  }
  .footer .footer-services ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 20px;
  }
  .footer .footer-quick-links a,
  .footer .footer-services a {
    display: flex;
    align-items: center;
    min-height: 44px;
    line-height: 1.5;
  }
  .footer .footer-bottom {
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    gap: 12px;
  }
  .mobile-bar {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mobile-bar a {
    min-width: 0;
    padding-inline: 10px;
  }
}

@media (max-width: 420px) {
  .hero .hero-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .hero .hero-chip {
    width: fit-content;
    max-width: 100%;
  }
  .footer .footer-services ul {
    grid-template-columns: minmax(0, 1fr);
  }
}
