/* ══════════════════════════════════════════════════════════════
   GLOBAL — applies to every page
   ══════════════════════════════════════════════════════════════ */

/* ── NAVBAR ── */
.navbar {
  background-color: #2E86B5 !important;
}

.navbar-brand {
  color: #fff !important;
}

.navbar-brand:hover {
  color: #fff !important;
}

.navbar-nav .nav-link {
  color: #fff !important;
}

.navbar-nav .nav-link:hover {
  color: #f0f0f0 !important;
}

/* ── NAV CARD BUTTONS ── */
.btn-outline-primary {
  color: #2E86B5 !important;
  border-color: #2E86B5 !important;
}

.btn-outline-primary:hover {
  background-color: #2E86B5 !important;
  border-color: #2E86B5 !important;
  color: #fff !important;
}

.card:hover {
  border-color: #2E86B5 !important;
}

/* ── REFERENCES ── */
#refs a {
  color: inherit;
  text-decoration: none;
  pointer-events: none;
}
a[href^="#ref-"] {
  color: inherit;
  text-decoration: none;
}
a[href^="#ref-"]:hover {
  text-decoration: underline;
  cursor: pointer;
}

/* ── REMOVE BOOTSTRAP STRIPING, RESTORE GREY HEADER ── */
.table-striped > thead > tr > th,
.table-striped > thead > tr > td,
table.table-striped thead th,
table.table-striped thead td {
  background: #f7f7f7 !important;
  color: #333 !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > *,
.table-striped > tbody > tr:nth-of-type(even) > * {
  background-color: transparent !important;
  --bs-table-accent-bg: transparent !important;
  --bs-table-striped-bg: transparent !important;
}


/* ══════════════════════════════════════════════════════════════
   MANUSCRIPT ONLY — scoped to .manuscript-page body class
   ══════════════════════════════════════════════════════════════ */

/* ── SUPPRESS TOC TOGGLE BUTTON ── */
.manuscript-page .quarto-toc-toggle,
.manuscript-page #quarto-toc-toggle,
.manuscript-page button.quarto-toc-toggle,
.manuscript-page .toc-actions,
.manuscript-page nav.toc-actions,
.manuscript-page #quarto-sidebar-toc-toggle,
.manuscript-page details.toc-sidebar,
.manuscript-page details > summary.toc-toggle {
  display: none !important;
}

/* ── TOC SIDEBAR ──
   Quarto places the TOC in #quarto-margin-sidebar on the right by default.
   We reposition it into grid column 1 (left) without touching .page-columns.
── */
.manuscript-page #quarto-margin-sidebar {
  grid-column: 1 !important;
  grid-row: 1 !important;
  position: sticky !important;
  top: 0 !important;
  height: 100vh !important;
  overflow-y: auto !important;
  width: 200px !important;
  min-width: 200px !important;
  max-width: 200px !important;
  border-right: 1px solid #e0e0e0 !important;
  border-left: none !important;
  background: transparent !important;
  padding: 0 !important;
}

/* ── TOC NAV typography ── */
.manuscript-page #quarto-margin-sidebar nav,
.manuscript-page #quarto-margin-sidebar #TOC,
.manuscript-page #quarto-margin-sidebar nav[role="doc-toc"] {
  font-size: 13px !important;
  padding: 20px 16px !important;
  display: block !important;
  pointer-events: auto !important;
}

/* ── MAIN CONTENT ──
   Leave Quarto's page grid intact; just ensure content doesn't overflow.
── */
.manuscript-page #quarto-content {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.manuscript-page main.content,
.manuscript-page #quarto-document-content {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* ── PREVENT WIDE COLUMN CLASSES FROM OVERFLOWING ──
   Covers all outset/page/screen/inset variants.
   left: 0 + position: relative anchors them to the content column
   so they don't bleed past the left edge of the page.
── */
.manuscript-page .column-body-outset,
.manuscript-page .column-body-outset-left,
.manuscript-page .column-body-outset-right,
.manuscript-page .column-page,
.manuscript-page .column-page-left,
.manuscript-page .column-page-right,
.manuscript-page .column-screen,
.manuscript-page .column-screen-left,
.manuscript-page .column-screen-right,
.manuscript-page .column-screen-inset,
.manuscript-page .column-screen-inset-left,
.manuscript-page .column-screen-inset-right,
.manuscript-page .column-screen-inset-shaded {
  max-width: 100% !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  /* Prevent negative-margin bleed past the left content edge */
  position: relative !important;
  left: 0 !important;
  transform: none !important;
}

/* ── TABLE 3 / screen-inset overflow fix ── */
.manuscript-page .column-screen-inset div.cell-output-display,
.manuscript-page .column-screen-inset div.cell-output {
  overflow: visible !important;
  width: 100% !important;
  max-width: 100% !important;
}

.manuscript-page .column-screen-inset table {
  margin-left: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* ── TABLE CONTAINER: no scrollbars ── */
.manuscript-page div.cell-output-display,
.manuscript-page div.cell-output {
  width: 100% !important;
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
}

/* ── KABLE CURVED BORDER ── */
.manuscript-page div.cell-output-display table,
.manuscript-page div.cell-output table {
  border: 1px solid #ddd;
  border-radius: 10px;
  border-collapse: separate !important;
  border-spacing: 0;
  overflow: visible !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  margin-top: 16px;
  margin-left: 0 !important;
  font-size: 12px;
  width: 100% !important;
}

/* ── ROUNDED TOP CORNERS ── */
.manuscript-page div.cell-output-display thead tr:first-child th:first-child,
.manuscript-page div.cell-output thead tr:first-child th:first-child {
  border-top-left-radius: 10px;
}
.manuscript-page div.cell-output-display thead tr:first-child th:last-child,
.manuscript-page div.cell-output thead tr:first-child th:last-child {
  border-top-right-radius: 10px;
}

/* ── TABLE HEADER ── */
.manuscript-page div.cell-output-display thead th,
.manuscript-page div.cell-output thead th {
  background: #f7f7f7;
  border-bottom: 2px solid #ddd;
  border-top: none;
  padding: 8px 10px !important;
  font-weight: 600;
  color: #333;
  text-align: center !important;
  line-height: 1.4;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

/* ── TABLE ROWS ── */
.manuscript-page div.cell-output-display tbody td,
.manuscript-page div.cell-output tbody td {
  border-bottom: 1px solid #f0f0f0;
  border-top: none !important;
  padding: 5px 10px !important;
  color: #333;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

/* ── REMOVE LAST ROW BORDER ── */
.manuscript-page div.cell-output-display tbody tr:last-child td,
.manuscript-page div.cell-output tbody tr:last-child td {
  border-bottom: none !important;
}

/* ── ROW HOVER ── */
.manuscript-page div.cell-output-display tbody tr:hover td,
.manuscript-page div.cell-output tbody tr:hover td {
  background: rgba(46,134,181,0.08) !important;
}

/* ── WIDE INTERACTIVE TABLE ── */
.manuscript-page #tbl-outer {
  position: relative;
  z-index: 50;
  width: 100% !important;
  overflow: visible !important;
}