/* Gallery — restyled from scroll strip into justified grid rows.
   Row shapes are set per section class (.row-a / .row-b) to mirror
   the original layout exactly. */

.block-gallery { margin: 0; }

.block-gallery__track {
  display: grid;
  gap: var(--grid-gap);
}

/* fallback when no row class is given: equal thirds */
.block-gallery__track { grid-template-columns: repeat(3, 1fr); }

/* row A: portrait / landscape / portrait (ratios 0.80 : 1.25 : 0.80) */
.row-a .block-gallery__track {
  grid-template-columns: 800fr 1250fr 800fr;
}

/* row B: three equal portraits (3:4) */
.row-b .block-gallery__track {
  grid-template-columns: repeat(3, 1fr);
}

.block-gallery__item {
  margin: 0;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.row-a .block-gallery__item { aspect-ratio: auto; }
.row-a .block-gallery__item:nth-child(1),
.row-a .block-gallery__item:nth-child(3) { aspect-ratio: 800 / 1000; }
.row-a .block-gallery__item:nth-child(2) { aspect-ratio: 1250 / 1000; }

.row-b .block-gallery__item { aspect-ratio: 3 / 4; }

.block-gallery__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* caption appears on hover, like the original grid */
.block-gallery__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.block-gallery__item:hover .block-gallery__caption { opacity: 1; }

@media (max-width: 820px) {
  .row-a .block-gallery__track,
  .row-b .block-gallery__track {
    grid-template-columns: 1fr;
  }
}
