/* Gallery Styles */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f7f4ea;
  color: #223126;
}

.container {
  width: min(1120px, 90%);
  margin: 0 auto;
}

/* ===== GALLERY HEADER ===== */

.gallery-header {
  color: #ffffff;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1;
}

.gallery-carousel-shell {
  position: relative;
  min-height: clamp(360px, 55vh, 520px);
  overflow: hidden;
  background: #1b5e20;
}

.gallery-carousel {
  position: absolute;
  inset: 0;
}

.gallery-carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.gallery-carousel-slide.active {
  opacity: 1;
}

.gallery-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: scale(1.03);
}

.gallery-carousel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(17, 59, 24, 0.8) 0%, rgba(17, 59, 24, 0.45) 100%);
  z-index: 1;
}

.gallery-header-content {
  position: relative;
  z-index: 2;
  padding: 60px 0 50px;
  min-height: clamp(360px, 55vh, 520px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  padding: 8px 16px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 20px;
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateX(-4px);
}

.back-arrow {
  font-size: 1.2rem;
}

.gallery-title {
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  line-height: 1.2;
}

.gallery-subtitle {
  font-size: 1.05rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.95);
  max-width: 650px;
  line-height: 1.6;
}

/* ===== GALLERY SECTION ===== */

.gallery-section {
  padding: 80px 0;
  background: #f7f4ea;
  min-height: 100vh;
}

@media (max-width: 768px) {
  .gallery-carousel-shell {
    min-height: 360px;
  }

  .gallery-header-content {
    min-height: 360px;
    padding: 40px 0;
  }

  .gallery-title {
    font-size: 1.8rem;
  }

  .gallery-subtitle {
    font-size: 0.98rem;
  }
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== GALLERY ITEMS ===== */

.gallery-item {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  animation: slideInItem 0.5s ease forwards;
  opacity: 0;
}

.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; }

@keyframes slideInItem {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(46, 125, 50, 0.2);
}

/* Image Items */
.image-item {
  height: 280px;
}

.gallery-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-image {
  transform: scale(1.1);
}

/* Video Items */
.video-item {
  height: 280px;
}

.gallery-video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

.gallery-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Gallery Overlay */
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(46, 125, 50, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

/* Expand Button */
.expand-btn {
  width: 60px;
  height: 60px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.expand-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Video Badge */
.video-badge {
  background: #2e7d32;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== GALLERY FOOTER ===== */

.gallery-footer {
  background: linear-gradient(135deg, #1b3a26 0%, #2e5f3f 100%);
  color: #ffffff;
  padding: 40px 0;
  text-align: center;
  border-top: 2px solid #2e7d32;
}

.gallery-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.gallery-footer p {
  flex: 1;
  margin: 0;
}

.footer-back-link {
  color: #66bb6a;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  padding: 8px 16px;
  border: 2px solid #66bb6a;
  border-radius: 6px;
}

.footer-back-link:hover {
  background: #66bb6a;
  color: #ffffff;
  transform: translateX(-4px);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet (900px) */
@media (max-width: 900px) {
  .gallery-header {
    padding: 40px 0 30px;
  }

  .gallery-title {
    font-size: 2rem;
  }

  .gallery-subtitle {
    font-size: 1rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
  }

  .gallery-item {
    height: 240px;
  }

  .gallery-section {
    padding: 60px 0;
  }

  .gallery-footer .container {
    flex-direction: column;
    text-align: center;
  }

  .footer-back-link {
    width: 100%;
  }
}

/* Mobile (600px) */
@media (max-width: 600px) {
  .gallery-header {
    padding: 30px 0 20px;
  }

  .gallery-title {
    font-size: 1.8rem;
    margin-bottom: 8px;
  }

  .gallery-subtitle {
    font-size: 0.95rem;
  }

  .back-button {
    font-size: 0.9rem;
    padding: 6px 12px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
  }

  .gallery-item {
    height: 180px;
  }

  .gallery-section {
    padding: 40px 0;
  }

  .expand-btn {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .video-badge {
    font-size: 0.85rem;
    padding: 8px 14px;
  }

  .gallery-footer {
    padding: 30px 0;
  }

  .gallery-footer p {
    font-size: 0.9rem;
  }
}

/* Extra Small (450px) */
@media (max-width: 450px) {
  .gallery-header {
    padding: 20px 0 15px;
  }

  .gallery-title {
    font-size: 1.5rem;
  }

  .gallery-subtitle {
    font-size: 0.9rem;
  }

  .back-button {
    font-size: 0.85rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
  }

  .gallery-item {
    height: 150px;
  }

  .gallery-section {
    padding: 30px 0;
  }

  .expand-btn {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
  }

  .gallery-footer {
    padding: 20px 0;
  }

  .gallery-footer .container {
    flex-direction: column;
  }

  .footer-back-link {
    font-size: 0.9rem;
  }
}
