body {
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  background: #f8fafc;
  color: #222;
}

.sticky-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.03);
}
.menu {
  display: flex;
  justify-content: center;
  gap: 2rem;
  list-style: none;
  padding: 1.5rem 0 0.5rem 0;
  margin: 0;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
.menu li a {
  color: #015941;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
}

.menu li a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: #015941;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.menu li a:hover::after {
  width: 80%;
}
.menu li a:hover {
  color: #1e293b;
}

.logo-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 0 1.5rem 0;
  background: #fff;
  flex-direction: row !important;
  flex-wrap: wrap;
}
.logo-bar img {
  height: 32px;
  max-width: 80px;
  object-fit: contain;
  margin: 0 0.2em;
  transition: all 0.3s ease;
  filter: grayscale(100%);
}

.logo-bar img:hover {
  transform: scale(1.1);
  filter: grayscale(0%);
  filter: drop-shadow(0 2px 4px rgba(1, 89, 65, 0.2));
}

.hero {
  background: linear-gradient(135deg, #015941 0%, #004684 50%, #015941 100%);
  color: #fff;
  padding: 3rem 1rem 2rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

#particles-js {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.hero-text {
  position: relative;
  z-index: 2;
}
.hero-text h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.hero-text p {
  font-size: 1.25rem;
  font-weight: 400;
  margin: 0 auto;
  max-width: 600px;
}

.story {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  margin: 2rem auto;
  padding: 3rem 2rem;
  border-radius: 1rem;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.04);
  max-width: 900px;
  line-height: 1.7;
  transition: all 0.3s ease;
  transform: translateY(0);
  border: 1px solid rgba(1, 89, 65, 0.1);
}

.story:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px 0 rgba(0,0,0,0.1);
}

.story h2 {
  color: #004684;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

.story h3 {
  color: #000;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem 0;
  border-left: 4px solid #015941;
  padding-left: 1rem;
}

.story p {
  margin-bottom: 1.5rem;
  color: #374151;
  font-size: 1.1rem;
}

.story-tagline {
  text-align: center;
  font-size: 1.2rem;
  color: #015941;
  font-weight: 600;
  margin-top: 2.5rem;
  padding: 1rem;
  background: #f1f5f9;
  border-radius: 0.5rem;
  border-left: 4px solid #015941;
}

.content-section {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  margin: 2rem auto;
  padding: 2rem 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.04);
  max-width: 800px;
  transition: all 0.3s ease;
  transform: translateY(0);
  border: 1px solid rgba(1, 89, 65, 0.1);
}

.content-section:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px 0 rgba(0,0,0,0.08);
}
.content-section h2 {
  color: #2563eb;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}
.team-card {
  background: none;
  box-shadow: none;
  border-radius: 1rem;
  perspective: 1200px;
  min-height: 380px;
  position: relative;
  transition: transform 0.3s;
}
.team-card img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 1rem;
  border: 3px solid #2563eb;
}
.team-card h3 {
  margin: 0.5rem 0 0.25rem 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.team-card p {
  margin: 0;
  color: #64748b;
  font-size: 0.95rem;
}

footer {
  background: #015941;
  color: #fff;
  text-align: center;
  padding: 1.5rem 0 1rem 0;
  margin-top: 3rem;
}
footer a {
  color: #bae6fd;
  text-decoration: underline;
}

#map {
  height: 60vh;
  min-height: 400px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Beautify map controls at the bottom */
.controls {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.97);
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.10);
  border-radius: 1.2rem;
  padding: 1.2rem 2.2rem 1.2rem 2.2rem;
  display: flex;
  gap: 2.5rem;
  align-items: center;
  z-index: 1000;
  min-width: 320px;
  max-width: 90vw;
}
.toggle-label, .slider-label {
  display: flex;
  align-items: center;
  gap: 0.8em;
  font-size: 1.1rem;
  font-weight: 500;
  color: #2563eb;
  cursor: pointer;
}
.toggle-label input[type="checkbox"] {
  accent-color: #2563eb;
  width: 1.2em;
  height: 1.2em;
  margin-right: 0.3em;
}
.slider-label input[type="range"] {
  margin-left: 0.3em;
  width: 90px;
  accent-color: #38bdf8;
  /* Ensure full range is accessible */
  padding: 0;
  margin-right: 0;
  box-sizing: border-box;
}
@media (max-width: 700px) {
  .controls {
    flex-direction: column;
    gap: 1.2rem;
    padding: 1rem 1rem;
    left: 50%;
    bottom: 1rem;
    min-width: 0;
  }
}

.center-controls {
  position: fixed;
  left: 50%;
  bottom: 6.5rem;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.97);
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.10);
  border-radius: 1.2rem;
  padding: 1rem 2rem;
  display: flex;
  gap: 1.2rem;
  align-items: center;
  z-index: 1001;
  min-width: 320px;
  max-width: 90vw;
}
.center-controls label {
  font-size: 1rem;
  color: #2563eb;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3em;
}
.center-controls input[type="text"],
.center-controls input[type="number"] {
  padding: 0.3em 0.7em;
  border: 1px solid #cbd5e1;
  border-radius: 0.5em;
  font-size: 1em;
  width: 7em;
}
.center-controls button {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 0.5em;
  padding: 0.5em 1.2em;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.center-controls button:hover {
  background: #1e293b;
}
@media (max-width: 700px) {
  .center-controls {
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.7rem 1rem;
    bottom: 8.5rem;
    min-width: 0;
  }
}

.layer-controls {
  position: fixed;
  left: 50%;
  bottom: 11.5rem;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.97);
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.10);
  border-radius: 1.2rem;
  padding: 0.7rem 1.5rem;
  display: flex;
  gap: 1.2rem;
  align-items: center;
  z-index: 1002;
  min-width: 220px;
  max-width: 90vw;
}
.layer-controls button {
  background: #38bdf8;
  color: #213547;
  border: none;
  border-radius: 0.5em;
  padding: 0.5em 1.2em;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.layer-controls button:hover {
  background: #2563eb;
  color: #fff;
}
@media (max-width: 700px) {
  .layer-controls {
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.5rem 1rem;
    bottom: 13.5rem;
    min-width: 0;
  }
}

.export-controls {
  position: fixed;
  left: 50%;
  bottom: 16rem;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.97);
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.10);
  border-radius: 1.2rem;
  padding: 0.7rem 1.5rem;
  display: flex;
  gap: 1.2rem;
  align-items: center;
  z-index: 1003;
  min-width: 220px;
  max-width: 90vw;
}
.export-controls button {
  background: #fbbf24;
  color: #1e293b;
  border: none;
  border-radius: 0.5em;
  padding: 0.5em 1.2em;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.export-controls button:hover {
  background: #f59e42;
  color: #fff;
}
@media (max-width: 700px) {
  .export-controls {
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.5rem 1rem;
    bottom: 18rem;
    min-width: 0;
  }
}

.map-legend {
  position: fixed;
  left: 2rem;
  bottom: 2rem;
  background: rgba(255,255,255,0.97);
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.10);
  border-radius: 1.2rem;
  padding: 1.1rem 1.5rem;
  z-index: 1100;
  font-size: 1rem;
  color: #1e293b;
  min-width: 210px;
  max-width: 90vw;
  line-height: 1.7;
}
.map-legend div {
  display: flex;
  align-items: center;
  gap: 0.7em;
  margin-bottom: 0.2em;
}
.legend-color {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  border-radius: 0.3em;
  border: 1.5px solid #cbd5e1;
}
.legend-line {
  display: inline-block;
  width: 1.7em;
  height: 0.3em;
  border-bottom: 3px solid #008000;
  margin-right: 0.2em;
}
.legend-circle {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  border-radius: 50%;
  border: 2px dashed #333;
  background: none;
}
.legend-cluster {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  border-radius: 50%;
  background: #fbbf24;
  border: 2px solid #f59e42;
  position: relative;
}
.legend-cluster:after {
  content: '';
  display: block;
  position: absolute;
  left: 0.4em;
  top: 0.4em;
  width: 0.4em;
  height: 0.4em;
  background: #fff;
  border-radius: 50%;
}
@media (max-width: 700px) {
  .map-legend {
    left: 50%;
    transform: translateX(-50%);
    bottom: 1rem;
    padding: 0.5rem 0.8rem;
    min-width: 0;
    font-size: 0.85rem;
    max-width: 85vw;
  }
}

#map .map-legend {
  position: absolute;
  left: 2rem;
  bottom: 2rem;
  background: rgba(255,255,255,0.97);
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.10);
  border-radius: 1.2rem;
  padding: 1rem 1.2rem;
  z-index: 1100;
  font-size: 0.9rem;
  color: #1e293b;
  min-width: 180px;
  max-width: 90vw;
  line-height: 1.5;
}
#map .map-legend div {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 0.15em;
  font-size: 0.9em;
}
@media (max-width: 700px) {
  #map .map-legend {
    left: 50% !important;
    transform: translateX(-50%) !important;
    bottom: 1rem !important;
    padding: 0.5rem 0.8rem !important;
    min-width: 0 !important;
    font-size: 0.85rem !important;
    max-width: 85vw !important;
    z-index: 1300 !important;
  }
  #control-panel.compact ~ #map-area #map .map-legend {
    left: calc(50% + 60px) !important;
    transform: translateX(-50%) !important;
  }
  #control-panel.compact.collapsed ~ #map-area #map .map-legend {
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
}

/* Print-friendly styles */
@media print {
  body, html {
    background: #fff !important;
    color: #000 !important;
  }
  .sticky-header, .controls, .center-controls, .layer-controls, .export-controls {
    display: none !important;
  }
  .map-legend {
    position: static !important;
    box-shadow: none !important;
    background: #fff !important;
    color: #000 !important;
    margin: 1em 0;
    min-width: 0;
    font-size: 1.1em;
  }
  #map {
    width: 8in !important;
    height: 8in !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    display: block !important;
  }
}

/* --- Enhanced Mobile Responsiveness --- */
@media (max-width: 600px) {
  body {
    font-size: 1.08em;
    overflow-x: hidden;
  }
  
  /* Improved header and navigation */
  .sticky-header {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    box-shadow: none;
  }
  
  /* Enhanced hamburger menu */
  .hamburger {
    display: flex !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 8px !important;
    background: #015941 !important;
    border: none !important;
    cursor: pointer !important;
    z-index: 3000 !important;
    position: fixed !important;
    top: 1rem !important;
    right: 1rem !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
  }
  
  .hamburger span {
    width: 24px !important;
    height: 3px !important;
    background: #fff !important;
    margin: 3px auto !important;
    border-radius: 2px !important;
    transition: 0.3s ease !important;
  }
  
  .hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg) !important;
  }
  
  .hamburger.active span:nth-child(2) {
    opacity: 0 !important;
  }
  
  .hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg) !important;
  }
  
  /* Mobile menu improvements */
  .menu {
    display: none !important;
  }
  
  .menu.open {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    background: rgba(1, 89, 65, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    z-index: 2500 !important;
    padding: 5rem 2rem 2rem 2rem !important;
    box-sizing: border-box !important;
    gap: 1.5rem !important;
    justify-content: flex-start !important;
    align-items: center !important;
  }
  
  .menu.open li {
    width: 100% !important;
    text-align: center !important;
  }
  
  .menu.open li a {
    color: #fff !important;
    font-size: 1.3rem !important;
    font-weight: 600 !important;
    padding: 1rem 1.5rem !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .menu.open li a:hover {
    background: rgba(255,255,255,0.2) !important;
    transform: translateY(-2px) !important;
  }
  
  /* Hero section improvements */
  .hero {
    padding: 2rem 1rem 1.5rem 1rem !important;
    overflow-x: hidden !important;
    width: 100vw !important;
    box-sizing: border-box !important;
    min-height: 60vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  .hero-text h1 {
    font-size: 1.8rem !important;
    margin-bottom: 1rem !important;
    line-height: 1.2 !important;
  }
  
  .hero-text p {
    font-size: 1.1rem !important;
    line-height: 1.4 !important;
    max-width: 100% !important;
    padding: 0 0.5rem !important;
  }
  
  /* Logo bar improvements */
  .logo-bar {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
    padding: 1rem 0.5rem !important;
    justify-content: center !important;
    align-items: center !important;
  }
  
  .logo-bar img {
    height: 40px !important;
    max-width: 80px !important;
    margin: 0 !important;
    object-fit: contain !important;
  }
  
  /* Content section improvements */
  .content-section {
    padding: 2rem 1rem !important;
    margin: 1.5rem 0.5rem !important;
    max-width: 100vw !important;
    border-radius: 12px !important;
  }
  
  .content-section h2 {
    font-size: 1.6rem !important;
    margin-bottom: 1.5rem !important;
    line-height: 1.3 !important;
  }
  
  .content-section p,
  .content-section ul {
    font-size: 1.1rem !important;
    line-height: 1.6 !important;
    margin-bottom: 1.2rem !important;
  }
  
  /* Team grid improvements */
  .team-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    margin-top: 2rem !important;
  }
  
  .team-card {
    min-height: 320px !important;
  }
  
  .card-front img {
    width: 120px !important;
    height: 120px !important;
  }
  
  .card-back .bio {
    font-size: 1rem !important;
    line-height: 1.5 !important;
  }
  
  /* Carousel improvements */
  .carousel-section {
    padding: 1.5rem 0 2rem 0 !important;
  }
  
  .carousel {
    max-width: 95vw !important;
    border-radius: 12px !important;
  }
  
  .carousel-img {
    max-height: 250px !important;
    border-radius: 12px !important;
  }
  
  .carousel-btn {
    width: 48px !important;
    height: 48px !important;
    font-size: 1.5rem !important;
    background: rgba(255,255,255,0.9) !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
  }
  
  /* KPI and mission blocks improvements */
  .mission-block, .objectives-block {
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    border-radius: 12px !important;
  }
  
  .kpi-list li,
  .vertical-farming-list li {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
  }
  
  /* Footer improvements */
  footer {
    padding: 2rem 1rem !important;
    font-size: 1rem !important;
  }
  
  footer p {
    margin-bottom: 0.5rem !important;
  }
  
  /* Touch-friendly buttons and inputs */
  button, input[type='range'], input[type='text'], input[type='number'], select {
    font-size: 1.1rem !important;
    padding: 0.8rem 1rem !important;
    margin: 0.3rem 0 !important;
    border-radius: 8px !important;
    min-height: 48px !important;
  }
  
  /* Social links improvements */
  .social-link {
    padding: 0.6rem 1.2rem !important;
    font-size: 1rem !important;
    border-radius: 8px !important;
  }
  
  /* Gallery improvements */
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
    gap: 1rem !important;
  }
  
  .gallery-thumb {
    max-width: 140px !important;
    height: 100px !important;
    border-radius: 8px !important;
  }
  
  /* Lightbox improvements */
  .lightbox-img {
    max-width: 95vw !important;
    max-height: 70vh !important;
  }
  
  .lightbox-close {
    top: 1rem !important;
    right: 1rem !important;
    font-size: 2rem !important;
    width: 48px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0,0,0,0.5) !important;
    border-radius: 50% !important;
  }
  
  .lightbox-prev, .lightbox-next {
    font-size: 2rem !important;
    width: 48px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0,0,0,0.5) !important;
    border-radius: 50% !important;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .hero-text h1 {
    font-size: 1.5rem !important;
  }
  
  .hero-text p {
    font-size: 1rem !important;
  }
  
  .logo-bar img {
    height: 32px !important;
    max-width: 60px !important;
  }
  
  .content-section {
    padding: 1.5rem 0.8rem !important;
    margin: 1rem 0.3rem !important;
  }
  
  .content-section h2 {
    font-size: 1.4rem !important;
  }
  
  .team-card {
    min-height: 280px !important;
  }
  
  .card-front img {
    width: 100px !important;
    height: 100px !important;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
    gap: 0.8rem !important;
  }
  
  .gallery-thumb {
    max-width: 120px !important;
    height: 80px !important;
  }
  
  .carousel-img {
    max-height: 200px !important;
  }
  
  .carousel-btn {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.2rem !important;
  }
}

/* Landscape orientation improvements */
@media (max-width: 600px) and (orientation: landscape) {
  .hero {
    min-height: 40vh !important;
    padding: 1rem !important;
  }
  
  .hero-text h1 {
    font-size: 1.4rem !important;
  }
  
  .hero-text p {
    font-size: 1rem !important;
  }
  
  .content-section {
    padding: 1.5rem 1rem !important;
  }
  
  .team-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }
  
  .team-card {
    min-height: 240px !important;
  }
  
  .card-front img {
    width: 80px !important;
    height: 80px !important;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hamburger span {
    border-radius: 1px !important;
  }
  
  .carousel-btn {
    box-shadow: 0 1px 4px rgba(0,0,0,0.2) !important;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .hero-text h1,
  .hero-text p,
  .content-section,
  .team-card,
  .carousel-track {
    animation: none !important;
    transition: none !important;
  }
  
  .hamburger span {
    transition: none !important;
  }
  
  .menu.open li a {
    transition: none !important;
  }
}

/* Focus improvements for accessibility */
@media (max-width: 600px) {
  button:focus,
  input:focus,
  select:focus,
  a:focus {
    outline: 3px solid #2563eb !important;
    outline-offset: 2px !important;
  }
  
  .hamburger:focus {
    outline: 3px solid #fff !important;
    outline-offset: 2px !important;
  }
  
  .menu.open li a:focus {
    outline: 3px solid #fff !important;
    outline-offset: 2px !important;
  }
}

/* Make buttons and inputs larger for touch on all screens */
button, input[type='range'], input[type='text'], input[type='number'], select {
  font-size: 1.08em;
  padding: 0.6em 0.7em;
  margin: 0.2em 0;
  border-radius: 0.5em;
  outline: none;
  transition: box-shadow 0.15s, border-color 0.15s;
}
button:focus, input:focus, select:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #bae6fd;
  border-color: #2563eb;
  z-index: 2;
}
button:hover, .export-controls button:hover, .layer-controls button:hover, #centerFilterBtn:hover {
  background: #e0e7ff;
  color: #1e293b;
}
button:active {
  background: #2563eb;
  color: #fff;
}
.panel-section-title:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
/* Spinner for export feedback */
#exportSpinner {
  display: none;
  width: 32px;
  height: 32px;
  border: 4px solid #bae6fd;
  border-top: 4px solid #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 1em auto;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
/* Visually hidden for screen readers */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  border: 0;
}

/* --- Layout for new map page --- */
#main-flex-container {
  display: flex;
  height: 100vh;
  min-height: 500px;
  width: 100vw;
  max-width: 100vw;
  margin: 0;
  overflow: hidden !important;
}
#control-panel {
  background: #fff;
  box-shadow: 2px 0 12px 0 rgba(0,0,0,0.06);
  width: 340px;
  min-width: 240px;
  max-width: 95vw;
  padding: 1.5rem 1.2rem 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  z-index: 999;
  transition: width 0.3s cubic-bezier(.4,0,.2,1), padding 0.3s, box-shadow 0.3s, min-width 0.3s;
  position: relative;
  overflow-y: auto;
  height: 100vh;
  top: 0;
  left: 0;
  margin: 0;
  resize: horizontal;
}

/* Custom resize handle styling */
#resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  background: transparent;
  cursor: col-resize;
  z-index: 998;
  transition: background 0.2s ease;
}

#resize-handle:hover {
  background: rgba(1, 89, 65, 0.2);
}

#resize-handle:active {
  background: rgba(1, 89, 65, 0.4);
}
#control-panel.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  overflow: hidden !important;
}
#control-panel-toggle {
  position: fixed;
  top: 90px;
  left: 340px;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: none;
  background: #2563eb;
  color: #fff;
  font-size: 1.7rem;
  cursor: pointer;
  z-index: 998;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 0.3s cubic-bezier(.4,0,.2,1), background 0.2s;
}
#control-panel.compact ~ #control-panel-toggle {
  left: 80px !important;
}
#control-panel.compact.collapsed ~ #control-panel-toggle,
#control-panel.collapsed ~ #control-panel-toggle {
  left: 0 !important;
}
#control-panel-toggle .arrow {
  display: inline-block;
  transition: transform 0.3s;
}
#control-panel.collapsed ~ #control-panel-toggle .arrow {
  transform: rotate(180deg);
}
#map-area {
  flex: 1 1 0%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100vw;
  margin: 0;
  overflow: hidden !important;
}
#map {
  flex: 1 1 0%;
  width: 100% !important;
  height: 100%;
  min-height: 500px;
  max-width: 100vw;
  margin: 0;
  border-radius: 0 0.7rem 0.7rem 0;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.04);
}
.panel-section {
  margin-bottom: 0.6rem;
}
.controls, .center-controls, .export-controls, .layer-controls {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0.2rem 0;
  position: static;
  min-width: 0;
  max-width: 100%;
}
.controls label, .center-controls label, .export-controls label, .layer-controls label {
  margin-bottom: 0.1em;
}
.export-controls button, .layer-controls button, #centerFilterBtn {
  width: 100%;
  margin-bottom: 0.2em;
  padding: 0.5em 0.7em;
  box-sizing: border-box;
  max-width: 100%;
}
input[type="text"], input[type="number"], select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.panel-divider {
  margin: 0.7rem 0 0.7rem 0;
}
.panel-title {
  margin-bottom: 0.7rem;
}
.panel-section-title {
  margin-bottom: 0.4rem;
}
.controls .toggle-label, .controls .slider-label {
  margin-bottom: 0.2em;
}
.center-controls .row {
  display: flex;
  gap: 0.7em;
  margin-bottom: 0.3em;
}
#legendPosition {
  margin-top: 0.5em;
  width: 100%;
  padding: 0.3em;
  border-radius: 0.4em;
  border: 1px solid #cbd5e1;
  font-size: 1em;
}
@media (max-width: 900px) {
  #control-panel {
    width: 240px;
    min-width: 140px;
    padding: 1rem 0.7rem 1rem 0.7rem;
  }
  #control-panel-toggle {
    left: 240px;
  }
  #control-panel.collapsed ~ #control-panel-toggle {
    left: 0;
  }
}
@media (max-width: 700px) {
  #main-flex-container {
    flex-direction: column;
    height: 100vh;
  }
  #control-panel {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    height: auto !important;
    min-height: auto !important;
    max-height: 40vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0.5rem !important;
    font-size: 0.9em !important;
    position: relative !important;
    z-index: 1000 !important;
    resize: none !important;
  }
  #control-panel.collapsed {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  #control-panel-toggle {
    display: none !important;
  }
  #control-panel.collapsed ~ #control-panel-toggle {
    display: none !important;
  }
  #map-area {
    flex: 1 !important;
    min-height: 60vh !important;
    height: auto !important;
  }
  #map {
    width: 100% !important;
    height: 100% !important;
    min-height: 60vh !important;
  }
  
  /* Disable resize handle on mobile */
  #resize-handle {
    display: none !important;
  }
}

/* Remove old fixed bottom panel styles */
.controls, .center-controls, .layer-controls, .export-controls {
  position: static !important;
  left: unset !important;
  bottom: unset !important;
  transform: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  background: none !important;
  min-width: 0 !important;
  max-width: 100% !important;
  z-index: auto !important;
  padding: 0 !important;
}

/* Panel section headers and dividers */
.panel-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 1.2rem 0;
  color: #2563eb;
  letter-spacing: 0.01em;
}
.panel-section-title {
  font-size: 1.08rem;
  font-weight: 600;
  margin: 0 0 0.7rem 0;
  color: #1e293b;
  letter-spacing: 0.01em;
}
.panel-divider {
  border: none;
  border-top: 1.5px solid #e5e7eb;
  margin: 1.2rem 0 1.2rem 0;
}
.legend-export-controls {
  margin-top: 0.7em;
  display: flex;
  flex-direction: column;
  gap: 0.3em;
}

#map, #map-area, #main-flex-container {
  margin-bottom: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  box-sizing: border-box;
}
html, body {
  height: 100%;
  /* Remove overflow: hidden here to restore scrollbars globally */
}
.map-page body {
  overflow: hidden !important;
}
.map-page {
  min-height: 100vh;
}

/* --- HEADER & NAVIGATION --- */
header, .sticky-header {
  background-color: rgba(186, 12, 47, 0.85) !important;
  padding: 1rem 0 0 0;
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  gap: 3rem;
  margin-bottom: 1rem;
  background: none;
  border-bottom: none;
  padding: 0;
}
.menu li a {
  color: #fff !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  position: relative;
  padding: 0.5rem;
  transition: all 0.3s ease;
}
.menu li a:hover {
  background-color: rgba(255,255,255,0.2);
  border-radius: 5px;
  color: #fff !important;
}

/* --- LOGO BAR --- */
.logo-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1rem 0;
  background-color: #fff !important;
}
.logo-bar img {
  max-height: 60px;
  max-width: 150px;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.logo-bar img:hover {
  transform: scale(1.05);
}

/* --- HERO SECTION --- */
.hero {
  background: url('images/Rutgers Newark Bodega Project.jpg') no-repeat center center/cover !important;
  padding: 1.2rem 1rem 0.5rem 1rem; /* Further shrink hero image height */
  color: #fff !important;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
  isolation: isolate;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: -1;
}
.hero h1, .hero p {
  position: relative;
  z-index: 2;
}
.hero h1 {
  font-size: 2.1rem;
  margin-bottom: 0.5rem;
  animation: fadeInDown 1s ease-out;
}
.hero p {
  font-size: 1rem;
  animation: fadeInUp 1s ease-out;
  max-width: 600px;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-text h1 {
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeUp 1s cubic-bezier(0.4,0.2,0.2,1) forwards;
}

.hero-text p {
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeUp 1s cubic-bezier(0.4,0.2,0.2,1) forwards;
  animation-delay: 0.2s;
}

/* --- CONTENT SECTIONS --- */
.content-section {
  padding: 4rem 2rem;
  max-width: 1000px;
  margin: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
}
.content-section h2 {
  color: #ba0c2f;
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  position: relative;
}
.content-section p,
.content-section ul {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
.content-section ul {
  padding-left: 1.5rem;
}

/* --- TEAM GRID --- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}
.team-card {
  background: none;
  box-shadow: none;
  border-radius: 1rem;
  perspective: 1200px;
  min-height: 380px;
  position: relative;
  transition: transform 0.3s;
}
.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 380px;
  transition: transform 0.7s cubic-bezier(0.4,0.2,0.2,1);
  transform-style: preserve-3d;
}
.team-card:hover .card-inner, .team-card:focus-within .card-inner {
  transform: rotateY(180deg);
}
.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 1rem;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.04);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}
.card-front img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 1rem;
  border: 5px solid #015941;
  transition: all 0.3s ease;
  filter: drop-shadow(0 4px 8px rgba(1, 89, 65, 0.2));
}

.card-front img:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 6px 12px rgba(1, 89, 65, 0.3));
  border-color: #004684;
}
.card-front h3, .card-back h3 {
  margin: 0.5rem 0 0.25rem 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #000;
}
.card-front p {
  color: #64748b;
  font-size: 0.95rem;
}
.card-back {
  transform: rotateY(180deg);
  justify-content: flex-start;
}
.card-back .bio {
  color: #374151;
  font-size: 1rem;
  margin-bottom: 1.2rem;
  margin-top: 0.5rem;
  text-align: center;
}
.social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
}
.social-link {
  color: #015941;
  background: #f1f5f9;
  padding: 0.4em 0.8em;
  border-radius: 0.5em;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
  border: 1.5px solid #015941;
  display: inline-block;
  min-width: fit-content;
  text-align: center;
}
.social-link:hover {
  background: #015941;
  color: #fff;
}
@media (max-width: 700px) {
  .team-card, .card-inner {
    min-height: 260px;
  }
  .card-front img {
    width: 110px;
    height: 110px;
  }
}

/* --- FOOTER --- */
footer {
  background-color: #222 !important;
  color: #eee !important;
  text-align: center;
  padding: 1rem;
  font-size: 0.95rem;
  margin-top: 3rem;
}
footer a {
  color: #bae6fd !important;
  text-decoration: underline;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  nav ul.menu {
    gap: 1.2rem;
    font-size: 1rem;
  }
  .hero h1 {
    font-size: 2.1rem;
  }
  .hero {
    padding: 4rem 1rem;
  }
  .story {
    margin: 1rem;
    padding: 2rem 1.5rem;
  }
  .story h2 {
    font-size: 1.6rem;
  }
  .story h3 {
    font-size: 1.2rem;
  }
  .story p {
    font-size: 1rem;
  }
  .content-section {
    padding: 2rem 1rem;
  }
  .team-card img {
    height: 120px;
  }
}
@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.3rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .logo-bar img {
    max-width: 90px;
    max-height: 40px;
  }
}

/* Custom icon styles for map markers */
.custom-div-icon {
  background: none;
  border: none;
}

.custom-div-icon i {
  filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
  transition: all 0.3s ease;
}

.custom-div-icon i:hover {
  transform: scale(1.2);
  filter: drop-shadow(3px 3px 6px rgba(0,0,0,0.4));
}

/* Fresh food icon styling */
.fresh-food-icon {
  color: #16a34a !important;
}

/* Fast food icon styling */
.fast-food-icon {
  color: #dc2626 !important;
}

#control-panel.compact {
  width: 120px !important;
  min-width: 100px !important;
  max-width: 140px !important;
  padding: 0.5rem 0.3rem 0.5rem 0.3rem !important;
  font-size: 0.9em !important;
  transition: width 0.3s, min-width 0.3s, max-width 0.3s, padding 0.3s, font-size 0.3s;
  overflow: visible !important;
}
#control-panel.compact .panel-title,
#control-panel.compact .panel-section-title,
#control-panel.compact label,
#control-panel.compact select,
#control-panel.compact input[type="text"],
#control-panel.compact input[type="number"],
#control-panel.compact .legend-export-controls,
#control-panel.compact .center-controls,
#control-panel.compact .panel-divider {
  display: none !important;
}
#control-panel.compact button,
#control-panel.compact .export-controls button,
#control-panel.compact .layer-controls button {
  font-size: 1em !important;
  padding: 0.4em 0.3em !important;
  min-width: 0 !important;
  width: 100% !important;
  margin-bottom: 0.3em !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
#control-panel.compact .controls,
#control-panel.compact .slider-compact-row,
#control-panel.compact .export-controls,
#control-panel.compact .layer-controls {
  margin-bottom: 1.5em !important;
  padding: 0.5em 0 !important;
}
#control-panel.compact .controls {
  margin-bottom: 1.2em !important;
  padding-bottom: 0.5em !important;
  gap: 0.5em !important;
}
#control-panel.compact .toggle-label {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.3em !important;
  padding: 0.3em 0.2em !important;
  margin-bottom: 0.3em !important;
  font-size: 0.9em !important;
  font-weight: 600 !important;
  color: #015941 !important;
}
#control-panel.compact .toggle-label input[type="checkbox"] {
  margin: 0 !important;
  transform: scale(1.2) !important;
}
#control-panel.compact .toggle-label .short-label {
  display: inline !important;
  font-weight: 600 !important;
  color: #015941 !important;
}
#control-panel.compact .toggle-label .long-label {
  display: none !important;
}
#control-panel.compact .slider-compact-row {
  margin-bottom: 1em !important;
}
#control-panel.compact .export-controls {
  margin-bottom: 1em !important;
}
#control-panel.compact .layer-controls {
  margin-bottom: 1em !important;
}
#control-panel.compact .controls,
#control-panel.compact .export-controls,
#control-panel.compact .layer-controls {
  gap: 0.3em !important;
  padding: 0 !important;
}
#control-panel.compact .panel-section {
  margin-bottom: 0.3rem !important;
  padding: 0 !important;
}
#control-panel.compact #compactPanelBtn {
  font-size: 1.2em !important;
  padding: 0.2em 0.3em !important;
}

.hero-text h1, .hero-text p {
  transition: transform 0.7s cubic-bezier(0.4,0.2,0.2,1), opacity 0.7s cubic-bezier(0.4,0.2,0.2,1);
}

.hero-text h1.sr, .hero-text p.sr {
  /* When ScrollReveal animates in, it will set transform: none; opacity: 1; */
  /* This ensures the transition is smooth and no snap occurs. */
}

.toggle-label .short-label { display: none; }
.toggle-label .long-label { display: inline; }
#control-panel.compact .toggle-label .short-label { display: inline !important; }
#control-panel.compact .toggle-label .long-label { display: none !important; }

#control-panel.compact .export-controls,
#control-panel.compact #centerFilterBtn {
  display: none !important;
}

#control-panel.compact .controls,
#control-panel.compact .toggle-label {
  display: flex !important;
}
#control-panel.compact .toggle-label .short-label { display: inline !important; }
#control-panel.compact .toggle-label .long-label { display: none !important; }

#control-panel.compact .slider-label {
  display: flex !important;
  align-items: center;
  gap: 0.3em;
}
#control-panel.compact .slider-label .short-label { display: inline !important; }
#control-panel.compact .slider-label .long-label { display: none !important; }
#control-panel.compact .slider-label input[type="range"] {
  width: 50px !important;
  margin-left: 0.2em;
}
#control-panel.compact .export-controls button {
  display: none !important;
}
#control-panel.compact .export-controls #exportImgBtn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
}
#control-panel.compact .export-controls #exportImgBtn .short-label { display: inline !important; }
#control-panel.compact .export-controls #exportImgBtn .long-label { display: none !important; }

.slider-compact-row {
  display: flex;
  flex-direction: row;
  gap: 1.2em;
}
#control-panel:not(.compact) .slider-label .short-label {
  display: none !important;
}
#control-panel:not(.compact) .slider-label .long-label {
  display: inline !important;
}
#control-panel.compact .slider-compact-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8em;
  width: 100%;
  padding: 0.5em 0;
}
#control-panel.compact .slider-label {
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.3em !important;
  margin: 0 !important;
  padding: 0.3em 0 !important;
  width: 100%;
  position: relative;
}
#control-panel.compact .slider-label .long-label {
  display: block !important;
  font-size: 0.85em;
  margin-bottom: 0.3em;
  text-align: center;
  font-weight: 600;
  color: #015941;
}
#control-panel.compact .slider-label .short-label {
  display: none !important;
}
#control-panel.compact .slider-label input[type="range"] {
  width: 60px !important;
  height: 24px !important;
  transform: rotate(-90deg);
  margin: 0 !important;
  margin-top: 0.5em !important;
  margin-bottom: 0.5em !important;
  display: block;
  position: relative;
  z-index: 1;
}

#control-panel.compact {
  position: relative;
}
#control-panel.compact .layer-controls {
  position: absolute !important;
  bottom: 0;
  left: 0;
  width: 100%;
  margin-bottom: 0 !important;
  padding-bottom: 0.8em !important;
  padding-top: 0.5em !important;
  background: #fff;
  z-index: 2;
  box-shadow: 0 -2px 8px 0 rgba(0,0,0,0.04);
  display: flex !important;
  flex-direction: column;
  gap: 0.4em;
  align-items: center;
  border-top: 1px solid #e5e7eb;
}
#control-panel.compact .slider-compact-row {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 0 !important;
  padding: 0.5em 0 !important;
  min-height: 160px;
}
#control-panel.compact .slider-label .long-label {
  font-size: 0.8em !important;
  margin-bottom: 0.6em;
  text-align: center;
  font-weight: 600;
  color: #015941;
}
#control-panel.compact .slider-label {
  margin-bottom: 1.2em !important;
}
#control-panel.compact .controls {
  margin-bottom: 1em !important;
  padding-bottom: 0.3em !important;
}

.gallery-section {
  margin-top: 2.5rem;
}
.gallery-section h2 {
  text-align: center;
  color: #004684;
  margin-bottom: 2rem;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  justify-items: center;
}
.gallery-thumb {
  width: 100%;
  max-width: 220px;
  height: 160px;
  object-fit: cover;
  border-radius: 0.7rem;
  box-shadow: 0 2px 12px 0 rgba(1,89,65,0.08);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid #fff;
}
.gallery-thumb:hover {
  transform: scale(1.04) rotate(-1deg);
  box-shadow: 0 8px 24px 0 rgba(1,89,65,0.18);
  border-color: #015941;
}
.lightbox-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  animation: fadeIn 0.3s;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 1rem;
  box-shadow: 0 8px 32px 0 rgba(1,89,65,0.25);
  margin-bottom: 1.5rem;
  background: #fff;
}
.lightbox-close {
  position: absolute;
  top: 2.5rem;
  right: 3.5rem;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  z-index: 10001;
  transition: color 0.2s;
}
.lightbox-close:hover {
  color: #015941;
}
.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  font-size: 3rem;
  color: #fff;
  cursor: pointer;
  user-select: none;
  z-index: 10001;
  padding: 0.2em 0.5em;
  border-radius: 0.3em;
  background: rgba(1,89,65,0.15);
  transition: background 0.2s, color 0.2s;
}
.lightbox-prev:hover, .lightbox-next:hover {
  background: #015941;
  color: #fff;
}
.lightbox-prev {
  left: 2vw;
  transform: translateY(-50%);
}
.lightbox-next {
  right: 2vw;
  transform: translateY(-50%);
}
@media (max-width: 700px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.7rem;
  }
  .gallery-thumb {
    max-width: 120px;
    height: 80px;
  }
  .lightbox-img {
    max-width: 98vw;
    max-height: 60vh;
  }
  .lightbox-close {
    top: 1.2rem;
    right: 1.2rem;
    font-size: 2rem;
  }
  .lightbox-prev, .lightbox-next {
    font-size: 2.2rem;
  }
}

#control-panel.collapsed > *:not(#restorePanelBtn) {
  display: none !important;
}
#control-panel.collapsed #restorePanelBtn {
  display: block !important;
}

#showPanelBtn {
  display: none !important;
}
#control-panel.collapsed ~ #showPanelBtn,
#showPanelBtn.active {
  display: block !important;
}

/* Mission & Objectives blocks */
.mission-block, .objectives-block {
  background: #f1f5f9;
  border-radius: 0.75rem;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 6px 0 rgba(1,89,65,0.06);
  border-left: 5px solid #2563eb;
}
.mission-block h3, .objectives-block h3 {
  color: #015941;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.objectives-block ul {
  margin: 0 0 0.5rem 1.2rem;
  padding: 0;
  list-style: disc inside;
}
.program-dates {
  background: #e0f2fe;
  color: #004684;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 1rem;
}

/* KPI List */
.kpi-list {
  margin: 1.2rem 0 0 1.2rem;
  padding: 0;
  list-style: square inside;
  font-size: 1.08rem;
}
.kpi-list li {
  margin-bottom: 0.7rem;
  color: #374151;
  background: #f9fafb;
  border-radius: 0.4rem;
  padding: 0.6rem 1rem;
  box-shadow: 0 1px 4px 0 rgba(37,99,235,0.04);
}
.kpi-intro {
  color: #015941;
  font-weight: 500;
  margin-bottom: 0.7rem;
  font-size: 1.08rem;
}

/* Vertical Farming List */
.vertical-farming-list {
  margin: 1.2rem 0 0 1.2rem;
  padding: 0;
  list-style: circle inside;
  font-size: 1.08rem;
}
.vertical-farming-list li {
  margin-bottom: 0.7rem;
  color: #2563eb;
  background: #f1f5f9;
  border-radius: 0.4rem;
  padding: 0.6rem 1rem;
  box-shadow: 0 1px 4px 0 rgba(1,89,65,0.04);
}

@media (max-width: 700px) {
  #control-panel.compact {
    width: 120px !important;
    min-width: 100px !important;
    max-width: 140px !important;
    height: auto !important;
    min-height: auto !important;
    max-height: 35vh !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 1200 !important;
    border-radius: 0 0 1rem 1rem !important;
    box-shadow: 0 4px 24px 0 rgba(0,0,0,0.10) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  #control-panel.compact ~ #map-area {
    margin-left: 120px !important;
    width: calc(100% - 120px) !important;
  }
  #control-panel.compact.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    overflow: hidden !important;
  }
  #control-panel.compact.collapsed ~ #map-area {
    margin-left: 0 !important;
    width: 100% !important;
  }
}

@media (max-width: 700px) {
  .controls, .center-controls, .layer-controls, .export-controls {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    font-size: 0.9em;
    padding: 0.5em 0.3em;
    gap: 0.5em;
  }
  .panel-title {
    font-size: 1.1em !important;
    margin-bottom: 0.5em !important;
    text-align: center !important;
  }
  .panel-section-title {
    font-size: 1em !important;
    margin-bottom: 0.3em !important;
    text-align: center !important;
  }
  .panel-divider {
    margin: 0.5em 0 !important;
  }
  .legend-export-controls {
    margin-top: 0.5em !important;
  }
}

@media (max-width: 480px) {
  #control-panel.compact {
    width: 100px !important;
    min-width: 80px !important;
    max-width: 120px !important;
    font-size: 0.8em !important;
    padding: 0.3rem 0.2rem !important;
  }
  #control-panel.compact ~ #map-area {
    margin-left: 100px !important;
    width: calc(100% - 100px) !important;
  }
  #control-panel.compact button,
  #control-panel.compact .export-controls button,
  #control-panel.compact .layer-controls button {
    font-size: 0.9em !important;
    padding: 0.3em 0.2em !important;
  }
  #control-panel.compact .slider-label input[type="range"] {
    width: 50px !important;
    height: 20px !important;
  }
  #control-panel.compact .toggle-label {
    font-size: 0.85em !important;
    padding: 0.2em 0.1em !important;
  }
  #control-panel.compact .slider-label .long-label {
    font-size: 0.75em !important;
    margin-bottom: 0.5em;
  }
  #control-panel.compact .slider-compact-row {
    min-height: 140px;
    gap: 0.6em;
  }
  #map .map-legend {
    font-size: 0.8rem !important;
    padding: 0.4rem 0.6rem !important;
    max-width: 90vw !important;
  }
  #control-panel.compact ~ #map-area #map .map-legend {
    left: calc(50% + 50px) !important;
  }
}

@media (max-width: 700px) {
  #control-panel.collapsed ~ #map-area {
    margin-left: 0 !important;
    width: 100% !important;
    height: 100vh !important;
  }
  #control-panel.collapsed ~ #map-area #map {
    height: 100vh !important;
    min-height: 100vh !important;
  }
}

/* Hamburger Menu Styles */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 300;
}
.hamburger span {
  display: block;
  width: 28px;
  height: 4px;
  margin: 4px 0;
  background: #015941;
  border-radius: 2px;
  transition: 0.3s;
}
.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}
@media (max-width: 900px) {
  .hamburger {
    display: flex;
  }
  .menu {
    flex-direction: column;
    position: absolute;
    top: 60px;
    right: 0;
    width: 200px;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: none;
    z-index: 250;
  }
  .menu.open {
    display: flex;
  }
}

/* Parallax Hero Section */
.hero {
  background: linear-gradient(135deg, #015941 0%, #004684 50%, #015941 100%);
  color: #fff;
  padding: 3rem 1rem 2rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
}

/* Carousel Styles */
.carousel-section {
  background: #f8fafc;
  padding: 2rem 0 3rem 0;
  text-align: center;
}
.carousel {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 2px 16px rgba(1,89,65,0.08);
  background: #fff;
}
.carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(.77,0,.18,1);
}
.carousel-img {
  min-width: 100%;
  max-height: 350px;
  object-fit: cover;
  border-radius: 1rem;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  color: #015941;
  border: none;
  border-radius: 0;
  width: 40px;
  height: 40px;
  font-size: 2rem;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s, color 0.2s;
  outline: none;
  box-shadow: none;
}
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }
.carousel-btn:hover { background: transparent; color: #004684; }
.carousel-btn:focus, .carousel-btn:active {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}
@media (max-width: 600px) {
  .carousel-img { max-height: 200px; }
  .carousel-section { padding: 1rem 0 2rem 0; }
}

/* Ensure carousel slide takes full width inside flex track */
.carousel-img-container { min-width: 100%; flex: 0 0 100%; }

/* --- Dynamic carousel height & full-image fit --- */
.carousel { height: auto !important; }
@media (max-width:600px){ .carousel{ height: auto !important; }}
.carousel-img{ width:100%; height:auto !important; max-height:60vh; object-fit: contain !important; }

/* Carousel container transition for dynamic height */
.carousel { transition: height 0.4s ease !important; }
/* Position track absolute so it doesn't affect container height */
.carousel-track { position: static !important; }
