/*
 * Mahan visual system 4.43.2.
 *
 * This file is the final route-neutral contract for component scale, fixed
 * chrome, form rhythm, trust rails, and responsive media. It is deliberately
 * loaded after route styles so older generated pages cannot override the
 * shared experience.
 */

:root {
  --mp-shell-desktop: 1120px;
  --mp-header-desktop: 66px;
  --mp-control-height: 52px;
  --mp-section-desktop: clamp(56px, 4.8vw, 76px);
}

/* Responsive images must size their picture wrapper as well as the img. */
.mh-service-hero__visual,
.mh-service-category__visual {
  overflow: hidden;
}

.mh-service-hero__visual > picture,
.mh-service-category__visual > picture {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
}

.mh-service-hero__visual > picture > img,
.mh-service-category__visual > picture > img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
}

.mahan-route-services .mh-service-hero__visual > picture > img {
  object-position: center 58%;
  filter: saturate(.88) contrast(1.02);
}

/* Forms share one stable row rhythm. A field with helper text must never
 * stretch the input beside it to the full height of the grid row. */
body .wp-site-blocks .mahan-form {
  align-items: start;
}

body .wp-site-blocks .mahan-form > label,
body .wp-site-blocks .mahan-form .mahan-field {
  align-self: start;
  align-content: start;
}

body .wp-site-blocks .mahan-form :is(input, select) {
  height: var(--mp-control-height);
  min-height: var(--mp-control-height);
}

body .wp-site-blocks .mahan-form textarea {
  min-height: 118px;
}

body .wp-site-blocks .mahan-form .mahan-field-hint {
  max-width: 34rem;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.45;
}

body .wp-site-blocks .mahan-form :is(
  .mahan-field--email,
  .mahan-field--phone,
  .mahan-field--contact-method,
  .mahan-field--full-name,
  .mahan-field--service
) {
  grid-column: 1 / -1;
}

body .wp-site-blocks .cp-enquiry__form,
body .wp-site-blocks .cp-appointment-form__panel {
  width: 100%;
  max-width: 560px;
  justify-self: end;
}

body .wp-site-blocks .cp-enquiry__grid,
body .wp-site-blocks .cp-appointment-form__grid {
  grid-template-columns: minmax(320px, .82fr) minmax(500px, 1fr);
  gap: clamp(56px, 6vw, 88px);
}

/* Trust blocks remain in document flow. */
body .wp-site-blocks .cp-appointment-trust {
  padding-top: 24px;
}

body .wp-site-blocks .cp-appointment-trust__strip {
  margin: 0 auto !important;
}

/* Services is a directory, not a 70-row wall. Category summaries stay
 * scannable; visitors reveal only the family they need or use search. */
.mahan-route-services .mh-service-category__toggle {
  display: inline-flex;
  min-height: 46px;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding: 10px 15px;
  border: 1px solid rgba(75, 60, 77, .38);
  color: var(--mp-deep-plum, #512958);
  background: rgba(255, 255, 255, .72);
  font: 700 .78rem/1.2 "Open Sans", Arial, sans-serif;
  letter-spacing: .045em;
  cursor: pointer;
  text-transform: uppercase;
  touch-action: manipulation;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.mahan-route-services .mh-service-category__toggle i {
  font: 400 1.15rem/1 Arial, sans-serif;
}

.mahan-route-services .mh-service-category__toggle:hover,
.mahan-route-services .mh-service-category__toggle:focus-visible {
  border-color: var(--mp-deep-plum, #512958);
  color: #fff;
  background: var(--mp-deep-plum, #512958);
}

.mahan-route-services .mh-service-category.is-collapsed .mh-service-subgroup {
  display: none;
}

.mahan-route-services .mh-service-category.is-collapsed {
  min-height: 0 !important;
}

.mahan-route-services .mh-service-category.is-collapsed .mh-service-category__content {
  padding: 28px 34px !important;
}

.mahan-route-services .mh-service-category.is-collapsed .mh-service-category__content > header {
  min-height: 0 !important;
  padding: 0 !important;
}

.mahan-route-services .mh-service-category.is-searching .mh-service-subgroup:not([hidden]) {
  display: block;
}

.mahan-route-services .mh-service-category.is-searching .mh-service-category__toggle {
  display: none;
}

/* Patient Results initially presents a useful, fast first set. Search,
 * treatment filters, and explicit pagination reveal the rest without an
 * intimidating 93-card page. */
body.mahan-route-gallery:not(.mh-results-ready) .cp-results-grid .cp-result-card:nth-child(n+13) {
  display: none;
}

body.mahan-route-gallery .cp-results-load-more {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

body.mahan-route-gallery .cp-results-load-more[hidden] {
  display: none;
}

body.mahan-route-gallery .cp-results-load-more button {
  display: inline-flex;
  min-height: 48px;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border: 1px solid var(--mp-deep-plum, #512958);
  color: #fff;
  background: var(--mp-deep-plum, #512958);
  font: 800 .75rem/1.2 "Open Sans", Arial, sans-serif;
  letter-spacing: .06em;
  cursor: pointer;
  text-transform: uppercase;
  touch-action: manipulation;
  transition: color 180ms ease, background-color 180ms ease;
}

body.mahan-route-gallery .cp-results-load-more button:hover,
body.mahan-route-gallery .cp-results-load-more button:focus-visible {
  color: var(--mp-deep-plum, #512958);
  background: #fff;
}

body.mahan-route-gallery .cp-result-card img {
  object-fit: contain;
  background: var(--mp-lavender-soft, #f2eef4);
}

/* Editorial pages keep a calmer reading rhythm on wide screens. */
body.mh-discovery-article-page .mh-article__feature img {
  max-height: 520px;
}

body.mh-discovery-article-page .mh-article__content h2,
body.mh-discovery-article-page .mh-article__content h3 {
  margin-top: 1.65em;
}

body.mh-discovery-article-page .mh-article__content img {
  width: 100%;
  max-width: 100%;
  max-height: none;
  margin-right: auto;
  margin-left: auto;
}

@media (min-width: 1201px) {
  body .wp-site-blocks .mp-shell,
  body .wp-site-blocks .mp-header__inner,
  body .wp-site-blocks .mahan-pattern-shell,
  body .wp-site-blocks .mahan-page-title {
    width: min(calc(100% - 96px), var(--mp-shell-desktop)) !important;
  }

  body .wp-site-blocks .mp-header,
  body .wp-site-blocks .mp-header__inner {
    min-height: var(--mp-header-desktop) !important;
  }

  body .wp-site-blocks .mahan-main {
    padding-top: var(--mp-header-desktop) !important;
  }

  body .wp-site-blocks .mp-logo img,
  body.home .wp-site-blocks .mp-logo img {
    width: 158px !important;
    max-height: 46px !important;
  }

  body .wp-site-blocks .mp-header__inner {
    gap: clamp(12px, 1.4vw, 20px) !important;
  }

  body .wp-site-blocks .mp-nav__desktop {
    gap: clamp(13px, 1.35vw, 21px) !important;
    white-space: nowrap;
  }

  body .wp-site-blocks .mp-nav__desktop > a,
  body .wp-site-blocks .mp-nav__trigger {
    min-height: 46px !important;
    font-size: .75rem !important;
    line-height: 1.15 !important;
    text-transform: none !important;
    white-space: nowrap;
  }

  body .wp-site-blocks .mp-header__utility {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
  }

  body .wp-site-blocks .mp-header__phone {
    white-space: nowrap;
  }

  body .wp-site-blocks .mp-header__cta {
    min-height: 42px !important;
    padding-inline: 13px !important;
    font-size: .7rem !important;
    white-space: nowrap;
  }

  body.home .mh-hero__copy {
    padding-bottom: 90px !important;
  }

  body.home .mh-hero__scroll {
    bottom: 15px;
  }

  body .wp-site-blocks .mahan-route-services .mh-service-hero__grid,
  body.mahan-route-services .wp-site-blocks .mh-service-hero__grid {
    min-height: 610px !important;
  }

  body.mahan-route-services .wp-site-blocks .mh-service-hero__visual,
  body.mahan-route-services .wp-site-blocks .mh-service-hero__visual > picture,
  body.mahan-route-services .wp-site-blocks .mh-service-hero__visual > picture > img {
    height: 100%;
    min-height: 610px !important;
  }

  body.mahan-route-services .wp-site-blocks .mh-service-category__visual,
  body.mahan-route-services .wp-site-blocks .mh-service-category__visual > picture,
  body.mahan-route-services .wp-site-blocks .mh-service-category__visual > picture > img {
    height: 420px !important;
    min-height: 0 !important;
    max-height: 420px;
  }

  body.mahan-route-services .wp-site-blocks .mh-service-category__visual {
    position: sticky;
    top: 84px;
    align-self: start;
  }

  body.mahan-route-services .wp-site-blocks .mh-service-category.is-collapsed .mh-service-category__visual,
  body.mahan-route-services .wp-site-blocks .mh-service-category.is-collapsed .mh-service-category__visual > picture,
  body.mahan-route-services .wp-site-blocks .mh-service-category.is-collapsed .mh-service-category__visual > picture > img {
    height: 260px !important;
    max-height: 260px;
  }

  body.mahan-route-services .wp-site-blocks .mh-service-category.is-collapsed .mh-service-category__visual {
    position: static;
  }

  body.mahan-route-gallery .wp-site-blocks .cp-results-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.mh-discovery-blog-archive .wp-site-blocks .mh-blog-card__image {
    aspect-ratio: 1.55 / 1;
  }

  body .wp-site-blocks .mp-footer {
    padding-top: 56px !important;
  }

  body .wp-site-blocks .mp-footer__top {
    gap: clamp(30px, 3.4vw, 48px) !important;
    padding-bottom: 34px !important;
  }

  body .wp-site-blocks .mp-footer__top img {
    width: 160px !important;
  }
}

@media (max-width: 1200px) {
  body .wp-site-blocks .cp-enquiry__grid,
  body .wp-site-blocks .cp-appointment-form__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  body .wp-site-blocks .cp-enquiry__form,
  body .wp-site-blocks .cp-appointment-form__panel {
    max-width: 620px;
    justify-self: start;
  }
}

@media (max-width: 820px) {
  body .wp-site-blocks .mahan-form {
    grid-template-columns: 1fr;
  }

  body .wp-site-blocks .mahan-form > *,
  body .wp-site-blocks .mahan-form :is(
    .mahan-field--email,
    .mahan-field--phone,
    .mahan-field--contact-method,
    .mahan-field--full-name,
    .mahan-field--service
  ) {
    grid-column: auto;
  }

  .mahan-route-services .mh-service-hero__visual,
  .mahan-route-services .mh-service-hero__visual > picture,
  .mahan-route-services .mh-service-hero__visual > picture > img {
    width: 100%;
    height: 330px;
    min-height: 330px !important;
    max-height: 330px;
  }

  .mahan-route-services .mh-service-hero__visual > picture > img {
    object-position: center 67%;
  }

  body.mahan-route-services .wp-site-blocks .mh-service-category.is-collapsed {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  body.mahan-route-services .wp-site-blocks .mh-service-category.is-collapsed .mh-service-category__visual,
  body.mahan-route-services .wp-site-blocks .mh-service-category.is-collapsed .mh-service-category__visual > picture,
  body.mahan-route-services .wp-site-blocks .mh-service-category.is-collapsed .mh-service-category__visual > picture > img {
    width: 100%;
    height: 100% !important;
    min-height: 196px !important;
    max-height: none;
  }

  body.mahan-route-services .wp-site-blocks .mh-service-category.is-collapsed .mh-service-category__content {
    padding: 20px 18px;
  }

  body.mahan-route-services .wp-site-blocks .mh-service-category.is-collapsed .mh-service-category__content > header {
    padding-bottom: 0;
  }

  body.mahan-route-services .wp-site-blocks .mh-service-category.is-collapsed .mh-service-category__number {
    margin-bottom: 10px;
  }

  body.mahan-route-services .wp-site-blocks .mh-service-category.is-collapsed h3 {
    font-size: 1.2rem;
  }

  body.mahan-route-services .wp-site-blocks .mh-service-category.is-collapsed header > p:last-of-type {
    font-size: .78rem;
    line-height: 1.45;
  }

  body.mahan-route-services .wp-site-blocks .mh-service-category__toggle {
    width: 100%;
    margin-top: 15px;
    font-size: .7rem;
  }

  body.mahan-route-services .wp-site-blocks .mh-service-category:not(.is-collapsed) .mh-service-category__visual,
  body.mahan-route-services .wp-site-blocks .mh-service-category:not(.is-collapsed) .mh-service-category__visual > picture,
  body.mahan-route-services .wp-site-blocks .mh-service-category:not(.is-collapsed) .mh-service-category__visual > picture > img {
    height: min(62vw, 280px) !important;
    min-height: 230px !important;
    max-height: 280px;
  }

  body .wp-site-blocks .cp-appointment-trust {
    padding-top: 18px;
  }
}

@media (max-width: 560px) {
  body .wp-site-blocks .cp-enquiry__form,
  body .wp-site-blocks .cp-appointment-form__panel {
    max-width: none;
    padding: 24px 20px;
  }

  body .wp-site-blocks .mahan-form .mahan-field-hint {
    max-width: 28rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body .wp-site-blocks .mp-header *,
  body .wp-site-blocks .mp-footer * {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }

  .mahan-route-services .mh-service-category__toggle,
  .mahan-route-gallery .cp-results-load-more button {
    transition-duration: .01ms !important;
  }
}
