.home-photo-gallery {
  margin-top: 3.25rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--global-divider-color, rgba(127, 127, 127, 0.25));
}

.home-photo-gallery-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.home-photo-gallery-kicker {
  margin: 0 0 0.3rem;
  color: var(--global-theme-color);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-photo-gallery h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.home-photo-shuffle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--global-divider-color, rgba(127, 127, 127, 0.4));
  border-radius: 0.35rem;
  background: transparent;
  color: var(--global-text-color);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.home-photo-shuffle:hover,
.home-photo-shuffle:focus-visible {
  border-color: var(--global-theme-color);
  color: var(--global-theme-color);
}

.home-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.home-photo-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 0;
  overflow: hidden;
  border-radius: 0.35rem;
  background: var(--global-code-bg-color, rgba(127, 127, 127, 0.08));
  outline: none;
}

.home-photo-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.35s ease,
    filter 0.35s ease;
}

.home-photo-tile figcaption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: end;
  padding: 0.65rem;
  background: linear-gradient(transparent 35%, rgba(0, 0, 0, 0.68));
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.home-photo-tile:hover img,
.home-photo-tile:focus-visible img {
  filter: brightness(0.85);
  transform: scale(1.035);
}

.home-photo-tile:hover figcaption,
.home-photo-tile:focus-visible figcaption {
  opacity: 1;
}

.home-photo-gallery-error {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--global-text-color-light);
  font-size: 0.9rem;
}

@media (max-width: 767.98px) {
  .home-photo-gallery-heading {
    align-items: start;
    flex-direction: column;
  }

  .home-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .home-photo-tile figcaption {
    padding: 0.45rem;
    font-size: 0.75rem;
    opacity: 0.82;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-photo-tile img,
  .home-photo-tile figcaption {
    transition: none;
  }
}
