.gallery-wrapper {
  background: linear-gradient(135deg, #f9fbff 0%, #e8f4fd 100%);
  padding: 40px 0;
  min-height: 85vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.gallery-wrapper .row {
  flex: 1;
  align-items: stretch;
  margin: 0; /* Remove Bootstrap margins for consistent height */
}

/* --- SIDEBAR (Stable Sizing) --- */
.sidebar {
  background: #006fdc;
  color: #fff;
  padding: 30px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 111, 252, 0.15);
  position: sticky;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  overflow-x: hidden;
  margin-left: 0px;
  min-width: 250px; /* Prevent sidebar from shrinking too much on desktop */
	 max-height: calc(100vh - 200px);
}

.sidebar h2 {
  border-left: 4px solid #ff9500;
  color: #fff;
  padding-left: 15px;
  margin-bottom: 25px;
  font-weight: 700;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.sidebar ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  flex: 1;
}

.sidebar ul li {
  padding: 12px 15px;
  margin: 10px 0;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
  flex-shrink: 0;
}

.sidebar ul li:hover,
.sidebar ul li.active {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateX(5px);
}

/* Hide scrollbar for sidebar */
.sidebar::-webkit-scrollbar { width: 0 !important; background: transparent; }
.sidebar { scrollbar-width: none; -ms-overflow-style: none; }

/* --- GALLERY PANEL (Anti-Shifting Sizing) --- */
.gallery-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
  padding: 30px;
  height: 100%;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.gallery-panel h1 {
  border-left: 4px solid #ff9500;
  padding-left: 15px;
  margin-bottom: 30px;
  font-weight: 700;
  font-size: 2rem;
  color: #2c3e50;
  flex-shrink: 0;
}

#gallery {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Hide scrollbar for gallery */
.gallery-panel::-webkit-scrollbar,
#gallery::-webkit-scrollbar { width: 0 !important; background: transparent; }
.gallery-panel, #gallery { scrollbar-width: none; -ms-overflow-style: none; }

/* --- RESPONSIVE GRIDS (Fixed Sizing Shifting) --- */
.gallery-grid,
.month-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Reduced min for better mobile/desktop balance */
  gap: 25px;
  align-items: start; /* Align tops to prevent row shifting */
}

.gallery-grid img,
.month-container img {
  width: 100%;
  height: clamp(180px, 20vw, 260px); /* Dynamic height: min 180px, scales with viewport width, max 260px */
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.gallery-grid img:hover,
.month-container img:hover {
  transform: translateY(-5px) scale(1.03);
  border-color: #ff9500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* --- MONTH BLOCK (Consistent Margins) --- */
.month-block {
  margin-bottom: 50px;
}

.month-title {
  font-size: 1.6rem;
  color: #006fdc;
  font-weight: 700;
  border-left: 5px solid #ff9500;
  padding-left: 12px;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* --- LIGHTBOX (Unchanged) --- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  justify-content: center;
  align-items: center;
  z-index: 99999 !important;
}

.lightbox.active { display: flex; }

.lightbox-img {
  max-width: 95vw;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

.close-btn, .nav-btn {
  position: fixed;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  z-index: 100000 !important;
}

.close-btn {
  top: 25px;
  right: 35px;
  width: 50px;
  height: 50px;
}

.nav-btn {
  top: 50%;
  width: 60px;
  height: 60px;
  transform: translateY(-50%);
}

.nav-prev { left: 35px; }
.nav-next { right: 35px; }

.nav-btn:hover, .close-btn:hover {
  color: #ff9500;
  background: rgba(0, 0, 0, 0.7);
}

/* --- MEDIA QUERIES (Anti-Shifting on Resize) --- */
@media (max-width: 991.98px) {
  .gallery-wrapper { padding: 20px 0; }
  
  .sidebar {
    max-height: calc(100vh - 100px);
    margin-left: 0;
    margin-bottom: 20px;
    min-width: auto; /* Allow full width on mobile */
  }
  
  .gallery-panel {
    max-height: calc(100vh - 150px);
    padding: 20px;
  }
  
  .gallery-grid,
  .month-container {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Smaller min for mobile */
    gap: 15px;
  }
  
  .gallery-grid img,
  .month-container img {
    height: clamp(140px, 25vw, 200px); /* Shorter on mobile */
  }
  
  /* Prevent shifting on orientation change */
  .row { min-height: auto !important; }
}

@media (min-width: 1200px) {
  .gallery-grid,
  .month-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Wider min for large desktops */
  }
  
  .gallery-grid img,
  .month-container img {
    height: clamp(18px, 18vw, 280px);
  }
}