/* =============================================
   GALLERY PAGE — Albums Grid
   ============================================= */

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes lbImgPop {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---- Albums grid ---- */
.albums-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.album-card {
  display: block;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line, #ded8cd);
  box-shadow: 0 4px 20px rgba(15, 38, 35, 0.06);
  text-decoration: none;
  color: inherit;
  opacity: 0;
  animation: fadeSlideUp 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: calc(var(--i) * 0.08s);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.album-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(15, 38, 35, 0.14);
}

/* Cover image */
.album-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #c9d5cf;
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              filter 0.4s ease;
  filter: brightness(0.88);
}

.album-card:hover .album-cover img {
  transform: scale(1.07);
  filter: brightness(1.02);
}

.album-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 28, 26, 0.55) 0%,
    rgba(10, 28, 26, 0.0) 60%
  );
  transition: opacity 0.4s ease;
}

.album-card:hover .album-overlay {
  opacity: 0.5;
}

.album-count {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  letter-spacing: 0.4px;
}

/* Album info */
.album-info {
  padding: 20px 22px 22px;
}

.album-info h3 {
  font-family: "Lustria", serif;
  font-weight: 400;
  font-size: 20px;
  margin: 0 0 6px;
  line-height: 1.25;
}

.album-info p {
  font-size: 13px;
  color: var(--muted, #6e7773);
  margin: 0 0 14px;
  line-height: 1.5;
}

.album-cta {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold, #c8a45d);
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: inline-block;
}

.album-card:hover .album-cta {
  opacity: 1;
  transform: translateX(0);
}

/* =============================================
   ALBUM DETAIL — Masonry Grid
   ============================================= */
.masonry-grid {
  columns: 3;
  column-gap: 14px;
}

.masonry-item {
  display: block;
  width: 100%;
  break-inside: avoid;
  margin-bottom: 14px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 0;
  padding: 0;
  background: #c9d5cf;
  opacity: 0;
  animation: fadeSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: calc(var(--i) * 0.06s);
}

.masonry-item img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              filter 0.4s ease;
  filter: brightness(0.9);
}

.masonry-item:hover img {
  transform: scale(1.05);
  filter: brightness(1.05);
}

.masonry-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 28, 26, 0.72) 0%,
    rgba(10, 28, 26, 0.0) 55%
  );
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.masonry-item:hover .masonry-overlay {
  opacity: 1;
}

.masonry-caption {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.masonry-zoom {
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
}

.album-back {
  margin-top: 40px;
}

/* =============================================
   LIGHTBOX
   ============================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(5, 14, 13, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: lbFadeIn 0.3s ease forwards;
  backdrop-filter: blur(8px);
}

.lightbox-inner {
  position: relative;
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* Close button */
.lb-close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lb-close:hover {
  background: rgba(200, 164, 93, 0.4);
}

/* Main image */
.lb-img-wrap {
  width: 100%;
  max-height: 68vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 14px;
}

.lb-img {
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 14px;
  display: block;
  animation: lbImgPop 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Footer */
.lb-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 4px;
}

.lb-caption {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 500;
}

.lb-counter {
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  letter-spacing: 0.5px;
}

/* Prev / Next arrows */
.lb-arrow {
  position: absolute;
  top: calc(50% - 30px);
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 0.2s;
}

.lb-arrow:hover {
  background: rgba(200, 164, 93, 0.4);
}

.lb-prev { left: -64px; }
.lb-next { right: -64px; }

/* Thumbnail strip */
.lb-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 100%;
  padding: 4px 2px 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.lb-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  background: rgba(255,255,255,0.08);
  opacity: 0.5;
  transition: opacity 0.2s, border-color 0.2s;
}

.lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lb-thumb:hover {
  opacity: 0.8;
}

.lb-thumb.active {
  border-color: var(--gold, #c8a45d);
  opacity: 1;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .albums-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .masonry-grid {
    columns: 2;
  }
  .lb-prev { left: -10px; }
  .lb-next { right: -10px; }
}

@media (max-width: 600px) {
  .albums-grid {
    grid-template-columns: 1fr;
  }
  .masonry-grid {
    columns: 2;
    column-gap: 10px;
  }
  .masonry-item {
    margin-bottom: 10px;
  }
  .lb-close {
    top: -46px;
    right: 0;
  }
  .lb-arrow {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
  .lb-prev { left: -4px; }
  .lb-next { right: -4px; }
  .lb-thumb {
    width: 52px;
    height: 40px;
  }
}

/* -- Additional responsive fixes -- */
@media (max-width: 480px) {
  .albums-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .album-info {
    padding: 16px 16px 18px;
  }
  .album-info h3 {
    font-size: 18px;
  }
  .masonry-grid {
    columns: 2;
    column-gap: 8px;
  }
  .masonry-item {
    margin-bottom: 8px;
    border-radius: 10px;
  }

  /* Lightbox: full screen on mobile */
  .lightbox {
    padding: 10px;
    align-items: flex-end;
  }
  .lightbox-inner {
    gap: 10px;
  }
  .lb-img-wrap {
    max-height: 55vh;
  }
  .lb-img {
    max-height: 55vh;
    border-radius: 10px;
  }
  .lb-close {
    top: -44px;
    right: 0;
    width: 38px;
    height: 38px;
    font-size: 24px;
  }
  .lb-arrow {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }
  .lb-prev { left: 2px; }
  .lb-next { right: 2px; }
  .lb-caption {
    font-size: 12px;
  }
  .lb-thumb {
    width: 48px;
    height: 36px;
  }
}

@media (max-width: 360px) {
  .masonry-grid {
    columns: 1;
  }
}
