/* V22 — qualification badges, compact spacing, complete treatment carousel. */

/* Start the Home content close to the header, without viewport-height centring. */
body[data-page="home"] .hero-section { min-height: 0; align-items: flex-start; }
body[data-page="home"] .hero-grid { min-height: 0; padding-block: 12px 28px; align-items: start; }
body[data-page="home"] .hero-copy { padding-top: 0; }
body[data-page="home"] .hero-visual { align-self: start; }
body[data-page="home"] .hero-photo-frame { min-height: 0; }

/* Degrees sit immediately below each name; all supplied clinical copy is retained. */
.doctor-degree-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  justify-self: start;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 18px;
  padding: 9px 13px;
  border: 1px solid #dbe3f2;
  border-radius: 10px;
  background: #edf2fb;
  color: var(--ink);
}
.doctor-degree-badge > span { flex: 0 0 auto; font-size: 23px; line-height: 1.2; }
.doctor-degree-badge strong { display: block; font: inherit; font-size: 15px; line-height: 1.4; letter-spacing: .02em; }
.doctor-degree-badge small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.5; }
body[data-page="home"] .credential-copy .client-doctor-name,
body[data-page="about"] .doctor-card-body .client-doctor-name {
  margin-bottom: 10px;
  font-size: clamp(23px, 2.1vw, 29px);
  line-height: 1.3;
  white-space: normal;
}
body[data-page="home"] .credential-copy .doctor-title,
body[data-page="about"] .doctor-card-body .doctor-title { min-height: 0; margin-bottom: 14px; }
body[data-page="home"] .credential-copy .doctor-description,
body[data-page="about"] .doctor-card-body .doctor-description { min-height: 0; }
body[data-page="home"] .credential-copy ul { align-content: start; gap: 10px; }
body[data-page="home"] .credential-copy li { border: 0; border-radius: 0; background: transparent; padding: 0; }
.home-doctor-identity { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.home-doctor-identity > strong { margin: 0; }
.home-doctor-identity .doctor-degree-badge { gap: 7px; padding: 7px 10px; margin: 0; }
.home-doctor-identity .doctor-degree-badge > span { font-size: 19px; }
.home-doctor-identity .doctor-degree-badge strong { font-size: 13px; }
.home-doctor-identity .doctor-experience-inline { margin: 0; }
html[data-theme="dark"] .doctor-degree-badge { background: #20354f; border-color: #506783; }

/* V24: only the two Home specialist cards use this portrait-first layout. */
body[data-page="home"] #qualifications .credentials-grid {
  grid-template-rows: auto;
  gap: 26px;
  align-items: stretch;
}
body[data-page="home"] #qualifications .credential-card,
body[data-page="home"] #qualifications .credential-card.active {
  display: flex;
  flex-direction: column;
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: none;
  grid-row: auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--soft-surface);
  box-shadow: none;
  overflow: hidden;
}
body[data-page="home"] #qualifications .credential-profile {
  flex: 0 0 auto;
  width: 100%;
  height: clamp(300px,26vw,380px);
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
}
body[data-page="home"] #qualifications .credential-profile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 23%;
}
body[data-page="home"] #qualifications #home-doctor-pratheepa .credential-profile img { object-position: center 14%; }
body[data-page="home"] #qualifications .experience-mark {
  inset: auto auto 18px 18px;
  max-width: calc(100% - 36px);
  padding: 9px 13px;
  box-shadow: 0 3px 12px rgb(23 40 64 / 8%);
}
body[data-page="home"] #qualifications .credential-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  grid-template-rows: none;
  grid-row: auto;
  width: 100%;
  min-width: 0;
  padding: 24px;
  gap: 0;
}
body[data-page="home"] #qualifications .client-doctor-name {
  min-height: 0;
  margin: 0 0 10px;
  font-size: clamp(24px,2.2vw,30px);
  line-height: 1.3;
  white-space: normal;
}
body[data-page="home"] #qualifications .doctor-degree-badge {
  flex: 0 0 auto;
  align-self: flex-start;
  margin: 0 0 16px;
}
body[data-page="home"] #qualifications .doctor-title {
  min-height: 0;
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.55;
}
body[data-page="home"] #qualifications .doctor-description {
  min-height: 0;
  margin: 0 0 22px;
  font-size: 16px;
  line-height: 1.7;
}
body[data-page="home"] #qualifications .credential-copy h4 {
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 18px;
  line-height: 1.4;
}
body[data-page="home"] #qualifications .credential-copy ul {
  display: grid;
  align-content: start;
  gap: 9px;
  margin: 14px 0 24px;
  padding: 0 0 0 20px;
  list-style: disc;
}
body[data-page="home"] #qualifications .credential-copy li {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 15px;
  line-height: 1.65;
}
body[data-page="home"] #qualifications .credential-copy li::marker { color: var(--blue); }
body[data-page="home"] #qualifications .credential-more {
  align-self: flex-start;
  margin-top: auto;
  min-height: 44px;
}
@media (max-width: 820px) {
  body[data-page="home"] #qualifications .credentials-grid { display: block; }
  body[data-page="home"] #qualifications .credential-card:not(.active) { display: none; }
  body[data-page="home"] #qualifications .credential-card.active { height: auto; }
  body[data-page="home"] #qualifications .credential-profile { height: clamp(300px,80vw,440px); }
  body[data-page="home"] #qualifications .client-doctor-name { font-size: clamp(23px,5.5vw,28px); }
}

/* Remove the double section padding between the profiles and treatment introduction. */
body[data-page="home"] .home-credentials { padding-bottom: 32px; }
body[data-page="home"] .services-section { padding-block: 32px 64px; }
body[data-page="home"] .services-section > .section-shell > .section-heading:first-child { margin-bottom: 24px; }
body[data-page="home"] .explore-treatment-options { margin-bottom: 28px; }
body[data-page="home"] .home-treatment-heading { padding-top: 28px; margin-bottom: 22px; }

/* A native horizontal rail, with separate 44px controls on both sides. */
.treatment-carousel { --carousel-control: 44px; --carousel-gap: 12px; min-width: 0; }
.treatment-carousel-caption { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.treatment-carousel-caption p { margin: 0; font-size: 14px; line-height: 1.5; }
.treatment-carousel-caption [data-swipe-status] { flex: 0 0 auto; font-size: 13px; line-height: 1.5; font-variant-numeric: tabular-nums; color: var(--ink); }
.treatment-carousel-stage {
  display: grid;
  grid-template-columns: var(--carousel-control) minmax(0, 1fr) var(--carousel-control);
  gap: var(--carousel-gap);
  align-items: center;
  min-width: 0;
}
.treatment-carousel-arrow {
  display: grid;
  place-items: center;
  width: var(--carousel-control);
  height: var(--carousel-control);
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft-surface);
  color: var(--ink);
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.treatment-carousel-arrow:hover:not(:disabled) { border-color: var(--blue); background: var(--surface-wash); }
.treatment-carousel-arrow:disabled { opacity: .4; cursor: default; }
.treatment-carousel-arrow:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
body[data-page="home"] .home-treatment-stack.swipe-track {
  display: grid;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 40px) / 3);
  gap: 20px;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 4px 0 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  overscroll-behavior-x: contain;
}
body[data-page="home"] .home-treatment-stack .home-treatment-card { min-width: 0; margin: 0; box-shadow: none; scroll-snap-align: start; }
body[data-page="home"] .home-treatment-stack .home-treatment-media { height: 205px; min-height: 0; flex-basis: 205px; }
body[data-page="home"] .home-treatment-stack .home-treatment-copy { padding: 22px; }
body[data-page="home"] .home-treatment-stack .home-treatment-copy h3 { font-size: clamp(24px, 2.2vw, 29px); line-height: 1.2; }
body[data-page="home"] .home-treatment-stack .home-treatment-copy p { margin: 0; }
body[data-page="home"] .home-treatment-stack .home-treatment-copy ul { padding-top: 18px; margin-bottom: 0; }
body[data-page="home"] .home-treatment-actions { margin-top: 22px; }

/* The dedicated treatment page retains its existing desktop grid. */
.treatment-page-carousel > .treatment-carousel-caption,
.treatment-page-carousel .treatment-carousel-arrow { display: none; }
.treatment-page-carousel > .treatment-carousel-stage { display: block; }
body[data-page="treatments"] .treatment-page-carousel .treatment-bento-scroll { width: 100%; margin: 0; }

/* Centre the clinic information beneath reviews on the same page container. */
body[data-page="home"] .home-clinic-info {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 28px 0 32px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  background: var(--surface-wash);
}
body[data-page="home"] .home-clinic-info .trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(1264px, calc(100% - 96px));
  margin-inline: auto;
  padding: 0;
  gap: 18px;
}
body[data-page="home"] .home-clinic-info .trust-grid > div {
  min-height: 120px;
  padding: 24px;
  justify-content: flex-start;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft-surface);
}
body[data-page="home"] .home-clinic-info .trust-grid > div > span { min-width: 0; }
body[data-page="home"] .home-clinic-info .trust-grid strong { font-size: 18px; color: var(--ink); }
body[data-page="home"] .home-clinic-info .trust-grid small { font-size: 14px; }

@media (min-width: 821px) and (max-width: 1199px) {
  body[data-page="home"] .home-treatment-stack.swipe-track { grid-auto-columns: calc((100% - 20px) / 2); }
  body[data-page="home"] .home-clinic-info .trust-grid > div { padding: 20px 16px; gap: 12px; }
  body[data-page="home"] .home-clinic-info .trust-grid strong { font-size: 17px; }
}
@media (min-width: 821px) and (max-width: 1100px) {
  body[data-page="home"] .home-clinic-info .trust-grid { width: calc(100% - 64px); }
  body[data-page="home"] .credential-copy .client-doctor-name,
  body[data-page="about"] .doctor-card-body .client-doctor-name { font-size: 23px; }
}
html.mobile-desktop-mode .treatment-carousel { --carousel-control: 60px; }

@media (max-width: 820px) {
  body[data-page="home"] .hero-grid { padding-block: 8px 18px; align-items: center; }
  body[data-page="home"] .hero-visual { align-self: center; }
  body[data-page="home"] .home-credentials { padding-bottom: 24px; }
  body[data-page="home"] .services-section { padding-block: 24px 44px; }
  body[data-page="home"] .credential-copy .client-doctor-name,
  body[data-page="about"] .doctor-card-body .client-doctor-name { font-size: clamp(21px, 5.5vw, 28px); }
  .treatment-carousel-stage,
  .treatment-page-carousel > .treatment-carousel-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--carousel-control);
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    align-items: stretch;
  }
  .treatment-carousel-stage > :is(.swipe-track, .mobile-swipe-track) { grid-column: 1; grid-row: 1 / 3; }
  .treatment-carousel-stage > [data-swipe-prev] { grid-column: 2; grid-row: 1; align-self: end; }
  .treatment-carousel-stage > [data-swipe-next] { grid-column: 2; grid-row: 2; align-self: start; }
  .treatment-page-carousel > .treatment-carousel-caption { display: flex; }
  .treatment-page-carousel .treatment-carousel-arrow { display: grid; }
  body[data-page="home"] .home-treatment-stack.swipe-track,
  body[data-page="treatments"] .treatment-page-carousel .treatment-bento-scroll.mobile-swipe-track {
    grid-auto-columns: 100%;
    gap: 14px;
    width: 100%;
    min-width: 0;
    padding: 4px 0 12px;
  }
  body[data-page="home"] .home-treatment-stack .home-treatment-media { height: 190px; flex-basis: 190px; }
  body[data-page="home"] .home-treatment-stack .home-treatment-copy { padding: 20px 18px; }
  body[data-page="home"] .home-treatment-actions { flex-direction: row; justify-content: flex-end; align-items: center; gap: 12px; }
  body[data-page="home"] .home-treatment-actions a { width: auto; max-width: 100%; }
  body[data-page="home"] .home-clinic-info { padding-block: 22px 28px; }
  body[data-page="home"] .home-clinic-info .trust-grid { grid-template-columns: 1fr; width: calc(100% - 44px); gap: 12px; }
  body[data-page="home"] .home-clinic-info .trust-grid > div { min-height: 100px; padding: 20px; border: 1px solid var(--line); }
  body[data-page="home"] .home-clinic-info .trust-grid > div + div { border: 1px solid var(--line); }

  /* Keep the review arrows beside the card, with no controls below it. */
  body[data-page="home"] .reviews-carousel { display: grid; grid-template-columns: minmax(0, 1fr) 44px; grid-template-rows: 1fr 1fr; gap: 12px; padding: 0; }
  body[data-page="home"] .reviews-carousel > [data-slot="carousel-content"] { grid-column: 1; grid-row: 1 / 3; min-width: 0; }
  body[data-page="home"] .reviews-carousel .review-arrow {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    translate: none;
    width: 44px !important;
    height: 44px !important;
    margin: 0;
    grid-column: 2;
  }
  body[data-page="home"] .reviews-carousel .review-prev { grid-row: 1; align-self: end; }
  body[data-page="home"] .reviews-carousel .review-next { grid-row: 2; align-self: start; }
  body[data-page="home"] .reviews-home .reviews-actions { margin-top: 20px; }
}
@media (max-width: 560px) {
  body[data-page="home"] .home-clinic-info .trust-grid { width: calc(100% - 36px); }
}
@media (prefers-reduced-motion: reduce) {
  .treatment-carousel-arrow { transition: none; }
}
