/* =====================================================================
   gallery.css
   Darussalam Islamic School — full gallery page + full-screen slideshow.
   Uses the same brand palette as the rest of the site:
     deep magenta #8E1550 · dark plum #3A1D4A · blush pink #F5C3CF
   Load this file only on gallery.php (already linked in that file).
   ===================================================================== */

:root {
  --dis-magenta: #8E1550;
  --dis-magenta-dark: #6f1040;
  --dis-plum: #3A1D4A;
  --dis-blush: #F5C3CF;
  --dis-white: #FFFFFF;
}

/* ---------- Page header (reuses the same look as other inner pages) ---------- */
.page-header {
  background: linear-gradient(160deg, var(--dis-plum) 0%, var(--dis-magenta) 100%);
  color: var(--dis-white);
  padding: 96px 0 64px;
  text-align: center;
}

.page-header__title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  margin: 8px 0 12px;
  color: #FFFFFF !important;
}

.page-header__text {
  font-family: "Mulish", sans-serif;
  max-width: 640px;
  margin: 0 auto;
  color: var(--dis-blush) !important;
  font-size: 1.05rem;
  line-height: 1.6;
}

/* ---------- Filter tabs ---------- */
.gallery-full {
  padding: 64px 0 96px;
  background: var(--dis-white);
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 40px;
}

.gallery-filters__btn {
  font-family: "Mulish", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--dis-magenta);
  background: transparent;
  color: var(--dis-magenta);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.gallery-filters__btn:hover {
  background: var(--dis-blush);
}

.gallery-filters__btn.is-active {
  background: var(--dis-magenta);
  color: var(--dis-white);
}

/* ---------- Thumbnail grid ---------- */
.gallery-full__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.gallery-full__item {
  position: relative;
  border: none;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: var(--dis-blush);
}

.gallery-full__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.gallery-full__item:hover img {
  transform: scale(1.06);
}

.gallery-full__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 14px;
  background: linear-gradient(to top, rgba(58, 29, 74, 0.75) 0%, rgba(58, 29, 74, 0) 55%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.gallery-full__item:hover .gallery-full__overlay,
.gallery-full__item:focus-visible .gallery-full__overlay {
  opacity: 1;
}

.gallery-full__caption {
  color: var(--dis-white);
  font-family: "Mulish", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
}

.gallery-full__zoom {
  color: var(--dis-white);
  flex-shrink: 0;
}

.gallery-full__empty {
  text-align: center;
  font-family: "Mulish", sans-serif;
  color: var(--dis-plum);
  padding: 40px 0;
}

/* ---------- "View More" button used on the homepage gallery preview ---------- */
.gallery__more {
  text-align: center;
  margin-top: 36px;
}

/* ---------- Full-screen slideshow lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.is-open {
  display: flex;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 8, 26, 0.94);
}

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 3;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--dis-white);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lightbox__close:hover {
  background: var(--dis-magenta);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--dis-white);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lightbox__nav:hover {
  background: var(--dis-magenta);
}

.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }

.lightbox__stage {
  position: relative;
  z-index: 2;
  max-width: 82vw;
  max-height: 68vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__image {
  max-width: 100%;
  max-height: 68vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.lightbox__info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  text-align: center;
  padding: 20px 20px 28px;
  color: var(--dis-white);
  font-family: "Mulish", sans-serif;
}

.lightbox__category {
  font-family: "Mulish", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--dis-blush);
  margin: 0 0 4px;
}

.lightbox__caption {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.lightbox__description {
  max-width: 560px;
  margin: 0 auto 10px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}

.lightbox__counter {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .lightbox__nav { width: 40px; height: 40px; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
  .lightbox__stage { max-width: 92vw; max-height: 56vh; }
  .lightbox__image { max-height: 56vh; }
  .lightbox__description { display: none; } /* keep mobile view uncluttered */
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .gallery-full__item img,
  .gallery-full__overlay {
    transition: none;
  }
}