/* User Provided Stylesheet */

/* ============================================================
   nanobeam-course — custom theming on top of MyST book-theme.
   Loaded via `site.options.style` in myst.yml.

   Accent: dark red rgb(204,0,0) (matching the quantEM docs),
   lightened in dark mode for contrast on the dark background.
   ============================================================ */

:root {
  --nbc-accent: rgb(204, 0, 0);
  --nbc-accent-soft: rgba(204, 0, 0, 0.12);
}
html.dark {
  --nbc-accent: rgb(240, 122, 158);
  --nbc-accent-soft: rgba(240, 122, 158, 0.18);
}

/* ---------- Site title (upper-left) ---------- */
.myst-home-link,
.myst-home-link span {
  color: var(--nbc-accent) !important;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.myst-home-link:hover span {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
}

/* ---------- Top-nav links ---------- */
.myst-top-nav-item {
  font-weight: 500;
}

/* ---------- Article links ----------
   Scoped to <article> so the home-link and navbar controls keep
   their own colors. */
article a:not(.myst-home-link),
article .link,
article .hover-link {
  color: var(--nbc-accent) !important;
}

/* Cards: accent title, neutral body text */
article a.myst-card {
  color: inherit !important;
}
article a.myst-card .myst-card-title {
  color: var(--nbc-accent);
}
article a.myst-card:hover {
  border-color: var(--nbc-accent) !important;
}

/* ---------- Places book-theme still uses Tailwind blue ---------- */
.myst-tab-item-header-active {
  color: var(--nbc-accent) !important;
  border-bottom-color: var(--nbc-accent) !important;
}
.myst-toc-item.active,
.myst-toc-item-exact {
  background-color: var(--nbc-accent-soft) !important;
}
.myst-toc-item:focus,
.myst-toc-item:focus-visible {
  outline-color: var(--nbc-accent) !important;
}
.myst-code-copy-icon {
  color: var(--nbc-accent) !important;
}
.myst-code-copy-icon:hover {
  opacity: 0.7;
}
.outline-blue-200 {
  outline-color: var(--nbc-accent-soft) !important;
}
button.myst-search-bar:hover {
  border-color: var(--nbc-accent) !important;
  --tw-ring-color: var(--nbc-accent) !important;
}

/* ---------- Code blocks ----------
   book-theme leaves `pre` at overflow-x: visible, so one long line pushes
   the whole page sideways on narrow screens. Scroll inside the block
   instead, and never let it widen the article. */
article pre {
  max-width: 100%;
  overflow-x: auto;
}

/* ---------- Inline code spans ---------- */
:not(pre) > code {
  color: rgb(190, 24, 93);
}
html.dark :not(pre) > code {
  color: rgb(244, 114, 182);
}

/* ---------- Left sidebar ----------
   Smaller type, tighter rhythm, bold top-level sections. */
.myst-primary-sidebar-toc {
  font-size: 0.85rem;
}
.myst-primary-sidebar-toc .myst-toc-item {
  margin-top: 0.125rem;
  margin-bottom: 0.125rem;
}
.myst-primary-sidebar-toc a.myst-toc-item {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}
.myst-primary-sidebar-toc .myst-toc-item > div {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}
.myst-primary-sidebar-toc button svg {
  height: 1.1rem;
  width: 1.1rem;
}
/* Top-level sections (Agenda, Course Blocks, ...) in bold */
.myst-toc > div > .myst-toc-item {
  font-weight: 700;
}
/* book-theme marks the section containing the current page in blue; make it
   bold accent instead, and keep the page links themselves accented when active. */
.myst-primary-sidebar-toc .text-blue-800,
html.dark .myst-primary-sidebar-toc .dark\:text-blue-200 {
  color: var(--nbc-accent) !important;
  font-weight: 700;
}
.myst-primary-sidebar-toc a.myst-toc-item-exact,
.myst-primary-sidebar-toc a.myst-toc-item.active {
  color: var(--nbc-accent) !important;
  font-weight: 700;
}
/* The site title is already in the top bar; drop the duplicate
   root entry at the top of the sidebar. */
.myst-toc > a.myst-toc-item[title="4D-STEM Workshop"] {
  display: none;
}
/* book-theme replays a height:0 -> full expand animation on every
   `data-state=open`; the sections start open, so kill the animation
   and make any real toggle instant. */
.myst-primary-sidebar-toc .collapsible-content {
  animation: none !important;
}

/* ---------- Hide the article-style frontmatter strip ---------- */
.myst-fm-block-header,
.myst-fm-block-date-doi,
header.myst-fm-authors-affiliations {
  display: none !important;
}

/* ---------- Landing page ---------- */
.nbc-hero {
  max-width: 34rem;
  margin: 1.5rem auto 0.5rem auto;
}
.nbc-hero img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
}
.nbc-tagline {
  text-align: left;
  font-size: 1.15rem;
  opacity: 0.85;
  max-width: 46rem;
  margin: 1rem auto 1.5rem auto;
}

/* Organizer list — compact row under the title */
.nbc-organizers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.5rem 0.75rem;
  margin: 0.75rem 0 1.25rem 0;
  font-size: 0.95rem;
}
.nbc-organizers p {
  margin: 0;
}

/* ---------- Search ----------
   The theme's dialog-based search is replaced at runtime (see
   scripts/patch_theme.py) with a flat input in the top bar. No overlay,
   no scroll lock, so opening it never shifts the page. */
.nbc-search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;          /* allow the input to shrink inside the flex nav */
}
.nbc-search input {
  height: 2.5rem;
  width: 100%;
  max-width: 12rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  color: inherit;
  background: rgb(249, 250, 251);
  border: 1px solid rgb(209, 213, 219);
  border-radius: 0.5rem;
  outline: none;
  appearance: none;
}
html.dark .nbc-search input {
  background: rgb(55, 65, 81);
  border-color: rgb(75, 85, 99);
}
.nbc-search input::-webkit-search-cancel-button {
  appearance: none;
}
.nbc-search input:focus {
  border-color: var(--nbc-accent);
  box-shadow: 0 0 0 1px var(--nbc-accent);
}
@media (min-width: 640px) {
  .nbc-search input { max-width: 20rem; }
}
.nbc-search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1000;
  width: min(26rem, 90vw);
  max-height: 70vh;
  overflow-y: auto;
  padding: 0.25rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}
html.dark .nbc-search-results {
  background: rgb(28, 25, 23);
  border-color: rgba(255, 255, 255, 0.18);
}
a.nbc-search-hit {
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: 0.35rem;
  color: inherit !important;
  text-decoration: none;
}
a.nbc-search-hit:hover,
a.nbc-search-hit.active {
  background: var(--nbc-accent);
  color: #fff !important;
}
.nbc-search-hit-title {
  font-size: 0.85rem;
  font-weight: 600;
}
.nbc-search-hit-text {
  font-size: 0.78rem;
  opacity: 0.75;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- MSA logo (bottom of the left sidebar) ----------
   Injected at runtime by scripts/patch_theme.py; light/dark variants
   follow the html.dark toggle. */
.nbc-msa-side {
  display: block;
  margin: 1.5rem 0.75rem 1rem 0.75rem;
  max-width: 150px;
}
.nbc-msa-side img {
  display: block;
  width: 100%;
  height: auto;
}
html:not(.dark) .nbc-msa-side .nbc-msa-dark { display: none; }
html.dark .nbc-msa-side .nbc-msa-light { display: none; }

/* ---------- Article heading spacing ----------
   With hide_title_block, the first heading otherwise sits flush
   against the top bar. */
article {
  padding-top: 1.75rem;
}

/* Instructors label on the landing page */
.nbc-instructors-label {
  margin: 1.25rem 0 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
}

/* ---------- Agenda table ---------- */
article table td,
article table th {
  vertical-align: top;
}
/* keep time ranges ("15:00 – 16:00") on one line */
article table td:first-child,
article table th:first-child {
  white-space: nowrap;
}
