@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600&display=swap");

body {
  margin: 0;
  background: #0d0e10;
  font-family: "DM Sans", sans-serif;
}

/* ── GALLERY HEADER ── */
.gallery-header {
  position: fixed;
  top: var(--header-h, 7.2rem);
  left: 0;
  right: 0;
  z-index: 10;
  padding: 1.6rem 3.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(
    to bottom,
    rgba(13, 14, 16, 0.98) 60%,
    transparent
  );
  pointer-events: none;
}
.gallery-header .gallery-title {
  font-size: 0.8rem;
  letter-spacing: 6px;
  color: rgba(255, 255, 255, 0.25);
  font-weight: 500;
  text-transform: uppercase;
}
.gallery-header .gallery-count {
  font-size: 0.85rem;
  letter-spacing: 3px;
  color: rgba(192, 160, 96, 0.6);
  font-weight: 300;
}

/* ── MASONRY GRID ── */
.gallery {
  columns: 5;
  column-gap: 3px;
  padding-top: calc(var(--header-h, 7.2rem) + 5rem);
  padding-bottom: 12rem;
  padding-left: 3px;
  padding-right: 3px;
  box-sizing: border-box;
}

/* ── GRID ITEMS — must be display:block for masonry ── */
.gallery-item {
  position: relative;
  break-inside: avoid;
  margin-bottom: 3px;
  overflow: hidden;
  cursor: pointer;
  background: #1a1b1e;
  display: block; /* critical for column masonry */
  width: 100%; /* fill column width */
}

/* Image/video fills item naturally */
.gallery-item img,
.gallery-item video {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.gallery-item:hover img,
.gallery-item:hover video {
  transform: scale(1.04);
}

/* Dark overlay on hover */
.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(13, 14, 16, 0);
  transition: background 0.35s ease;
  z-index: 1;
}
.gallery-item:hover::after {
  background: rgba(13, 14, 16, 0.3);
}

/* Gold bottom line reveal */
.gallery-item::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #c0a060;
  transition: width 0.4s ease;
  z-index: 3;
}
.gallery-item:hover::before {
  width: 100%;
}

/* ── FEATURED: every 7th — full-width banner ── */
.gallery-item:nth-child(7n + 1) {
  column-span: all;
  display: block;
}
.gallery-item:nth-child(7n + 1) img,
.gallery-item:nth-child(7n + 1) video {
  width: 100%;
  height: 52rem;
  object-fit: cover;
}

/* ── VIDEO PLAY ICON ── */
.gallery-item.is-video {
  position: relative;
}
.gallery-item.is-video .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: rgba(192, 160, 96, 0.9);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.3s ease,
    background 0.25s ease;
  pointer-events: none;
}
.gallery-item.is-video .play-icon svg {
  width: 1.8rem;
  height: 1.8rem;
  fill: #fff;
  margin-left: 0.3rem; /* optical center for triangle */
}
.gallery-item.is-video:hover .play-icon {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(192, 160, 96, 1);
}

/* ── LIGHTBOX ── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 8, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(8px);
}
.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 88vh;
  transform: scale(0.95) translateY(8px);
  transition: transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.lightbox.active .lightbox-media {
  transform: scale(1) translateY(0);
}

.lightbox-media img {
  max-width: 88vw;
  max-height: 84vh;
  object-fit: contain;
  display: none;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7);
}
.lightbox-media video {
  max-width: 88vw;
  max-height: 84vh;
  display: none;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7);
}
.lightbox-media img.visible,
.lightbox-media video.visible {
  display: block;
}

/* Top bar */
.lightbox-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  padding: 2.4rem 3.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(
    to bottom,
    rgba(6, 7, 8, 0.85) 0%,
    transparent 100%
  );
}
.lightbox-title {
  font-size: 0.85rem;
  letter-spacing: 5px;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 400;
  text-transform: uppercase;
}
.lightbox-close {
  width: 4.4rem;
  height: 4.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
  font-size: 2rem;
  transition:
    color 0.2s ease,
    transform 0.25s ease,
    border-color 0.2s ease;
  font-weight: 300;
  border: 1px solid rgba(255, 255, 255, 0.1);
  line-height: 1;
}
.lightbox-close:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Arrows */
.lightbox-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 5.6rem;
  height: 5.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
  color: rgba(255, 255, 255, 0.4);
  font-size: 2rem;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
  user-select: none;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  font-family: inherit;
}
.lightbox-arrow:hover {
  background: rgba(192, 160, 96, 0.15);
  border-color: rgba(192, 160, 96, 0.4);
  color: #c0a060;
}
.lightbox-prev {
  left: 2.4rem;
}
.lightbox-next {
  right: 2.4rem;
}

/* Bottom bar */
.lightbox-bottombar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  padding: 2rem 3.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to top, rgba(6, 7, 8, 0.8) 0%, transparent 100%);
}
.lightbox-counter {
  font-size: 0.85rem;
  letter-spacing: 5px;
  color: rgba(255, 255, 255, 0.25);
  font-weight: 300;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.lightbox-counter-cur {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  font-weight: 400;
  color: #c0a060;
  line-height: 1;
}
.lightbox-counter-sep {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.15);
}
.lightbox-counter-tot {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.25);
}

/* ── RESPONSIVE ── */
@media screen and (max-width: 1200px) {
  .gallery {
    columns: 4;
  }
}

@media screen and (max-width: 940px) {
  .gallery {
    columns: 3;
    padding-top: calc(var(--header-h, 7.2rem) + 3rem);
  }
  .gallery-item:nth-child(7n + 1) img,
  .gallery-item:nth-child(7n + 1) video {
    height: 36rem;
  }
  .lightbox-arrow {
    width: 4.4rem;
    height: 4.4rem;
    font-size: 1.6rem;
  }
  .lightbox-prev {
    left: 1.2rem;
  }
  .lightbox-next {
    right: 1.2rem;
  }
}

@media screen and (max-width: 600px) {
  .gallery {
    columns: 2;
    column-gap: 2px;
  }
  .gallery-item {
    margin-bottom: 2px;
  }
  .gallery-item:nth-child(7n + 1) img,
  .gallery-item:nth-child(7n + 1) video {
    height: 26rem;
  }
}

@media screen and (max-width: 380px) {
  .gallery {
    columns: 1;
  }
}
