/* -------------------------------------------------------------------------- */
/*                     06-components/_network-modal.css                       */
/*   Memory: "What Gyrus remembers", the d3 graph drawn in app.js. Opened    */
/*   from the rail.                                                           */
/*   Node type is shown by shape and weight in text colours; the accent       */
/*   marks only the node the user selected.                                   */
/* -------------------------------------------------------------------------- */

.network-modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: none;
}

.network-modal.is-visible {
  display: flex;
}

.network-modal__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.25);
}

.network-modal__content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: calc(100% - var(--space-6));
  max-width: var(--width-wide);
  height: calc(100% - var(--space-7) * 2);
  margin: auto;
}

.network-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
}

.network-modal__heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.network-modal__title {
  margin: 0;
  font-size: var(--font-size-display);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

.network-modal__subtitle {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-ink-muted);
}

.network-modal__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.network-graph {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 var(--space-5);
  border-radius: var(--radius-button);
  background-color: var(--color-ground);
  overflow: hidden;
}

.network-graph__container {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.network-graph__container svg {
  display: block;
  cursor: grab;
}

.network-graph__empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-4);
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-ink-muted);
}

.network-graph__empty strong {
  font-size: var(--font-size-title);
  font-weight: var(--font-weight-semibold);
  color: var(--color-ink);
}

.network-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5) var(--space-4);
}

/* One-line legend under the title: searches, topics, links. */
.network-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-ink-muted);
}

.network-legend__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.network-legend__item svg {
  width: var(--space-3);
  height: var(--space-3);
}

/* Graph marks (d3 SVG and legend). */
.graph-link {
  stroke: var(--color-hairline);
  stroke-width: 1;
}

.graph-link.is-highlighted {
  stroke: var(--color-accent);
}

.graph-node--concept {
  fill: var(--color-ink);
  stroke: none;
}

.graph-node--query {
  fill: var(--color-ground);
  stroke: var(--color-ink);
  stroke-width: 2;
}

.graph-node--link {
  fill: var(--color-ink-muted);
  stroke: none;
}

.network-graph__container .graph-node {
  cursor: pointer;
}

.graph-node.is-selected {
  fill: var(--color-accent);
  stroke: var(--color-accent);
}

.graph-label {
  fill: var(--color-ink-muted);
  font-size: var(--font-size-caption);
  pointer-events: none;
}

.graph-label--concept {
  fill: var(--color-ink);
  font-weight: var(--font-weight-semibold);
}

.graph-label.is-selected {
  fill: var(--color-accent);
}
