/* Site-level polish for public documentation pages. */

:root {
  --site-muted-border: #d9dee7;
  --site-muted-bg: #f7f9fc;
}

.quarto-title-block .quarto-title-tools-only h1:empty {
  display: none;
}

main.content {
  overflow-wrap: anywhere;
}

table {
  table-layout: auto;
  width: 100%;
}

th,
td {
  vertical-align: top;
  overflow-wrap: anywhere;
}

td {
  max-width: 42rem;
}

.table-sm td,
.table-sm th {
  padding: 0.35rem 0.45rem;
}

details {
  border: 1px solid var(--site-muted-border);
  border-radius: 6px;
  margin: 0.75rem 0;
  padding: 0.75rem 0.9rem;
  background: var(--site-muted-bg);
}

details summary {
  cursor: pointer;
  font-weight: 600;
}

details[open] summary {
  margin-bottom: 0.65rem;
}

.callout-note,
.callout-tip,
.callout-important,
.callout-warning {
  overflow-wrap: anywhere;
}

.ledger-detail {
  border-top: 1px solid var(--site-muted-border);
  margin-top: 1.25rem;
  padding-top: 1rem;
}

/* Suppress "Anchor" text leakage in headings.
 * Quarto's anchorjs library appends an <a class="anchorjs-link">Anchor</a>
 * element after each heading's text. Some Quarto theme versions render the
 * accessible-name "Anchor" as visible text inside the heading (e.g.,
 * "What Was EvaluatedAnchor"). Hide the link's text content; keep the link
 * clickable via a hover-only "#" pseudo-element. */
.anchorjs-link {
  font-size: 0 !important;
}
.anchorjs-link::before {
  content: "#";
  font-size: 1rem;
  margin-left: 0.25em;
  color: var(--site-muted-border);
  opacity: 0;
  transition: opacity 0.15s;
}
h1:hover .anchorjs-link::before,
h2:hover .anchorjs-link::before,
h3:hover .anchorjs-link::before,
h4:hover .anchorjs-link::before,
h5:hover .anchorjs-link::before,
h6:hover .anchorjs-link::before {
  opacity: 1;
}

/* Mobile-narrow viewport: ensure long monospace tokens wrap rather than
 * force horizontal page overflow. Default `code` styling uses
 * `white-space: pre` which prevents wrapping; we override on mobile.
 *
 * v1.3.2 P3-2 introduced this rule for `table code` (fixed RESULTS §7
 * raw-artifacts table overflow). v1.3.4 §3.B extends to all `<code>`
 * elements after the visual audit found inline `<code>` in prose
 * paragraphs (e.g., `AutoModelForSequenceClassification.from_pretrained`,
 * `evals/predictions/<rung>__fold0__seed42__*.parquet`) causing 136px
 * mobile overflow on `WRITEUP/reproducibility.html`. */
@media (max-width: 480px) {
  code,
  pre code,
  table code,
  td code,
  th code {
    overflow-wrap: anywhere;
    word-break: break-all;
    white-space: normal;
  }
}
