/* ── Garden Page ─────────────────────────────────────────── */

.garden-page {
  padding-bottom: 30px;
}

.garden-subtitle {
  font-size: 0.85em;
  color: #888;
  margin-bottom: 10px;
}

/* ── Legend ──────────────────────────────────────────────── */

.garden-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8em;
  color: #555;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

/* ── Fold / collapse ────────────────────────────────────── */

.node-children.folded {
  display: none;
}

.fold-badge {
  cursor: pointer;
}

.fold-badge circle {
  transition: fill 0.15s ease;
}

/* ── Garden container & SVG ─────────────────────────────── */

.garden-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  background: #f8f2ef;
  border-radius: 12px;
  border: 1px solid #e0d8d2;
  position: relative;
}

#garden-svg {
  display: block;
  min-width: 100%;
}

/* ── Stems ──────────────────────────────────────────────── */

.garden-stem {
  fill: none;
  stroke: #167264;
  stroke-width: 3px;
  stroke-linecap: round;
}

.garden-stem-thin {
  fill: none;
  stroke: #167264;
  stroke-width: 2px;
  stroke-linecap: round;
}

/* ── Flowers ────────────────────────────────────────────── */

.garden-flower {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.garden-flower:hover {
  transform: scale(1.3);
}

.garden-flower .flower-petal {
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.garden-flower:hover .flower-petal {
  opacity: 1;
}

.garden-flower .flower-center {
  fill: #fff;
  stroke: none;
}

/* ── Cross-topic edges ─────────────────────────────────── */

.garden-cross-edge {
  fill: none;
  stroke-width: 1.2px;
  stroke-dasharray: 4 3;
  opacity: 0.3;
  transition: opacity 0.2s ease;
}
.garden-cross-edge:hover {
  opacity: 0.7;
}

/* ── Paper labels ───────────────────────────────────────── */

.paper-label {
  font-size: 9px;
  fill: #444;
  pointer-events: none;
  font-family: 'Open Sans', sans-serif;
  font-weight: 500;
}

.paper-venue-label {
  font-size: 7px;
  fill: #999;
  font-weight: 300;
}

/* ── Plant labels (topic names at bottom) ───────────────── */

.plant-label {
  font-size: 13px;
  font-weight: 600;
  fill: #333;
  text-anchor: middle;
  font-family: 'Open Sans', sans-serif;
}

/* ── Grass ──────────────────────────────────────────────── */

.garden-grass {
  fill: #85b9b1;
}

/* ── Clouds ─────────────────────────────────────────────── */

.garden-cloud {
  fill: #e5e5f5;
  opacity: 0.7;
}

/* ── Modal ──────────────────────────────────────────────── */

.garden-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.garden-modal-overlay.show {
  display: flex;
}

.garden-modal {
  background: #fff;
  border-radius: 10px;
  padding: 28px 32px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.garden-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #888;
  cursor: pointer;
  line-height: 1;
}

.garden-modal-close:hover {
  color: #333;
}

.garden-modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  padding-right: 30px;
}

.garden-modal-venue {
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 6px;
  font-weight: 500;
}

.garden-modal-authors {
  font-size: 0.82rem;
  color: #777;
  margin-bottom: 12px;
}

.garden-modal-abstract {
  font-size: 0.85rem;
  color: #444;
  line-height: 1.55;
  margin-bottom: 16px;
  white-space: pre-wrap;
}

.garden-modal-link {
  display: inline-block;
  font-size: 0.85rem;
  color: #0033a0;
  text-decoration: none;
  font-weight: 500;
}

.garden-modal-link:hover {
  text-decoration: underline;
}

/* ── Dark mode ──────────────────────────────────────────── */

html.dark .garden-container {
  background: #2a2520;
  border-color: #3a3530;
}

html.dark .garden-subtitle {
  color: #999;
}

html.dark .legend-item {
  color: #aaa;
}

html.dark .paper-label {
  fill: #bbb;
}

html.dark .plant-label {
  fill: #ccc;
}

html.dark .garden-grass {
  fill: #3a6b60;
}

html.dark .garden-cloud {
  fill: #3a3a50;
  opacity: 0.5;
}

html.dark .garden-stem,
html.dark .garden-stem-thin {
  stroke: #2a8a78;
}

html.dark .garden-cross-edge {
  opacity: 0.25;
}

html.dark .paper-venue-label {
  fill: #777;
}

html.dark .garden-modal {
  background: #2a2a2a;
  color: #ddd;
}

html.dark .garden-modal-close {
  color: #aaa;
}

html.dark .garden-modal-close:hover {
  color: #fff;
}

html.dark .garden-modal-title {
  color: #eee;
}

html.dark .garden-modal-venue {
  color: #aaa;
}

html.dark .garden-modal-authors {
  color: #999;
}

html.dark .garden-modal-abstract {
  color: #ccc;
}

html.dark .garden-modal-link {
  color: #66aaff;
}

html.dark .garden-modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 768px) {
  .garden-container {
    border-radius: 8px;
  }

  .garden-modal {
    padding: 20px 22px;
  }
}
