/* TASK-2026-09-04-05 — Doctor page rebuild.
   Route-local CSS owns the unique profile, About and Education sections plus
   route spacing around shared Reviews/Appointment components. */

body[data-route="doctor"] {
  --doctor-shell: 1320px;
  --doctor-gutter: 60px;
  --site-header-position: relative;
  overflow-x: clip;
  background: #fff;
}

body[data-route="doctor"] .doctor-page {
  min-inline-size: 0;
  overflow: clip;
}

.doctor-shell {
  width: min(var(--doctor-shell), calc(100% - (var(--doctor-gutter) * 2)));
  margin-inline: auto;
}

.doctor-profile,
.doctor-about {
  font-family: var(--font-body);
}

:where(.doctor-profile, .doctor-about) :where(figure, p) {
  margin: 0;
}

/* Profile — wide two-column composition. */

.doctor-profile {
  background: #fafafa;
}

.doctor-profile__shell {
  display: grid;
  padding-top: 13px;
  grid-template-columns: minmax(0, 572px) minmax(0, 599px);
  column-gap: clamp(48px, 6.806vw, 98px);
  align-items: start;
}

.doctor-profile__copy {
  min-width: 0;
  padding-top: 50px;
}

.doctor-breadcrumbs {
  display: flex;
  min-width: 0;
  align-items: baseline;
  color: #303030;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 17.165px;
  white-space: nowrap;
}

.doctor-breadcrumbs a,
.doctor-breadcrumbs span {
  min-width: 0;
}

.doctor-breadcrumbs [aria-current="page"] {
  color: #010f77;
}

body[data-route="doctor"] .doctor-profile h1 {
  max-width: 572px;
  margin: 37px 0 0;
  color: #232742;
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -2.08px;
}

.doctor-profile__meta {
  display: grid;
  max-width: 497px;
  row-gap: 20px;
  margin-top: 30px;
  font-family: var(--font-display);
  font-weight: 500;
}

.doctor-profile__meta [data-field="role"] {
  color: #303030;
  font-size: 20px;
  line-height: 1;
}

.doctor-profile__meta [data-field="experience"] {
  color: #010f77;
  font-size: 16px;
  line-height: 1;
}

.doctor-profile__intro {
  max-width: 538px;
  margin-top: clamp(56px, 7.014vw, 101px);
  color: #303030;
  font-size: 16px;
  font-weight: 400;
  line-height: 19.617px;
}

.doctor-profile__media {
  position: relative;
  overflow: hidden;
}

.doctor-about__media {
  position: relative;
  overflow: hidden;
}

.doctor-profile__media {
  width: 599px;
  max-width: 100%;
  align-self: end;
  aspect-ratio: 599 / 608;
}

.doctor-profile__media img {
  position: absolute;
  top: -18.82%;
  left: 0;
  width: 100%;
  max-width: none;
  height: auto;
}

.doctor-about__media img {
  position: absolute;
  top: -18.82%;
  left: 0;
  width: 100%;
  max-width: none;
  height: auto;
}

/* Shared action primitive for the two unique sections. */

.doctor-action {
  --corner-color: #fff;
  --corner-hover-color: #010f77;
  --corner-inset: 10px;
  display: flex;
  width: min(360px, 100%);
  height: 60px;
  min-height: 60px;
  align-items: center;
  justify-content: center;
  padding-block: 0;
  color: #fff;
  background: #010f77;
  border: 1px solid #010f77;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
}

.doctor-action__label {
  z-index: 1;
  text-align: center;
}

.doctor-profile__action {
  margin-top: 38px;
}

/* About — media and copy have independent grid ownership. */

.doctor-about {
  padding-top: 60px;
  background: #fff;
}

.doctor-section-head {
  display: flex;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid #eaeaea;
  color: #5f5f5f;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -.56px;
  text-transform: uppercase;
}

.doctor-about__layout {
  display: grid;
  margin-top: -14px;
  grid-template-columns: minmax(0, 620px) minmax(0, 650px);
  grid-template-areas:
    "media copy"
    "media action";
  column-gap: 50px;
}

.doctor-about__copy {
  min-width: 0;
  padding-top: 74px;
  grid-area: copy;
}

body[data-route="doctor"] .doctor-about h2 {
  max-width: 487px;
  margin: 0;
  color: #232742;
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -2.08px;
}

.doctor-about__copy p {
  max-width: 650px;
  margin-top: 30px;
  color: #303030;
  font-size: 16px;
  font-weight: 400;
  line-height: 19.617px;
}

.doctor-about__media {
  width: 503px;
  max-width: 100%;
  margin-left: 4px;
  align-self: end;
  grid-area: media;
  aspect-ratio: 503 / 509;
}

.doctor-about__badge {
  z-index: 1;
  display: grid;
  width: 66px;
  height: 66px;
  align-self: center;
  justify-self: end;
  place-items: center;
  grid-area: media;
  background: rgb(192 193 204 / 30%);
  transform: translateY(-20%);
}

.doctor-about__badge img {
  width: 36px;
  height: 36px;
}

.doctor-about__action {
  align-self: end;
  margin: 40px 0 61px;
  grid-area: action;
}

/* Compact desktop: retain two columns, but let both tracks share space. */

@media (max-width: 1359px) and (min-width: 981px) {
  body[data-route="doctor"] {
    --doctor-gutter: 32px;
  }

  .doctor-profile__shell {
    grid-template-columns: minmax(0, 1fr) minmax(420px, .98fr);
  }

  .doctor-profile__copy {
    padding-top: clamp(28px, 4vw, 50px);
    padding-bottom: 40px;
  }

  body[data-route="doctor"] .doctor-profile h1 {
    font-size: clamp(42px, 4vw, 52px);
    letter-spacing: -.04em;
  }

  .doctor-profile__intro {
    margin-top: clamp(59px, calc(9.6vw - 35px), 95px);
  }

  .doctor-about__layout {
    grid-template-columns: minmax(0, .96fr) minmax(0, 1.04fr);
    column-gap: 32px;
  }
}

/* Tablet: one-column editorial composition, before the phone treatment. */

@media (max-width: 980px) and (min-width: 768px) {
  body[data-route="doctor"] {
    --doctor-gutter: 32px;
  }

  .doctor-profile__shell {
    padding-block: 42px 0;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 42px;
    justify-items: center;
  }

  .doctor-profile__copy {
    display: grid;
    width: min(680px, 100%);
    padding-top: 0;
  }

  body[data-route="doctor"] .doctor-profile h1 {
    font-size: clamp(42px, 6vw, 52px);
    letter-spacing: -.04em;
  }

  body[data-route="doctor"] .doctor-profile h1 {
    max-width: 680px;
  }

  .doctor-profile__intro {
    margin-top: 46px;
    justify-self: center;
    text-align: center;
  }

  .doctor-profile__action {
    justify-self: center;
  }

  .doctor-profile__media {
    width: min(599px, 100%);
    justify-self: center;
  }

  .doctor-about__layout {
    margin-top: 35px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "copy"
      "media"
      "action";
    column-gap: 0;
  }

  .doctor-about__copy {
    padding-top: 0;
  }

  .doctor-about__media {
    width: min(599px, calc(100% + 4px));
    margin: -21px auto 0;
    aspect-ratio: 394 / 433;
  }

  .doctor-about__media img {
    top: -18.71%;
    left: -6.28%;
    width: 108.1395%;
  }

  .doctor-about__badge {
    display: none;
  }

  .doctor-about__action {
    z-index: 1;
    width: min(599px, calc(100% + 4px));
    margin: -10px auto 0;
  }
}

/* Phone: exact 430 composition plus intrinsic narrow-width continuation. */

@media (max-width: 767px) {
  body[data-route="doctor"] {
    --doctor-gutter: 20px;
  }

  .doctor-profile__shell {
    width: 100%;
    padding-top: 52px;
    grid-template-columns: minmax(0, 1fr);
  }

  .doctor-profile__copy {
    min-width: 0;
    padding: 0 var(--doctor-gutter);
  }

  .doctor-breadcrumbs {
    overflow-wrap: anywhere;
    white-space: normal;
    font-size: clamp(12px, 3.256vw, 14px);
    line-height: 17px;
  }

  body[data-route="doctor"] .doctor-profile h1 {
    max-width: 348px;
    margin-top: 20px;
    font-size: clamp(30px, 7.442vw, 32px);
    line-height: 1;
    letter-spacing: -.04em;
  }

  .doctor-profile__meta {
    max-width: none;
    row-gap: 10px;
    margin-top: 20px;
  }

  .doctor-profile__meta [data-field="role"] {
    font-size: 16px;
  }

  .doctor-profile__meta [data-field="experience"] {
    font-size: 14px;
  }

  .doctor-profile__intro {
    max-width: none;
    margin-top: 20px;
    font-size: 14px;
    line-height: 17px;
  }

  .doctor-profile__action {
    display: none;
  }

  .doctor-profile__media {
    width: auto;
    max-width: none;
    margin: 0 20px 0 16px;
    aspect-ratio: 394 / 433;
  }

  .doctor-profile__media img {
    top: -12.8%;
    left: 0;
    width: 100%;
  }

  .doctor-about__media img {
    top: -18.71%;
    left: -6.28%;
    width: 108.1395%;
  }

  .doctor-about {
    padding-top: 40px;
  }

  .doctor-section-head {
    padding-top: 10px;
    font-size: 12px;
    line-height: 1;
    letter-spacing: -.48px;
  }

  .doctor-about__layout {
    margin-top: 35px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "copy"
      "media"
      "action";
    column-gap: 0;
  }

  .doctor-about__copy {
    padding-top: 0;
  }

  body[data-route="doctor"] .doctor-about h2 {
    max-width: 390px;
    font-size: 32px;
    line-height: 1;
    letter-spacing: -1.28px;
  }

  .doctor-about__copy p {
    max-width: none;
    margin-top: 20px;
    font-size: 14px;
    line-height: 17px;
  }

  .doctor-about__media {
    width: auto;
    max-width: none;
    margin: -21px 0 0 -4px;
    aspect-ratio: 394 / 433;
  }

  .doctor-about__badge {
    display: none;
  }

  .doctor-about__action {
    z-index: 1;
    width: 100%;
    margin: -10px 0 0 -2px;
  }
}

@media (max-width: 767px) and (min-width: 600px) {
  .doctor-profile__media {
    width: min(599px, calc(100% - 36px));
    margin-inline: auto;
  }

  .doctor-about__media,
  .doctor-about__action {
    width: min(599px, calc(100% + 4px));
    margin-inline: auto;
  }
}

@media (max-width: 360px) {
  body[data-route="doctor"] {
    --doctor-gutter: 16px;
  }

  .doctor-profile__shell {
    padding-top: 44px;
  }

  body[data-route="doctor"] .doctor-profile h1 {
    font-size: 30px;
  }

  .doctor-profile__media {
    width: auto;
    margin-inline: 16px;
  }

  .doctor-about__media {
    margin-left: 0;
  }
}

/* Education — unique content, generic carousel behavior. */

.doctor-education {
  background: #fafafa;
}

.doctor-education p {
  margin: 0;
}

.doctor-education__surface {
  padding-top: 60px;
  background: #fafafa;
}

.doctor-education__shell {
  display: grid;
  padding-bottom: 60px;
  grid-template-columns: minmax(0, 1fr) 140px;
  grid-template-areas:
    "head head"
    "title controls"
    "layout layout";
}

.doctor-education__head {
  grid-area: head;
}

.doctor-education__title-row {
  min-width: 0;
  margin-top: 60px;
  grid-area: title;
}

body[data-route="doctor"] .doctor-education h2 {
  width: min(487px, 100%);
  margin: 0;
  color: #232742;
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -2.08px;
}

.doctor-education h2 span {
  display: block;
  color: #c0c1cc;
}

.doctor-education__layout {
  display: grid;
  width: calc(100% + var(--doctor-gutter));
  margin-top: 40px;
  grid-template-columns: 538px 710px;
  gap: 132px;
  grid-area: layout;
}

.doctor-history {
  min-width: 0;
}

.doctor-history__group + .doctor-history__group {
  margin-top: 40px;
}

.doctor-history__group h3 {
  margin: 0;
  color: #010f77;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}

.doctor-history__group ul {
  display: grid;
  gap: 20px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.doctor-history__group li {
  display: grid;
  min-width: 0;
  grid-template-columns: 3px minmax(0, 1fr);
  gap: 20px;
  color: #7c7c7c;
  font-size: 14px;
  line-height: 17px;
}

.doctor-history__group li::before {
  width: 3px;
  height: 20px;
  background: #010f77;
  content: "";
}

.doctor-certificates {
  width: 710px;
  min-width: 0;
  height: 349px;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.doctor-certificates.is-dragging {
  cursor: grabbing;
}

html:not(.js) .doctor-certificates {
  max-width: none;
  overflow-x: auto;
  scrollbar-gutter: auto;
  scrollbar-width: none;
}

html:not(.js) .doctor-certificates::-webkit-scrollbar {
  display: none;
}

.doctor-certificates__track {
  display: flex;
  width: max-content;
  gap: 20px;
  will-change: transform;
}

.doctor-certificates__track > img {
  width: 238px;
  max-width: none;
  height: 349px;
  flex: 0 0 238px;
  object-fit: cover;
}

.doctor-carousel-controls {
  z-index: 1;
  display: flex;
  width: 140px;
  align-items: center;
  gap: 20px;
  height: 60px;
  margin-top: 96px;
  align-self: start;
  grid-area: controls;
}

.doctor-carousel-controls button {
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  padding: 0;
  background: #fafafa center / 9px 18px no-repeat;
  border: 0;
  font-size: 0;
  transition: background-color .2s ease;
}

.doctor-carousel-controls button:first-child {
  background-image: url('../media/doctor/slider-arrow-left.svg');
}

.doctor-carousel-controls button:last-child {
  background-image: url('../media/doctor/slider-arrow-right.svg');
}

.doctor-carousel-controls button:is(:hover, :focus-visible) {
  background-color: #fff;
}

.doctor-carousel-controls__count {
  display: none;
  width: 54px;
  color: #c4c4c1;
  font-family: var(--font-display);
  white-space: nowrap;
}

.doctor-carousel-controls__count b {
  color: #010f77;
  font-size: 24px;
  font-weight: 500;
}

/* Shared text reviews retain their canonical internals in reviews.css. */

body[data-route="doctor"] .doctor-reviews {
  margin: 0;
  padding: 60px 0 0;
}

body[data-route="doctor"] .doctor-reviews > .page-shell {
  box-shadow: inset 0 1px #eaeaea;
}

@media (min-width: 768px) {
  body[data-route="doctor"] .doctor-reviews > .page-shell {
    padding-bottom: 60px;
  }
}

@media (min-width: 1280px) and (max-width: 1439px) {
  .doctor-education__layout {
    width: calc(100% + var(--doctor-gutter));
    grid-template-columns: 538px minmax(0, 1fr);
    gap: clamp(40px, 9.17vw, 132px);
  }

  .doctor-certificates {
    width: 100%;
  }
}

@media (min-width: 768px) and (max-width: 1279px) {
  .doctor-education__shell {
    display: block;
  }

  .doctor-education__layout {
    display: block;
    width: 100%;
  }

  .doctor-history {
    width: min(538px, 100%);
  }

  .doctor-certificates {
    width: calc(100% + (var(--doctor-gutter) * 2));
    margin-inline-start: calc(var(--doctor-gutter) * -1);
    margin-top: 60px;
    scroll-padding-inline-start: var(--doctor-gutter);
  }

  .doctor-certificates__track {
    padding-inline-start: var(--doctor-gutter);
  }

  .doctor-carousel-controls {
    width: max-content;
    margin: 35px auto 0;
  }

  .doctor-carousel-controls__count {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
  }
}

@media (max-width: 767px) {
  .doctor-education {
    padding: 40px 0;
    background: #fff;
  }

  .doctor-education__surface {
    padding-top: 40px;
  }

  .doctor-education__shell {
    display: block;
    padding-bottom: 0;
  }

  .doctor-education__title-row {
    margin-top: 35px;
  }

  body[data-route="doctor"] .doctor-education h2 {
    width: 100%;
    font-size: 32px;
    line-height: 1;
    letter-spacing: -1.28px;
  }

  .doctor-education__layout {
    display: block;
    width: 100%;
    margin-top: 30px;
  }

  .doctor-history__group:first-child {
    width: calc(100% + 6px);
  }

  .doctor-history__group + .doctor-history__group {
    margin-top: 30px;
  }

  .doctor-history__group h3 {
    font-size: 16px;
  }

  .doctor-certificates {
    width: calc(100% + (var(--doctor-gutter) * 2));
    margin-inline-start: calc(var(--doctor-gutter) * -1);
    margin-top: 57px;
    scroll-padding-inline-start: var(--doctor-gutter);
  }

  .doctor-certificates__track {
    gap: 24px;
    padding-inline-start: var(--doctor-gutter);
  }

  .doctor-carousel-controls {
    width: max-content;
    margin: 35px auto 0;
    transform: translateX(6px);
  }

  .doctor-carousel-controls__count {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
  }

  body[data-route="doctor"] .doctor-reviews {
    margin-top: 0;
    padding-top: 0;
  }
}

@media (max-width: 360px) {
  .doctor-history__group:first-child {
    width: 100%;
  }

  .doctor-history__group li {
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .doctor-profile,
  .doctor-about,
  .doctor-certificates {
    scroll-behavior: auto;
  }

  .doctor-certificates__track {
    transition: none !important;
  }
}
