/* ==========================================================================
   IE University — shared rules for the course site (light + dark).
   Reads only the semantic --ie-* variables defined in ie-light.scss /
   ie-dark.scss, so nothing here needs to change between themes.
   ========================================================================== */

/* Long-form reading text in PT Serif; UI, headings and navigation stay in Montserrat */
#quarto-document-content p,
#quarto-document-content li,
#quarto-document-content blockquote,
#quarto-document-content dd {
  font-family: "PT Serif", Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

#quarto-document-content .callout p,
#quarto-document-content .callout li {
  font-size: 1rem;
}

h1, h2, h3, h4, .title {
  letter-spacing: -0.01em;
}

h1.title {
  font-weight: 700;
}

/* Section headings get a short Sea Blue rule, like IE's editorial pages */
#quarto-document-content h2 {
  padding-bottom: 0.35rem;
  border-bottom: 0;
  background: linear-gradient(var(--ie-accent), var(--ie-accent)) left bottom / 3rem 3px no-repeat;
}

/* Links: underline offset for readability */
a {
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-thickness: 2px;
}

/* Sidebar */
.sidebar-title {
  color: var(--ie-heading);
  font-weight: 700;
}
.sidebar nav[role="doc-toc"] ul > li > a.active,
.sidebar-item .sidebar-link.active {
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--ie-accent);
  padding-left: 0.5rem;
}
.sidebar-section > .sidebar-item-container .sidebar-item-text {
  font-weight: 600;
}

/* Table of contents: accent marker on the active entry */
#TOC .nav-link.active,
nav#TOC a.active {
  border-left-color: var(--ie-accent) !important;
  color: var(--ie-heading) !important;
  font-weight: 600;
}

/* Buttons (e.g. "Launch the Monty Hall simulator") */
.btn {
  font-weight: 800;
  border-radius: 999px;
  padding-left: 1.2rem;
  padding-right: 1.2rem;
}
.btn-primary,
.btn-primary:visited {
  color: var(--ie-on-brand);
  background-color: var(--ie-brand);
  border-color: var(--ie-brand);
  text-decoration: none;
}
.btn-primary:hover,
.btn-primary:focus {
  color: var(--ie-on-brand);
  background-color: var(--ie-accent-strong);
  border-color: var(--ie-accent-strong);
}

/* Keyboard focus that meets 3:1 on both backgrounds */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--ie-focus);
  outline-offset: 2px;
  box-shadow: none;
}

/* Code blocks: thin accent on the left */
div.sourceCode {
  border-left: 3px solid var(--ie-accent);
}

/* Light/dark toggle: make it easy to spot */
.quarto-color-scheme-toggle .bi::before {
  transform: scale(1.15);
}

/* Footer */
.nav-footer {
  border-top: 1px solid var(--ie-border);
  font-size: 0.875rem;
}

/* Light/dark switch: fixed in the top-right corner (theme/toggle.html).
   Quarto's small sidebar toggle is hidden in favour of this one. */
.ie-theme-toggle {
  position: fixed;
  z-index: 1100;
  top: 14px;
  right: 18px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--ie-border);
  border-radius: 50%;
  color: var(--ie-heading);
  background: var(--ie-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 36, 0.08), 0 4px 14px rgba(0, 0, 36, 0.10);
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease;
}
.ie-theme-toggle:hover {
  border-color: var(--ie-accent-strong);
  transform: scale(1.06);
}
.ie-theme-toggle svg {
  width: 21px;
  height: 21px;
}
.ie-theme-toggle__sun,
body.quarto-dark .ie-theme-toggle__moon {
  display: none;
}
body.quarto-dark .ie-theme-toggle__sun {
  display: block;
}
.quarto-color-scheme-toggle {
  display: none !important;
}
/* keep the "On this page" column clear of the button */
#quarto-margin-sidebar {
  padding-top: 3.25rem;
}
@media (max-width: 991.98px) {
  /* sit inside Quarto's mobile top bar */
  .ie-theme-toggle {
    top: 4px;
    right: 10px;
    width: 38px;
    height: 38px;
  }
}

/* Wide display equations scroll inside their own box on small screens
   instead of widening the whole page */
mjx-container[display="true"],
.katex-display {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}
