/* Self-hosted fonts — no third-party requests */
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/SourceSans3-VariableFont_wght.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/SourceSans3-Italic-VariableFont_wght.ttf") format("truetype");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Source Code Pro";
  src: url("../fonts/SourceCodePro-VariableFont_wght.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Code Pro";
  src: url("../fonts/SourceCodePro-Italic-VariableFont_wght.ttf") format("truetype");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --md-text-font: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --md-code-font: "Source Code Pro", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --tb-paper: #f6f2ea;
  --tb-ink: #2c2a26;
  --tb-forest: #3c4a3f;
  --tb-brass: #b07d3a;
  --tb-rule: rgba(44, 42, 38, 0.12);
}

/* Custom palette: warm paper, forest header, brass accents */
:root > * {
  --md-primary-fg-color: #3c4a3f;
  --md-primary-fg-color--light: #5a6b5c;
  --md-primary-fg-color--dark: #2a332c;
  --md-primary-bg-color: #f6f2ea;
  --md-primary-bg-color--light: #f6f2ea;
  --md-accent-fg-color: #b07d3a;
  --md-accent-fg-color--transparent: rgba(176, 125, 58, 0.12);
  --md-typeset-a-color: #6b4c22;
}

[data-md-color-scheme="default"] {
  --md-default-bg-color: #f6f2ea;
  --md-default-fg-color: #2c2a26;
  --md-default-fg-color--light: #5a564e;
  --md-default-fg-color--lighter: #8a857c;
  --md-default-fg-color--lightest: rgba(44, 42, 38, 0.12);
  --md-code-bg-color: #ece6da;
  --md-code-fg-color: #2c2a26;
  --md-typeset-table-color: rgba(44, 42, 38, 0.12);
  --md-footer-bg-color: #2a332c;
  --md-footer-bg-color--dark: #222924;
  --md-footer-fg-color: #f6f2ea;
}

[data-md-color-scheme="slate"] {
  --md-default-bg-color: #1b1d1c;
  --md-default-fg-color: #ece8e0;
  --md-default-fg-color--light: #c5c0b6;
  --md-default-fg-color--lighter: #9a958c;
  --md-default-fg-color--lightest: rgba(236, 232, 224, 0.14);
  --md-primary-fg-color: #2f3b32;
  --md-primary-fg-color--light: #5a6b5c;
  --md-primary-fg-color--dark: #1f2822;
  --md-accent-fg-color: #d4a45a;
  --md-accent-fg-color--transparent: rgba(212, 164, 90, 0.14);
  --md-typeset-a-color: #e0b56a;
  --md-code-bg-color: #262925;
  --md-code-fg-color: #ece8e0;
  --md-footer-bg-color: #141615;
  --md-footer-bg-color--dark: #101211;
  --md-footer-fg-color: #ece8e0;
}

/* Header and tabs */
.md-header {
  box-shadow: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.md-header__title {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.md-header__button.md-logo {
  padding: 0.3rem;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 1.35rem;
  width: 1.35rem;
}

.md-tabs {
  background-color: var(--md-primary-fg-color);
  box-shadow: none;
}

.md-tabs__link {
  font-weight: 500;
  opacity: 0.82;
}

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

/* Content typography */
.md-typeset h1 {
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--md-default-fg-color);
}

.md-typeset h2,
.md-typeset h3 {
  font-weight: 650;
  letter-spacing: -0.015em;
}

.md-typeset {
  font-size: 0.82rem;
  line-height: 1.65;
}

/* Home hero */
.tb-hero {
  margin: 0 0 2rem;
  padding: 0.4rem 0 0.2rem;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.tb-hero h1 {
  margin-bottom: 0.35em;
}

.tb-hero p {
  max-width: 38rem;
  font-size: 1.05em;
  color: var(--md-default-fg-color--light);
}

.tb-hero .md-button {
  margin-top: 0.4rem;
  margin-right: 0.4rem;
}

.md-typeset .md-button--primary {
  background-color: var(--md-primary-fg-color);
  border-color: var(--md-primary-fg-color);
  color: #f6f2ea;
}

.md-typeset .md-button--primary:hover {
  background-color: var(--md-primary-fg-color--dark);
  border-color: var(--md-primary-fg-color--dark);
  color: #f6f2ea;
}

/* Cards on the home and how-to index */
.md-typeset .grid.cards > ul > li {
  border-radius: 0.3rem;
  border-color: var(--md-default-fg-color--lightest);
  background: color-mix(in srgb, var(--md-default-bg-color) 70%, #fff 30%);
}

[data-md-color-scheme="slate"] .md-typeset .grid.cards > ul > li {
  background: color-mix(in srgb, var(--md-default-bg-color) 80%, #fff 6%);
}

/* Footer */
.md-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.md-copyright {
  width: 100%;
}

.md-copyright__highlight {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.1rem;
}

.tb-tagline {
  color: var(--md-footer-fg-color);
  opacity: 0.72;
  font-style: italic;
}

/* Document library table */
.tb-docs-table td:last-child,
.tb-docs-table th:last-child {
  white-space: nowrap;
}

.md-typeset a.tb-download {
  font-weight: 600;
}

/* Slightly calmer admonitions */
.md-typeset .admonition,
.md-typeset details {
  border-radius: 0.25rem;
  font-size: 0.78rem;
}

/* Tables */
.md-typeset table:not([class]) {
  font-size: 0.76rem;
}

.md-typeset table:not([class]) th {
  font-weight: 650;
  background-color: color-mix(in srgb, var(--md-primary-fg-color) 10%, var(--md-default-bg-color));
}

/* Code */
.md-typeset code {
  font-size: 0.85em;
}

.md-typeset pre > code {
  font-variant-ligatures: none;
}


/* The grid is on the .grid div, not the inner ul. Keep the home cards as a 2x2. */
.md-typeset .grid.cards.tb-home-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media screen and (max-width: 44.9em) {
  .md-typeset .grid.cards.tb-home-cards {
    grid-template-columns: 1fr;
  }
}

.md-typeset .grid.cards.tb-home-cards > ul > li {
  display: flex;
  flex-direction: column;
}
.md-typeset .grid.cards.tb-home-cards > ul > li > p:last-child {
  margin-top: auto;
}

/* Outline buttons need more contrast on the dark palette */
[data-md-color-scheme="slate"] .md-typeset .md-button {
  color: #ece8e0;
  border-color: rgba(236, 232, 224, 0.45);
}
[data-md-color-scheme="slate"] .md-typeset .md-button:hover {
  background-color: rgba(236, 232, 224, 0.08);
  color: #ece8e0;
  border-color: rgba(236, 232, 224, 0.7);
}
[data-md-color-scheme="slate"] .md-typeset .md-button--primary {
  background-color: #4a5b4d;
  border-color: #4a5b4d;
  color: #f6f2ea;
}
[data-md-color-scheme="slate"] .md-typeset .md-button--primary:hover {
  background-color: #5a6b5c;
  border-color: #5a6b5c;
  color: #f6f2ea;
}

/* Give the document title room so it doesn't wrap mid-phrase */
.tb-docs-table table:not([class]) td:nth-child(1),
.tb-docs-table table:not([class]) th:nth-child(1) {
  min-width: 13.5rem;
}
.tb-docs-table table:not([class]) td:nth-child(3),
.tb-docs-table table:not([class]) th:nth-child(3),
.tb-docs-table table:not([class]) td:nth-child(4),
.tb-docs-table table:not([class]) th:nth-child(4) {
  white-space: nowrap;
  width: 1%;
}
