.research-block {
  display: grid;
  grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
  gap: 1.75rem;
  align-items: center;
  padding: 2rem 0;
  border-top: 1px solid #ddd;
}

.research-block.image-right {
  grid-template-columns: minmax(0, 58fr) minmax(0, 42fr);
}

.research-block h2 {
  margin-top: 0;
}

.research-block__image {
  margin: 0;
  width: 100%;
  min-width: 0;
}

.research-block__image img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
}

@media (max-width: 800px) {
  .research-block,
  .research-block.image-right {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Place the text before the image on phones. */
  .research-block__text {
    order: 1;
  }

  .research-block__image {
    order: 2;
    max-width: 550px;
    justify-self: center;
  }
}

/* Multiple photos within the second block's image column */
.research-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

/* With three photos, make the first one larger */
.research-gallery > :first-child:nth-last-child(3) {
  grid-column: 1 / -1;
}

.research-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.research-image-button img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

/* Consistent thumbnails for photos; enlarged views remain uncropped */
.research-gallery .research-image-button img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
}

.research-image-button:focus-visible {
  outline: 3px solid #0072b2;
  outline-offset: 4px;
}

.research-gallery-note {
  margin: 0.5rem 0 0;
  font-size: 0.8em;
  color: #666;
}

/* Floating image viewer */
.research-lightbox {
  box-sizing: border-box;
  width: min(1100px, 94vw);
  max-width: 94vw;
  max-height: 92vh;
  padding: 1rem;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #222;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.3);
  overflow: auto;
}

.research-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.75);
}

.research-lightbox__toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.research-lightbox__close {
  padding: 0.4rem 0.8rem;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  color: #222;
  font: inherit;
  cursor: pointer;
}

.research-lightbox figure {
  margin: 0;
}

.research-lightbox__image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 70vh;
  margin: 0 auto;
  object-fit: contain;
}

.research-lightbox__caption {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: normal;
  width: 100%;
  margin-top: 0.8rem;
  line-height: 1.5;
  text-align: center;
}