/*
 * Remaining service pages (642–646): consistent replacement photo proportions
 * and card alignment. Scope to these pages only; Hospice Care keeps its
 * separately approved image treatment.
 */
:is(.page-id-642,.page-id-643,.page-id-644,.page-id-645,.page-id-646) .mmh-service-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2560 / 1396;
  object-fit: contain;
}

/* Prevent the last descriptive paragraph being pushed down to the bottom. */
:is(.page-id-642,.page-id-643,.page-id-644,.page-id-645,.page-id-646) .mmh-service-card-body > p:last-child {
  margin-top: 0;
  margin-bottom: 0;
}

/* Match the Hospice Care feature image: ample presence, without upscaling
   a shallow cropped thumbnail across a tall region. */
@media (min-width: 901px) {
  :is(.page-id-642,.page-id-643,.page-id-644,.page-id-645,.page-id-646) .mmh-services-feature .mmh-services-feature-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    gap: clamp(30px, 3.5vw, 48px);
    align-items: center;
  }
  :is(.page-id-642,.page-id-643,.page-id-644,.page-id-645,.page-id-646) .mmh-services-feature .mmh-services-feature-grid > img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1.5 / 1;
    object-fit: cover;
    object-position: center center;
    align-self: center;
    border-radius: 16px;
  }
}

@media (max-width: 900px) {
  :is(.page-id-642,.page-id-643,.page-id-644,.page-id-645,.page-id-646) .mmh-services-feature .mmh-services-feature-grid > img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2560 / 1396;
    object-fit: contain;
  }
  :is(.page-id-642,.page-id-643,.page-id-644,.page-id-645,.page-id-646) .mmh-service-cards {
    align-items: start;
  }
  :is(.page-id-642,.page-id-643,.page-id-644,.page-id-645,.page-id-646) .mmh-service-card-body {
    flex: 0 1 auto;
  }
}

@media (min-width: 701px) and (max-width: 900px) {
  /* Center the odd third card beneath the first two at tablet widths. */
  :is(.page-id-642,.page-id-643,.page-id-644,.page-id-645,.page-id-646) .mmh-service-cards > .mmh-service-card:last-child {
    grid-column: 1 / -1;
    justify-self: center;
    box-sizing: border-box;
    width: calc(50% - 11px);
  }
}

@media (max-width: 700px) {
  /* One full-width card per row on phones. */
  :is(.page-id-642,.page-id-643,.page-id-644,.page-id-645,.page-id-646) .mmh-service-cards > .mmh-service-card:last-child {
    grid-column: auto;
    width: auto;
  }
}
