/* ── GUEST GALLERY STYLESHEET ── */

.gallery-archive-wrapper {
  background: var(--ink);
  color: var(--ivory);
  min-height: 100vh;
  padding-bottom: 120px;
}

/* ── HERO BANNER ── */
.gallery-hero {
  position: relative;
  text-align: center;
  padding: 140px 24px 80px;
  background: linear-gradient(to bottom, rgba(13, 26, 18, 0.4) 0%, var(--ink) 100%),
              url('../images/background-camau.webp') no-repeat center center;
  background-size: cover;
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
}

.gallery-hero-content {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.gallery-hero-eyebrow {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.gallery-hero-eyebrow::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--gold);
}

.gallery-hero-title {
  font-family: var(--display);
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--ivory);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.gallery-hero-title em {
  font-style: italic;
  color: var(--gold);
}

.gallery-hero-desc {
  font-size: 15px;
  color: rgba(247, 242, 232, 0.65);
  line-height: 1.8;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ── ALBUMS CONTAINER ── */
.albums-container {
  max-width: 1400px;
  width: 90%;
  margin: 60px auto 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ── ALBUM SECTION ── */
.album-section {
  width: 100%;
  padding: 0 !important;
}

.album-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
  padding-bottom: 10px;
}

.album-header-left {
  flex: 1;
}

.album-title {
  font-family: var(--display);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 400;
  color: var(--gold);
  line-height: 1.3;
  margin-bottom: 8px;
}

.album-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: rgba(247, 242, 232, 0.45);
  text-transform: uppercase;
}

.album-count {
  position: relative;
  padding-left: 16px;
}

.album-count::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--gold);
}

.album-desc {
  flex: 1.5;
  font-size: 14px;
  color: rgba(247, 242, 232, 0.65);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

/* ── ALBUM IMAGES GRID (Collage & Flat Layouts) ── */
.album-images-grid {
  display: grid;
  gap: 16px;
  width: 100%;
}

/* Default / Flat grids */
.album-images-grid.flat-layout-1 { grid-template-columns: minmax(200px, 600px); }
.album-images-grid.flat-layout-2 { grid-template-columns: repeat(2, 1fr); }
.album-images-grid.flat-layout-3 { grid-template-columns: repeat(3, 1fr); }
.album-images-grid.flat-layout-4 { grid-template-columns: repeat(4, 1fr); }

.album-image-col {
  width: 100%;
  height: 100%;
}

/* ── PREMIUM COLLAGE MASONRY LAYOUT (For 5+ images) ── */
.album-images-grid.collage-layout {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 200px 200px;
}

.album-images-grid.collage-layout .album-image-col {
  grid-column: span 1;
  grid-row: span 1;
}

/* 1st image is Large (2x2) */
.album-images-grid.collage-layout .album-image-col:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
}

/* Make cards in collage layout take full container height (ignoring aspect-ratio) */
.album-images-grid.collage-layout .gallery-card {
  aspect-ratio: unset;
  height: 100%;
}

/* ── CARD DESIGN ── */
.gallery-card {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: #0d1a12;
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  display: block;
}

.gallery-card-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}

.gallery-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hover info overlay */
.gallery-card-hover-info {
  position: absolute;
  inset: 0;
  background: rgba(13, 26, 18, 0.85);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-card-hover-info span {
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--gold);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 2px;
  text-transform: uppercase;
}

/* Card Hover Interactions */
.gallery-card:hover {
  border-color: var(--gold);
  box-shadow: 0 10px 30px rgba(201, 168, 76, 0.2);
  transform: translateY(-4px);
}

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

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

/* ── OVERLAY "+X" CARD FOR THE 5TH ITEM ── */
.gallery-card.has-overlay::after {
  content: attr(data-remaining);
  position: absolute;
  inset: 0;
  background: rgba(13, 26, 18, 0.85);
  color: var(--gold);
  font-family: var(--display);
  font-size: 28px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.gallery-card.has-overlay:hover::after {
  background: rgba(201, 168, 76, 0.25);
  color: var(--ivory);
  font-size: 32px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.gallery-card.has-overlay:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
}

/* ── LOAD MORE BUTTON ── */
.gallery-loadmore-container {
  display: flex;
  justify-content: center;
  margin-top: 60px;
  width: 100%;
}

.gallery-loadmore-btn {
  background: rgba(13, 26, 18, 0.6);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  padding: 16px 36px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-radius: 50px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gallery-loadmore-btn:hover {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 8px 30px rgba(201, 168, 76, 0.4);
  transform: translateY(-2px);
}

.gallery-loadmore-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.loadmore-spinner {
  width: 16px;
  height: 16px;
  display: none;
  animation: loadmore-rotate 1s linear infinite;
}

.gallery-loadmore-btn.loading .loadmore-spinner {
  display: inline-block;
}

.loadmore-spinner circle {
  stroke-dasharray: 60;
  stroke-dashoffset: 20;
  stroke-linecap: round;
}

@keyframes loadmore-rotate {
  100% { transform: rotate(360deg); }
}

/* ── LIGHTBOX (PREMIUM OVERLAY) ── */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(13, 26, 18, 0.96);
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.gallery-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-close {
  position: absolute;
  top: 40px;
  right: 40px;
  background: rgba(247, 242, 232, 0.05);
  border: 1px solid rgba(201, 168, 76, 0.2);
  color: var(--gold);
  font-size: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100000;
}

.lightbox-close:hover {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
  transform: rotate(90deg);
}

.lightbox-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 900px;
  width: 90%;
  position: relative;
}

.lightbox-media-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.lightbox-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(201, 168, 76, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-lightbox.active .lightbox-img {
  opacity: 1;
  transform: scale(1);
}

/* Lightbox Navigation Buttons */
.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(13, 26, 18, 0.6);
  border: 1px solid rgba(201, 168, 76, 0.25);
  color: var(--gold);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-btn:hover {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}

.lightbox-btn-prev {
  left: -80px;
}

.lightbox-btn-next {
  right: -80px;
}

/* Lightbox Text Details */
.lightbox-details {
  text-align: center;
  margin-top: 24px;
  max-width: 680px;
  width: 100%;
}

.lightbox-title {
  font-family: var(--display);
  font-size: 24px;
  color: var(--gold);
  margin-bottom: 10px;
}

.lightbox-desc {
  font-size: 14.5px;
  color: rgba(247, 242, 232, 0.85);
  line-height: 1.7;
}

/* ── RESPONSIVE DESIGN ── */
@media (max-width: 1100px) {
  .lightbox-btn-prev { left: 16px; }
  .lightbox-btn-next { right: 16px; }
  .lightbox-btn {
    width: 44px;
    height: 44px;
    background: rgba(13, 26, 18, 0.8);
  }
}

@media (max-width: 900px) {
  .album-header {
    flex-direction: column;
    gap: 12px;
    padding-bottom: 16px;
  }
  .album-desc {
    font-size: 13.5px;
    line-height: 1.6;
  }
  .album-images-grid {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .album-images-grid::-webkit-scrollbar {
    display: none;
  }
  .album-image-col {
    flex: 0 0 220px;
    scroll-snap-align: start;
  }
  .gallery-card {
    aspect-ratio: 3 / 2;
  }
  .album-images-grid.collage-layout .gallery-card {
    aspect-ratio: 3 / 2 !important;
    height: auto !important;
  }
  .gallery-card.has-overlay::after {
    font-size: 24px;
  }
  .lightbox-close {
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}

@media (max-width: 600px) {
  .albums-container {
    gap: 20px;
    margin-top: 40px;
  }
  .gallery-hero {
    padding: 100px 16px 60px;
  }
  .album-image-col {
    flex: 0 0 180px;
  }
  .lightbox-title {
    font-size: 20px;
  }
  .lightbox-desc {
    font-size: 13.5px;
  }
}
