/* Gallery Page Styles */

/* Hero Section */
.gallery-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  position: relative;
  color: white;
  padding: 120px 0;
  text-align: center;
  overflow: hidden;
}

.gallery-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(0, 191, 166, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 105, 92, 0.08) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg) scale(1); }
  50% { transform: translateY(-20px) rotate(180deg) scale(1.1); }
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.gallery-hero .container {
  position: relative;
  z-index: 2;
}

.gallery-hero h1 {
  font-size: 4em;
  font-weight: 900;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff, #00BFA6, #ffffff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(0, 191, 166, 0.3);
  animation: glow 3s ease-in-out infinite alternate;
}

.gallery-hero p {
  font-size: 1.4em;
  max-width: 800px;
  margin: 0 auto;
  opacity: 0.9;
  line-height: 1.6;
}

@keyframes glow {
  from { text-shadow: 0 0 30px rgba(0, 191, 166, 0.3); }
  to { text-shadow: 0 0 50px rgba(0, 191, 166, 0.6), 0 0 70px rgba(0, 191, 166, 0.4); }
}

/* Gallery Section */
.gallery-section {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: 80px 0;
  min-height: 100vh;
}

.gallery-header {
  text-align: center;
  margin-bottom: 60px;
}

.gallery-header h2 {
  font-size: 3.5em;
  font-weight: 800;
  background: linear-gradient(135deg, #00BFA6, #00695c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 20px;
  letter-spacing: 2px;
}

.gallery-header p {
  font-size: 1.2em;
  color: #64748b;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Chronological Left-to-Right Editorial Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Gallery Item */
.gallery-item {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 42, 63, 0.1);
  border: 1px solid rgba(226, 232, 240, 0.85);
  transition: transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.35s ease;
  background: #0f172a;
  position: relative;
  display: block;
  width: 100%;
  cursor: pointer;
}

.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 44px rgba(15, 42, 63, 0.2);
}

.gallery-item-inner {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  aspect-ratio: 4 / 3;
  width: 100%;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.45s ease;
  object-fit: cover;
  object-position: center 22%;
}

.gallery-item:hover img {
  transform: scale(1.06);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
  }
}

@media (max-width: 768px) {
  .gallery-hero {
    padding: 80px 0;
  }
  
  .gallery-hero h1 {
    font-size: 2.5em;
  }
  
  .gallery-hero p {
    font-size: 1.1em;
  }
  
  .gallery-header h2 {
    font-size: 2.5em;
  }
  
  .gallery-header p {
    font-size: 1em;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    padding: 0 16px;
  }
}

@media (max-width: 480px) {
  .gallery-hero h1 {
    font-size: 2em;
  }
  
  .gallery-header h2 {
    font-size: 2em;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Loading Animation */
.gallery-item {
  cursor: pointer;
  animation: fadeInUp 0.5s ease-out both;
}

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

/* Staggered Animation for Items */
.gallery-item:nth-child(1) { animation-delay: 0.04s; }
.gallery-item:nth-child(2) { animation-delay: 0.08s; }
.gallery-item:nth-child(3) { animation-delay: 0.12s; }
.gallery-item:nth-child(4) { animation-delay: 0.16s; }
.gallery-item:nth-child(5) { animation-delay: 0.20s; }
.gallery-item:nth-child(6) { animation-delay: 0.24s; }
.gallery-item:nth-child(7) { animation-delay: 0.28s; }
.gallery-item:nth-child(8) { animation-delay: 0.32s; }
.gallery-item:nth-child(9) { animation-delay: 0.36s; }
.gallery-item:nth-child(10) { animation-delay: 0.40s; }
.gallery-item:nth-child(11) { animation-delay: 0.44s; }
.gallery-item:nth-child(12) { animation-delay: 0.48s; }
.gallery-item:nth-child(13) { animation-delay: 0.52s; }
.gallery-item:nth-child(14) { animation-delay: 0.56s; }
.gallery-item:nth-child(15) { animation-delay: 0.60s; }
.gallery-item:nth-child(16) { animation-delay: 0.64s; }
.gallery-item:nth-child(17) { animation-delay: 0.68s; }
.gallery-item:nth-child(18) { animation-delay: 0.72s; }
.gallery-item:nth-child(19) { animation-delay: 0.76s; }
.gallery-item:nth-child(20) { animation-delay: 0.80s; }
.gallery-item:nth-child(21) { animation-delay: 0.84s; }
.gallery-item:nth-child(22) { animation-delay: 0.88s; }
.gallery-item:nth-child(23) { animation-delay: 0.92s; }

/* Lightbox styles */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

.lightbox.is-open { display: flex; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(6px);
}

.lightbox-image {
  max-width: 88vw;
  max-height: 78vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  z-index: 1102;
  opacity: 1;
  transition: opacity .3s ease;
  object-fit: contain;
}

.lb-fade-in { opacity: 0; animation: lbFade .3s ease forwards; }
@keyframes lbFade { to { opacity: 1; } }

.lightbox-counter {
  position: absolute;
  top: 22px;
  left: 24px;
  z-index: 1103;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  z-index: 1103;
  background: rgba(255,255,255,0.14);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  cursor: pointer;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
  transition: transform .2s ease, background .2s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(0, 191, 166, 0.85); border-color: transparent; }

.lightbox-close { top: 20px; right: 20px; font-size: 28px; line-height: 1; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); font-size: 20px; }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); font-size: 20px; }

.lightbox-caption {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 20px;
  border-radius: 12px;
  z-index: 1103;
  width: max-content;
  max-width: 88vw;
  text-align: center;
  backdrop-filter: blur(6px);
}

.lightbox-caption h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff;
}

.lightbox-caption p {
  font-size: 0.9rem;
  color: #cbd5e1;
  margin-bottom: 6px;
}

@media (max-width: 768px) {
  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 18px;
    background: rgba(15, 23, 42, 0.75);
  }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  .lightbox-image { max-width: 92vw; max-height: 68vh; margin-bottom: 40px; }
  .lightbox-caption {
    bottom: 14px;
    padding: 10px 14px;
    max-width: 92vw;
  }
  .lightbox-caption h3 { font-size: 0.98rem; }
  .lightbox-caption p { font-size: 0.82rem; }
}
