/* --------------------------------------------------------------------------
   Palette
   Setting Material's own variables means the theme cascades correctly and we
   almost never need !important.
   -------------------------------------------------------------------------- */
[data-md-color-scheme="slate"] {
  --md-default-bg-color: #0d1117;
  --md-default-fg-color: #c9d1d9;
  --md-default-fg-color--light: #8b949e;
  --md-default-fg-color--lighter: #6e7681;

  --md-primary-fg-color: #0d1117;
  --md-primary-bg-color: #f0f6fc;

  --md-accent-fg-color: #00d29d;
  --md-typeset-a-color: #00d29d;

  --md-typeset-color: #c9d1d9;
  --md-code-bg-color: #161b22;
  --md-default-fg-color--lightest: rgba(255, 255, 255, 0.06);
}

/* --------------------------------------------------------------------------
   Header, tabs, footer chrome
   -------------------------------------------------------------------------- */

/* No logo — the site name alone is the wordmark */
.md-header__button.md-logo {
  display: none;
}

.md-header {
  box-shadow: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.md-header__title {
  font-weight: 700;
  font-size: 1.15rem;
  margin-left: 0.6rem;
}

.md-tabs {
  border-bottom: none;
}

.md-tabs__link {
  color: var(--md-accent-fg-color);
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.8;
}

.md-tabs__item--active .md-tabs__link,
.md-tabs__link:hover {
  opacity: 1;
}

/* The generator line is removed via `extra.generator: false` in mkdocs.yml,
   which leaves an empty bar behind — drop it too. Prev/next links stay. */
.md-footer-meta {
  display: none;
}

/* --------------------------------------------------------------------------
   Home page hero
   Scoped to <div class="home"> so note pages keep Material's reading defaults.
   -------------------------------------------------------------------------- */

.home {
  max-width: 36rem;
  margin: 2rem auto 0;
}

.home h1 {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f0f6fc;
  margin-bottom: 1.4rem;
}

.home p {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--md-default-fg-color--light);
  margin-bottom: 1rem;
}

a.intro-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-right: 1.2rem;
  margin-top: 0.8rem;
}

/* --------------------------------------------------------------------------
   Notes that aren't published yet
   A [[wikilink]] whose target hasn't been proofed becomes one of these: the
   words stay readable, but it must never be mistaken for a real teal link.
   -------------------------------------------------------------------------- */

.md-typeset .unlinked {
  color: var(--md-default-fg-color--lighter);
  border-bottom: 1px dotted var(--md-default-fg-color--lighter);
  cursor: help;
}

/* --------------------------------------------------------------------------
   Callouts
   The vault's > [!Definition] / [!Theorem] / [!Proof] blocks become Material
   admonitions via mkdocs-callouts. They follow the colour convention a maths
   textbook uses, so the colour alone says what kind of block it is:

     blue   definition
     gold   theorem, lemma, corollary, proposition
     grey   proof
     green  remark, recall
     red    caution (mkdocs-callouts folds caution/attention into "warning")

   No icons: the coloured, capitalised title *is* the label, the way a
   textbook prints "Theorem 3.1" in the margin.
   -------------------------------------------------------------------------- */

/* Drop the icon and reclaim the 1.4rem it was indenting the title by.
   The dir- prefix matches the specificity of the Material rule it replaces. */
.md-typeset .admonition-title::before,
.md-typeset summary::before {
  display: none;
}

[dir="ltr"] .md-typeset .admonition-title,
[dir="ltr"] .md-typeset summary {
  padding-left: 0.6rem;
}

/* summary keeps its fold chevron, so leave that corner clear. */
[dir="ltr"] .md-typeset summary {
  padding-right: 1.8rem;
}

/* Each group sets the block's border, the tint behind its title, and the
   title's own colour. `:is()` takes the specificity of its heaviest argument,
   which is what lets these override Material's built-in `warning`. */
.md-typeset :is(.admonition, details).definition {
  border-color: #58a6ff;
}

.md-typeset :is(.admonition, details).definition > :is(.admonition-title, summary) {
  background-color: rgba(88, 166, 255, 0.1);
  color: #58a6ff;
}

.md-typeset :is(.admonition, details):is(.theorem, .lemma, .corollary, .proposition) {
  border-color: #e3b341;
}

.md-typeset :is(.admonition, details):is(.theorem, .lemma, .corollary, .proposition)
  > :is(.admonition-title, summary) {
  background-color: rgba(227, 179, 65, 0.1);
  color: #e3b341;
}

.md-typeset :is(.admonition, details).proof {
  border-color: #8b949e;
}

.md-typeset :is(.admonition, details).proof > :is(.admonition-title, summary) {
  background-color: rgba(139, 148, 158, 0.1);
  color: #8b949e;
}

/* [!Recall] restates something already established, which is what a remark
   does -- so it shares the remark's green rather than earning a sixth colour. */
.md-typeset :is(.admonition, details):is(.remark, .recall) {
  border-color: #3fb950;
}

.md-typeset :is(.admonition, details):is(.remark, .recall) > :is(.admonition-title, summary) {
  background-color: rgba(63, 185, 80, 0.1);
  color: #3fb950;
}

.md-typeset :is(.admonition, details):is(.warning, .danger) {
  border-color: #f85149;
}

.md-typeset :is(.admonition, details):is(.warning, .danger) > :is(.admonition-title, summary) {
  background-color: rgba(248, 81, 73, 0.1);
  color: #f85149;
}

/* Images embedded as ![[file.png#center]] */
.md-typeset img.center {
  display: block;
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Course cards on the Notes landing page
   -------------------------------------------------------------------------- */

.course-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

/* One column once two cards no longer fit side by side. */
@media screen and (max-width: 44.9375em) {
  .course-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.md-typeset a.course-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.4rem;
  background-color: #161b22;
  color: var(--md-default-fg-color);
  transition: border-color 120ms, transform 120ms;
}

.md-typeset a.course-card:hover {
  border-color: var(--md-accent-fg-color);
  transform: translateY(-2px);
}

.md-typeset a.course-card strong {
  color: var(--md-accent-fg-color);
  font-size: 1.05rem;
}

.md-typeset a.course-card span {
  color: var(--md-default-fg-color--light);
  font-size: 0.75rem;
}
