.gallery_section {
  padding: 64px 0;
}

.gallery_section h2 {
  text-align: center;
  margin-bottom: 10px;
}

.gallery_note {
  text-align: center;
  margin-bottom: 32px;
}

/* shared tile: photos and video thumbnails */
.gallery_item,
.gallery_item:hover {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: var(--primary-soft, #ffecb3);
  border-radius: 16px;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.gallery_item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery_item:hover img,
.gallery_item:focus-visible img {
  transform: scale(1.06);
}

.gallery_item:focus-visible {
  outline: 3px solid var(--primary-dark, #e88e14);
  outline-offset: 3px;
}

/* feed: uniform portrait tiles, photos and videos mixed (Instagram-like) */
.gallery_grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 960px;
  margin: 0 auto;
}

.gallery_grid .gallery_item,
.gallery_grid .gallery_item:hover {
  aspect-ratio: 4 / 5;
  border-radius: 12px;
}

/* video tile: poster, silent preview fading in on hover/focus, camera badge */
.gallery_preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.gallery_video.is_playing .gallery_preview {
  opacity: 1;
}

.gallery_badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  font-size: 15px;
  z-index: 1;
  transition: background-color 0.2s;
}

.gallery_video.is_playing .gallery_badge {
  background: var(--primary-dark, #e88e14);
}

.gallery_video,
.gallery_video:hover {
  cursor: pointer;
}

.gallery_grid:not(.gallery_all) .gallery_extra {
  display: none;
}

.gallery_grid.gallery_all .gallery_extra {
  animation: gallery_fade_in 0.4s ease both;
}

@keyframes gallery_fade_in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.gallery_more_wrap {
  text-align: center;
  margin-top: 28px;
}

.gallery_more,
.gallery_more:hover {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 30px;
  border: 2px solid var(--primary-dark, #e88e14);
  border-radius: 999px;
  background: #ffffff;
  color: var(--primary-deep, #c56b0a);
  font-weight: 600;
  font-size: 16px;
  box-shadow: none;
}

.gallery_more:hover {
  background: var(--primary-soft, #ffecb3);
}

@media (max-width: 575px) {
  .gallery_grid {
    gap: 3px;
  }

  .gallery_grid .gallery_item,
  .gallery_grid .gallery_item:hover {
    border-radius: 4px;
  }

  .gallery_badge {
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
}

/* lightbox */
.gallery_lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.gallery_lightbox::backdrop {
  background: rgba(20, 20, 20, 0.92);
}

.gallery_stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 56px 72px;
}

.gallery_stage img,
.gallery_stage video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  animation: gallery_fade_in 0.25s ease both;
}

.gallery_nav,
.gallery_nav:hover,
.gallery_close,
.gallery_close:hover {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  box-shadow: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.gallery_nav:hover,
.gallery_close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.gallery_nav {
  top: 50%;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  font-size: 32px;
}

.gallery_prev { left: 12px; }
.gallery_next { right: 12px; }

.gallery_close {
  top: 12px;
  right: 12px;
  width: 46px;
  height: 46px;
  font-size: 32px;
  line-height: 1;
}

.gallery_counter {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 14px;
}

@media (max-width: 575px) {
  .gallery_stage {
    padding: 56px 8px;
  }

  .gallery_nav {
    top: auto;
    bottom: 8px;
    margin-top: 0;
    width: 44px;
    height: 44px;
  }
}
