/* Override link colors to match red theme */
.md-typeset a,
.md-typeset a:link,
.md-typeset a:visited {
  color: #ffffff !important;
  text-decoration: underline;
}

.md-typeset a:hover,
.md-typeset a:active {
  color: #ef5350 !important;
}

/* Navigation links */
.md-nav__link {
  color: #bdbdbd !important;
  text-decoration: none !important;
}

.md-nav__link--active,
.md-nav__link:focus,
.md-nav__link:hover,
.md-nav__item--active > .md-nav__link {
  color: #ef5350 !important;
}

/* Custom admonition for Claude-written content */
.md-typeset .admonition.claude,
.md-typeset details.claude {
  border-color: #b71c1c;
}

.md-typeset .claude > .admonition-title,
.md-typeset .claude > summary {
  background-color: rgba(183, 28, 28, 0.1);
}

.md-typeset .claude > .admonition-title::before,
.md-typeset .claude > summary::before {
  background-color: #b71c1c;
  -webkit-mask-image: var(--md-admonition-icon--claude);
          mask-image: var(--md-admonition-icon--claude);
}

:root {
  --md-admonition-icon--claude: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2M7.5 13A2.5 2.5 0 0 0 5 15.5A2.5 2.5 0 0 0 7.5 18a2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 7.5 13m9 0a2.5 2.5 0 0 0-2.5 2.5a2.5 2.5 0 0 0 2.5 2.5a2.5 2.5 0 0 0 2.5-2.5a2.5 2.5 0 0 0-2.5-2.5z"/></svg>');
}

@media print {
  @page {
    margin: 0.75in;
  }

  /* Honor our print colors instead of letting the browser strip backgrounds */
  *,
  *::before,
  *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide site chrome */
  .md-header,
  .md-tabs,
  .md-sidebar,
  .md-footer,
  .md-search,
  .md-content__button,
  .md-top,
  .md-skip,
  .md-source,
  .md-dialog,
  nav.md-tags {
    display: none !important;
  }

  /* Force light backgrounds and dark text regardless of slate theme */
  html,
  body,
  .md-main,
  .md-main__inner,
  .md-content,
  .md-content__inner,
  .md-typeset {
    background: #ffffff !important;
    color: #000000 !important;
  }

  /* Reset the slate theme's link color CSS variable so links inherit dark color */
  :root,
  [data-md-color-scheme="slate"],
  [data-md-color-scheme="default"] {
    --md-typeset-a-color: #000000 !important;
    --md-default-fg-color: #000000 !important;
    --md-default-fg-color--light: #333333 !important;
    --md-default-fg-color--lighter: #666666 !important;
  }

  /* Full-width content since sidebars are hidden */
  .md-main__inner,
  .md-content,
  .md-content__inner {
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Override the white link color from the slate theme so links are readable on paper */
  html body .md-typeset a,
  html body .md-typeset a:link,
  html body .md-typeset a:visited,
  html body .md-typeset a.headerlink {
    color: #000000 !important;
    text-decoration: underline;
  }

  /* Auto-expand collapsed details/admonitions so research content prints.
     The closed-details content is hidden via the user-agent's internal
     content-visibility mechanism, not display:none — so we have to target
     the ::details-content pseudo and explicitly make it visible. */
  .md-typeset details:not([open])::details-content {
    content-visibility: visible !important;
    display: block !important;
    block-size: auto !important;
    overflow: visible !important;
  }

  .md-typeset details summary::after,
  .md-typeset details > summary::marker {
    display: none !important;
  }

  /* Keep tables, code blocks, and admonitions from breaking awkwardly */
  .md-typeset table,
  .md-typeset pre,
  .md-typeset .admonition,
  .md-typeset details,
  .md-typeset figure {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .md-typeset tr,
  .md-typeset img {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Headings should stay with the content that follows them */
  .md-typeset h1,
  .md-typeset h2,
  .md-typeset h3,
  .md-typeset h4 {
    break-after: avoid;
    page-break-after: avoid;
  }

  /* Make admonition titles readable without colored backgrounds */
  .md-typeset .admonition,
  .md-typeset details {
    border: 1px solid #999 !important;
    background: #ffffff !important;
  }

  .md-typeset .admonition-title,
  .md-typeset summary {
    background: #f0f0f0 !important;
    color: #000000 !important;
  }

  /* Override slate-theme dark table styling for readable print */
  .md-typeset table:not([class]),
  .md-typeset__table,
  .md-typeset table,
  .md-typeset thead,
  .md-typeset tbody,
  .md-typeset tr,
  .md-typeset th,
  .md-typeset td {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #999 !important;
  }

  .md-typeset table:not([class]) th,
  .md-typeset th {
    background: #f0f0f0 !important;
    color: #000000 !important;
    font-weight: 600;
  }

  /* Zebra stripe with very light grey instead of dark slate */
  .md-typeset table:not([class]) tr:nth-child(even),
  .md-typeset tr:nth-child(even) {
    background: #f9f9f9 !important;
  }

  /* Slightly tighter line height for paper */
  .md-typeset {
    font-size: 11pt;
    line-height: 1.5;
  }
}
