/* Gallery Page Specific Styles */

.gallery-intro-section {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 4rem auto;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, rgba(31, 68, 47, 0.03), rgba(201, 165, 91, 0.03));
  border-radius: 16px;
  border: 1px solid rgba(31, 68, 47, 0.1);
}

.gallery-intro-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  color: #1f442f;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.gallery-intro-section h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #c9a55b, #d4a574);
  border-radius: 2px;
}

.gallery-intro-section p {
  font-size: 1.15rem;
  color: #555;
  line-height: 1.8;
  margin-top: 2rem;
}

/* Category Sections */
.gallery-category {
  max-width: 1200px;
  margin: 0 auto 5rem auto;
  padding: 3rem 2rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.category-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: #1f442f;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid #c9a55b;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.category-title::before {
  content: '';
  width: 6px;
  height: 40px;
  background: linear-gradient(180deg, #1f442f, #c9a55b);
  border-radius: 3px;
}

/* Gallery Grid - Medium Thumbnails (Original Size) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.gallery-item {
  background: #fefcf9;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(31, 68, 47, 0.08);
  position: relative;
}

.gallery-item:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-color: rgba(201, 165, 91, 0.4);
}

/* Thumbnail Image Container - 3:2 Ratio */
.image-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 66.67%; /* 3:2 aspect ratio - slightly wider, natural for photos */
  overflow: hidden;
  background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
}

.image-container::after {
  content: '\f065';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 2rem;
  color: #fff;
  background: rgba(31, 68, 47, 0.9);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.gallery-item:hover .image-container::after {
  transform: translate(-50%, -50%) scale(1);
}

.image-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(31, 68, 47, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.gallery-item:hover .image-container::before {
  opacity: 1;
}

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

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

/* Remove item captions since we're using thumbnails */
.item-caption {
  display: none;
}

/* Lightbox Styles */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.3s ease;
}

.lightbox.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 90vh;
  animation: zoomIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0 auto;
}

@keyframes zoomIn {
  from { 
    transform: scale(0.8);
    opacity: 0;
  }
  to { 
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.lightbox-caption {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 90vw;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  color: #fff;
  padding: 2rem;
  border-radius: 0 0 8px 8px;
  text-align: center;
}

.lightbox-caption h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #fdf3e1;
  text-align: center;
}

.lightbox-caption p {
  font-size: 1rem;
  color: #e8e8e8;
  margin: 0;
  text-align: center;
}

/* Lightbox Close Button */
.lightbox-close {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid #fff;
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  z-index: 10001;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg) scale(1.1);
}

/* Lightbox Navigation Arrows */
.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid #fff;
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  z-index: 10001;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 2rem;
}

.lightbox-next {
  right: 2rem;
}

/* Call to Action Section */
.gallery-cta {
  text-align: center;
  background: linear-gradient(135deg, rgba(31, 68, 47, 0.92), rgba(45, 90, 56, 0.92)),
              url("images/wood.jpg") center/cover no-repeat;
  color: #fff;
  padding: 5rem 2rem;
  border-radius: 20px;
  max-width: 1200px;
  margin: 5rem auto 2rem auto;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.gallery-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 15px,
    rgba(255, 255, 255, 0.02) 15px,
    rgba(255, 255, 255, 0.02) 30px
  );
  pointer-events: none;
}

.gallery-cta h3 {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  color: #fdf3e1;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.gallery-cta p {
  font-size: 1.2rem;
  color: #e8e8e8;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 1;
}

.cta-button {
  display: inline-block;
  background: linear-gradient(135deg, #c9a55b, #d4a574);
  color: #1f442f;
  padding: 1.2rem 3rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(201, 165, 91, 0.4);
  position: relative;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cta-button:hover {
  background: linear-gradient(135deg, #d4a574, #e0b685);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(201, 165, 91, 0.5);
  color: #1f442f;
}

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

  .gallery-intro-section h2 {
    font-size: 2rem;
  }

  .category-title {
    font-size: 1.5rem;
  }

  .gallery-category {
    padding: 2rem 1.5rem;
  }

  .gallery-cta {
    padding: 3rem 1.5rem;
  }

  .gallery-cta h3 {
    font-size: 1.8rem;
  }

  /* Mobile Lightbox Fixes */
  .lightbox {
    padding: 0.5rem;
    text-align: center;
  }

  .lightbox-content {
    max-width: 100vw;
    max-height: 90vh;
    width: 100%;
    margin: 0;
    padding: 0;
    left: 0;
    right: 0;
  }

  .lightbox-content img {
    max-width: 100vw;
    max-height: 75vh;
    margin: 0 auto;
    position: relative;
    left: 0;
    right: 0;
  }

  .lightbox-caption {
    width: 100%;
    max-width: 100vw;
    left: 0;
    transform: none;
    padding: 1.5rem 1rem;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .lightbox-prev {
    left: 0.5rem;
  }

  .lightbox-next {
    right: 0.5rem;
  }

  .lightbox-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 40px;
    height: 40px;
  }

  .lightbox-caption {
    padding: 1.5rem;
  }

  .lightbox-caption h4 {
    font-size: 1.2rem;
  }

  .lightbox-caption p {
    font-size: 0.9rem;
  }

  .image-container::after {
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .gallery-intro-section {
    padding: 2rem 1rem;
  }

  .gallery-intro-section h2 {
    font-size: 1.7rem;
  }

  .cta-button {
    padding: 0.9rem 2rem;
    font-size: 1rem;
  }

  .gallery-category {
    padding: 2rem 1rem;
  }

  .category-title {
    font-size: 1.3rem;
  }

  .category-title::before {
    width: 4px;
    height: 30px;
  }

  .image-container::after {
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
  }
}