/* -------------------------
   Gallery Folders View
   ------------------------- */

.gallery-folders {
  padding-top: 100px;
  padding-bottom: 80px;
  text-align: center;
  background: linear-gradient(180deg, #bfc7c2, #7f98a6);
  min-height: 100vh;
}

.gallery-folders-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.gallery-folders h2 {
  font-size: 40px;
  margin-bottom: 10px;
  color: #222;
}

/* -------------------------
   Folder Grid
   ------------------------- */

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 10px;
}

.folder-card {
  width: 100%;
  height: 230px;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: 0.35s ease;
  box-shadow: 0 8px 25px rgba(0,0,0,0.18);
}

.folder-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  filter: brightness(65%);
  transition: 0.35s ease;
}

.folder-title {
  position: absolute;
  bottom: 18px;
  left: 18px;
  right: 18px;
  color: white;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
  line-height: 1.3;
  text-align: left;
}

.folder-card:hover {
  transform: translateY(-7px) scale(1.03);
  box-shadow: 0 16px 42px rgba(0,0,0,0.28);
}

.folder-card:hover .folder-image {
  filter: brightness(82%);
}

/* -------------------------
   Album View
   ------------------------- */

.album-view {
  padding-top: 90px;
  padding-bottom: 80px;
  min-height: 100vh;
  background: linear-gradient(180deg, #bfc7c2, #7f98a6);
}

.album-header {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto 36px;
  padding: 0 24px;
  flex-wrap: wrap;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: #fff;
  color: #222;
  border: none;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transition: 0.25s ease;
  white-space: nowrap;
}

.back-btn:hover {
  background: #ff6b6b;
  color: #fff;
  transform: translateX(-3px);
}

.album-title {
  font-size: 2rem;
  font-weight: 800;
  color: #222;
  text-shadow: 0 1px 4px rgba(255,255,255,0.4);
}

/* -------------------------
   Album Image Grid
   ------------------------- */

.album-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Unified wrapper for both images and videos */
.album-media-item {
  width: 100%;
  height: 220px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  background: #111;
  position: relative;
  transition: box-shadow 0.3s ease;
}

.album-media-item:hover {
  box-shadow: 0 10px 32px rgba(0,0,0,0.35);
}

/* Images fill the card uniformly */
.album-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.album-img:hover {
  transform: scale(1.04);
}

/* Videos fill the card uniformly */
.album-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.no-images {
  color: #555;
  font-size: 1.1rem;
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 0;
}

.album-loading {
  text-align: center;
  color: #444;
  font-size: 1.1rem;
  padding: 60px 0;
}

/* =========================================
   FULLSCREEN LIGHTBOX
   ========================================= */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.94);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
}

.lightbox.active {
  display: flex;
}

.lightbox-img {
  max-width: 88vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 12px 50px rgba(0,0,0,0.6);
  user-select: none;
  -webkit-user-drag: none;
}

/* × close */
.lightbox-close {
  position: fixed;
  top: 18px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 52px;
  line-height: 1;
  cursor: pointer;
  z-index: 10001;
  padding: 0;
  transition: 0.2s ease;
}

.lightbox-close:hover { color: #ff6b6b; transform: scale(1.15); }

/* Prev / Next arrows */
.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  font-size: 48px;
  line-height: 1;
  cursor: pointer;
  z-index: 10001;
  padding: 10px 16px;
  border-radius: 50%;
  transition: 0.2s ease;
  user-select: none;
}

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,0.28);
}

/* Image counter */
.lightbox-counter {
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
  letter-spacing: 1px;
}

/* -------------------------
   Tablet
   ------------------------- */

@media (max-width: 900px) {
  .folder-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .folder-card { height: 200px; }
  .folder-title { font-size: 17px; }

  .album-image-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .album-media-item { height: 180px; }
}

/* -------------------------
   Mobile
   ------------------------- */

@media (max-width: 600px) {
  .gallery-folders,
  .album-view {
    padding-top: 88px;
    padding-bottom: 50px;
  }

  .gallery-folders h2 { font-size: 26px; }

  .folder-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 4px;
  }

  .folder-card {
    height: 150px;
    border-radius: 12px;
  }

  .folder-title {
    font-size: 13px;
    bottom: 10px;
    left: 10px;
    right: 10px;
  }

  .album-header {
    gap: 12px;
    margin-bottom: 24px;
    padding: 0 14px;
  }

  .album-title { font-size: 1.4rem; }
  .back-btn { padding: 8px 16px; font-size: 0.85rem; }

  .album-image-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 12px;
  }

  .album-media-item { height: 145px; border-radius: 10px; }

  /* Lightbox on mobile */
  .lightbox-img {
    max-width: 96vw;
    max-height: 70vh;
  }

  .lightbox-prev { left: 6px; font-size: 36px; padding: 8px 12px; }
  .lightbox-next { right: 6px; font-size: 36px; padding: 8px 12px; }
  .lightbox-close { font-size: 40px; top: 12px; right: 14px; }
}

/* -------------------------
   Very small screens
   ------------------------- */

@media (max-width: 360px) {
  .folder-grid { grid-template-columns: 1fr; }
  .folder-card { height: 180px; }
  .album-image-grid { grid-template-columns: 1fr; }
  .album-media-item { height: 200px; }
}

/* -------------------------
   Enroll Now + hamburger on mobile
   ------------------------- */

@media (max-width: 768px) {
  .donate-btn {
    display: inline-block !important;
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  .nav-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
}