/* /css/notes.css
   Notes pane + DSB styling + verified-xref styling + xref popup styling
*/

/* -----------------------------
   Notes pane layout (header fixed, body scroll)
------------------------------ */
.paneNotes{
  display: flex;
  flex-direction: column;
  min-height: 0; /* critical for iOS + nested scrollers */
}

.notesBody{
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  -webkit-overflow-scrolling: touch;
}

/* -----------------------------
   Note card
------------------------------ */
.noteCard{
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 14px;
}

.noteTitle{
  font-weight: 700;
  margin-bottom: 8px;
}

.noteText{
  color: var(--text);
  line-height: 1.55;
}

/* DSB rendering */
.noteP{
  margin: 0 0 10px;
  line-height: 1.55;
}

/* -----------------------------
   XRefs (IMPORTANT):
   - markup.js outputs [[...]] as .mk-xref (neutral)
   - notes.js upgrades VERIFIED refs → adds .xrefLink + data-xref
------------------------------ */

/* Neutral marker (default — NOT a link) */
.mk-xref{
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
  cursor: default;
  opacity: 1;
  white-space: nowrap;
}

/* Back-compat neutral span */
.xref{
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
  cursor: default;
  opacity: 1;
  white-space: nowrap;

  -webkit-tap-highlight-color: transparent;
  -webkit-text-fill-color: currentColor;
}

/* VERIFIED xref — subtle, no underline */
.xrefLink{
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;

  /* NO underline */
  text-decoration: none;

  /* slight visual distinction */
  opacity: 0.9;

  -webkit-tap-highlight-color: rgba(37,99,235,.18);
  -webkit-text-fill-color: currentColor;
}

/* Hover: gentle emphasis, still restrained */
@media (hover:hover){
  .xrefLink:hover{
    opacity: 1;
    color: color-mix(in oklab, var(--accent) 85%, var(--text));
  }
}

/* Keyboard accessibility */
.xrefLink:focus-visible{
  outline: 2px solid color-mix(in oklab, var(--accent) 45%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* -----------------------------
   Notes header reference (top right)
------------------------------ */
.notesRef{
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
  text-align: right;
}

/* -----------------------------
   Imported-note label (@@MAT13:4)
------------------------------ */
.noteImportLabel{
  margin: 10px 0 6px;
  padding: 6px 10px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-size: 13px;
  border-radius: 12px;
  background: var(--surface);
}

/* -----------------------------
   XRef popup (hover / tap)
------------------------------ */
.xrefPopup{
  position: absolute;
  z-index: 50;

  max-width: min(92vw, 420px);

  background: var(--surface);
  color: var(--text);

  border: 1px solid var(--rule);
  border-radius: 16px;

  padding: 12px 14px;

  /* elevation */
  box-shadow:
    0 12px 28px rgba(0,0,0,.14),
    0 4px 10px rgba(0,0,0,.08);

  line-height: 1.5;
}

/* Anchor nub */
.xrefPopup::after{
  content: "";
  position: absolute;
  top: -6px;
  left: 18px;
  width: 12px;
  height: 12px;

  background: var(--surface);
  border-left: 1px solid var(--rule);
  border-top: 1px solid var(--rule);

  transform: rotate(45deg);
}

/* Popup content */
.xrefPopupCard{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Reference line (clickable navigation) */
.xrefPopupRef{
  display: inline-block;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}

@media (hover:hover){
  .xrefPopupRef:hover{
    color: var(--accent);
  }
}

/* Verse text */
.xrefPopupText{
  font-size: 15px;
  color: var(--text);
}
