/* Admin blog interlink map (force-directed graph, rendered by the
   interlink_graph Stimulus controller with d3). */

.interlink-graph-card .card-body {
  position: relative;
  min-height: 640px;
}

/* Mobile: extra breathing room at the page edges. */
@media (max-width: 767.98px) {
  .interlinks-page {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}
@media (max-width: 575.98px) {
  .interlinks-page {
    padding-left: 1.75rem;
    padding-right: 1.75rem;
  }
}

.interlink-graph {
  position: relative;
  height: 620px;
  width: 100%;
  background: #fafaf7;
  border-radius: 0.5rem;
  overflow: hidden;
}

.interlink-svg {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.interlink-svg:active {
  cursor: grabbing;
}

.interlink-node {
  stroke: #ffffff;
  stroke-width: 1.5px;
  cursor: pointer;
}

/* Green: post contains offsite (absolute http(s)) links. */
.interlink-node--has-external {
  fill: #2f6f4e;
}

/* Red: no external links. */
.interlink-node--no-external {
  fill: #b0442f;
}

.interlink-node:hover {
  stroke: var(--primary-color, #6a4d8a);
  stroke-width: 2px;
}

/* Orphan posts (no internal links) render hollow, keeping their color. */
.interlink-node--orphan {
  fill: transparent;
}

.interlink-node--orphan.interlink-node--has-external {
  stroke: #2f6f4e;
}

.interlink-node--orphan.interlink-node--no-external {
  stroke: #b0442f;
}

.interlink-node--orphan:hover {
  stroke-width: 2px;
}

.interlink-edge {
  stroke: #8aa694;
  stroke-opacity: 0.55;
  marker-end: url(#interlink-arrow);
}

.interlink-edge--hot {
  stroke: #2f6f4e;
  stroke-opacity: 1;
}

.interlink-edge--dim {
  stroke: #d7ddd8;
  stroke-opacity: 0.4;
}

.interlink-arrow {
  fill: #8aa694;
}

.interlink-label {
  font-size: 11px;
  fill: #4a5550;
  paint-order: stroke;
  stroke: #fafaf7;
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
}

.interlink-label--hot {
  fill: #1c3527;
  font-weight: 600;
}

.interlink-label--dim {
  fill: #b7c2bc;
}

.interlink-legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2f6f4e;
  border: 1.5px solid #ffffff;
}

.interlink-legend-dot--orphan {
  background: transparent;
  border: 1.5px solid #b0442f;
}

.interlink-legend-dot--green {
  background: #2f6f4e;
}

.interlink-legend-dot--red {
  background: #b0442f;
}

.interlink-legend-line {
  display: inline-block;
  width: 36px;
  height: 2px;
  background: #8aa694;
  position: relative;
}

.interlink-legend-line::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  border-left: 7px solid #8aa694;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.interlink-tooltip {
  position: absolute;
  display: none;
  max-width: 260px;
  padding: 8px 10px;
  background: #1c3527;
  color: #ffffff;
  font-size: 12px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 1050;
  line-height: 1.4;
}

.interlink-tooltip--visible {
  display: block;
}

.interlink-tooltip-orphan {
  margin-top: 2px;
  font-style: italic;
  color: #f0c896;
}
