/* Gallery Page Specific Styles */

.gallery {
  max-width: 1280px;
  margin: auto;
  padding: 3.5rem 2rem 5rem;
  background: transparent;
}

.gallery * {
  box-sizing: border-box;
}

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

.gallery .header h1 {
  color: var(--green-dark, #1F4F3A);
  margin: 0 0 .6rem 0;
  font-weight: 700;
}

.gallery .header p {
  max-width: 760px;
  margin: auto;
  color: var(--muted, #6b7280);
}

.gallery .featured-videos {
  margin-bottom: 4rem;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, rgba(46, 107, 78, 0.03) 0%, rgba(242, 183, 5, 0.02) 100%);
  border-radius: 20px;
}

.gallery .featured-videos h2 {
  color: var(--green-dark, #1F4F3A);
  margin-bottom: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.video-slider-controls {
  display: flex;
  gap: 0.75rem;
}

.slider-btn {
  background: var(--green-primary, #2E6B4E);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-weight: bold;
}

.slider-btn:hover {
  background: var(--green-dark, #1F4F3A);
  transform: scale(1.1);
}

.videos-slider-container {
  overflow: hidden;
  border-radius: 16px;
}

.gallery .videos-grid {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 0.5rem;
  flex-wrap: nowrap;
}

.gallery .videos-grid::-webkit-scrollbar {
  height: 6px;
}

.gallery .videos-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.gallery .videos-grid::-webkit-scrollbar-thumb {
  background: var(--green-primary, #2E6B4E);
  border-radius: 10px;
}

.gallery .videos-grid::-webkit-scrollbar-thumb:hover {
  background: var(--green-dark, #1F4F3A);
}

.gallery .video-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  aspect-ratio: 16 / 9;
  background: #000;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex: 0 0 400px;
  min-width: 400px;
}

.gallery .video-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(46, 107, 78, 0.2);
  border-color: var(--green-primary, #2E6B4E);
}

.gallery .video-card iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.video-card-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(46, 107, 78, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}

.video-play-icon::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 30px solid white;
  border-top: 20px solid transparent;
  border-bottom: 20px solid transparent;
  margin-left: 8px;
}

.gallery-section-wrapper {
  padding: 3rem 2rem;
  background: linear-gradient(135deg, rgba(46, 107, 78, 0.04) 0%, rgba(242, 183, 5, 0.02) 100%);
  border-radius: 20px;
  margin-bottom: 2rem;
}

.gallery .filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 3rem;
}

.gallery .filters button {
  padding: 0.75rem 1.75rem;
  border-radius: 25px;
  border: 1px solid rgba(46, 107, 78, 0.2);
  background: rgba(255, 255, 255, 0.8);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.gallery .filters button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(46, 107, 78, 0.15);
  background: rgba(255, 255, 255, 1);
  border-color: var(--green-primary, #2E6B4E);
}

.gallery .filters button.active {
  background: var(--green-primary, #2E6B4E);
  color: #fff;
  border-color: var(--green-primary, #2E6B4E);
  box-shadow: 0 10px 25px rgba(46, 107, 78, 0.25);
}

.gallery .gallery-grid {
  display: grid !important;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  gap: 1.75rem;
  align-items: stretch;
  padding: 0;
}

.gallery .gallery-grid .gallery-item.filtered-out {
  display: none !important;
}

.gallery .gallery-grid .gallery-item:nth-child(n+9) {
  display: none !important;
}

.gallery .gallery-grid.show-all .gallery-item {
  display: flex !important;
}

.gallery .gallery-grid.show-all .gallery-item.filtered-out {
  display: none !important;
}

@media (min-width: 1200px) {
  .gallery .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

.toggle-all-btn {
  display: block;
  margin: 3rem auto 0;
  padding: 0.875rem 2.5rem;
  background: var(--green-primary, #2E6B4E);
  color: white;
  border: none;
  border-radius: 25px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 25px rgba(46, 107, 78, 0.2);
}

.toggle-all-btn:hover {
  background: var(--green-dark, #1F4F3A);
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(46, 107, 78, 0.3);
}

.toggle-all-btn:active {
  transform: translateY(-1px);
}

.gallery .gallery-item {
  background: var(--white, #ffffff);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  height: 360px;
  width: 100%;
  min-width: 0;
  position: relative;
}

.gallery .gallery-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(46, 107, 78, 0.2);
  border-color: var(--green-primary, #2E6B4E);
}

.gallery .gallery-item img,
.gallery .gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  flex: 1;
}

.gallery .gallery-item.video::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(46, 107, 78, 0.85);
  border-radius: 50%;
  z-index: 10;
}

.gallery .gallery-item.video::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-left: 20px solid white;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  z-index: 11;
  margin-left: 4px;
}

.gallery .overlay {
  position: absolute;
  inset: 0;
  background: rgba(31, 79, 58, 0.6);
  opacity: 0;
  transition: opacity .2s ease;
  z-index: 5;
}

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

.gallery .lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  flex-direction: column;
}

.gallery .lightbox.active {
  display: flex;
}

.gallery .lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery .lightbox-media {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: var(--radius);
}

.gallery .lightbox-media.video {
  width: 100%;
  max-width: 80vw;
  aspect-ratio: 16 / 9;
}

.gallery .lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease;
  z-index: 2001;
}

.gallery .lightbox-close:hover {
  background: rgba(255, 255, 255, 0.4);
}

.gallery .lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background .2s ease;
  z-index: 2001;
}

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

.gallery .lightbox-prev {
  left: 20px;
}

.gallery .lightbox-next {
  right: 20px;
}

.gallery .lightbox-pagination {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  z-index: 2001;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

@media (max-width: 600px) {
  .gallery {
    padding: 2rem 1rem 3rem;
  }

  .gallery .gallery-item img,
  .gallery .gallery-item video {
    height: 180px;
  }

  .gallery .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    gap: var(--md);
  }

  .gallery .gallery-item {
    height: 310px;
  }

  .gallery .videos-grid {
    grid-template-columns: 1fr;
  }

  .gallery .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .gallery .lightbox-prev {
    left: 10px;
  }

  .gallery .lightbox-next {
    right: 10px;
  }

  .gallery .lightbox-close {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}

.empty-state {
  text-align: center;
  padding: var(--xxl) var(--xl);
  color: #6b7280;
}

.empty-state p {
  font-size: 1.1rem;
}
