/* 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 {
  --msc-accent: rgb(204, 0, 0);
  --msc-accent-soft: rgba(204, 0, 0, 0.12);
}
html.dark {
  --msc-accent: rgb(255, 63, 63);
  --msc-accent-soft: rgba(255, 63, 63, 0.18);
}

/* ---------- Site title (upper-left) ---------- */
.myst-home-link,
.myst-home-link span {
  color: var(--msc-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(--msc-accent) !important;
  text-decoration-color: var(--msc-accent) !important;
}

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

/* ---------- Places book-theme still uses Tailwind blue ---------- */
.myst-tab-item-header-active {
  color: var(--msc-accent) !important;
  border-bottom-color: var(--msc-accent) !important;
}
.myst-toc-item.active,
.myst-toc-item-exact {
  background-color: var(--msc-accent-soft) !important;
}
.myst-toc-item:focus,
.myst-toc-item:focus-visible {
  outline-color: var(--msc-accent) !important;
}
.myst-code-copy-icon {
  color: var(--msc-accent) !important;
}
.myst-code-copy-icon:hover {
  opacity: 0.7;
}
.outline-blue-200 {
  outline-color: var(--msc-accent-soft) !important;
}
button.myst-search-bar:hover {
  border-color: var(--msc-accent) !important;
  --tw-ring-color: var(--msc-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 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(--msc-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(--msc-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="MATSCI 323"] {
  display: none;
}
/* ---------- 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 ---------- */
.msc-hero {
  max-width: 34rem;
  margin: 1.5rem auto 0.5rem auto;
}
.msc-hero img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
}
.msc-tagline {
  text-align: left;
  font-size: 1.15rem;
  opacity: 0.85;
  max-width: 46rem;
  margin: 1rem auto 1.5rem auto;
}

/* Instructor list — compact row under the title */
.msc-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;
}
.msc-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. */
.msc-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 12rem;
  min-width: 0;          /* allow the input to shrink inside the flex nav */
}
.msc-search input {
  height: 2.5rem;
  width: 100%;
  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 .msc-search input {
  background: rgb(55, 65, 81);
  border-color: rgb(75, 85, 99);
}
.msc-search input::-webkit-search-cancel-button {
  appearance: none;
}
.msc-search input:focus {
  border-color: var(--msc-accent);
  box-shadow: 0 0 0 1px var(--msc-accent);
}
@media (min-width: 640px) {
  .msc-search { width: 16rem; }   /* the stock search button's sm:w-64 */
}
.msc-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;
  color: rgb(28, 25, 23);   /* the top bar's text color is black in both themes */
  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 .msc-search-results {
  color: rgb(231, 229, 228);
  background: rgb(28, 25, 23);
  border-color: rgba(255, 255, 255, 0.18);
}
a.msc-search-hit {
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: 0.35rem;
  color: inherit !important;
  text-decoration: none;
}
a.msc-search-hit:hover,
a.msc-search-hit.active {
  background: var(--msc-accent);
  color: #fff !important;
}
.msc-search-hit-title {
  font-size: 0.85rem;
  font-weight: 600;
}
.msc-search-hit-text {
  font-size: 0.78rem;
  opacity: 0.75;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

/* Small caps label on the landing page */
.msc-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;
}

/* ---------- Schedule tables ---------- */
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;
}

/* ---------- Sidebar footer: lab logo (theme-swapped) ---------- */
.myst-primary-sidebar-footer figure,
.myst-primary-sidebar-footer p {
  margin: 0;
  text-align: left;
}
.myst-primary-sidebar-footer .msc-sidebar-logo {
  display: block;
  margin: 0 0 2px 0;
}
.myst-primary-sidebar-footer .msc-sidebar-logo img {
  display: block;
  margin: 0 !important;   /* the theme centers images with auto margins */
}
html.dark .msc-logo-light {
  display: none;
}
html:not(.dark) .msc-logo-dark {
  display: none;
}
div.article.footer.myst-primary-sidebar-footer {
  position: relative;
  width: 130px;
}
/* hide the external-link arrow icon */
.myst-primary-sidebar-footer p a svg {
  display: none !important;
}
.myst-primary-sidebar-footer p a {
  display: block;
  width: 130px;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  color: inherit !important;
  opacity: 0.8;
}
/* make the logo + text block one click target */
.myst-primary-sidebar-footer p a::before {
  content: "";
  position: absolute;
  inset: 0;
}
.myst-primary-sidebar-footer p a:hover {
  opacity: 1;
}
