.gallery-section {
  background: var(--paper);
}

.gallery-section .section-heading-description {
  max-width: 24rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.75rem);
}

.gallery-item {
  display: block;
  border-bottom: 1px solid var(--line);
}

.gallery-picture {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  background: var(--cream);
}

.gallery-picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}

.gallery-item:hover img {
  transform: scale(1.035);
}

.gallery-zoom {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--forest);
  transition: background .2s ease;
}

.gallery-zoom .icon {
  width: 1.2rem;
  height: 1.2rem;
}

.gallery-item:is(:hover, :focus-visible) .gallery-zoom {
  background: var(--gold-light);
}

.gallery-label {
  display: block;
  padding: .8rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.gallery-dialog {
  width: min(960px, calc(100% - 2rem));
  max-height: 92vh;
  max-height: 92dvh;
  margin: auto;
  padding: clamp(.75rem, 2vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--forest);
  overflow: auto;
}

.gallery-dialog::backdrop {
  background: rgb(14 27 20 / 82%);
}

.gallery-toolbar, .gallery-description {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.gallery-toolbar {
  padding-bottom: .5rem;
}

.gallery-toolbar h2 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: normal;
}

.gallery-dialog-photo {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  max-height: 68vh;
  max-height: 68dvh;
  border-radius: 4px;
  background: var(--forest-dark);
  overflow: hidden;
}

.gallery-dialog-photo img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.gallery-description {
  margin-top: .65rem;
  font-size: .95rem;
}

.gallery-position {
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.gallery-controls {
  display: flex;
  gap: .5rem;
}

.gallery-dialog button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--forest);
}

.gallery-dialog button:hover {
  background: var(--cream);
}

.gallery-dialog button .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.gallery-prev .icon {
  transform: rotate(180deg);
}

@media (max-width: 700px) {
  .gallery-grid {
    gap: 1.25rem .8rem;
  }

  .gallery-picture {
    aspect-ratio: 4 / 3;
  }

  .gallery-label {
    font-size: .85rem;
  }

  .gallery-zoom {
    right: .4rem;
    bottom: .4rem;
    width: 1.75rem;
    height: 1.75rem;
  }

  .gallery-zoom .icon {
    width: .9rem;
    height: .9rem;
  }

  .gallery-description {
    gap: .6rem;
    font-size: .8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-item:hover img {
    transform: none;
  }
}
