.custom-gallery {
  background: var(--white);
  box-sizing: border-box !important;
  display: grid;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
  align-items: center;
  padding: 10px;
  width: 100%;
}

.gallery-row--standard {
  width: 100%;
}

.gallery-row--standard .gallery-item {
  width: 100%;
}

.gallery-row--standard img {
  width: 100%;
  height: auto; /* Allow the height to be natural for full-width shots */
  display: block;
}

.gallery-row--two-columns {
  display: flex;
  gap: 10px;
  width: 100%;
}
.gallery-row--two-columns .gallery-item {
  flex-grow: 1;
}

.gallery-row--l-shape {
  display: grid;
  grid-template-columns: 1fr 2fr; /* Left is 1 part, Right is 2 parts */
  gap: 10px;
}

/* Nested R-Shape (Large image on the left) */
.gallery-row--l-shape-r {
  display: grid;
  grid-template-columns: 2fr 1fr; /* 2 parts left, 1 part right */
  gap: 10px;
}

/* Re-use the stack logic from before */
.gallery-row--l-shape-r .gallery-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Reusable Stack Logic */
.gallery-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-stack .gallery-item {
  flex: 1; /* Ensures equal height for stacked items */
}

/* Image Handling */
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* This is vital for the gallery look */
  display: block;
}

/* Mobile Responsive */
@media (max-width: 834px) {
  .custom-gallery {
    gap: 5px;
    padding: unset;
  }

  .gallery-row,
  .gallery-stack {
    gap: 5px;
  }

  .gallery-row--l-shape,
  .gallery-row--l-shape-r {
    grid-template-columns: 1fr; /* Stacks everything on phones */
  }
  .gallery-row--two-columns {
    flex-direction: column;
  }
}

/* Placerholder Boxes */
.placeholder-box {
  background: #dcdcdc;
  aspect-ratio: 4 / 5;
  width: 100%;
  position: relative;
  overflow: hidden;
}
.placeholder-box::after {
  content: "+";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: var(--black-20);
  font-weight: 300;
}

.gallery-item--large.placeholder-box {
  aspect-ratio: 1 / 1.2;
}

.is-placeholder {
  width: 100%;
}

.gallery-item--large {
  height: 100%;
}
