/* Gallery Row */
gallery-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  width: 100%;
  max-height: 100%;
  margin-bottom: 0px;
  padding: 5px 3px 50px 3px;
  overflow-y: scroll;
  scrollbar-width: none;
  position: relative;
  direction: ltr;
  overscroll-behavior: contain;
  z-index: var(--z-raised);



  /* Scrollbars */
  &::-webkit-scrollbar {
    width: 2px;
  }

  &::-webkit-scrollbar-track {
    background: transparent;
  }

  &::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
  }

  &::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
  }
}

/* Gallery Images */
gallery-row img {
  box-shadow: 3px 3px 4px 0px rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  cursor: pointer;
  outline: 1px solid transparent;
  user-select: none;

  &:hover {
    outline: var(--glass-border-b);
  }
}

html#light gallery-row img {
  filter: brightness(1.2) contrast(0.8);
}

/* Scroll Stop */
body:has(.zoom-overlay) {
  overflow: hidden;
}

/* Overlay */
.zoom-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  z-index: 9999;

  /* Overlay Spacers and Caption */
  &::before {
    content: "";
    flex: 1;
    padding: 0 20px 0 20px;
    position: relative;
    top: 5vh;
  }

  &::after {
    content: attr(data-caption);
    flex: 1;
    position: relative;
    top: 5vh;
    align-self: flex-start;

    padding: 0 20px 200px 20px;
    max-height: 90vh;
    overflow-y: auto;
    font-family: "Courier New", Courier, monospace;
    font-size: var(--f-size-m);
    line-height: var(--lh-n);
    color: var(--off-white);
  }
}

.zoom-overlay img {
  max-width: 75%;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Responsive Overlay */
@media (max-width: 900px) {
  .zoom-overlay {
    flex-direction: column;
  }

  .zoom-overlay img {
    max-width: 90%;
    max-height: 60vh;
  }

  .zoom-overlay::after {
    max-height: 35vh;
    max-width: 70ch;
    margin-inline: auto;
    padding: 0 20px 50px;
    line-height: 1.3;
    top: 5vw;
  }

  .zoom-overlay::before {
    display: none;
  }
}

@media (max-width: 660px) {
  gallery-row {
    border-radius: 5px;
    gap: 2px;
    max-height: 100vw !important;
    padding-bottom: 5px;
  }
}

footer:has(gallery-row) {
  align-items: start;
  padding-inline: 12px !important;
  overflow: hidden;
}

footer p {
  font-family: var(--ff-alagard);
  font-size: var(--f-size-m);
  padding-left: 10px;
}
