/* ── Ecosystem section spacing overrides ─────────────────────── */
.ecosystem {
  padding: var(--space-xs) 0;
}

.ecosystem-grid {
  gap: 0.25rem;
}

.ecosystem-content p {
  margin-bottom: 0.25rem;
  line-height: 1.5;
}

.ecosystem-content h2 {
  margin-bottom: 0.5rem;
}

/* ── Interactive Brightway Ecosystem Diagram ──────────────────── */

.eco-svg-wrapper {
  width: 100%;
  background: #f4f3ec;
  border-radius: var(--border-radius);
  padding: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  overflow: hidden;
}

.eco-svg {
  width: 100%;
  height: auto;
  display: block;
  font-family: 'Nunito', sans-serif;
}

/* ── Node interactions ────────────────────────────────────────── */
.eco-node {
  cursor: pointer;
}

.eco-node rect,
.eco-node circle {
  transition: filter 0.15s ease, stroke-width 0.15s ease;
}

.eco-node:hover rect,
.eco-node:hover circle {
  filter: brightness(1.12);
  stroke: rgba(0,0,0,0.25);
  stroke-width: 2;
}

.eco-node:focus {
  outline: none;
}

.eco-node:focus rect,
.eco-node:focus circle {
  stroke: #3548CC;
  stroke-width: 2.5;
}

/* ── Tooltip ──────────────────────────────────────────────────── */
.eco-tooltip {
  position: fixed;
  background: #2B2B2B;
  color: #f5f5f5;
  padding: 7px 11px;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Nunito', sans-serif;
  max-width: 240px;
  line-height: 1.45;
  pointer-events: none;
  z-index: 1500;
  opacity: 0;
  transition: opacity 0.12s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
}

.eco-tooltip.visible {
  opacity: 1;
}

/* ── Modal overlay ────────────────────────────────────────────── */
.eco-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.48);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.eco-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Modal card ───────────────────────────────────────────────── */
.eco-modal {
  background: var(--color-primary-beige, #F0EEE1);
  border-radius: 12px;
  padding: 28px 30px 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.28);
  transform: translateY(14px);
  transition: transform 0.2s ease;
  position: relative;
}

.eco-modal-overlay.open .eco-modal {
  transform: translateY(0);
}

.eco-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  color: #666;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.eco-modal-close:hover {
  color: #2B2B2B;
  background: rgba(0,0,0,0.06);
}

/* ── Modal category badge ─────────────────────────────────────── */
.eco-modal-category {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  color: #fff;
}

.eco-modal-category.cat-core         { background: #3548CC; }
.eco-modal-category.cat-database     { background: #9468C8; }
.eco-modal-category.cat-webapp       { background: #C84030; }
.eco-modal-category.cat-inout        { background: #C83870; }
.eco-modal-category.cat-visualization{ background: #8A8C10; }
.eco-modal-category.cat-ui           { background: #C87010; }
.eco-modal-category.cat-inventory    { background: #A82878; }
.eco-modal-category.cat-assessment   { background: #4E8C18; }

/* ── Modal content ────────────────────────────────────────────── */
.eco-modal h3 {
  margin: 0 0 12px;
  font-size: 1.4rem;
  color: var(--color-dark-charcoal, #2B2B2B);
  padding-right: 24px; /* room for close button */
}

.eco-modal p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #444;
  margin: 0 0 18px;
}

.eco-modal p a {
  color: #3C5343;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.eco-modal p a:hover {
  color: #84AE99;
}

/* ── Modal links ──────────────────────────────────────────────── */
.eco-modal-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.eco-modal-links a {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  background: var(--color-primary-dark-green, #3C5343);
  color: #fff;
  transition: background 0.15s ease;
}

.eco-modal-links a:hover {
  background: var(--color-primary-light, #4a6652);
}
