.country-section-title p {
  margin: 4px 0 0;
  color: var(--bs-secondary-color);
  font-size: .82rem;
}

.country-community-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 10px;
}

.country-community-gallery > a {
  position: relative;
  overflow: hidden;
  border-radius: 13px;
  aspect-ratio: 1;
  background: var(--bs-light);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .06);
}

.country-community-gallery > a.featured {
  grid-column: span 2;
  grid-row: span 2;
}

.country-community-gallery[data-count="2"] > a:last-child,
.country-community-gallery[data-count="4"] > a:last-child,
.country-community-gallery[data-count="6"] > a:last-child,
.country-community-gallery[data-count="8"] > a:last-child,
.country-community-gallery[data-count="10"] > a:last-child {
  grid-column: span 2;
  aspect-ratio: 2 / 1;
}

.country-community-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

.country-community-gallery a:hover img {
  transform: scale(1.035);
}

.country-community-gallery a span {
  position: absolute;
  inset: auto 0 0;
  padding: 32px 12px 10px;
  background: linear-gradient(transparent, rgba(3, 7, 18, .82));
  color: #fff;
  opacity: .94;
}

.country-community-gallery a span > * {
  display: block;
}

.country-community-gallery a small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 991px) {
  .country-community-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .country-community .card-body {
    padding: 18px !important;
  }

  .country-section-title {
    align-items: flex-start;
    gap: 12px;
  }

  .country-section-title p {
    font-size: .76rem;
  }

  .country-community-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: auto;
    gap: 7px;
  }

  .country-community-gallery > a {
    border-radius: 10px;
  }

  .country-community-gallery > a.featured {
    grid-column: 1 / -1;
    grid-row: auto;
    aspect-ratio: 16 / 9;
  }

  .country-community-gallery[data-count="1"] > a.featured {
    aspect-ratio: 4 / 3;
  }

  .country-community-gallery a span {
    padding: 24px 9px 8px;
  }

  .country-community-gallery a small {
    display: none;
  }
}

@media (max-width: 359px) {
  .country-community .card-body {
    padding: 14px !important;
  }

  .country-community-gallery {
    gap: 6px;
  }

  .country-section-title h2 {
    font-size: 1.15rem;
  }

  .country-section-title > a {
    font-size: .78rem;
    white-space: nowrap;
  }
}
