/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Montserrat:wght@600;700&display=swap');

/* General styles */
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  line-height: 1.7;
  color: #333;
  font-size: 1rem;
  background: linear-gradient(to bottom, #C8E6C9, #F5F5F5); /* Eco-friendly gradient */
  min-height: 100vh;
}

/* Headings */
h1, h2, h3, h4, h5 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: #1565c0;
  letter-spacing: 0.5px;
  line-height: 1.2;
  margin: 0.5rem 0;
}

h1 {
  font-size: 2.6rem;
}

h2 {
  font-size: 1.8rem;
}

p {
  font-size: 1.05rem;
  line-height: 1.8;
  margin: 0 0 0; /* Reset to 0 to avoid stacking */
  color: #444;
}

/* Header */
.site-header {
  background-color: #1565c0;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo img {
  height: 40px;
}

/* Navigation */
.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

.nav li {
  display: inline-block;
}

.nav a {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: opacity 0.2s ease-in-out, color 0.2s ease-in-out;
}

.nav a:hover {
  opacity: 0.8;
  color: #ffd700;
}

.nav a.active {
  color: #ffd700;
}

/* Hero Section with Abstract Recycling Background */
.hero {
  background: url('images/recycling-background.jpg') no-repeat center/cover;
  padding: 1.5rem 1.5rem 1rem;
  text-align: center;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.8); /* Light overlay for readability */
  padding: 1rem;
  border-radius: 8px;
}

.hero-logo {
  max-width: 300px;
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 2.8rem;
  letter-spacing: 0.5px;
  color: #1565c0;
}

.hero p {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 1.2rem;
  color: #333;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.8;
}

/* Content Sections */
.content-section {
  padding: 1rem;
  max-width: 1000px;
  margin: 1rem auto;
  text-align: center;
  box-shadow: 0 4px 8px rgba(176, 190, 197, 0.2); /* Eco-friendly shadow */
  background: #fff;
  border-radius: 8px;
}

/* Ensure first content section has reduced margin-top as per inline style */
.content-section:nth-child(2) {
  margin-top: 0.25rem;
}

/* Jazz up font styles from inline <style> */
.content-section h2 {
  font-weight: 600;
  color: #1565c0;
  letter-spacing: 0.5px;
}

.content-section p {
  line-height: 1.9;
}

.content-section strong {
  color: #1565c0;
  font-weight: 600;
}

/* Ensure first content section has a matching gap after hero */
main > .content-section:first-child {
  margin-top: 1rem;
}

/* Gallery Styles */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2x2 grid on desktop */
  gap: 0.75rem; /* Reduced gap for tighter layout */
  max-width: 1000px;
  margin: 1.5rem auto; /* Reduced margin for better flow */
  padding: 0 1rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(129, 199, 132, 0.3); /* Eco-friendly shadow */
  background-color: #fff;
}

.gallery-item img {
  width: 100%;
  height: 150px; /* Fixed height to control size */
  object-fit: cover; /* Maintain aspect ratio, crop if needed */
  display: block;
  transition: transform 0.3s ease; /* Smooth hover effect */
}

.gallery-item:hover img {
  transform: scale(1.05); /* Slight zoom on hover */
}

.caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(21, 101, 192, 0.7); /* Semi-transparent blue overlay */
  color: #fff;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
}

/* Image Container Styles */
.image-container {
  max-width: 1000px;
  margin: 1.5rem auto; /* Matches content section margin for flow */
  padding: 0 1rem; /* Consistent with content section padding */
  text-align: center; /* Center the image */
}

.image-container img {
  max-width: 100%; /* Responsive width */
  height: auto; /* Maintain aspect ratio */
  max-height: 300px; /* Cap height for PC */
  object-fit: cover; /* Crop if needed to fit */
  border-radius: 8px; /* Match content section corners */
  box-shadow: 0 4px 8px rgba(129, 199, 132, 0.3); /* Eco-friendly shadow */
  display: block; /* Remove extra space below image */
  margin: 0 auto; /* Center horizontally */
}

/* Footer */
.site-footer {
  background-color: #1565c0;
  color: #fff;
  text-align: center;
  padding: 1.5rem;
  margin-top: 1rem;
}

.footer-logo {
  margin-bottom: 0.5rem;
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
  color: #f0f0f0;
}

/* Responsive Design */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .hero {
    padding: 1rem 1rem 0.75rem;
    min-height: 250px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-logo {
    max-width: 200px;
  }

  .site-header {
    flex-direction: column;
    padding: 1rem;
  }

  .nav ul {
    flex-direction: column;
    gap: 0.5rem; /* Reduced from 1rem to 8px for tighter mobile menu */
    text-align: center;
    max-height: 200px; /* Limit height to prevent overflow */
    overflow-y: auto; /* Allow scrolling if needed */
  }

  .content-section {
    padding: 0.75rem;
    margin: 0.75rem auto;
  }

  main > .content-section:first-child {
    margin-top: 0.75rem;
  }

  .site-footer {
    margin-top: 0.75rem;
  }

  .gallery {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 0.5rem; /* Further reduced gap */
    margin: 1rem auto;
    padding: 0 0.5rem;
  }

  .gallery-item img {
    height: 120px; /* Reduced height for mobile */
  }

  .gallery-item {
    box-shadow: 0 2px 4px rgba(129, 199, 132, 0.2); /* Lighter shadow on mobile */
  }

  .image-container img {
    max-height: 200px; /* Reduced height for tablets */
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .hero {
    padding: 0.75rem 0.75rem 0.5rem;
    min-height: 200px;
  }

  .hero-logo {
    max-width: 150px;
  }

  .hero p {
    font-size: 0.9rem;
  }

  .content-section {
    padding: 0.5rem;
    margin: 0.5rem auto;
  }

  main > .content-section:first-child {
    margin-top: 0.5rem;
  }

  .gallery {
    margin: 0.75rem auto;
    padding: 0 0.25rem;
  }

  .gallery-item img {
    height: 100px; /* Further reduced for small screens */
  }

  .image-container {
    margin: 1rem auto; /* Reduced margin for mobile */
    padding: 0 0.5rem; /* Adjusted padding */
  }

  .image-container img {
    max-height: 150px; /* Further reduced for phones */
  }
}