/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
  /* HSL Color Palette - Agriculture Theme */
  --primary: 142 72% 29%;
  /* #15803d */
  --primary-dark: 142 76% 24%;
  /* #0f6b31 */
  --primary-light: 142 60% 45%;
  /* #2eb85c */
  --accent: 35 100% 50%;
  /* #ffaa00 */
  --text-main: 210 20% 15%;
  /* #1e293b */
  --text-light: 210 15% 25%;
  /* #364152 */
  --bg-body: 0 0% 98%;
  /* #fafafa */
  --bg-white: 0 0% 100%;
  --glass: rgba(255, 255, 255, 0.95);

  /* Transitions */
  --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  /* Structure */
  --container-width: 1200px;
  --header-height: 70px;
  --header-height-mobile: 60px;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: hsl(var(--text-main));
  background-color: hsl(var(--bg-body));
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.3s var(--ease-smooth);
}

ul {
  list-style: none;
}

/* =========================================
   2. UTILITIES
   ========================================= */
.container {
  width: 100%;
  padding: 0 20px;
  margin: 0 auto;
  max-width: var(--container-width);
}

.section-padding {
  padding: 60px 0;
}

.text-center {
  text-align: center;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

/* Typography */
h1,
h2,
h3,
h4 {
  line-height: 1.2;
  font-weight: 700;
  color: hsl(var(--primary-dark));
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  color: hsl(var(--text-light));
  margin-bottom: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: hsl(var(--primary));
  color: white;
  box-shadow: 0 4px 12px hsla(var(--primary), 0.3);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-outline {
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
  background: transparent;
}

/* =========================================
   3. HEADER (Mobile First)
   ========================================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height-mobile);
  background: var(--glass);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1rem;
  color: hsl(var(--primary));
  z-index: 1002;
  /* Above mobile menu */
}

.logo img {
  height: 40px;
  width: auto;
}

/* Desktop Nav Hidden on Mobile */
.nav-links {
  display: none;
}

/* Hamburger Icon */
.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 1005;
  /* Must be highest */
  padding: 10px;
  position: relative;
}

.bar {
  width: 26px;
  height: 3px;
  background-color: hsl(var(--primary-dark));
  border-radius: 3px;
  transition: all 0.3s var(--ease-elastic);
}

/* Hamburger Animation */
.menu-toggle.active .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Navigation Overlay */
.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  z-index: 1001;
  padding: 20px;
  /* Hidden State */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: all 0.3s var(--ease-out);
}

.mobile-nav.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-nav .nav-link {
  font-size: 1.5rem;
  font-weight: 600;
  color: hsl(var(--text-main));
}

.mobile-nav .nav-link:hover {
  color: hsl(var(--primary));
}

/* =========================================
   4. HERO SECTION
   ========================================= */
.hero {
  padding-top: calc(var(--header-height-mobile) + 40px);
  padding-bottom: 60px;
  position: relative;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  overflow: hidden;
}

.hero .container {
  display: flex;
  flex-direction: column-reverse;
  /* Image on top logic usually, or bottom for mobile? Let's stack properly */
  gap: 40px;
}

.hero-content {
  text-align: center;
  z-index: 2;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: white;
  border-radius: 50px;
  font-size: 0.8rem;
  color: hsl(var(--primary));
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 1rem;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.hero-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.hero-image-wrapper {
  position: relative;
  width: 100%;
  margin: 0 auto;
  max-width: 500px;
}

.hero-img {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  aspect-ratio: 4/3;
}

.hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================
   5. STATS
   ========================================= */
.stats-section {
  background: hsl(var(--primary));
  color: white;
  padding: 40px 0;
  border-radius: 20px;
  margin: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  /* 2x2 on mobile */
  gap: 20px;
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  display: block;
}

/* =========================================
   6. CARDS & GRID
   ========================================= */
.programs-grid,
.location-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.card {
  background: white;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
  transition: transform 0.3s;
}

.card:hover {
  transform: translateY(-5px);
}

.card-icon {
  width: 50px;
  height: 50px;
  background: hsla(var(--primary), 0.1);
  color: hsl(var(--primary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

/* =========================================
   7. FOOTER
   ========================================= */
footer {
  background: hsl(var(--primary-dark));
  color: white;
  padding: 60px 0 20px;
  margin-top: auto;
}

.footer-content {
  display: grid;
  gap: 40px;
}

.footer-col h4 {
  color: white;
  margin-bottom: 1.5rem;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
}

.footer-links a:hover {
  color: white;
  padding-left: 5px;
}

/* =========================================
   8. MEDIA QUERIES (DESKTOP)
   ========================================= */
@media (min-width: 900px) {
  :root {
    --header-height: 80px;
  }

  /* Header */
  header {
    height: var(--header-height);
  }

  .menu-toggle {
    display: none;
  }

  .mobile-nav {
    display: none;
  }

  /* Strictly hide mobile nav */

  .nav-links {
    display: flex;
    gap: 32px;
  }

  .nav-link {
    font-weight: 500;
    color: hsl(var(--text-light));
    position: relative;
    padding: 5px 0;
  }

  .nav-link:hover,
  .nav-link.active {
    color: hsl(var(--primary));
  }

  .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: hsl(var(--primary));
    transition: width 0.3s;
  }

  .nav-link:hover::after {
    width: 100%;
  }

  /* Hero */
  .hero {
    min-height: 90vh;
    padding-top: var(--header-height);
    display: flex;
    align-items: center;
  }

  .hero .container {
    flex-direction: row;
    align-items: center;
  }

  .hero-content {
    flex: 1;
    text-align: left;
  }

  .hero-btns {
    flex-direction: row;
  }

  .hero-image-wrapper {
    flex: 0.8;
  }

  /* Stats */
  .stats-section {
    border-radius: 16px 16px 0 0;
    margin: -50px auto 0;
    max-width: var(--container-width);
    padding: 60px 0;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Grids */
  .programs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Animations */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}