/* ==========================================================================
   BHARANI INTERNATIONAL MODERN SCHOOL (CBSE)
   Photo Gallery Master Stylesheet (gallery.css)
   Asymmetric Rhythmic Photographic Grid & Interactive Lightbox
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. INTRO OVERVIEW SECTION
   -------------------------------------------------------------------------- */
.gallery-intro-section {
  margin-bottom: 2.75rem;
}

.gallery-intro-lead {
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--color-text-main, #374151);
  max-width: 940px;
  margin: 0;
}

/* --------------------------------------------------------------------------
   02. CATEGORY FILTER NAVIGATION TOOLBAR
   -------------------------------------------------------------------------- */
.gallery-toolbar-section {
  margin-bottom: 2.5rem;
}

.gallery-toolbar-box {
  background: #FFFFFF;
  border: 1px solid rgba(217, 119, 6, 0.22);
  border-radius: 18px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 6px 20px rgba(28, 15, 7, 0.04);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.gallery-toolbar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.gallery-toolbar-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gallery-toolbar-title-wrap svg {
  width: 20px;
  height: 20px;
  color: #D97706;
}

.gallery-toolbar-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-brown-dark, #1C0F07);
  letter-spacing: -0.01em;
  margin: 0;
}

.gallery-counter-badge {
  background: #FEF3C7;
  color: #92400E;
  padding: 0.25rem 0.8rem;
  border-radius: 9999px;
  border: 1px solid rgba(217, 119, 6, 0.25);
  font-size: 0.82rem;
  font-weight: 700;
}

/* Category Filter Bar */
.gallery-filter-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 119, 6, 0.3) transparent;
  padding-bottom: 0.35rem;
}

.gallery-filter-scroll-wrapper::-webkit-scrollbar {
  height: 4px;
}

.gallery-filter-scroll-wrapper::-webkit-scrollbar-thumb {
  background: rgba(217, 119, 6, 0.35);
  border-radius: 4px;
}

.gallery-filter-nav {
  display: flex;
  gap: 0.6rem;
  white-space: nowrap;
  padding: 0.2rem 0;
}

.gallery-filter-pill {
  background: #FFFDF9;
  border: 1px solid rgba(217, 119, 6, 0.25);
  color: #78350F;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.22s ease;
  user-select: none;
}

.gallery-filter-pill:hover {
  background: #FEF3C7;
  border-color: #D97706;
  color: #92400E;
  transform: translateY(-1px);
}

.gallery-filter-pill.active {
  background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
  color: #FFFFFF;
  border-color: #B45309;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.gallery-pill-count {
  font-size: 0.72rem;
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.08);
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
}

.gallery-filter-pill.active .gallery-pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   03. ASYMMETRIC RHYTHMIC PHOTO GRID (LIKE REFERENCE IMAGE)
   -------------------------------------------------------------------------- */
.gallery-grid-section {
  margin-bottom: 4rem;
}

.gallery-rhythmic-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

/* Rhythmic Column Spans (4-5-3 / 5-4-3 pattern) */
.gallery-col-4 {
  grid-column: span 4;
}

.gallery-col-5 {
  grid-column: span 5;
}

.gallery-col-3 {
  grid-column: span 3;
}

.gallery-col-6 {
  grid-column: span 6;
}

/* --------------------------------------------------------------------------
   04. GALLERY PHOTO CARDS
   -------------------------------------------------------------------------- */
.gallery-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  height: 270px;
  background: #1C0F07;
  box-shadow: 0 10px 25px -5px rgba(28, 15, 7, 0.12);
  border: 1.5px solid rgba(217, 119, 6, 0.2);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.35s ease;
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 36px -8px rgba(28, 15, 7, 0.22);
  border-color: var(--color-gold, #F59E0B);
}

.gallery-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-card:hover .gallery-card-img {
  transform: scale(1.06);
}

.gallery-card-img[src*="tab_sports.jpg"] {
  object-position: 50% 5%;
}

.gallery-card-img[src*="art2.jpg"] {
  object-position: 50% 18%;
}

/* Bottom Warm Dark Gradient Overlay */
.gallery-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
      rgba(28, 15, 7, 0.92) 0%,
      rgba(28, 15, 7, 0.55) 45%,
      rgba(28, 15, 7, 0.12) 75%,
      transparent 100%);
  pointer-events: none;
  transition: background 0.3s ease;
}

.gallery-card:hover .gallery-card-overlay {
  background: linear-gradient(to top,
      rgba(28, 15, 7, 0.95) 0%,
      rgba(28, 15, 7, 0.65) 50%,
      rgba(28, 15, 7, 0.2) 80%,
      transparent 100%);
}

/* Top Hover Zoom Icon Indicator */
.gallery-card-zoom-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(28, 15, 7, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #FEF3C7;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.85);
  transition: all 0.25s ease;
  z-index: 2;
}

.gallery-card:hover .gallery-card-zoom-badge {
  opacity: 1;
  transform: scale(1);
}

.gallery-card-zoom-badge svg {
  width: 16px;
  height: 16px;
}

/* Bottom Content (Matching Reference Image Labels) */
.gallery-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 2;
  pointer-events: none;
}

.gallery-card-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gold-bright, #F59E0B);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.gallery-card-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-gold-bright, #F59E0B);
}

.gallery-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.35;
  margin: 0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* --------------------------------------------------------------------------
   05. EMPTY FILTER STATE
   -------------------------------------------------------------------------- */
.gallery-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4.5rem 2rem;
  background: #FFFDF8;
  border: 2px dashed rgba(217, 119, 6, 0.25);
  border-radius: 20px;
  display: none;
}

.gallery-empty-state.active {
  display: block;
}

.gallery-empty-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #FEF3C7;
  color: #92400E;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.gallery-empty-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-brown-dark, #1C0F07);
  margin: 0 0 0.5rem 0;
}

.gallery-empty-text {
  font-size: 0.95rem;
  color: #57463A;
  margin: 0 0 1.25rem 0;
}

/* --------------------------------------------------------------------------
   06. INTERACTIVE LIGHTBOX MODAL
   -------------------------------------------------------------------------- */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 8, 4, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallery-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-dialog {
  position: relative;
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #1C0F07;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-lightbox.active .lightbox-dialog {
  transform: scale(1);
}

.lightbox-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(28, 15, 7, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.lightbox-close-btn:hover {
  background: #D97706;
  color: #FFFFFF;
  transform: rotate(90deg);
}

.lightbox-media-wrap {
  position: relative;
  width: 100%;
  max-height: 68vh;
  background: #0D0603;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-img {
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
  display: block;
}

/* Lightbox Prev/Next Nav Controls */
.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(28, 15, 7, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.lightbox-nav-btn:hover {
  background: #D97706;
  color: #FFFFFF;
  transform: translateY(-50%) scale(1.08);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-footer {
  padding: 1.25rem 1.75rem;
  background: #1C0F07;
  border-top: 1px solid rgba(217, 119, 6, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.lightbox-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.lightbox-category {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-gold-bright, #F59E0B);
}

.lightbox-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
}

.lightbox-counter {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-gold-light, #FEF3C7);
  background: rgba(245, 158, 11, 0.15);
  padding: 0.3rem 0.8rem;
  border-radius: 9999px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* --------------------------------------------------------------------------
   07. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .gallery-rhythmic-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 1.25rem;
  }

  .gallery-col-4,
  .gallery-col-5,
  .gallery-col-3,
  .gallery-col-6 {
    grid-column: span 3;
  }

  .gallery-card {
    height: 250px;
  }
}

@media (max-width: 768px) {
  .gallery-rhythmic-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .gallery-col-4,
  .gallery-col-5,
  .gallery-col-3,
  .gallery-col-6 {
    grid-column: span 1;
  }

  .gallery-card {
    height: 240px;
  }

  .gallery-toolbar-box {
    padding: 1.25rem 1rem;
  }

  .lightbox-dialog {
    max-height: 95vh;
  }

  .lightbox-media-wrap {
    max-height: 55vh;
  }

  .lightbox-nav-btn {
    width: 40px;
    height: 40px;
  }

  .lightbox-prev {
    left: 0.5rem;
  }

  .lightbox-next {
    right: 0.5rem;
  }
}