/* Reproduct Health v7.12 - reliable, deterministic global photo grid.
   No CSS columns, no JS row-size measurement, and no tall placeholder figures.
   Gallery tiles use fixed grid track spans derived ONLY from photo orientation.
   Full natural photo is always available via the v7.9 lightbox. */

body .rhs-gallery-layout.rhs-gallery-layout.rhs-gallery-layout {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-auto-flow: row dense !important;
  grid-auto-rows: 60px !important;
  gap: 10px !important;
  columns: auto !important;
  column-count: auto !important;
  column-gap: normal !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0 !important;
  margin: 24px 0 !important;
  background: transparent !important;
}
/* Three class repetitions intentionally beat historical article/figure selectors. */
body .rhs-gallery-layout.rhs-gallery-layout.rhs-gallery-layout > :is(figure,.wp-block-image,.blocks-gallery-item,li) {
  display: block !important;
  position: relative !important;
  grid-column: auto !important;
  grid-row: span 3 !important;
  align-self: stretch !important;
  justify-self: stretch !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: #eef1f6 !important;
  box-sizing: border-box !important;
  break-inside: auto !important;
  transform: none !important;
}
body .rhs-gallery-layout.rhs-gallery-layout.rhs-gallery-layout > .rhs-gallery-tile--portrait {
  grid-row: span 5 !important;
}
/* Unwrap links and picture blocks without creating a second sizing box. */
body .rhs-gallery-layout.rhs-gallery-layout.rhs-gallery-layout > :is(figure,.wp-block-image,.blocks-gallery-item,li) :is(a,picture) {
  display: block !important;
  position: static !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}
body .rhs-gallery-layout.rhs-gallery-layout.rhs-gallery-layout > :is(figure,.wp-block-image,.blocks-gallery-item,li) img {
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
  object-position: center !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  transform: none !important;
  cursor: zoom-in;
}
body .rhs-gallery-layout.rhs-gallery-layout.rhs-gallery-layout > :is(figure,.wp-block-image,.blocks-gallery-item,li) figcaption {
  position: absolute !important;
  left: 0; right: 0; bottom: 0;
  padding: 9px 11px !important;
  margin: 0 !important;
  background: linear-gradient(transparent,rgba(8,14,30,.78));
  color: #fff !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  pointer-events: none;
}
@media (max-width: 900px) {
  body .rhs-gallery-layout.rhs-gallery-layout.rhs-gallery-layout {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  }
}
@media (max-width: 540px) {
  body .rhs-gallery-layout.rhs-gallery-layout.rhs-gallery-layout {
    grid-template-columns: minmax(0,1fr) !important;
    grid-auto-rows: auto !important;
    grid-auto-flow: row !important;
    gap: 10px !important;
    margin: 18px 0 !important;
  }
  body .rhs-gallery-layout.rhs-gallery-layout.rhs-gallery-layout > :is(figure,.wp-block-image,.blocks-gallery-item,li),
  body .rhs-gallery-layout.rhs-gallery-layout.rhs-gallery-layout > .rhs-gallery-tile--portrait {
    grid-row: auto !important;
    aspect-ratio: 4 / 3 !important;
    height: auto !important;
  }
  body .rhs-gallery-layout.rhs-gallery-layout.rhs-gallery-layout > .rhs-gallery-tile--portrait {
    aspect-ratio: 3 / 4 !important;
  }
}
@media (prefers-reduced-motion: no-preference) {
  body .rhs-gallery-layout.rhs-gallery-layout.rhs-gallery-layout > :is(figure,.wp-block-image,.blocks-gallery-item,li) {
    transition: box-shadow .15s ease;
  }
  body .rhs-gallery-layout.rhs-gallery-layout.rhs-gallery-layout > :is(figure,.wp-block-image,.blocks-gallery-item,li):hover {
    box-shadow: 0 8px 22px rgba(20,35,70,.15);
  }
}
