/* Interactive dependency graph (see assets/js/dependency-graph.js and
   _includes/dependency-graph.html). The site is fixed to color_scheme: light (_config.yml), so
   this stylesheet does not need a dark-mode variant. */

.dependency-graph {
  margin: 1rem 0 0.5rem;
  font-family: Helvetica, Arial, sans-serif;
}

.dependency-graph .dg-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.dependency-graph .dg-search-wrap {
  position: relative;
}

.dependency-graph .dg-search {
  padding: 0.35rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 220px;
  font-size: 0.9rem;
}

.dependency-graph .dg-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 5;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.dependency-graph .dg-search-item {
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.dependency-graph .dg-search-item:hover {
  background: #eef3fb;
}

.dependency-graph .dg-toggle {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
}

.dependency-graph .dg-reset {
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f7f7f7;
  cursor: pointer;
}

.dependency-graph .dg-reset:hover {
  background: #eee;
}

.dependency-graph .dg-canvas {
  border: 1px solid #ddd;
  border-radius: 6px;
  height: 720px;
  overflow: hidden;
  background: #fff;
}

.dependency-graph .dg-canvas svg {
  width: 100%;
  height: 100%;
  cursor: grab;
}

.dependency-graph .dg-error {
  padding: 1rem;
  color: #B5342A;
  font-size: 0.9rem;
}

/* Node fills, keyed to the same palette as the color model (see
   skills/project-color-coding/SKILL.md). */
.dependency-graph .dg-node rect {
  stroke: rgba(0, 0, 0, 0.15);
  stroke-width: 1px;
}
.dependency-graph .dg-node-green rect { fill: #3FA34D; }
.dependency-graph .dg-node-blue rect { fill: #2F6FB0; }
.dependency-graph .dg-node-yellow rect { fill: #E6B800; }
.dependency-graph .dg-node-orange rect { fill: #E8730C; }
.dependency-graph .dg-node-red rect { fill: #B5342A; }
.dependency-graph .dg-node-grey rect { fill: #9E9E9E; }

.dependency-graph .dg-node text {
  fill: #fff;
  font-size: 12px;
  font-family: Helvetica, Arial, sans-serif;
}
.dependency-graph .dg-node-yellow text,
.dependency-graph .dg-node-grey text {
  fill: #1a1a1a;
}

.dependency-graph .dg-node-external rect {
  stroke-dasharray: 4, 3;
  opacity: 0.65;
}
.dependency-graph .dg-node-external text {
  opacity: 0.85;
}

/* Edges (see assets/js/dependency-graph.js buildDagreGraph/draw). dagre-d3 renders each edge as a
   routed <path> inside a <g class="edgePath">; stroke color/width/dasharray are set inline per
   edge (buildDagreGraph's edgeStyle()) since dagre-d3 applies an edge's `class` option to that
   outer <g>, not the <path> itself. Kept light/thin at rest so a dense graph's edges read as
   texture rather than competing with the node labels; highlight() in dependency-graph.js
   overrides this opacity inline on hover. */
.dependency-graph .edgePath {
  opacity: 0.4;
}

.dependency-graph .dg-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 0.6rem;
  font-size: 0.85rem;
}

.dependency-graph .dg-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.dependency-graph .dg-legend-chip {
  width: 13px;
  height: 13px;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  display: inline-block;
}

.dependency-graph .dg-legend-chip-external {
  background: #9E9E9E;
  border-style: dashed;
  opacity: 0.65;
}

.dependency-graph .dg-instructions {
  font-size: 0.82rem;
  color: #555;
  margin-top: 0.5rem;
}

.dg-json-link {
  font-size: 0.8rem;
  margin: 0.25rem 0 0.5rem;
}
