/* ========================================
   GALLERY PAGE STYLES
   Jeddah Expert - Luxury Construction
======================================== */

/* ========================================
   PAGE HERO - GALLERY
======================================== */
.gallery-hero .page-hero-bg {
  background-image: url('https://images.unsplash.com/photo-1600585154340-be6161a56a0c?w=1600&q=80');
}

/* ========================================
   GALLERY FILTER
======================================== */
.gallery-section {
  background: var(--matte-black);
}

.gallery-filter {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 50px;
  flex-wrap: wrap;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: rgba(15, 23, 42, 0.8);
  /* Darker background for white text */
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 30px;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.4s ease;
}

.filter-btn i {
  color: #FFFFFF;
  opacity: 0.9;
}

.filter-btn:hover {
  background: rgba(148, 163, 184, 0.1);
  border-color: var(--accent-blue);
  transform: translateY(-3px);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--metallic-gold), var(--gold-dark));
  border-color: var(--metallic-gold);
  color: #FFFFFF;
  box-shadow: 0 10px 25px rgba(26, 60, 22, 0.4);
}

.filter-btn.active i {
  color: #FFFFFF;
}

/* ========================================
   GALLERY GRID - MASONRY
======================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 300px;
  gap: 20px;
}

.gallery-item {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  cursor: pointer;
}

.gallery-item:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-item:nth-child(4) {
  grid-column: span 2;
}

.gallery-item:nth-child(5) {
  grid-row: span 2;
}

.gallery-item:nth-child(8) {
  grid-column: span 2;
}

.gallery-item:nth-child(11) {
  grid-column: span 2;
}

.gallery-image {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.6s ease;
}

.gallery-item:hover .gallery-image img {
  transform: scale(1.15);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, rgba(15, 20, 25, 0.95) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 25px;
  opacity: 0;
  transition: all 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-info {
  transform: translateY(20px);
  transition: all 0.4s ease;
}

.gallery-item:hover .gallery-info {
  transform: translateY(0);
}

.gallery-category {
  display: inline-block;
  padding: 5px 15px;
  background: var(--metallic-gold);
  color: var(--royal-blue);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.gallery-info h3 {
  font-size: 20px;
  color: var(--pure-white);
  margin-bottom: 8px;
}

.gallery-info p {
  font-size: 13px;
  color: var(--primary-white);
  /* Stays white as it's on a dark overlay even in light mode, but let's check */
  display: flex;
  align-items: center;
  gap: 8px;
}

.gallery-info p i {
  color: var(--metallic-gold);
}

.gallery-zoom {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: rgba(168, 230, 207, 0.9);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--royal-blue);
  font-size: 18px;
  cursor: pointer;
  transform: scale(0);
  transition: all 0.4s ease;
}

.gallery-item:hover .gallery-zoom {
  transform: scale(1);
}

.gallery-zoom:hover {
  background: var(--metallic-gold);
  transform: scale(1.1);
}

/* ========================================
   LIGHTBOX
======================================== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
}

.lightbox-content {
  position: relative;
  z-index: 10;
  max-width: 90%;
  max-height: 90%;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 45px;
  height: 45px;
  background: var(--metallic-gold);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--royal-blue);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lightbox-close:hover {
  background: var(--pure-white);
  transform: rotate(90deg);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(212, 175, 55, 0.8);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--royal-blue);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lightbox-nav:hover {
  background: var(--metallic-gold);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev {
  left: -80px;
}

.lightbox-nav.next {
  right: -80px;
}

/* ========================================
   FEATURED HIGHLIGHT
======================================== */
.featured-highlight {
  background: linear-gradient(180deg, var(--dark-gray) 0%, var(--royal-blue) 100%);
  transition: background 0.4s ease;
}

body.light-mode .featured-highlight {
  background: var(--bg-color);
}

.highlight-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: repeat(2, 280px);
  gap: 25px;
}

.highlight-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
}

.highlight-card.large {
  grid-row: span 2;
}

.highlight-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.6s ease;
}

.highlight-card:hover img {
  transform: scale(1.1);
}

.highlight-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 30px;
  background: linear-gradient(180deg, transparent 0%, rgba(27, 51, 26, 0.95) 100%);
}

.highlight-tag {
  display: inline-block;
  padding: 6px 18px;
  background: var(--deep-red);
  color: var(--pure-white);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 20px;
  margin-bottom: 15px;
}

.highlight-content h3 {
  font-size: 28px;
  color: var(--pure-white);
  margin-bottom: 15px;
}

.highlight-content p {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 20px;
  line-height: 1.6;
}

.highlight-card:not(.large) .highlight-content h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.highlight-card:not(.large) .highlight-content p {
  font-size: 13px;
  color: var(--primary-white);
  margin-bottom: 0;
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
  }

  .gallery-item:nth-child(4),
  .gallery-item:nth-child(8),
  .gallery-item:nth-child(11) {
    grid-column: span 1;
  }
}

@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 250px;
  }

  .gallery-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
  }

  .highlight-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .highlight-card.large {
    grid-row: span 1;
    height: 400px;
  }

  .lightbox-nav.prev {
    left: 20px;
  }

  .lightbox-nav.next {
    right: 20px;
  }
}

@media (max-width: 576px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 280px;
  }

  .gallery-item:nth-child(1) {
    grid-column: span 1;
    grid-row: span 1;
  }

  .gallery-filter {
    gap: 10px;
  }

  .filter-btn {
    padding: 10px 18px;
    font-size: 12px;
  }

  .highlight-card.large {
    height: 350px;
  }

  .lightbox-nav {
    display: none;
  }
}

/* ========================================
   REFACTORED FOR CENTRAL THEME CONTROL
   Subpage variables are now in style.css
   ======================================== */