/* ========================= 
    GALLERY PAGE STYLES
========================== */

/* Gallery Hero Section */
.gallery-hero {
  background: linear-gradient(135deg, rgba(186, 149, 79, 0.95), rgba(186, 149, 79, 0.85)), url("/images/gallery-bg.jpg")
    center / cover;
  color: white;
  padding: 6rem 0;
  text-align: center;
  min-height: 300px;
  display: flex;
  align-items: center;
}

.gallery-hero-content {
  width: 100%;
}

.gallery-hero .hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: 1px;
}

.gallery-hero .hero-subtitle {
  font-size: 1.3rem;
  opacity: 0.95;
  font-weight: 300;
}

/* Gallery Section */
.gallery-section {
  background: #f9f7f4;
  min-height: 100vh;
}

.gallery-header {
  margin-bottom: 3rem;
}

/* Gallery Filters */
.gallery-filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.filter-btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.filter-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--primary);
  transition: left 0.3s ease;
  z-index: -1;
}

.filter-btn:hover::before,
.filter-btn.active::before {
  left: 0;
}

.filter-btn:hover,
.filter-btn.active {
  color: white;
  transform: translateY(-2px);
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* Gallery Item */
.gallery-item {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

/* Staggered animation for gallery items */
.gallery-item:nth-child(1) {
  animation-delay: 0.1s;
}
.gallery-item:nth-child(2) {
  animation-delay: 0.15s;
}
.gallery-item:nth-child(3) {
  animation-delay: 0.2s;
}
.gallery-item:nth-child(4) {
  animation-delay: 0.25s;
}
.gallery-item:nth-child(5) {
  animation-delay: 0.3s;
}
.gallery-item:nth-child(6) {
  animation-delay: 0.35s;
}
.gallery-item:nth-child(7) {
  animation-delay: 0.4s;
}
.gallery-item:nth-child(8) {
  animation-delay: 0.45s;
}
.gallery-item:nth-child(9) {
  animation-delay: 0.5s;
}
.gallery-item:nth-child(10) {
  animation-delay: 0.55s;
}
.gallery-item:nth-child(11) {
  animation-delay: 0.6s;
}
.gallery-item:nth-child(12) {
  animation-delay: 0.65s;
}
.gallery-item:nth-child(13) {
  animation-delay: 0.7s;
}
.gallery-item:nth-child(14) {
  animation-delay: 0.75s;
}
.gallery-item:nth-child(15) {
  animation-delay: 0.8s;
}
.gallery-item:nth-child(16) {
  animation-delay: 0.85s;
}

.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

/* Gallery Image Wrapper */
.gallery-img-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  overflow: hidden;
  background: #f0f0f0;
}

.gallery-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Zoom animation on hover */
.gallery-item:hover .gallery-img {
  transform: scale(1.1);
}

/* Gallery Overlay */
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(186, 149, 79, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

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

/* Overlay Content */
.overlay-content {
  text-align: center;
  transform: scale(0.8);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover .overlay-content {
  transform: scale(1);
}

.overlay-content i {
  font-size: 2.5rem;
  color: white;
  display: inline-block;
}

/* Gallery Caption */
.gallery-caption {
  padding: 1.5rem;
  background: white;
  text-align: center;
  transition: all 0.3s ease;
}

.gallery-caption h5 {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.gallery-caption p {
  color: #666;
  font-size: 0.9rem;
  margin: 0;
}

.gallery-item:hover .gallery-caption h5 {
  color: #8b6914;
}

/* Hide animation class for filtered items */
.gallery-item.hidden {
  display: none !important;
}

/* Show animation class for filtered items */
.gallery-item.show {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* ========================= 
    LIGHTGALLERY CUSTOMIZATION
========================== */

/* Ensure gallery links inherit proper styling */
.gallery-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.gallery-link:hover {
  text-decoration: none;
}

/* LightGallery modal customization */
.lg-outer {
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
}

.lg-backdrop {
  background-color: rgba(0, 0, 0, 0.95);
}

/* LightGallery toolbar styling */
.lg-toolbar {
  background: rgba(0, 0, 0, 0.8);
  padding: 15px 20px;
}

.lg-toolbar button {
  color: white;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.lg-toolbar button:hover {
  opacity: 1;
  color: var(--primary);
}

/* Counter styling */
.lg-counter {
  color: white;
  font-weight: 600;
}

/* Thumbnail styling */
.lg-thumb-item {
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.lg-thumb-item.active {
  border-color: var(--primary);
  transform: scale(1.05);
}

.lg-thumb-item:hover {
  border-color: var(--primary);
}

/* Image zoom effect */
.lg-img-container {
  animation: zoomInImage 0.4s ease-out;
}

@keyframes zoomInImage {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Fade animation for slides */
.lg-item.lg-show-item {
  animation: fadeInSlide 0.5s ease-out;
}

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

/* Download and share buttons */
.lg-download,
.lg-share {
  color: white;
}

.lg-download:hover,
.lg-share:hover {
  color: var(--primary);
}

/* ========================= 
    RESPONSIVE GALLERY
========================== */

/* Tablets (768px - 991px) */
@media (max-width: 991px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
  }

  .gallery-hero .hero-title {
    font-size: 2.5rem;
  }

  .gallery-hero .hero-subtitle {
    font-size: 1.1rem;
  }

  .gallery-filters {
    gap: 0.75rem;
  }

  .filter-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
}

/* Small Tablets (640px - 767px) */
@media (min-width: 640px) and (max-width: 767px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .gallery-hero {
    padding: 4rem 0;
    min-height: 250px;
  }

  .gallery-hero .hero-title {
    font-size: 2rem;
  }

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

  .gallery-filters {
    gap: 0.5rem;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .gallery-caption {
    padding: 1rem;
  }

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

  .gallery-caption p {
    font-size: 0.8rem;
  }

  .overlay-content i {
    font-size: 2rem;
  }
}

/* Mobile Phones (480px - 639px) */
@media (max-width: 639px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .gallery-hero {
    padding: 3rem 0;
    min-height: 200px;
  }

  .gallery-hero .hero-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .gallery-hero .hero-subtitle {
    font-size: 0.9rem;
  }

  .gallery-section {
    padding: 2rem 0;
  }

  .gallery-header {
    margin-bottom: 2rem;
  }

  .titleheading {
    font-size: 1.5rem;
  }

  .gallery-filters {
    gap: 0.4rem;
    margin-top: 1rem;
  }

  .filter-btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.75rem;
    border-width: 1.5px;
  }

  .gallery-caption {
    padding: 0.75rem;
  }

  .gallery-caption h5 {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
  }

  .gallery-caption p {
    font-size: 0.75rem;
  }

  .overlay-content i {
    font-size: 1.5rem;
  }
}

/* Extra Small (Up to 480px) */
@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .gallery-hero {
    padding: 2rem 0;
    min-height: 180px;
  }

  .gallery-hero .hero-title {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
  }

  .gallery-hero .hero-subtitle {
    font-size: 0.85rem;
  }

  .gallery-filters {
    gap: 0.3rem;
  }

  .filter-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.7rem;
  }

  .gallery-caption {
    padding: 0.6rem;
  }

  .gallery-caption h5 {
    font-size: 0.85rem;
  }

  .gallery-caption p {
    font-size: 0.7rem;
  }

  .overlay-content i {
    font-size: 1.3rem;
  }
}

/* Landscape Mode */
@media (orientation: landscape) and (max-height: 600px) {
  .gallery-hero {
    padding: 2rem 0;
    min-height: 150px;
  }

  .gallery-hero .hero-title {
    font-size: 1.3rem;
  }

  .gallery-hero .hero-subtitle {
    font-size: 0.8rem;
  }
}
