.gallery-section {
  background: var(--bg-light);
}

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

.gallery-count {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 700;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

/* Pagination দিয়ে page hide korar jonno — JS এ classList.toggle('gallery-hidden') use hocche */
.gallery-item.gallery-hidden {
  display: none !important;
}

.gallery-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.gallery-page-btn {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
}

.gallery-page-btn:hover:not(:disabled) {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.gallery-page-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.gallery-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.gallery-item {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: zoom-in;
  box-shadow: var(--shadow-sm);
}

.gallery-item::after {
  content: 'View image';
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  background: rgba(36, 36, 36, 0.82);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item:hover::after,
.gallery-item:focus-visible::after {
  opacity: 1;
}

.gallery-item:focus-visible {
  outline: 3px solid var(--secondary-color);
  outline-offset: 3px;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 80px;
  background: rgba(36, 36, 36, 0.96);
  opacity: 0;
  pointer-events: none;
}

.gallery-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-figure {
  max-width: min(1100px, 88vw);
  max-height: 90vh;
  margin: 0;
  text-align: center;
}

.lightbox-figure img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.lightbox-close,
.lightbox-control {
  position: absolute;
  display: grid;
  place-items: center;
  padding: 0;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  line-height: 1;
  font-size: 1.6rem;
  cursor: pointer;
}

.lightbox-close:hover,
.lightbox-control:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.lightbox-close {
  top: 24px;
  right: 28px;
  font-size: 2rem;
  line-height: 46px;
}

.lightbox-prev { left: 28px; }
.lightbox-next { right: 28px; }

@media (max-width: 767px) {
  .gallery-hero { min-height: 350px; }
  .gallery-heading { align-items: start; flex-direction: column; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .gallery-lightbox { padding: 56px 18px 32px; }
  .lightbox-control { width: 38px; height: 38px; font-size: 1.2rem; }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  .lightbox-close { top: 14px; right: 14px; }
}

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