/* --brand-color drives the navbar, table headers, and section dividers.
   currently set to williams college (purple #362061, gold #fecc06). */
:root {
  --brand-color: #362061;        /* primary: navbar and table header background */
  --brand-color-light: #5a3d8a;  /* secondary: section-header row background */
  --brand-color-tint: #ede8f5;   /* tint: alternating table row background */
  --brand-accent: #FECC06;       /* accent: proof block border, link underline */
  --brand-link: #8F6B00;         /* link text: deepened gold, 4.9:1 on white */
  --brand-link-hover: #6F5400;   /* link hover: deeper still, 7.1:1 on white */
}

/* ── Links ──────────────────────────────────────────────────────────────
   Body links are Williams gold rather than the default Bootstrap blue.
   Pure #FECC06 only reaches 1.5:1 against white, well under the 4.5:1
   WCAG AA needs, so the text uses a deepened gold and the bright accent
   is carried by the underline, where thickness does the work instead of
   contrast. Navbar links are excluded; they stay white on purple. */
main a:not(.anchorjs-link):not(.quarto-title-meta-heading) {
  color: var(--brand-link);
  text-decoration: underline;
  text-decoration-color: var(--brand-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

main a:not(.anchorjs-link):hover,
main a:not(.anchorjs-link):focus {
  color: var(--brand-link-hover);
  text-decoration-color: var(--brand-accent);
  text-decoration-thickness: 3px;
}

/* links inside the purple section-divider rows stay legible on purple */
.section-header a,
.section-header a:hover {
  color: #FFFFFF;
  text-decoration-color: var(--brand-accent);
}

/* ── Layout ─────────────────────────────────────────────────────────── */
.container {
  max-width: 100% !important;
  width: 100%;
  padding: 0 1rem;
}

/* ── Navbar ─────────────────────────────────────────────────────────── */
.navbar {
  background-color: var(--brand-color);
}

/* The site title stays white so it reads as the identity, not as a link. */
.navbar .navbar-brand {
  color: #FFFFFF;
}

/* Nav links use the true Williams gold. Against the purple bar that is
   9.0:1, so unlike body text on white it needs no darkening. Underline is
   held transparent and revealed on hover, since permanent underlines up
   here would clutter the bar. */
.navbar .nav-link {
  color: var(--brand-accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus,
.navbar .nav-link.active {
  color: #FFFFFF;
  text-decoration-color: var(--brand-accent);
}

/* ── Schedule table ─────────────────────────────────────────────────── */
table, th, td {
  border: 2px solid;
  border-color: #FFFFFF;
}

table tr:first-of-type {
  color: white;
  background-color: var(--brand-color);
  font-weight: bold;
}

tr:nth-child(even), th {
  background-color: var(--brand-color-tint);
}

table td, table th {
  padding-left: 10px;
}

/* Keep "Lab 10 (B)" on a single line. Without this the column collapses to
   the width of "Lab" and the (A)/(B) marker wraps onto its own row. The
   column then sizes itself to the widest entry rather than a fixed width. */
.lab-col {
  white-space: nowrap;
}

.section-header {
  background-color: var(--brand-color-light) !important;
  text-align: center;
  font-weight: bold;
  color: white !important;
}

/* ── Typography ─────────────────────────────────────────────────────── */
h1 {
  text-align: center;
}

/* ── Two-column info block (index.qmd) ──────────────────────────────── */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.col {
  flex: 1;
  min-width: 300px;
  box-sizing: border-box;
}

/* ── Images ─────────────────────────────────────────────────────────── */
.responsive-img {
  display: block;
  margin: 1em auto;
  max-width: 100%;
  width: 100%;
  height: auto;
}
@media (min-width: 768px) {
  .responsive-img {
    width: 700px;
  }
}

/* ── MathJax (scrollable block equations on mobile) ─────────────────── */
mjx-container[jax="SVG"] {
  overflow-x: auto;
  overflow-y: hidden;
  display: block;
  max-width: 100%;
}

mjx-container[jax="SVG"] > svg {
  max-width: 100%;
  height: auto;
}

/* ── Collapsible proof blocks ───────────────────────────────────────── */
.proof-block details {
  margin: 1em 0;
  padding: 0.5em 1em;
  border-left: 4px solid var(--brand-accent);
  background: #f8f9fa;
  border-radius: 6px;
}

.proof-block summary {
  font-weight: bold;
  cursor: pointer;
  list-style: none;
}

.proof-block summary::-webkit-details-marker {
  display: none;
}

.proof-block summary::before {
  content: "▶ ";
  transition: transform 0.2s ease;
}

.proof-block[open] summary::before,
.proof-block details[open] summary::before {
  transform: rotate(90deg);
  display: inline-block;
}
