:root {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #132a13;
  background-color: #f7f9f7;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: inherit;
}

.site-footer {
  margin-top: 3rem;
  background: #1f2933;
  color: #f8fbf9;
  padding: 3rem 5vw;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  align-items: start;
}

.footer-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.footer-branding .logo-mark {
  background-color: #f8fbf9;
}

.footer-copy {
  margin: 0.75rem 0 1.25rem;
  color: rgba(248, 251, 249, 0.82);
  line-height: 1.6;
}

.footer-links h4 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: #e5f2eb;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer-links a {
  display: block;
  color: rgba(248, 251, 249, 0.8);
  text-decoration: none;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #8ff0bb;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.footer-meta span {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.maplibregl-popup.pulse-popup-container .maplibregl-popup-content {
  padding: 0.45rem 0.5rem;
  border-radius: 0.6rem;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  border: 1px solid #e5e7eb;
  min-width: 320px;
}

.pulse-popup {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pulse-summary-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.35rem 0.5rem;
}

.pulse-summary-card h4 {
  margin: 0 0 0.1rem;
  font-size: 0.8rem;
  color: #1f2937;
}

.pulse-summary-card p {
  margin: 0;
  font-size: 0.6rem;
  color: #6b7280;
}

.pulse-metric-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.35rem;
  background: #fff;
}

.pulse-popup .metric-tiles {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.25rem;
}

.pulse-popup .metric-tiles li {
  border: 1px solid #e0e7ff;
  border-radius: 0.5rem;
  padding: 0.25rem 0.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  background: #f8fafc;
}

.pulse-popup .metric-score {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.6rem;
}

.pulse-popup .metric-tiles span {
  font-size: 0.55rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #4b5563;
  text-align: center;
}

header {
  background-color: #f7f9f7;
  padding: 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.header-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.header-pill h1 {
  font-size: 1.1rem;
  margin: 0;
  color: #1b4332;
}

.logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background-color: #1b4332;
  mask: url("green-legacy-logo.svg") center / contain no-repeat;
  -webkit-mask: url("green-legacy-logo.svg") center / contain no-repeat;
  display: inline-block;
}

.logo-mark.large {
  width: 72px;
  height: 72px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: #e5e7eb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.header-actions nav {
  display: flex;
  gap: 1.2rem;
}

.header-actions nav a {
  color: #111827;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.85rem;
}

.header-actions button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 999px;
  background: #2d6a4f;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

main {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.map-card {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.map-card h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.map-stage {
  position: relative;
}

#map {
  position: relative;
  width: 100%;
  height: 78vh;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 250ms ease-in-out;
}

.map-stage.is-ready #map {
  opacity: 1;
}

#map-loading {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: #f8faf9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #1b4332;
  font-weight: 600;
  transition: opacity 200ms ease, visibility 200ms ease;
}

#map-loading[aria-hidden="true"] {
  opacity: 0;
  visibility: hidden;
}

.map-loading-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(27, 67, 50, 0.2);
  border-top-color: #1b4332;
  animation: map-spin 0.9s linear infinite;
}

@keyframes map-spin {
  to {
    transform: rotate(360deg);
  }
}

.top-controls {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.6rem;
  padding: 0.5rem 1.25rem;
  background: white;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 20;
  opacity: 0.7;
  transition: opacity 0.2s ease-in-out;
}

.top-controls:hover {
  opacity: 1;
}

.top-controls button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  background: #1b4332;
  color: white;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.top-controls button:hover {
  background: #2d6a4f;
}

.layer-controls {
  position: absolute;
  top: 60%;
  left: 32px;
  transform: translate(0, -50%);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 10;
  font-size: 14px;
  transition: transform 0.35s ease, opacity 0.35s ease;
  opacity: 1;
}

.layer-controls.is-hidden {
  transform: translate(calc(-100% - 24px), -50%);
  opacity: 0;
  pointer-events: none;
}

.layer-controls-toggle {
  position: absolute;
  top: 60%;
  left: 32px;
  transform: translate(-130%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
  cursor: pointer;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: background 0.2s ease, transform 0.3s ease;
}

.layer-controls-toggle:hover {
  background: #f3f4f6;
}

.layer-controls-toggle.is-collapsed {
  transform: translate(-50%, -50%);
}

.layer-controls h4 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
}

.layer-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  min-width: 160px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  color: #111827;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  opacity: 0.7;
}

.layer-control:hover {
  transform: translateX(4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  opacity: 1;
}

.layer-control.is-active {
  transform: translateX(4px);
  opacity: 1;
}

.layer-control--trees:hover,
.layer-control--trees.is-active {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.6);
  box-shadow: 0 10px 20px rgba(34, 197, 94, 0.25);
  color: #064e3b;
}

.layer-control--corridor:hover,
.layer-control--corridor.is-active {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(248, 113, 113, 0.5);
  box-shadow: 0 10px 20px rgba(248, 113, 113, 0.2);
  color: #7f1d1d;
}

.layer-control--train:hover,
.layer-control--train.is-active {
  background: rgba(107, 114, 128, 0.12);
  border-color: rgba(107, 114, 128, 0.5);
  box-shadow: 0 10px 20px rgba(107, 114, 128, 0.22);
  color: #1f2937;
}

.layer-control--pulse:hover,
.layer-control--pulse.is-active {
  background: rgba(236, 72, 153, 0.12);
  border-color: rgba(236, 72, 153, 0.5);
  box-shadow: 0 10px 20px rgba(236, 72, 153, 0.2);
  color: #831843;
}

.layer-control--airports:hover,
.layer-control--airports.is-active {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.25);
  color: #0f172a;
}
.layer-control--farms:hover,
.layer-control--farms.is-active {
  background: rgba(132, 204, 22, 0.15);
  border-color: rgba(132, 204, 22, 0.6);
  box-shadow: 0 10px 20px rgba(77, 124, 15, 0.25);
  color: #365314;
}

.layer-control input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.floating-card {
  position: absolute;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.15);
  padding: 0.85rem 1rem;
  border: 1px solid #e5e7eb;
  min-width: 160px;
  pointer-events: none;
  transform: translate(-50%, -100%) scale(0.7);
  opacity: 0;
  display: none;
  transition: opacity 700ms ease, transform 875ms ease;
  z-index: 5;
}

.floating-card h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.floating-card p {
  margin: 0;
  font-size: 0.85rem;
  color: #374151;
}

.floating-card img {
  width: 100%;
  border-radius: 0.6rem;
  margin-bottom: 0.5rem;
  display: block;
}

.floating-card.visible {
  opacity: 1;
  transform: translate(-50%, -100%) scale(0.75);
}

#info-bar {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translate(-50%, 120%);
  min-width: 320px;
  max-width: 520px;
  background: rgba(17, 24, 39, 0.94);
  color: #f9fafb;
  padding: 0.85rem 1.25rem;
  font-size: 0.9rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transition: transform 250ms ease, opacity 200ms ease;
  z-index: 15;
  pointer-events: none;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

#info-bar.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

#info-bar-text {
  margin: 0;
  font-weight: 600;
  color: #f9fafb;
  text-align: center;
}

.layer-tabs {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  padding: 1rem 1.5rem;
}

.layer-tabs .tab-list {
  display: flex;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.layer-tabs .tab-button {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f8fafc;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: #374151;
}

.layer-tabs .tab-button.active {
  background: #2d6a4f;
  color: #f1fdf5;
  border-color: #2d6a4f;
}

.layer-tabs .tab-content {
  font-size: 0.9rem;
  color: #4b5563;
}

.layer-tabs .tab-content.rich {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tab-summary h3 {
  margin: 0 0 0.25rem;
}

.tab-summary p {
  margin: 0 0 0.5rem;
  color: #4b5563;
  line-height: 1.5;
}

.tab-summary .tab-detail {
  margin: 0 0 0.5rem;
  color: #1f2937;
  font-size: 0.9rem;
}

.tab-slider {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  min-height: 220px;
  background: #f3f4f6;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.tab-slider img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  display: block;
}

.slider-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(17, 24, 39, 0.55);
  color: #f9fafb;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
}

.slider-control.prev {
  left: 12px;
}

.slider-control.next {
  right: 12px;
}

.slide-meta {
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.75));
  color: #f8fafc;
  padding: 1rem;
  font-size: 0.85rem;
}

.slide-meta strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.slider-placeholder {
  padding: 1.25rem;
  text-align: center;
  font-style: italic;
  color: #6b7280;
}

.tab-placeholder {
  padding: 1rem;
  text-align: center;
  font-style: italic;
  color: #6b7280;
  background: #f8fafc;
  border: 1px dashed #d1d5db;
  border-radius: 0.75rem;
  margin-left: 0.5rem;
}
