/* ============================================================
   SARHAD DARBAR — Gallery Page Styles
   ============================================================ */

.page-inner .gallery-page {
  min-height: 100vh;
  padding-top: calc(var(--header-height) + var(--topbar-height));
  padding-bottom: 0;
  background: var(--color-cream);
}

@media (max-width: 767px) {
  .page-inner .gallery-page {
    padding-top: var(--header-height);
  }
}

/* ---------- Page Hero ---------- */
.gallery-hero {
  padding: 0 0 40px;
}

.gallery-hero__content {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.gallery-hero__title {
  font-family: var(--font-primary);
  font-size: clamp(2.25rem, 5vw, 3rem);
  color: var(--color-green);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-top: 8px;
}

.gallery-hero__desc {
  font-size: 0.875rem;
  color: rgba(17, 22, 18, 0.65);
  line-height: 1.7;
  margin-top: 16px;
}

.gallery-hero .section-divider {
  width: 80px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Filter Buttons ---------- */
.gallery-filters {
  padding: 0 0 40px;
}

.gallery-filters__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.gallery-filter {
  padding: 10px 24px;
  font-family: var(--font-primary);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-green);
  background: var(--color-white);
  border: 1px solid rgba(7, 59, 36, 0.2);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.gallery-filter:hover {
  border-color: var(--color-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.gallery-filter--active {
  background: var(--color-green);
  color: var(--color-cream);
  border-color: var(--color-green);
}

.gallery-filter--active:hover {
  background: var(--color-green-light);
  border-color: var(--color-green-light);
}

/* ---------- Masonry Grid ---------- */
.gallery-section {
  padding: 0 0 96px;
}

.gallery-masonry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  gap: 24px;
}

.gallery-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.gallery-card.is-filtering-in {
  animation: galleryFadeIn 0.45s ease forwards;
}

@keyframes galleryFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gallery-card.is-hidden {
  display: none;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.gallery-card--tall {
  grid-row: span 2;
}

.gallery-card__media {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gallery-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.gallery-card:hover .gallery-card__img {
  transform: scale(1.08);
}

.gallery-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(3, 36, 21, 0.85) 0%, rgba(3, 36, 21, 0.25) 45%, rgba(3, 36, 21, 0.15) 100%);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
}

.gallery-card:hover .gallery-card__overlay {
  opacity: 1;
}

.gallery-card__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(197, 160, 34, 0.2);
  border: 1px solid rgba(197, 160, 34, 0.45);
  color: var(--color-gold);
  opacity: 0;
  transition: opacity var(--transition), transform var(--transition);
}

.gallery-card:hover .gallery-card__icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.gallery-card__icon svg {
  width: 22px;
  height: 22px;
}

.gallery-card__category {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-gold);
  margin-bottom: 6px;
}

.gallery-card__title {
  font-family: var(--font-primary);
  font-size: 1rem;
  color: var(--color-cream);
  line-height: 1.3;
}

/* ---------- Featured Card ---------- */
.gallery-card--featured .gallery-card__overlay {
  opacity: 1;
  background: linear-gradient(to top, rgba(3, 36, 21, 0.92) 0%, rgba(3, 36, 21, 0.35) 50%, rgba(3, 36, 21, 0.2) 100%);
}

.gallery-card--featured .gallery-card__icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.gallery-card--featured:hover .gallery-card__img {
  transform: scale(1.05);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 36, 21, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.lightbox__content {
  position: relative;
  z-index: 1;
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  transform: scale(0.92);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.lightbox.is-open .lightbox__content {
  transform: scale(1);
  opacity: 1;
}

.lightbox__figure {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.lightbox__caption {
  padding: 16px 4px 0;
  text-align: center;
}

.lightbox__category {
  display: block;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-gold);
  margin-bottom: 4px;
}

.lightbox__title {
  font-family: var(--font-primary);
  font-size: 1.125rem;
  color: var(--color-cream);
}

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(252, 249, 242, 0.1);
  border: 1px solid rgba(197, 160, 34, 0.35);
  color: var(--color-cream);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.lightbox__close:hover {
  background: rgba(197, 160, 34, 0.25);
  transform: rotate(90deg);
}

.lightbox__close svg {
  width: 20px;
  height: 20px;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(252, 249, 242, 0.1);
  border: 1px solid rgba(197, 160, 34, 0.35);
  color: var(--color-cream);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.lightbox__nav:hover {
  background: rgba(197, 160, 34, 0.25);
}

.lightbox__nav--prev {
  left: 20px;
}

.lightbox__nav--next {
  right: 20px;
}

.lightbox__nav svg {
  width: 22px;
  height: 22px;
}

body.lightbox-open {
  overflow: hidden;
}

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .gallery-masonry {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 180px;
  }
}

@media (max-width: 767px) {
  .gallery-hero {
    padding: 32px 0 32px;
  }

  .gallery-filters {
    padding-bottom: 28px;
  }

  .gallery-filters__inner {
    gap: 8px;
  }

  .gallery-filter {
    padding: 8px 16px;
    font-size: 0.625rem;
  }

  .gallery-section {
    padding-bottom: 56px;
  }

  .gallery-masonry {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 16px;
  }

  .gallery-card,
  .gallery-card--tall {
    grid-row: span 1;
    aspect-ratio: 4 / 3;
    min-height: 220px;
  }

  .gallery-card--featured {
    aspect-ratio: 3 / 4;
    min-height: 320px;
  }

  .lightbox__nav {
    width: 40px;
    height: 40px;
  }

  .lightbox__nav--prev {
    left: 8px;
  }

  .lightbox__nav--next {
    right: 8px;
  }

  .lightbox__close {
    top: 12px;
    right: 12px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .gallery-card--featured {
    grid-column: span 2;
  }
}
