/* ===== COFFEE LIFE GALLERY - LUXURY EDITION ===== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;700;900&family=Poppins:wght@400;600;700&display=swap');

:root {
  --coffee-dark: #3a2310;
  --coffee-light: #d7b894;
  --cream-bg: #fffaf3;
  --overlay-dark: rgba(0, 0, 0, 0.7);
  --shadow-soft: 0 20px 40px rgba(0, 0, 0, 0.12);
  --gold-gradient: linear-gradient(90deg, #d7b894, #b29261, #f1dfb9);
}

/* ===== BODY ===== */
body {
  font-family: 'Poppins', sans-serif;
  background: var(--cream-bg);
  color: var(--coffee-dark);
  margin: 0;
  overflow-x: hidden;
}

/* ===== BACKGROUND EFFECT ===== */
.gallery-section {
  padding: 6rem 2rem;
  background: linear-gradient(180deg, var(--cream-bg) 0%, #f6e9dc 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.gallery-section::before {
  content: "";
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background: url("assets/coffee-grain-pattern.png") repeat;
  opacity: 0.06;
  animation: floatPattern 90s linear infinite;
  z-index: 0;
}

@keyframes floatPattern {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-400px);
  }
}

.gallery-section::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(215, 184, 148, 0.15) 0%, transparent 60%);
  animation: sparkle 20s linear infinite;
  pointer-events: none;
}

@keyframes sparkle {

  0%,
  100% {
    opacity: 0.2;
    transform: translateY(0);
  }

  50% {
    opacity: 0.5;
    transform: translateY(-10px);
  }
}

/* ===== HEADER ===== */
.gallery-header {
  margin-bottom: 3rem;
  position: relative;
  z-index: 2;
}

.gallery-title {
  font-family: 'Playfair Display', serif;
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--coffee-dark);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeInDown 1.2s ease forwards;
}

.gallery-subtitle {
  font-size: 1.25rem;
  font-weight: 500;
  color: #5a3818;
  max-width: 750px;
  margin: 0 auto;
  line-height: 1.7;
  animation: fadeInUp 1.8s ease 0.3s forwards;
}

/* ===== FILTERABLE GALLERY GRID ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  z-index: 2;
  position: relative;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 1.8rem;
  box-shadow: var(--shadow-soft);
  background: #fff;
  height: 320px;
  /* uniform height for boxed layout */
  transform: translateY(30px);
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item.reveal {
  opacity: 1;
  transform: translateY(0);
}

/* Images & videos fill the box */
.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  transition: transform 0.8s ease, filter 0.8s ease;
}

.gallery-item:hover img,
.gallery-item:hover video {
  transform: scale(1.08) rotate(1deg);
  filter: brightness(1.05) contrast(1.1);
}

/* ===== OVERLAYS ===== */
.overlay,
.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: linear-gradient(to top, var(--overlay-dark), transparent);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.6s ease;
  padding: 1rem;
}

.gallery-item:hover .overlay,
.gallery-item:hover .video-overlay {
  opacity: 1;
}

/* ===== CAPTIONS ===== */
.caption,
.video-text {
  color: #fff;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.8);
  padding: 1.8rem;
  text-align: center;
}

.caption {
  font-size: 1.2rem;
  font-weight: 500;
  font-family: 'Playfair Display', serif;
  animation: slideUp 1s ease forwards;
}

.video-item {
  position: relative;
  border-radius: 1.8rem;
  overflow: hidden;
}

.video-overlay.dark {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.video-text h3 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  white-space: nowrap;
  animation: moveText 12s linear infinite;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.video-text p {
  font-size: 1rem;
  color: #f2ddba;
  font-weight: 400;
  letter-spacing: 0.3px;
  line-height: 1.5;
  animation: fadeInUp 2s ease forwards;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s ease;
  z-index: 9999;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 95%;
  max-height: 90%;
  position: relative;
  overflow: hidden;
  border-radius: 2rem;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.85);
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.lightbox-content img,
.lightbox-content video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 15px;
  right: 25px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 10000;
}

.lightbox-close:hover {
  color: var(--coffee-light);
}

/* ===== ANIMATIONS ===== */
@keyframes moveText {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }

  10% {
    opacity: 1;
    transform: translateX(0);
  }

  90% {
    opacity: 1;
    transform: translateX(0);
  }

  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-60px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(60px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
  .gallery-title {
    font-size: 2.6rem;
  }
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .gallery-item {
    height: 250px;
  }

  .gallery-title {
    font-size: 2.2rem;
  }

  .gallery-subtitle {
    font-size: 1rem;
  }

  .video-text h3 {
    font-size: 1.4rem;
  }

  .video-text p {
    font-size: 0.9rem;
  }

  .caption {
    font-size: 1rem;
  }
}

/* ===== OPTIONAL FILTER CLASSES ===== */
.gallery-item.images,
.gallery-item.videos {
  display: block;
}