/* names: styles of this study feature only (see docs/STUDY_FEATURES_PLAN.md §7). */

/* ───────── spotlight: everything dims, the target (lifted by pages::names::spotlight_css) stays ───────── */
html .text.spot :is(.tx, .wg, .sp, [class*="t-"]) { color: color-mix(in srgb, var(--fg) 32%, var(--bg)) !important; }
html .text.spot .tx { transition: color .25s ease; }
@keyframes spot-flash { 0%, 35% { box-shadow: 0 0 0 .3em color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 3px; } 100% { box-shadow: 0 0 0 .3em transparent; } }
.text .spot-flash { animation: spot-flash 1.1s ease-out; }

.spot-pill {
  position: fixed; z-index: 45; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 2px; max-width: calc(100vw - 24px); padding: 3px 4px 3px 14px;
  background: var(--card); color: var(--fg); border: 1px solid var(--rule); border-radius: 999px; box-shadow: var(--shadow);
  font: 500 .84rem/1.2 var(--sans); animation: pop .18s ease-out;
}
@media (max-width: 699px) { .spot-pill { bottom: calc(72px + env(safe-area-inset-bottom)); } }
.spot-dot { color: var(--accent); margin-right: 6px; font-size: .9em; }
.spot-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 4px; }
.spot-label strong { font-weight: 650; }
.spot-n { color: var(--muted); }
@media print { .spot-pill { display: none; } }

/* the legend: a label is a spotlight button */
.lg-spot-hint { font-size: .74rem; color: var(--muted); margin: -2px 0 6px; padding: 0 2px; }
.legend-item .lg-text { cursor: pointer; }

/* ───────── the word popover's name tab ───────── */
.nm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.nm-name { font-family: var(--serif); font-size: 1.35rem; font-weight: 560; }
.nm-kind { font: 600 .64rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.nm-brief { font-family: var(--serif); font-size: .98rem; line-height: 1.5; margin: 4px 0 6px; color: var(--fg2); }
.nm-also { font-size: .8rem; color: var(--fg2); margin: 0 0 6px; }
.nm-k { font: 600 .64rem/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.nm-rel { display: grid; gap: 4px; margin: 8px 0; }
.nm-rel-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.nm-rel-row .nm-k { min-width: 5.6em; }
.nm-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.nm-chip { border: 1px solid var(--rule); background: none; color: var(--fg); border-radius: 99px; padding: 3px 10px; font: 500 .78rem/1.3 var(--sans); cursor: pointer; }
.nm-chip:hover { background: var(--rule2); }
.nm-uses { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--rule2); }
.nm-count { font-size: .78rem; color: var(--muted); margin: 6px 0 8px; }
.nm-count strong { color: var(--fg); font-weight: 650; }
.nm-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.nm-actions .pill { min-height: 32px; padding: 0 12px; font-size: .8rem; gap: 6px; }
.nm-actions .pill .ic { width: 15px; height: 15px; }
.nm-actions .pill.on { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--fg); border-color: transparent; }
.nm-dot { color: var(--accent); font-size: .85em; }

/* ───────── /name/{id} ───────── */
.name-page .nm-page-head { margin-bottom: .4rem; }
.name-page .page-title { margin-bottom: .4rem; }
.nm-text { font-family: var(--serif); font-size: 1.06rem; line-height: 1.7; }
.nm-short { margin: .6rem 0; }
.nm-more { margin: .4rem 0 1rem; }
.nm-more summary { cursor: pointer; font: 600 .82rem/1.4 var(--sans); color: var(--accent); list-style: none; display: inline-flex; gap: 4px; }
.nm-more summary::-webkit-details-marker { display: none; }
.nm-more summary::after { content: "›"; transition: transform .15s ease; }
.nm-more[open] summary::after { transform: rotate(90deg); }
.nm-src { color: var(--muted); font-weight: 500; }
.nm-more p { color: var(--fg2); font-size: 1rem; }
.nm-map { font-size: .88rem; }
.nm-mentions { margin-top: 1.6rem; }
.nm-total { margin-left: 8px; color: var(--faint); letter-spacing: 0; }
.nm-filter { margin: 8px 0 0; border: 0; background: var(--rule2); color: var(--fg2); border-radius: 99px; padding: 5px 12px; font: 600 .78rem/1 var(--sans); cursor: pointer; }
.nm-hits { margin-top: 8px; }
.nm-book { font: 650 .66rem/1.2 var(--sans); letter-spacing: .15em; text-transform: uppercase; color: var(--muted); margin: 18px 0 2px; }
.nm-more-btn { margin: 14px 0; }
.nm-credit { margin-top: 2.4rem; font-size: .74rem; color: var(--muted); line-height: 1.5; }
.name-page .sr-only, .nm-filter .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── search: people and places ───────── */
.nm-search { margin: 0 0 14px; }
.nm-search .panel-h { margin-top: 4px; }
.nm-search ul { list-style: none; margin: 0; padding: 0; }
.nm-row { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 10px; padding: 8px 6px; border-radius: 8px; text-decoration: none; color: var(--fg); }
.nm-row:hover { background: var(--bg2); }
.nm-row-name { font-family: var(--serif); font-weight: 600; }
.nm-row-brief { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nm-row-n { font: 600 .72rem/1 var(--sans); color: var(--faint); }

/* ───────── book overview: who and what, chapter by chapter ───────── */
.ov-dist { margin-top: 2.4rem; max-width: 60rem; }
.ov-dist .ov-hint { margin: -2px 0 12px; }
.od-grid { display: grid; gap: 5px; }
.od-row { display: grid; grid-template-columns: minmax(7.5rem, 11rem) 1fr; align-items: center; gap: 10px; }
.od-label { display: flex; align-items: center; gap: 7px; min-width: 0; text-decoration: none; color: var(--fg2); font-size: .8rem; }
.od-label:hover .od-name { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }
.od-sw { width: 9px; height: 9px; border-radius: 50%; background: var(--oc); flex: none; }
.od-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.od-n { font: 600 .66rem/1 var(--sans); color: var(--faint); }
.od-strip { display: flex; gap: 1px; height: 16px; min-width: 0; }
.od-cell { flex: 1 1 0; min-width: 0; border-radius: 2px; background: color-mix(in srgb, var(--oc) var(--s), transparent); }
.od-cell.zero { background: var(--rule2); opacity: .55; }
.od-cell:hover { outline: 1.5px solid var(--fg); outline-offset: 0; }
.od-axis .od-strip { height: auto; }
.od-tick { flex: 1 1 0; min-width: 0; font: 500 .6rem/1 var(--sans); color: var(--faint); overflow: visible; white-space: nowrap; }
@media (max-width: 520px) {
  .od-row { grid-template-columns: 1fr; gap: 3px; }
  .od-axis .od-label { display: none; }
  .od-grid { gap: 9px; }
}
