.community-gallery {
  padding-top: 46px;
  padding-bottom: 46px;
}

.community-gallery-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 26px;
}

.community-gallery-heading .section-heading {
  margin: 0;
  max-width: 670px;
}

.community-gallery-heading h2 {
  margin-bottom: 0;
}

.community-gallery-intro {
  max-width: 390px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.community-mosaic {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 0.9fr 0.9fr;
  grid-auto-rows: 172px;
  gap: 12px;
}

.community-shot {
  position: relative;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 8px;
  background: var(--surface);
  isolation: isolate;
}

.community-shot--lead {
  grid-column: span 2;
  grid-row: span 2;
}

.community-shot--tall {
  grid-row: span 2;
}

.community-shot--wide {
  grid-column: span 2;
}

.community-shot img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 500ms ease, filter 500ms ease;
}

.community-shot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 38%, rgba(12, 5, 28, 0.76) 100%);
  pointer-events: none;
}

.community-shot figcaption {
  position: absolute;
  z-index: 2;
  inset-inline: 15px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
}

.community-shot figcaption span {
  min-width: 28px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 28px;
  text-align: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: rgba(17, 8, 45, 0.42);
  backdrop-filter: blur(8px);
}

.community-shot figcaption strong {
  font-size: 0.88rem;
  letter-spacing: 0;
}

.community-shot:hover img {
  transform: scale(1.045);
  filter: saturate(1.08);
}

[data-theme="light"] .community-shot {
  border-color: rgba(44, 33, 83, 0.17);
  box-shadow: 0 8px 22px rgba(40, 26, 78, 0.08);
}

@media (max-width: 850px) {
  .community-gallery-heading {
    display: block;
  }

  .community-gallery-intro {
    margin-top: 14px;
  }

  .community-mosaic {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 190px;
  }

  .community-shot--lead {
    grid-column: span 2;
  }

  .community-shot--wide {
    grid-column: span 2;
  }
}

@media (max-width: 540px) {
  .community-gallery {
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .community-mosaic {
    grid-template-columns: 1fr;
    grid-auto-rows: 225px;
    gap: 10px;
  }

  .community-shot--lead,
  .community-shot--wide {
    grid-column: auto;
  }

  .community-shot--lead,
  .community-shot--tall {
    grid-row: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .community-shot img {
    transition: none;
  }
}
