/* Global Reset & Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  background-color: #f9f9f9;
  color: #333;
  overflow-x: hidden;
}

h2.gallery-title {
  font-weight: bold;
  color: #2e7d32;
  margin-bottom: 1rem;
}

/* Hero Section */
.hero-section {
  background-image: url('/assets/images/slider1.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 45vh;
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 0;
}

.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4); /* transparent black overlay */
  z-index: 1;
}

.hero-section .container {
  position: relative;
  z-index: 2;
}

.hero-section h1,
.hero-section p {
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
  color: #fff;
  margin-bottom: 0.5rem;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Gallery Card */
.gallery-card {
  position: relative;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  background-color: #fff;
  margin-bottom: 50px;
}

.gallery-card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 12px 30px rgba(0, 128, 0, 0.15);
}

.gallery-img {
  height: 200px;
  width: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.3s ease;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.gallery-card:hover .gallery-img {
  transform: scale(1.05);
  filter: brightness(0.9);
}

/* Overlay (Non-blocking) */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 128, 0, 0.1), rgba(0, 128, 0, 0.7));
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  z-index: 2;
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay h6 {
  color: #fff;
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.gallery-overlay small {
  color: #f1f1f1;
  font-size: 0.85rem;
}

/* Carousel Controls */
.carousel-control-prev,
.carousel-control-next {
  background-color: rgba(0, 128, 0, 0.3);
  width: 50px;
  height: 50px;
  top: 45%;
  border-radius: 50%;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background-color: rgba(0, 128, 0, 0.6);
}

/* Modal Styling */
.modal-header.bg-success {
  background: linear-gradient(to right, #2e7d32, #1b5e20);
  color: #fff;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.modal-content {
  border-radius: 10px;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.2);
}

.modal-body img {
  max-height: 500px;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.modal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
  transform: translateY(-30px);
}

.modal.fade.show .modal-dialog {
  transform: translateY(0);
}

/* Responsive Media Queries */

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
  .gallery-img {
    height: 140px;
  }

  .hero-section {
    padding: 1rem 0.5rem !important;
    min-height: 22vh !important;
    text-align: center;
  }

  .hero-section h1 {
    font-size: 1.25rem !important;
    margin-bottom: 0.5rem;
  }

  .hero-section p {
    font-size: 0.85rem !important;
    margin-bottom: 1rem;
  }

  .hero-section .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
}

/* Small to medium devices (≥576px and <768px) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .gallery-img {
    height: 160px;
  }

  .hero-section {
    min-height: 45vh;
    padding: 2.5rem;
  }
}

/* Medium to large devices (≥768px and <992px) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .gallery-img {
    height: 180px;
  }

  .hero-section h1 {
    font-size: 2.2rem;
  }
}

/* Large devices (≥992px and <1200px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .hero-section h1 {
    font-size: 2.8rem;
  }
}

/* Extra large devices (≥1200px) */
@media (min-width: 1200px) {
  .hero-section h1 {
    font-size: 3.2rem;
  }
}

/* Bootstrap Modal Stacking Fix */
.modal {
  z-index: 1050;
}

.modal-backdrop {
  z-index: 1040;
}
