/**
 * DIME Landing - Gallery Page Styles
 * Custom styles for the main gallery page with lightbox
 */

/* ============================================================
   PAGE HEADER — Elegant title section
   ============================================================ */
.page-header-gallery {
   position: relative;
   padding: var(--space-16) 0;
   background: linear-gradient(
      135deg,
      var(--color-primary-50) 0%,
      rgba(0, 102, 204, 0.05) 100%
   );
   border-bottom: 1px solid var(--color-gray-100);
   overflow: hidden;
}

.page-header-gallery::before {
   content: '';
   position: absolute;
   top: -50%;
   right: -10%;
   width: 400px;
   height: 400px;
   background: radial-gradient(
      circle,
      rgba(0, 102, 204, 0.08) 0%,
      transparent 70%
   );
   pointer-events: none;
}

.page-header-gallery h1 {
   font-family: var(--font-display);
   font-size: var(--text-5xl);
   font-weight: var(--font-bold);
   color: var(--text-primary);
   margin-bottom: var(--space-3);
}

.page-header-gallery .lead {
   font-size: var(--text-lg);
   color: var(--text-muted);
   max-width: 500px;
}

/* ============================================================
   GALLERY GRID — Masonry-style responsive grid
   ============================================================ */
.gallery-section {
   padding: var(--space-16) 0;
   background: var(--bg-primary);
}

.gallery-grid {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
   gap: var(--space-6);
}

.gallery-item {
   position: relative;
   border-radius: var(--radius-xl);
   overflow: hidden;
   cursor: pointer;
   aspect-ratio: 4 / 3;
   background: var(--color-gray-100);
}

.gallery-item img {
   width: 100%;
   height: 100%;
   object-fit: cover;
   transition: transform var(--transition-slow) ease;
}

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

.gallery-item .overlay {
   position: absolute;
   inset: 0;
   background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.6) 0%,
      rgba(0, 0, 0, 0) 50%
   );
   opacity: 0;
   transition: opacity var(--transition-base) ease;
   display: flex;
   align-items: flex-end;
   justify-content: center;
   padding: var(--space-5);
}

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

.gallery-item .overlay i {
   font-size: var(--text-3xl);
   color: white;
   transform: translateY(10px);
   transition: transform var(--transition-base) ease;
}

.gallery-item:hover .overlay i {
   transform: translateY(0);
}

/* ============================================================
   LIGHTBOX MODAL — Full-screen image viewer
   ============================================================ */
.lightbox {
   position: fixed;
   inset: 0;
   z-index: 9999;
   background: rgba(0, 0, 0, 0.95);
   display: none;
   align-items: center;
   justify-content: center;
   opacity: 0;
   transition: opacity var(--transition-base) ease;
}

.lightbox.active {
   display: flex;
   opacity: 1;
}

.lightbox-content {
   position: relative;
   max-width: 90vw;
   max-height: 90vh;
}

.lightbox-content img {
   max-width: 100%;
   max-height: 85vh;
   object-fit: contain;
   border-radius: var(--radius-lg);
   box-shadow: var(--shadow-2xl);
}

.lightbox-close {
   position: absolute;
   top: -3rem;
   right: 0;
   background: none;
   border: none;
   color: white;
   font-size: var(--text-3xl);
   cursor: pointer;
   opacity: 0.8;
   transition: opacity var(--transition-fast) ease;
}

.lightbox-close:hover {
   opacity: 1;
}

.lightbox-nav {
   position: absolute;
   top: 50%;
   transform: translateY(-50%);
   background: rgba(255, 255, 255, 0.1);
   backdrop-filter: blur(8px);
   border: none;
   color: white;
   font-size: var(--text-3xl);
   width: 56px;
   height: 56px;
   border-radius: var(--radius-full);
   cursor: pointer;
   transition: all var(--transition-fast) ease;
   display: flex;
   align-items: center;
   justify-content: center;
}

.lightbox-nav:hover {
   background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav.prev {
   left: -4rem;
}

.lightbox-nav.next {
   right: -4rem;
}

.lightbox-counter {
   position: absolute;
   bottom: -2.5rem;
   left: 50%;
   transform: translateX(-50%);
   color: rgba(255, 255, 255, 0.7);
   font-size: var(--text-sm);
}

/* ============================================================
   BACK LINK — Return navigation
   ============================================================ */
.gallery-back {
   padding: var(--space-12) 0;
   background: var(--color-gray-50);
   border-top: 1px solid var(--color-gray-100);
   text-align: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
   .page-header-gallery h1 {
      font-size: var(--text-4xl);
   }

   .lightbox-nav.prev {
      left: var(--space-4);
   }

   .lightbox-nav.next {
      right: var(--space-4);
   }
}

@media (max-width: 767.98px) {
   .gallery-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: var(--space-4);
   }

   .lightbox-content img {
      max-height: 70vh;
   }
}
