.group-gallery {
  --gallery-purple: #542959;
  --gallery-lavender: #f1ecf7;
}
.group-gallery section {
  margin-block: 32px;
  scroll-margin-top: 24px;
}
.group-gallery-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 12px 0;
  border-bottom: 1px solid #dfd6e9;
}
.group-gallery-nav a {
  color: var(--gallery-purple);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.group-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.group-gallery-tile {
  display: block;
  position: relative;
  width: 100%;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 0;
  border-radius: 12px;
  background: var(--gallery-lavender);
  cursor: pointer;
}
.group-gallery-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.group-gallery-tile--video img { object-fit: contain; }
.group-gallery-tile span {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #542959;
  color: white;
  font-size: 12px;
}
.group-gallery-dialog {
  width: min(94vw, 1050px);
  max-height: 94vh;
  padding: 0;
  color: white;
  background: #312039;
  border: 0;
  border-radius: 12px;
}
.group-gallery-dialog::backdrop { background: rgb(22 13 28 / 80%); }
.group-gallery-dialog-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
}
.group-gallery-dialog-bar p { margin: 0; }
.group-gallery-dialog-bar button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #a98ab4;
  border-radius: 8px;
  background: transparent;
  color: white;
  font-size: 24px;
  cursor: pointer;
}
.group-gallery-dialog [data-gallery-media] > * {
  display: block;
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
}
@media (max-width: 760px) {
  .group-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
