/*
  About Us — photo-friendly layout (body.page-about-us).
  Use these classes in Page Content (HTML) alongside /images/family/... paths.

  Optional wrappers:
  - .about-lead — slightly larger opening paragraph
  - .about-photo-grid — responsive 2–3 column image grid
  - .about-photo-strip — horizontal row of thumbs (wraps on small screens)
  - .about-split — image + text (non-reverse: side-by-side on desktop; stacks on small screens)
  - .about-split--reverse — text then photo (stacked; avoids a tall empty column beside a portrait)
  - .about-split--reverse.about-split--side — optional two-column reverse on desktop only
  - figure.about-photo — single framed image (+ optional figcaption)
*/

body.page-about-us .inner-page-content {
  padding-bottom: clamp(2.5rem, 1.5rem + 3vw, 4rem);
}

body.page-about-us .cms-page-content {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

/* Opening emphasis */
body.page-about-us .cms-page-content .about-lead {
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.15rem);
  line-height: 1.75;
  color: var(--cms-muted, #5a5a5a);
  margin-bottom: 1.35em;
}

/* Kill float/wrap from TinyMCE or pasted Word styles */
body.page-about-us .cms-page-content img,
body.page-about-us .cms-page-content figure {
  float: none !important;
}

body.page-about-us .cms-page-content .cms-float,
body.page-about-us .cms-page-content .cms-float--right {
  float: none !important;
  max-width: 100% !important;
}

/* Any image in copy: safe defaults (rounded cards, no overflow) */
body.page-about-us .cms-page-content img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* Single framed photo block */
body.page-about-us .cms-page-content figure.about-photo {
  margin: 1.75rem auto;
  max-width: min(640px, 100%);
}

body.page-about-us .cms-page-content figure.about-photo img {
  display: block;
  width: 100%;
}

body.page-about-us .cms-page-content figure.about-photo figcaption {
  margin-top: 0.65rem;
  font-size: 0.92em;
  color: var(--cms-muted, #5a5a5a);
  line-height: 1.45;
  text-align: center;
}

/* 2–3 column grid of family photos */
body.page-about-us .cms-page-content .about-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(0.85rem, 0.5rem + 1vw, 1.25rem);
  margin: 1.75rem 0;
  align-items: start;
}

body.page-about-us .cms-page-content .about-photo-grid figure,
body.page-about-us .cms-page-content .about-photo-grid .about-photo-grid__item {
  margin: 0;
}

body.page-about-us .cms-page-content .about-photo-grid img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

body.page-about-us .cms-page-content .about-photo-grid figcaption {
  margin-top: 0.45rem;
  font-size: 0.85em;
  color: var(--cms-muted, #5a5a5a);
  line-height: 1.35;
}

/* Compact strip (e.g. timeline moments) */
body.page-about-us .cms-page-content .about-photo-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(0.65rem, 0.4rem + 0.8vw, 1rem);
  margin: 1.5rem 0;
}

body.page-about-us .cms-page-content .about-photo-strip img {
  flex: 1 1 140px;
  max-width: min(220px, 100%);
  min-width: 120px;
  aspect-ratio: 1;
  object-fit: cover;
}

/* Side-by-side: wide text column + narrow photo (portraits stay proportional) */
body.page-about-us .cms-page-content .about-split {
  display: grid;
  gap: clamp(1.25rem, 0.75rem + 1.5vw, 2rem);
  align-items: start;
  margin: 2rem 0;
}

body.page-about-us .cms-page-content .about-split .about-split__media {
  margin: 0;
  min-width: 0;
}

/* Default: image left (narrow), text right (flex) */
body.page-about-us .cms-page-content .about-split:not(.about-split--reverse) {
  grid-template-columns: minmax(0, min(300px, 42%)) minmax(0, 1fr);
}

body.page-about-us .cms-page-content .about-split .about-split__media img {
  width: 100%;
  max-width: 100%;
  display: block;
  max-height: min(340px, 52vh);
  object-fit: cover;
  object-position: center top;
}

body.page-about-us .cms-page-content .about-split .about-split__text {
  min-width: 0;
}

body.page-about-us .cms-page-content .about-split .about-split__text p:first-child {
  margin-top: 0;
}

body.page-about-us .cms-page-content .about-split .about-split__text p:last-child {
  margin-bottom: 0;
}

@media (max-width: 767.98px) {
  body.page-about-us .cms-page-content .about-split {
    grid-template-columns: 1fr;
  }
}

/*
  .about-split--reverse: stacked layout (text then photo).
  Side-by-side grid made the row as tall as the portrait, so the next paragraph
  sat under a huge empty area — bad reading rhythm. Stacking fixes that.
*/
body.page-about-us .cms-page-content .about-split.about-split--reverse {
  grid-template-columns: 1fr;
  gap: 1.15rem;
}

body.page-about-us .cms-page-content .about-split.about-split--reverse .about-split__text {
  order: 1;
}

body.page-about-us .cms-page-content .about-split.about-split--reverse .about-split__media {
  order: 2;
  max-width: min(400px, 88%);
  margin-left: auto;
  margin-right: auto;
}

body.page-about-us .cms-page-content .about-split.about-split--reverse .about-split__media img {
  width: 100%;
  max-height: none;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 18%;
}

/* Optional: true two-column again (tall image + gap risk) */
@media (min-width: 768px) {
  body.page-about-us .cms-page-content .about-split.about-split--reverse.about-split--side {
    grid-template-columns: minmax(0, 1fr) minmax(0, min(280px, 38%));
    gap: clamp(1.25rem, 0.75rem + 1.5vw, 2rem);
    align-items: start;
  }

  body.page-about-us .cms-page-content .about-split.about-split--reverse.about-split--side .about-split__media {
    order: 2;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  body.page-about-us .cms-page-content .about-split.about-split--reverse.about-split--side .about-split__text {
    order: 1;
  }

  body.page-about-us .cms-page-content .about-split.about-split--reverse.about-split--side .about-split__media img {
    aspect-ratio: auto;
    max-height: min(300px, 48vh);
    object-fit: cover;
    object-position: center top;
  }
}

/* Subtle section rhythm between story beats */
body.page-about-us .cms-page-content .about-section-gap {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}
