/* === JM 4.2.3 hero: height from content, CTAs visible === */

.jm-hero {
  position: relative;
  overflow: visible !important;
}

/* Grid stretches photo to match text column — no fixed max-height that clips CTAs */
body .jm-hero .wp-block-columns.jm-hero__grid.is-layout-flex,
body .jm-hero .wp-block-columns.jm-hero__grid,
.jm-hero .wp-block-columns.jm-hero__grid {
  display: grid !important;
  align-items: stretch !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}
@media (min-width: 960px) {
  body .jm-hero .wp-block-columns.jm-hero__grid.is-layout-flex,
  body .jm-hero .wp-block-columns.jm-hero__grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr) !important;
  }
}

/* Copy: compact, top-aligned, natural height */
.jm-hero .wp-block-columns.jm-hero__grid > .wp-block-column:first-child,
.jm-hero .jm-hero__copy {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  padding: 2.75rem 1.5rem 2.25rem !important;
  max-height: none !important;
  overflow: visible !important;
  gap: 0 !important;
}
@media (min-width: 960px) {
  .jm-hero .wp-block-columns.jm-hero__grid > .wp-block-column:first-child,
  .jm-hero .jm-hero__copy {
    padding: 3.25rem 2.25rem 2.5rem max(2rem, calc((100% - 72rem) / 2)) !important;
  }
}

.jm-hero .jm-kicker {
  margin: 0 0 0.55rem !important;
}
.jm-hero h1,
.jm-hero .wp-block-heading {
  margin: 0 0 0.75rem !important;
  max-width: min(26rem, 100%) !important;
  font-size: clamp(1.95rem, 3.2vw, 2.85rem) !important;
  line-height: 1.12 !important;
}
.jm-hero .jm-hero-lede,
.jm-hero .wp-block-column > .jm-hero-lede,
.jm-hero .is-layout-flow > .jm-hero-lede {
  margin: 0 !important;
  margin-block-start: 0 !important;
  margin-block-end: 0 !important;
  max-width: 32rem !important;
  line-height: 1.55 !important;
}

/* Kill leftover large button margins from earlier patches */
.jm-hero .wp-block-column > .wp-block-buttons,
.jm-hero .jm-hero__copy > .wp-block-buttons,
.jm-hero .wp-block-column > .jm-hero__actions,
.jm-hero .jm-hero__copy > .jm-hero__actions,
.jm-hero .is-layout-flow > .jm-hero__actions {
  margin: 1.15rem 0 0 !important;
  margin-block-start: 1.15rem !important;
  margin-block-end: 0 !important;
}

.jm-hero__actions {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0.75rem 1.25rem !important;
  width: auto !important;
  max-width: 100% !important;
}
.jm-hero__actions > .wp-block-column {
  flex: 0 0 auto !important;
  width: auto !important;
  padding: 0 !important;
  margin: 0 !important;
}
.jm-hero__actions .wp-block-buttons,
.jm-hero__actions .jm-textlink {
  margin: 0 !important;
  margin-block-start: 0 !important;
  margin-block-end: 0 !important;
}
.jm-hero__actions .jm-textlink a {
  white-space: nowrap;
}

/* Photo fills the row height (matches copy), with shader — no artificial min-height */
.jm-hero .wp-block-column:last-child,
.jm-hero .jm-hero__photo {
  position: relative !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden;
  min-height: 18rem;
}
.jm-hero .wp-block-column:last-child .wp-block-image,
.jm-hero .wp-block-column:last-child figure,
.jm-hero .jm-hero__photo .wp-block-image,
.jm-hero .jm-hero__photo figure {
  position: absolute !important;
  inset: 0 !important;
  margin: 0 !important;
  height: 100% !important;
  width: 100% !important;
}
.jm-hero .wp-block-column:last-child img,
.jm-hero .jm-hero__photo img {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center 18% !important;
}

/* Keep shader */
.jm-hero .wp-block-column:last-child::before,
.jm-hero .jm-hero__photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(14, 22, 19, 0.55) 0%, rgba(14, 22, 19, 0.12) 28%, transparent 48%),
    linear-gradient(to right, rgba(14, 22, 19, 0.45) 0%, rgba(14, 22, 19, 0.12) 22%, transparent 42%);
}
.jm-hero .wp-block-column:last-child::after,
.jm-hero .jm-hero__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(14, 22, 19, 0.22) 0%, transparent 35%);
}

/* Undo 4.2.2 height clamp if still winning somehow */
.jm-hero .wp-block-columns.jm-hero__grid > .wp-block-column:first-child {
  max-height: none !important;
  overflow: visible !important;
}
