/* ============================================================
   GALLERY PAGE STYLES
   ============================================================ */

/* Gallery Section */
.sv-gallery-section {
  padding: 80px 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  min-height: 100vh;
}

/* Gallery Grid */
.sv-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 60px;
}

/* Gallery Item */
.sv-gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 15px rgba(139, 69, 19, 0.1);
  transition: all 400ms ease;
  cursor: pointer;
  animation: sv-scale-in 600ms ease forwards;
  opacity: 0;
}

.sv-gallery-item:nth-child(1) { animation-delay: 100ms; }
.sv-gallery-item:nth-child(2) { animation-delay: 150ms; }
.sv-gallery-item:nth-child(3) { animation-delay: 200ms; }
.sv-gallery-item:nth-child(4) { animation-delay: 250ms; }
.sv-gallery-item:nth-child(5) { animation-delay: 300ms; }
.sv-gallery-item:nth-child(6) { animation-delay: 350ms; }
.sv-gallery-item:nth-child(7) { animation-delay: 400ms; }
.sv-gallery-item:nth-child(8) { animation-delay: 450ms; }
.sv-gallery-item:nth-child(9) { animation-delay: 500ms; }

.sv-gallery-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(139, 69, 19, 0.25);
}

.sv-gallery-link {
  display: block;
  position: relative;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
}

.sv-gallery-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 500ms ease;
  display: block;
}

.sv-gallery-item:hover img {
  transform: scale(1.15) rotate(2deg);
}

/* Empty State */
.sv-gallery-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 70px 30px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.08) 0%, rgba(212, 175, 55, 0.12) 100%);
  border: 1px solid rgba(139, 69, 19, 0.16);
  box-shadow: 0 18px 45px rgba(139, 69, 19, 0.08);
  animation: sv-slide-up 600ms ease;
}

.sv-gallery-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8B4513 0%, #D4AF37 100%);
  color: #fff;
  font-size: 30px;
  box-shadow: 0 12px 30px rgba(139, 69, 19, 0.25);
}

.sv-gallery-empty-state h3 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
}

.sv-gallery-empty-state p {
  margin: 0;
  max-width: 520px;
  color: #6b7280;
  font-size: 16px;
  line-height: 1.7;
}

/* Gallery Overlay */
.sv-gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.9) 0%, rgba(212, 175, 55, 0.85) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  opacity: 0;
  visibility: hidden;
  transition: all 400ms ease;
  z-index: 10;
}

.sv-gallery-link:hover .sv-gallery-overlay {
  opacity: 1;
  visibility: visible;
}

.sv-gallery-title {
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin: 0;
  letter-spacing: 1px;
}

.sv-gallery-category {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin: 0;
}

.sv-gallery-view-btn {
  padding: 8px 20px;
  background: #ffffff;
  color: #8B4513;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  letter-spacing: 1px;
  font-weight: 700;
  cursor: pointer;
  transition: all 300ms ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.sv-gallery-view-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.sv-gallery-view-btn i {
  font-size: 14px;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes sv-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sv-slide-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sv-scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes sv-pop-in {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================================
   MAGNIFIC POPUP CUSTOMIZATION
   ============================================================ */

/* Popup Background Overlay */
.mfp-bg {
  background: rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity 300ms ease;
}

.mfp-bg.mfp-ready {
  opacity: 1;
}

/* Popup Wrapper */
.mfp-wrap {
  outline: none;
}

.mfp-container {
  padding: 0;
}

/* Image Container */
.mfp-content {
  position: relative;
}

.mfp-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Bottom Bar - Title and Counter */
.mfp-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.95) 0%, rgba(212, 175, 55, 0.85) 100%);
  padding: 15px 20px;
  gap: 15px;
}

.mfp-title {
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  flex: 1;
  text-align: left;
  letter-spacing: 0.5px;
}

.mfp-bottom-bar .mfp-counter {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 12px;
  border-radius: 15px;
  white-space: nowrap;
  position: static;
  bottom: auto;
  left: auto;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Close Button */
.mfp-close {
  position: absolute;
  top: 30px;
  right: 30px;
  z-index: 9999;
  width: 40px;
  height: 40px;
  line-height: 40px;
  padding: 0;
  text-align: center;
  text-decoration: none;
  color: #ffffff;
  font-size: 28px;
  font-weight: 700;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 300ms ease;
  opacity: 0.8;
}

.mfp-close:hover {
  opacity: 1;
  color: #D4AF37;
}

/* Counter/Counter Badge */
.mfp-counter {
  display: inline-block;
}

/* Preloader */
.mfp-preloader {
  color: #ffffff;
}

/* ============================================================
   RESPONSIVE MEDIA QUERIES
   ============================================================ */

/* Tablet: 768px and below */
@media (max-width: 768px) {
  .sv-gallery-section {
    padding: 60px 0;
  }

  .sv-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
  }

  .sv-gallery-item img {
    height: 180px;
  }

  /* Magnific Popup Responsive */
  .mfp-close {
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    line-height: 35px;
    font-size: 24px;
  }
  
  .mfp-bottom-bar {
    padding: 12px 15px;
  }

  .mfp-title {
    font-size: 14px;
  }

  .mfp-bottom-bar .mfp-counter {
    font-size: 11px;
    padding: 5px 10px;
  }
}

/* Mobile: 640px and below */
@media (max-width: 640px) {
  .sv-gallery-section {
    padding: 40px 0;
  }

  .sv-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 40px;
  }

  .sv-gallery-item img {
    height: 140px;
  }

  .sv-gallery-overlay {
    gap: 10px;
  }

  .sv-gallery-title {
    font-size: 14px;
  }

  .sv-gallery-category {
    font-size: 10px;
  }

  .sv-gallery-view-btn {
    padding: 6px 14px;
    font-size: 10px;
  }

  /* Magnific Popup Mobile */
  .mfp-close {
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    line-height: 32px;
    font-size: 20px;
  }

  .mfp-counter {
    font-size: 11px;
    padding: 5px 10px;
    bottom: 10px;
    left: 10px;
  }

  .mfp-bottom-bar {
    padding: 10px 12px;
    gap: 10px;
  }

  .mfp-title {
    font-size: 13px;
  }

  .mfp-bottom-bar .mfp-counter {
    font-size: 10px;
    padding: 4px 8px;
  }
}
