/* Styles for the macro-ABM literature map (posts/abm-landscape).
   The page's colour tokens map onto the site palette from season.css, so the post follows
   the season; --c1..--c8 are the categorical colours of the nine family rows. */
:root {
  --surface-1: var(--bg);
  --surface-2: var(--soft);
  --text-primary: var(--ink);
  --text-secondary: var(--mut);
  --grid: var(--line);
  --axis: color-mix(in srgb, var(--ink) 32%, var(--bg));
  --accent: var(--link);
  --c1: #257de0; --c2: #f47230; --c3: #00a383; --c4: #d99500; --c5: #e0679a; --c6: #008a17; --c7: #6a4ce2; --c8: #e03a3b;
}

/* ---------- network figure ---------- */
figure.abm-network { margin: 1.6em 0 1em; }
/* as in the original: wide screens let it run 24px past the text column, short of the margin notes (32px) */
@media (min-width: 1200px) { figure.abm-network { margin-right: -24px; } }
figure.abm-network figcaption { color: var(--text-secondary); font-size: 0.8rem; padding: 4px 12px 0; }
#network { overflow-x: auto; }               /* phones: the network keeps its size and scrolls sideways */
#network svg { display: block; width: 100%; min-width: 760px; height: auto; }
#network .lane-band { fill: var(--surface-2); }
#network text { font-family: inherit; }
#network .label { paint-order: stroke; stroke: var(--surface-1); stroke-width: 4px; stroke-linejoin: round; }
#network .edge { fill: none; transition: opacity .15s, stroke-width .15s; }
#network .node { cursor: pointer; }
#network .node circle { transition: r .15s; }
#network .node:hover circle, #network .node:focus circle { r: 7.5; }
#network .node:focus { outline: none; }
#network .node:focus-visible .label { text-decoration: underline; }
#network.focus .edge { opacity: 0.08; }
#network.focus .edge.on { opacity: 1; stroke-width: 2.5; }
#network.focus .node { opacity: 0.25; }
#network.focus .node.on { opacity: 1; }
#network .node.self circle { r: 8; }
#network .node.self .label { text-decoration: underline; text-decoration-thickness: 1.5px; }
#network .edge.back, #network .edge.forth { stroke-opacity: 1; }

/* ---------- cite links and reference notes ---------- */
a.cite { color: inherit; text-decoration: underline dotted var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; cursor: pointer; }
a.cite:hover, a.cite.active { color: var(--accent); }
a.cite.active { background: color-mix(in srgb, var(--pri) 18%, transparent); border-radius: 3px; }

/* margin notes, level with what cites them (wide screens only; position set in the script) */
#margin { position: absolute; top: 0; width: 250px; pointer-events: none; }
@media (max-width: 1199.98px) { #margin { display: none; } }
.mnote { pointer-events: auto; position: absolute; left: 0; right: 0; font-size: 0.8rem; line-height: 1.5; color: var(--text-secondary);
  padding: 2px 0 2px 12px; border-left: 2px solid var(--pri); transition: top .15s; }
.mnote.node-note { border-left-width: 3px; }
.mnote .rp-body { color: var(--text-primary); padding-right: 18px; }
.mnote .rp-close { position: absolute; top: -2px; right: -4px; border: 0; background: none; color: var(--text-secondary); font-size: 1rem; cursor: pointer; padding: 2px 4px; }
.mnote .rp-actions { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; font-weight: 600; }
.mnote .rp-actions a, #refpanel .rp-actions a { text-decoration: none; }

/* floating card, used when the screen is too narrow for the margin */
#refpanel { position: absolute; z-index: 1040; width: 290px; max-width: calc(100vw - 16px); display: none; background: var(--surface-1); color: var(--text-primary);
  border: 1px solid var(--grid); border-left: 3px solid var(--pri); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.14);
  padding: 12px 14px 10px; font-size: 0.83rem; line-height: 1.5; }
#refpanel.open { display: block; }
#refpanel .rp-close { position: absolute; top: 4px; right: 6px; border: 0; background: none; color: var(--text-secondary); font-size: 1.1rem; cursor: pointer; line-height: 1; padding: 4px; }
#refpanel .rp-body { padding-right: 14px; }
#refpanel .rp-actions { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--grid); font-size: 0.8rem; font-weight: 600; }

/* ---------- reference list ---------- */
.abm-note { color: var(--text-secondary); font-size: 0.88rem; }
.sources { padding-left: 1.6em; font-size: 0.9rem; line-height: 1.5; }
.sources li { margin: 0 0 0.55em; padding: 4px 8px; border-radius: 6px; scroll-margin-top: 80px; transition: background .4s; }
.sources li:target { background: color-mix(in srgb, var(--pri) 18%, transparent); box-shadow: inset 3px 0 0 var(--pri); }
.sources li.hl { animation: abm-hl 2.4s ease-out; }
@keyframes abm-hl { 0%, 40% { background: color-mix(in srgb, var(--pri) 22%, transparent); box-shadow: inset 3px 0 0 var(--pri); } 100% { background: transparent; } }
.sources .tag { display: inline-block; font-size: 0.7rem; font-weight: 600; letter-spacing: .02em; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 999px; padding: 0 7px; margin-right: 4px; vertical-align: 1px; }
.sources .tag.bib { color: var(--text-secondary); border-color: var(--axis); }
.sources a.tag.net { text-decoration: none; cursor: pointer; }
.sources a.tag.net:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.sources a.ext { white-space: nowrap; font-size: 0.82rem; }

.abm-back { position: fixed; left: 18px;  /* left: the right side holds the margin notes */
   bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 1030; background: var(--surface-1); border: 1px solid var(--grid);
  border-radius: 999px; padding: 6px 14px; font-size: 0.82rem; text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
@media print { .abm-back { display: none; } #network.focus .edge, #network.focus .node { opacity: 1; } }

/* the two overview tables scroll sideways on phones instead of widening the page */
@media (max-width: 767.98px) { #quarto-document-content table { display: block; overflow-x: auto; } }
