/* ============================================================
   Public editorial media normalization
   Preserves source composition and prevents tall, narrow, or oversized
   hero and feature illustrations from determining section height.
   ============================================================ */
.uh-media-frame {
  --uh-media-frame-max: 44rem;
  width: min(100%, var(--uh-media-frame-max));
  min-width: 0;
  max-width: 100%;
  justify-self: center;
  margin-inline: auto;
}

.uh-media-frame--feature { --uh-media-frame-max: 35rem; }

.uh-media-frame > img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: var(--uh-media-focus, center);
}

.about-hero__grid,
.rites-hero__grid,
.safety-hero__grid {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
}

.about-hero__art,
.rites-hero__art,
.safety-hero__art {
  --uh-media-frame-max: 42rem;
  justify-self: end;
}

.rites-hero__art figcaption { margin: .6rem 1rem .9rem; }

.shop-page .shop-hero-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, .78fr);
}

.shop-page .shop-hero-art {
  --uh-media-frame-max: 40rem;
  justify-self: end;
}

.start-circle-hero__grid {
  grid-template-columns: minmax(0, .82fr) minmax(440px, 1.08fr);
}

.start-circle-hero__art,
.contact-hero__art {
  --uh-media-frame-max: 44rem;
  justify-self: end;
}

.start-circle-money__panel {
  grid-template-columns: minmax(300px, .72fr) minmax(0, 1.08fr);
  align-items: center;
}

.start-circle-money__art,
.safety-consent__art { --uh-media-frame-max: 34rem; }
.safety-refuses__art { --uh-media-frame-max: 31rem; }

.safety-consent__grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, .72fr);
  align-items: center;
}

/* Contact: one compact left card, with the two right cards sharing
   exactly the same combined desktop height. */
body.contact-page-body .contact-main-grid {
  align-items: stretch;
}

body.contact-page-body .contact-main-grid > .contact-form-panel,
body.contact-page-body .contact-main-grid > .contact-side-stack,
body.contact-page-body .contact-side-stack > .contact-panel--reply,
body.contact-page-body .contact-side-stack > .contact-email-card {
  min-height: 0;
  height: auto;
}

body.contact-page-body .contact-main-grid > .contact-form-panel,
body.contact-page-body .contact-main-grid > .contact-side-stack {
  align-self: stretch;
}

body.contact-page-body .contact-main-grid > .contact-side-stack {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
  row-gap: clamp(.75rem, 1.1vw, 1rem);
}

@media (min-width: 941px) {
  body.contact-page-body .contact-main-grid > .contact-form-panel {
    padding: clamp(1.25rem, 1.8vw, 1.65rem) clamp(1.25rem, 2vw, 1.85rem);
  }

  body.contact-page-body .contact-main-grid > .contact-form-panel > h2 {
    margin-top: 0;
    margin-bottom: .15rem;
    line-height: 1.02;
  }

  body.contact-page-body .contact-main-grid > .contact-form-panel > .contact-ornament {
    margin-top: .15rem;
    margin-bottom: .85rem;
  }

  body.contact-page-body .contact-form-panel .contact-form {
    gap: .72rem;
    row-gap: .72rem;
  }

  body.contact-page-body .contact-form-panel .contact-form__row {
    gap: .75rem;
  }

  body.contact-page-body .contact-form-panel .contact-form label {
    gap: .32rem;
    margin: 0;
  }

  body.contact-page-body .contact-form-panel .contact-form input,
  body.contact-page-body .contact-form-panel .contact-form select {
    min-height: 2.85rem;
  }

  body.contact-page-body .contact-form-panel .contact-form textarea {
    height: 8.75rem;
    min-height: 8.75rem;
  }

  body.contact-page-body .contact-form-panel .contact-form__button {
    min-height: 3.1rem;
    margin-top: 0;
  }

  body.contact-page-body .contact-form-panel .contact-form__note {
    margin: .35rem 0 0;
    line-height: 1.4;
  }

  body.contact-page-body .contact-side-stack > .contact-panel--reply {
    padding: clamp(1.25rem, 1.9vw, 1.7rem);
    gap: clamp(1rem, 1.8vw, 1.4rem);
    align-items: center;
    align-content: center;
    grid-template-columns: minmax(9rem, .78fr) minmax(0, 1.22fr);
  }

  body.contact-page-body .contact-side-stack > .contact-panel--reply > img {
    width: 100%;
    max-width: 12.25rem;
    height: auto;
    min-height: 0;
    object-fit: contain;
  }

  body.contact-page-body .contact-panel--reply .contact-panel__copy h2 {
    margin: 0 0 .55rem;
    line-height: 1.04;
  }

  body.contact-page-body .contact-panel--reply .contact-panel__copy p {
    margin: .42rem 0 0;
    line-height: 1.48;
  }

  body.contact-page-body .contact-side-stack > .contact-email-card {
    padding: .85rem 1.15rem;
    gap: .9rem;
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr);
  }

  body.contact-page-body .contact-side-stack > .contact-email-card > img {
    width: 4.75rem;
    height: 4.75rem;
    min-width: 4.75rem;
    object-fit: contain;
  }

  body.contact-page-body .contact-email-card h2 {
    margin: 0 0 .2rem;
    line-height: 1.06;
  }

  body.contact-page-body .contact-email-card p {
    margin: .2rem 0 0;
    line-height: 1.4;
  }
}

@media (max-width: 1180px) {
  .about-hero__grid,
  .rites-hero__grid,
  .safety-hero__grid,
  .shop-page .shop-hero-grid,
  .start-circle-hero__grid {
    gap: clamp(1.5rem, 3vw, 2.75rem);
  }
}

@media (min-width: 941px) and (max-width: 1100px) {
  body.contact-page-body .contact-side-stack > .contact-panel--reply {
    padding: 1.1rem;
    gap: .9rem;
    grid-template-columns: minmax(7.5rem, .7fr) minmax(0, 1.3fr);
  }

  body.contact-page-body .contact-side-stack > .contact-panel--reply > img {
    max-width: 9.5rem;
  }

  body.contact-page-body .contact-side-stack > .contact-email-card > img {
    width: 4.25rem;
    height: 4.25rem;
    min-width: 4.25rem;
  }
}

@media (max-width: 940px) {
  .about-hero__grid,
  .rites-hero__grid,
  .shop-page .shop-hero-grid,
  .start-circle-hero__grid,
  .start-circle-money__panel,
  .safety-hero__grid,
  .safety-consent__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .uh-media-frame,
  .about-hero__art,
  .rites-hero__art,
  .shop-page .shop-hero-art,
  .start-circle-hero__art,
  .start-circle-money__art,
  .safety-hero__art,
  .safety-consent__art,
  .contact-hero__art {
    width: min(100%, 46rem);
    max-width: 100%;
    justify-self: center;
    margin-inline: auto;
  }

  body.contact-page-body .contact-main-grid {
    align-items: start;
  }

  body.contact-page-body .contact-main-grid > .contact-form-panel,
  body.contact-page-body .contact-main-grid > .contact-side-stack,
  body.contact-page-body .contact-side-stack > .contact-panel--reply,
  body.contact-page-body .contact-side-stack > .contact-email-card {
    height: auto;
    min-height: 0;
    grid-row: auto;
    align-self: auto;
  }

  body.contact-page-body .contact-main-grid > .contact-side-stack {
    grid-template-rows: auto;
    row-gap: 1rem;
  }
}

@media (max-width: 680px) {
  .uh-media-frame { width: 100%; }
}

/* About feature artwork: preserve the native landscape compositions without
   allowing either panel illustration to dictate an oversized section height. */
.about-definition__art {
  --uh-media-frame-max: 28rem;
  justify-self: center;
}

.about-forming__art {
  --uh-media-frame-max: 34rem;
  justify-self: end;
}

/* Rest and Limits was omitted from the shared media-frame import during the
   initial refactor. These page-scoped rules bring its hero and feature art
   into the same non-cropping, bounded system. */
.rest-limits-page .featured-start-hero-inner {
  grid-template-columns: minmax(0, 1fr) minmax(360px, .82fr);
  align-items: center;
}

.rest-limits-page .rest-hero-art {
  --uh-media-frame-max: 38rem;
  justify-self: end;
}

.rest-limits-page .rest-boundary-art {
  --uh-media-frame-max: 15rem;
  justify-self: center;
}

.rest-limits-page .rest-teaching-art {
  --uh-media-frame-max: 14rem;
  justify-self: center;
}

@media (max-width: 940px) {
  .rest-limits-page .featured-start-hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .about-definition__art {
    width: min(100%, 28rem);
    justify-self: center;
  }

  .about-forming__art {
    width: min(100%, 34rem);
    justify-self: center;
  }

  .rest-limits-page .rest-hero-art {
    width: min(100%, 34rem);
    justify-self: center;
    margin-inline: auto;
  }

  .rest-limits-page .rest-boundary-art {
    width: min(100%, 15rem);
    margin-inline: auto;
  }

  .rest-limits-page .rest-teaching-art {
    width: min(100%, 14rem);
    margin-inline: auto;
  }
}

