/* Bretz Markup — rendering styles for vision-OCR tagged field notebook text.
   Uses bm- prefix to avoid collisions with main app styles.
   Designed for dark-theme notebook viewer (--tb-* variables from main CSS). */

/* ── Inline formatting ─────────────────────────────────────────── */

.bm-underline {
  text-decoration: underline;
  text-decoration-color: rgba(232, 220, 184, 0.5);
  text-underline-offset: 2px;
}

.bm-red-ul {
  text-decoration-color: #c1502e;
}

.bm-struck {
  text-decoration: line-through;
  opacity: 0.5;
  color: var(--tb-ink-2, #a89d80);
}

.bm-caret {
  font-size: 0.75em;
  color: #7cb3a3;
  vertical-align: super;
}
.bm-caret::before { content: '\2038'; font-size: 0.8em; opacity: 0.5; }

.bm-interlinear {
  font-size: 0.85em;
  color: #7cb3a3;
  border-bottom: 1px dotted rgba(124, 179, 163, 0.4);
}
.bm-interlinear::before { content: '\2191 '; font-size: 0.7em; opacity: 0.4; }

.bm-overtype {
  color: #d4a06a;
  border-bottom: 1px dashed rgba(212, 160, 106, 0.4);
}

.bm-uncertain {
  color: var(--tb-ink-2, #a89d80);
  border-bottom: 1px dotted rgba(168, 157, 128, 0.5);
  cursor: help;
}

.bm-illegible {
  font-style: italic;
  color: rgba(168, 157, 128, 0.6);
  font-size: 0.9em;
}

.bm-circled {
  border: 1.5px solid rgba(232, 220, 184, 0.4);
  border-radius: 50%;
  padding: 0 4px;
}

.bm-red {
  color: #c1502e;
}

.bm-later {
  color: #8a9eb5;
  font-style: italic;
}
.bm-later::before { content: '\270E '; font-size: 0.8em; opacity: 0.5; }

.bm-blank-field {
  color: rgba(168, 157, 128, 0.5);
  font-style: italic;
}
.bm-blank-field::before { content: '['; }
.bm-blank-field::after { content: ']'; }

/* ── Aside / margin notes ──────────────────────────────────────── */

.bm-margin, .bm-footnote {
  display: block;
  margin: 6px 0;
  padding: 4px 8px 4px 10px;
  border-left: 2px solid rgba(124, 179, 163, 0.4);
  background: rgba(124, 179, 163, 0.06);
  font-size: 0.9em;
  color: #7cb3a3;
}

.bm-footnote {
  border-left-color: rgba(168, 157, 128, 0.4);
  background: rgba(168, 157, 128, 0.06);
  color: var(--tb-ink-2, #a89d80);
}

.bm-aside-label {
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin-right: 6px;
}

/* ── Sketch placeholder ────────────────────────────────────────── */

.bm-sketch {
  display: block;
  margin: 10px 0;
  padding: 12px 14px;
  border: 1px dashed rgba(232, 220, 184, 0.2);
  border-radius: 4px;
  background: rgba(232, 220, 184, 0.04);
}

.bm-sketch-icon {
  font-size: 16px;
  margin-bottom: 4px;
  opacity: 0.5;
}

.bm-sketch figcaption {
  font-size: 0.85em;
  line-height: 1.5;
  color: var(--tb-ink-2, #a89d80);
  font-style: italic;
}

.bm-sketch-bounded {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* ── Table ─────────────────────────────────────────────────────── */

.bm-table {
  display: block;
  margin: 6px 0;
  padding: 8px 10px;
  background: rgba(232, 220, 184, 0.04);
  border: 1px solid rgba(232, 220, 184, 0.1);
  border-radius: 3px;
  font-size: 0.9em;
  overflow-x: auto;
}

/* ── Stamps & page markers ─────────────────────────────────────── */

.bm-stamp {
  font-size: 0.75em;
  color: rgba(168, 157, 128, 0.5);
  font-family: var(--mono-font, monospace);
  margin-bottom: 4px;
}
.bm-stamp-top-right { text-align: right; }
.bm-stamp-top-left { text-align: left; }

.bm-page-marker {
  font-size: 0.8em;
  color: rgba(168, 157, 128, 0.5);
  text-align: center;
  margin: 4px 0;
}

/* ── Structural / page-level ───────────────────────────────────── */

.bm-blank-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  color: rgba(168, 157, 128, 0.4);
  font-style: italic;
  font-size: 0.9em;
}

.bm-duplicate {
  color: rgba(168, 157, 128, 0.5);
  font-style: italic;
  font-size: 0.85em;
  text-align: center;
  margin: 8px 0;
}

.bm-rotated {
  color: rgba(168, 157, 128, 0.4);
  font-size: 0.8em;
  text-align: center;
}

.bm-archive-label {
  display: block;
  margin: 6px 0;
  padding: 4px 8px;
  border-left: 2px solid rgba(168, 157, 128, 0.3);
  background: rgba(168, 157, 128, 0.04);
  font-size: 0.8em;
  color: rgba(168, 157, 128, 0.6);
}

.bm-insert {
  display: block;
  margin: 6px 0;
  padding: 4px 8px 4px 10px;
  border-left: 2px solid rgba(212, 160, 106, 0.4);
  background: rgba(212, 160, 106, 0.06);
  font-size: 0.9em;
  color: #d4a06a;
}

/* ── Vline-red (vertical red line marking published passages) ──── */

.bm-vline-red {
  border-left: 3px solid rgba(193, 80, 46, 0.35);
  padding-left: 8px;
  margin-left: -3px;
}

/* ── Misc ──────────────────────────────────────────────────────── */

.bm-bleed, .bm-cropped {
  font-size: 0.75em;
  color: rgba(168, 157, 128, 0.4);
  font-style: italic;
}

.bm-contd {
  font-size: 0.8em;
  color: rgba(168, 157, 128, 0.5);
  font-style: italic;
}

.bm-unknown {
  color: rgba(168, 157, 128, 0.5);
  font-size: 0.9em;
}

/* ── Positioned blocks ([pos y= x=] tags) ─────────────────────── */

.bm-pos-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.bm-pos {
  position: absolute;
  left: 0;
  width: 100%;
  white-space: pre-wrap;
}
