.cms-directory-page {
  background: #f5f8fc;
}

.cms-directory-page .directory-hero h1,
.cms-contact-page .info-hero h1 {
  font-size: clamp(32px, 2.9vw, 46px);
  line-height: 1.18;
}

.cms-directory-page .directory-toolbar {
  position: static;
  top: auto;
}

.cms-directory-page .directory-empty {
  display: none;
}

.cms-directory-page .directory-empty.is-visible {
  display: block;
}

.cms-directory-page [hidden] {
  display: none !important;
}

.cms-directory-doctors .directory-expert-card {
  position: relative;
  min-height: 354px;
  padding: 20px;
  border-radius: 20px;
}

.cms-directory-doctors .cms-card-detail-arrow {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #cfdeec;
  border-radius: 50%;
  color: var(--brand-600);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 14px rgba(var(--brand-rgb), 0.08);
  font-size: 17px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-4px, 4px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.cms-directory-doctors .cms-doctor-card:hover .cms-card-detail-arrow,
.cms-directory-doctors .cms-card-detail-arrow:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.cms-directory-doctors .cms-card-detail-arrow:hover,
.cms-directory-doctors .cms-card-detail-arrow:focus-visible {
  border-color: #aac7e2;
  color: var(--brand-700);
  background: #edf5fc;
}

.cms-directory-doctors .expert-avatar,
.cms-directory-doctors .cms-directory-doctor-photo {
  width: 108px;
  height: 132px;
  border-radius: 14px;
  object-fit: cover;
  object-position: center top;
}

.cms-directory-doctors .expert-head {
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.cms-directory-doctors .expert-name-row h2 a {
  color: var(--ink);
}

.cms-directory-doctors .expert-role,
.cms-directory-doctors .expert-bio {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.cms-directory-doctors .expert-role {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.65;
  -webkit-line-clamp: 2;
}

.cms-directory-doctors .expert-bio {
  min-height: 66px;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.7;
  -webkit-line-clamp: 3;
}

.cms-directory-doctors .expert-consult-link {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}


.cms-directory-cases .directory-case-content > p {
  display: -webkit-box;
  flex: 0 0 auto;
  max-height: 5.25em;
  margin-bottom: 14px;
  overflow: hidden;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.cms-directory-cases .directory-case-content {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.cms-directory-cases .directory-case-content h2 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cms-directory-cases .directory-case-content .directory-tags {
  max-height: 31px;
  flex: 0 0 auto;
  overflow: hidden;
}

.cms-directory-cases .directory-case-link {
  flex: 0 0 auto;
}

.cms-directory-cases .directory-case-image img {
  transition: transform 0.35s ease;
}

.cms-directory-cases .directory-case-card:hover .directory-case-image img {
  transform: scale(1.035);
}

.cms-contact-page {
  background: #f5f8fc;
}

.cms-contact-page .info-hero {
  padding: 76px 0 54px;
  color: #fff;
  background: #0c3158;
}

.cms-contact-page .info-hero .eyebrow {
  color: #9ac9f3;
}

.cms-contact-page .info-hero h1 {
  max-width: 820px;
  margin: 12px 0 16px;
  font-family: var(--font-display);
  letter-spacing: -0.035em;
}

.cms-contact-page .info-hero p:last-child {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  line-height: 1.75;
}

.cms-contact-main {
  padding: 54px 0 96px;
}

.cms-contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.72fr);
  align-items: start;
  gap: 30px;
}

.cms-contact-form,
.cms-contact-quick {
  border: 1px solid rgba(var(--brand-rgb), 0.14);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(var(--brand-rgb), 0.06);
}

.cms-contact-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 34px;
}

.cms-contact-field-wide {
  grid-column: auto;
}

.cms-contact-form-heading {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.cms-contact-form-heading p,
.cms-contact-quick-kicker {
  margin: 0 0 7px;
  color: var(--brand-600);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.cms-contact-form-heading h2 {
  margin: 0 0 7px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 25px;
}

.cms-contact-form-heading span {
  color: var(--muted);
  font-size: 14px;
}

.cms-contact-field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.cms-contact-field input,
.cms-contact-field select,
.cms-contact-field textarea {
  width: 100%;
  min-height: 50px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #f9fbfd;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.cms-contact-field textarea {
  min-height: 132px;
  resize: vertical;
}

.cms-contact-field input:focus,
.cms-contact-field select:focus,
.cms-contact-field textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.08);
}

.cms-contact-field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.cms-captcha-row {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 10px;
}

.cms-captcha-row img {
  width: 150px;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  object-fit: contain;
}

.cms-contact-submit {
  min-height: 50px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--brand-700);
  cursor: pointer;
  font-weight: 700;
}

.cms-contact-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.cms-contact-submit:hover,
.cms-contact-submit:focus-visible {
  background: var(--brand-900);
}

.cms-contact-status {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.cms-contact-quick {
  position: sticky;
  top: 92px;
  padding: 30px;
}

.cms-contact-quick h2 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 23px;
}

.cms-contact-quick-kicker {
  color: var(--brand-600);
}

.cms-contact-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.cms-contact-row span {
  color: var(--muted);
}

.cms-contact-row a {
  overflow-wrap: anywhere;
  color: var(--brand-700);
  font-weight: 700;
  text-align: right;
}

.form-feedback {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
}

.form-feedback.is-success {
  color: #14633f;
  background: #e8f7ef;
}

.form-feedback.is-error {
  color: #9b2c2c;
  background: #fff0f0;
}

.form-feedback.is-loading {
  color: var(--brand-700);
  background: var(--brand-soft);
}

.cms-profile-page {
  color: var(--ink);
  background: #f5f8fc;
}

.cms-profile-hero {
  padding: 42px 0 72px;
  background:
    radial-gradient(circle at 84% 18%, rgba(62, 148, 224, 0.18), transparent 26%),
    linear-gradient(135deg, #eef5fc, #fff 64%);
}

.cms-profile-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 12px;
}

.cms-profile-breadcrumb a {
  color: var(--brand-700);
}

.cms-profile-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  max-width: 1040px;
  overflow: hidden;
  border: 1px solid rgba(var(--brand-rgb), 0.15);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(var(--brand-rgb), 0.1);
}

.cms-profile-photo-wrap {
  min-height: 470px;
  background: #dfeafa;
}

.cms-profile-photo,
.cms-profile-photo-placeholder {
  width: 100%;
  height: 100%;
  min-height: 470px;
}

.cms-profile-photo {
  display: block;
  object-fit: cover;
  object-position: center top;
}

.cms-profile-photo-placeholder {
  display: grid;
  place-items: center;
  color: var(--brand-700);
  font-size: 46px;
  font-weight: 800;
}

.cms-profile-summary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 50px;
}

.cms-profile-summary .eyebrow {
  margin: 0 0 14px;
}

.cms-profile-name-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cms-profile-name-row h1,
.cms-case-article-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 2.9vw, 46px);
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.cms-profile-name-row .expert-consult-link {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
}

.cms-profile-role {
  margin: 14px 0 0;
  color: var(--brand-700);
  font-size: 17px;
  font-weight: 700;
}

.cms-profile-tags {
  margin-top: 18px;
}

.cms-profile-lead,
.cms-case-article-lead {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
}

.cms-profile-lead {
  margin: 22px 0 0;
}

.cms-profile-hospital {
  margin-top: 26px;
}

.cms-profile-content-section,
.cms-case-article-body {
  padding: 72px 0;
  background: #fff;
}

.cms-profile-content-shell,
.cms-case-article-content,
.cms-case-article-shell {
  max-width: 980px;
}

/* Case masthead uses the full site shell; only long-form body keeps reading width. */
.cms-case-article-shell {
  max-width: none;
}

.cms-profile-content-shell > h2 {
  margin: 14px 0 30px;
  font-family: var(--font-display);
  font-size: clamp(32px, 2.9vw, 46px);
  line-height: 1.18;
}

.cms-profile-rich {
  color: #425875;
  font-size: 15px;
  line-height: 1.9;
}

.cms-profile-rich > :first-child {
  margin-top: 0;
}

.cms-profile-rich > :last-child {
  margin-bottom: 0;
}

.cms-profile-rich h2,
.cms-profile-rich h3,
.cms-profile-rich h4 {
  margin: 34px 0 14px;
  color: var(--ink);
  line-height: 1.35;
}

.cms-profile-rich img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
}

.cms-profile-rich table {
  display: table;
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  max-height: none !important;
  overflow: visible;
  border-collapse: collapse;
  table-layout: auto;
}

.cms-profile-rich thead,
.cms-profile-rich tbody,
.cms-profile-rich tfoot,
.cms-profile-rich tr {
  height: auto !important;
  max-height: none !important;
  overflow: visible;
}

.cms-profile-rich th,
.cms-profile-rich td {
  min-width: 0;
  height: auto !important;
  padding: 12px;
  border: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.cms-profile-cta {
  padding: 64px 0 80px;
  color: #fff;
  background: var(--brand-900);
}

.cms-profile-cta .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.cms-profile-cta h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 28px;
}

.cms-profile-cta p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.cms-profile-cta a {
  flex: 0 0 auto;
  padding: 14px 24px;
  border-radius: 999px;
  color: var(--brand-900);
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.cms-profile-cta a:hover,
.cms-profile-cta a:focus-visible {
  color: #fff;
  background: var(--brand-600);
  transform: translateY(-2px);
}

.cms-case-article-hero {
  padding: 42px 0 66px;
  background:
    radial-gradient(circle at 80% 18%, rgba(62, 148, 224, 0.16), transparent 30%),
    linear-gradient(135deg, #eef5fc, #fff 66%);
}

.cms-case-article-hero .eyebrow {
  margin-bottom: 16px;
}

.cms-case-article-hero h1 {
  max-width: none;
}

.cms-case-article-lead {
  max-width: none;
  margin: 24px 0 0;
}

.cms-case-article-image {
  display: block;
  width: 100%;
  max-height: 560px;
  margin-bottom: 42px;
  border-radius: 22px;
  object-fit: cover;
}

@media (max-width: 820px) {
  .cms-contact-layout {
    grid-template-columns: 1fr;
  }

  .cms-contact-quick {
    position: static;
  }

  .cms-profile-card {
    grid-template-columns: 1fr;
  }

  .cms-profile-photo-wrap,
  .cms-profile-photo,
  .cms-profile-photo-placeholder {
    min-height: 420px;
    max-height: 520px;
  }

  .cms-profile-summary {
    padding: 34px;
  }

  .cms-profile-cta .shell {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .cms-contact-page .info-hero {
    padding: 54px 0 40px;
  }

  .cms-contact-main {
    padding: 36px 0 64px;
  }

  .cms-contact-form,
  .cms-contact-quick {
    padding: 22px;
  }

  .cms-contact-form {
    grid-template-columns: 1fr;
  }

  .cms-contact-field-wide {
    grid-column: auto;
  }

  .cms-captcha-row {
    grid-template-columns: 1fr;
  }

  .cms-profile-hero,
  .cms-case-article-hero {
    padding: 28px 0 48px;
  }

  .cms-profile-photo-wrap,
  .cms-profile-photo,
  .cms-profile-photo-placeholder {
    min-height: 360px;
  }

  .cms-profile-summary {
    padding: 26px 22px;
  }

  .cms-profile-content-section,
  .cms-case-article-body {
    padding: 52px 0;
  }

  .cms-profile-cta {
    padding: 48px 0 58px;
  }
}

/* Doctor directory reuses the same card contract as the medical-care page. */
.cms-directory-doctors .cms-service-doctors .cms-doctor-card {
  min-height: 0;
  padding: 20px;
}

.cms-directory-doctors .cms-service-doctors .cms-doctor-head {
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.cms-directory-doctors .cms-service-doctors .expert-bio {
  min-height: 0;
  margin: 14px 0;
  font-size: 13px;
  line-height: 1.7;
  -webkit-line-clamp: 3;
}

.cms-directory-doctors .cms-service-doctors .cms-doctor-hospital {
  margin-top: auto;
}

/* Centered doctor profile, based on the approved reference card. */
.cms-doctor-profile-page .cms-profile-hero {
  min-height: calc(100vh - 76px);
  padding: 38px 0 82px;
  background: #f8fafc;
}

.cms-doctor-detail-shell {
  width: min(1040px, calc(100% - 40px));
  max-width: 1040px;
  margin-inline: auto;
}

.cms-doctor-profile-page .cms-profile-card {
  display: block;
  width: 100%;
  max-width: none;
  margin-inline: auto;
  border-radius: 22px;
}

.cms-profile-card-top {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  gap: 38px;
  padding: 38px;
  background: #f4f8fc;
}

.cms-doctor-profile-page .cms-profile-photo-wrap {
  width: 220px;
  height: 270px;
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #dceaf5;
}

.cms-doctor-profile-page .cms-profile-photo,
.cms-doctor-profile-page .cms-profile-photo-placeholder {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.cms-doctor-profile-page .cms-profile-summary {
  display: block;
  padding: 0;
}

.cms-doctor-profile-page .cms-profile-role {
  display: inline-block;
  max-width: 100%;
  margin-top: 14px;
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--ink);
  background: #e7f1fb;
  font-size: 13px;
  line-height: 1.5;
}

.cms-doctor-profile-page .cms-profile-tags {
  margin-top: 12px;
}

.cms-doctor-profile-page .cms-profile-hospital {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin-top: 22px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.cms-doctor-profile-page .cms-profile-hospital:hover,
.cms-doctor-profile-page .cms-profile-hospital:focus-visible {
  border-color: rgba(var(--brand-rgb), 0.35);
  background: #edf5fc;
}

.cms-doctor-profile-page .cms-profile-hospital img,
.cms-doctor-profile-page .cms-profile-hospital .expert-hospital-placeholder {
  width: 48px;
  height: 48px;
}

.cms-doctor-profile-page .cms-profile-hospital small,
.cms-doctor-profile-page .cms-profile-hospital strong {
  display: block;
}

.cms-doctor-profile-page .cms-profile-hospital small {
  color: var(--muted);
  font-size: 12px;
}

.cms-doctor-profile-page .cms-profile-hospital strong {
  margin-top: 2px;
  font-size: 13px;
}

.cms-profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.cms-profile-actions a {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.cms-profile-actions a:hover,
.cms-profile-actions a:focus-visible {
  filter: brightness(0.92);
  transform: translateY(-1px);
}

.cms-profile-contact {
  background: var(--brand-700);
}

.cms-profile-whatsapp {
  background: #278b3a;
}

.cms-profile-card-content {
  padding: 36px 38px 40px;
  border-top: 1px solid rgba(var(--brand-rgb), 0.1);
  background: #fff;
}

@media (max-width: 780px) {
  .cms-directory-doctors .cms-card-detail-arrow {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .cms-profile-card-top {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 26px;
    padding: 28px;
  }

  .cms-doctor-profile-page .cms-profile-photo-wrap {
    width: 180px;
    height: 230px;
    min-height: 0;
  }
}

@media (max-width: 620px) {
  .cms-doctor-detail-shell {
    width: min(100% - 28px, 1040px);
  }

  .cms-profile-card-top {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .cms-doctor-profile-page .cms-profile-photo-wrap {
    width: min(220px, 100%);
    height: 270px;
  }

  .cms-profile-actions {
    grid-template-columns: 1fr;
  }

  .cms-profile-card-content {
    padding: 28px 22px 32px;
  }
}
