.event-gallery-section {
  padding-top: clamp(3.5rem, 7vw, 6rem);
  background:
    radial-gradient(circle at 12% 8%, rgba(242, 166, 74, .12), transparent 30%),
    linear-gradient(180deg, var(--paper), var(--white));
}

.event-gallery-heading {
  max-width: 760px;
  margin-bottom: 1.6rem;
}

.event-gallery-heading h2 {
  margin: .65rem 0 .8rem;
}

.event-gallery-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.event-gallery-status {
  padding: 1rem 1.15rem;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: var(--paper);
}

.event-gallery-status[hidden],
.event-gallery-more[hidden] {
  display: none !important;
}

.event-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: clamp(.8rem, 2vw, 1.25rem);
}

.event-gallery-item {
  position: relative;
  display: block;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 14px 34px rgba(9, 22, 47, .13);
}

.event-gallery-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: zoom-in;
}

.event-gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .24s ease, filter .24s ease;
}

.event-gallery-open:hover img,
.event-gallery-open:focus-visible img {
  transform: scale(1.035);
  filter: saturate(1.06);
}

.event-gallery-open:focus-visible {
  outline: 3px solid #f5b257;
  outline-offset: -3px;
}

.event-gallery-caption {
  display: block;
  padding: .75rem .9rem .85rem;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.4;
}

.event-gallery-more {
  display: flex;
  justify-content: center;
  margin-top: 1.6rem;
}

.event-gallery-dialog {
  width: min(94vw, 1100px);
  max-width: none;
  max-height: 92vh;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 20px;
  color: #fff;
  background: #06142d;
  box-shadow: 0 28px 100px rgba(0, 0, 0, .6);
}

.event-gallery-dialog::backdrop {
  background: rgba(2, 8, 23, .84);
  backdrop-filter: blur(6px);
}

.event-gallery-dialog-inner {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  background: #020817;
}

.event-gallery-dialog img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 74px);
  object-fit: contain;
}

.event-gallery-dialog-close {
  position: absolute;
  z-index: 2;
  top: .75rem;
  right: .75rem;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  color: #fff;
  background: rgba(5, 18, 41, .82);
  font: inherit;
  font-size: 1.45rem;
  cursor: pointer;
}

.event-gallery-dialog-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  color: #dbe8ff;
  background: #0a1d3c;
  font-size: .9rem;
}

.event-gallery-dialog-caption:empty {
  display: none;
}

html[data-theme="light"] .event-gallery-section {
  background:
    radial-gradient(circle at 12% 8%, rgba(242, 166, 74, .14), transparent 30%),
    linear-gradient(180deg, #fffdf8, #f5f9fd);
}

html[data-theme="light"] .event-gallery-item {
  background: #fff;
  border-color: #cbd8e6;
  box-shadow: 0 14px 34px rgba(36, 67, 103, .12);
}

@media (max-width: 620px) {
  .event-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
  }

  .event-gallery-item,
  .event-gallery-dialog {
    border-radius: 14px;
  }

  .event-gallery-caption {
    padding: .6rem .65rem .7rem;
    font-size: .78rem;
  }

  .event-gallery-dialog-footer {
    flex-direction: column;
    gap: .25rem;
  }
}

@media (max-width: 390px) {
  .event-gallery-grid {
    grid-template-columns: 1fr;
  }
}
