/* Page tools for the product pages: passage numbers, outline, quote and note. Loaded with notes.js. */

.cx-desc [data-p], .cx-curious [data-p] { position: relative; scroll-margin-top: 90px; }

/* the passage number, in the left margin on wide screens */
@media (min-width: 900px) {
  .cx-desc [data-p]::before, .cx-curious [data-p]::before {
    content: attr(data-p);
    position: absolute; left: -2.9em; top: .25em; width: 2.3em;
    text-align: right; font-size: .68rem; line-height: 1.4; font-weight: 400;
    color: var(--muted, #8a93a3); opacity: .55; font-variant-numeric: tabular-nums; letter-spacing: 0;
  }
  .cx-desc li[data-p]::before, .cx-curious li[data-p]::before { left: -4.6em; }
  .cx-desc, .cx-curious { padding-left: 3.4em !important; }
}

.nx-flash { animation: nx-flash 2.4s ease-out 1; }
@keyframes nx-flash { 0% { background: #fff3b0; } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .nx-flash { animation: none; outline: 2px solid #e8c84a; } }

/* the outline */
.nx-outline { border: 1px solid var(--line, #d8dde6); border-radius: 8px; background: var(--work, #f6f8fb); padding: 10px 14px; margin: 0 0 18px; font-size: .9rem; }
.nx-outline summary { cursor: pointer; font-weight: 600; color: var(--h1, #1d3a6b); }
.nx-outline ul { margin: 10px 0 2px; padding-left: 0; list-style: none; columns: 2 260px; column-gap: 28px; }
.nx-outline li { margin: 2px 0; break-inside: avoid; font-weight: 600; }
.nx-outline li.nx-sub { margin-left: 1em; font-size: .86rem; font-weight: 400; }
.nx-outline a { color: var(--ink, #222); text-decoration: none; }
.nx-outline a:hover { text-decoration: underline; }
.nx-bar { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; margin-top: 8px; font-size: .84rem; color: var(--muted, #6b7280); }
.nx-bar a { color: var(--blue, #2a579a); }

/* Contents: the project's file listing (contents_pass.py) */
.cx-contents summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; color: var(--h1, #1d3a6b); }
.cx-contents summary small { font-weight: 400; font-size: .82rem; color: var(--muted, #6b7280); margin-left: 8px; }
.cx-tree-note { margin: 10px 0 0; font-size: .88rem; color: var(--muted, #6b7280); }
.cx-tree { margin-top: 12px; max-height: 70vh; overflow: auto; font: .82rem/1.5 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }
.cx-tree ul { list-style: none; margin: 0; padding-left: 1.3em; border-left: 1px solid var(--line, #d8dde6); }
.cx-tree > ul { padding-left: 0; border-left: 0; }
.cx-tree li { margin: 1px 0; overflow-wrap: anywhere; }
.cx-tree li.d > b { color: var(--h1, #1d3a6b); font-weight: 600; }
.cx-tree li span { color: var(--muted, #6b7280); margin-left: .6em; white-space: nowrap; }
.cx-tree li.more { color: var(--muted, #6b7280); font-style: italic; }

/* the small tab that follows the passage under the pointer */
#nx-chip {
  position: absolute; z-index: 30; display: none;
  font: 600 .72rem/1 Arial, Helvetica, sans-serif; letter-spacing: .02em;
  padding: 5px 8px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--blue, #2a579a); background: #fff; color: var(--blue, #2a579a);
  box-shadow: 0 2px 8px rgba(30, 50, 90, .15);
}
#nx-chip:hover, #nx-chip:focus { background: var(--blue, #2a579a); color: #fff; outline: none; }

#nx-menu {
  position: absolute; z-index: 31; display: none; width: min(340px, calc(100vw - 24px));
  background: #fff; color: var(--ink, #222); border: 1px solid var(--line, #d8dde6); border-radius: 10px;
  box-shadow: 0 12px 34px rgba(30, 50, 90, .22); padding: 12px; font: .88rem/1.45 Arial, Helvetica, sans-serif;
}
#nx-menu h4 { margin: 0 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted, #6b7280); font-weight: 600; }
#nx-menu .nx-q { font-size: .82rem; color: var(--muted, #6b7280); border-left: 3px solid var(--line, #d8dde6); padding-left: 8px; margin: 0 0 10px; max-height: 5.8em; overflow: hidden; }
#nx-menu button, #nx-menu a.nx-btn {
  display: block; width: 100%; text-align: left; margin: 4px 0; padding: 8px 10px; cursor: pointer;
  border: 1px solid var(--line, #d8dde6); border-radius: 6px; background: #fff; color: var(--ink, #222);
  font: inherit; text-decoration: none; box-sizing: border-box;
}
#nx-menu button:hover, #nx-menu a.nx-btn:hover { border-color: var(--blue, #2a579a); }
#nx-menu button.nx-go { background: var(--blue, #2a579a); border-color: var(--blue, #2a579a); color: #fff; }
#nx-menu textarea { width: 100%; min-height: 84px; box-sizing: border-box; font: inherit; padding: 8px; border: 1px solid var(--line, #d8dde6); border-radius: 6px; resize: vertical; }
#nx-menu .nx-msg { font-size: .8rem; color: var(--muted, #6b7280); margin-top: 6px; min-height: 1.2em; }

/* a saved note, shown under its passage to the member who wrote it */
.nx-note {
  display: block; margin: 8px 0 4px; padding: 8px 10px; border-left: 3px solid #e8c84a; background: #fffbe6;
  font: .86rem/1.45 Arial, Helvetica, sans-serif; color: #3b3521; border-radius: 0 6px 6px 0; white-space: normal;
}
.nx-note b { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #8a7a2e; margin-bottom: 2px; font-weight: 600; }
.nx-note i { display: block; font-style: normal; color: #6b6440; font-size: .8rem; margin-bottom: 4px; }
.nx-note button { margin-top: 6px; padding: 2px 8px; font: inherit; font-size: .76rem; cursor: pointer; border: 1px solid #d8c97a; background: transparent; border-radius: 4px; color: #6b6440; }

/* the My notes page */
.nx-list { max-width: 820px; }
.nx-list h2 { font-size: 1.1rem; margin: 26px 0 8px; }
.nx-list h2 a { color: var(--h1, #1d3a6b); text-decoration: none; }
.nx-item { border: 1px solid var(--line, #d8dde6); border-radius: 8px; background: var(--panel, #fff); padding: 12px 14px; margin: 8px 0; }
.nx-item blockquote { margin: 0 0 8px; padding-left: 10px; border-left: 3px solid var(--line, #d8dde6); color: var(--muted, #5b6472); font-size: .92rem; }
.nx-item p { margin: 0 0 8px; }
.nx-item .nx-meta { font-size: .8rem; color: var(--muted, #6b7280); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.nx-item .nx-meta button { font: inherit; cursor: pointer; border: 1px solid var(--line, #d8dde6); background: transparent; border-radius: 4px; padding: 2px 8px; color: inherit; }
