/* Testudo docs theme: the logo's maroon and gold (testudo/tui/theme.py).
   Gold has too little contrast on white, so in light mode it is only ever a
   fill or an underline, never text. Severity colors are status, not brand:
   they stay separate and always come with their icon. */

:root {
  --testudo-maroon: #971b2f;
  --testudo-maroon-dark: #74101f;
  --testudo-gold: #ffb500;
  --testudo-slate: #4b5563;
  /* Marks areas of a screenshot: a warm white that sits with the maroon and gold. */
  --testudo-callout: #f5ead6;
  --md-primary-fg-color: var(--testudo-maroon);
  --md-primary-fg-color--light: #b23347;
  --md-primary-fg-color--dark: var(--testudo-maroon-dark);
  --md-primary-bg-color: #ffffff;
  --md-primary-bg-color--light: #ffffffb3;
}

[data-md-color-scheme="default"] {
  --md-accent-fg-color: var(--testudo-maroon);
  --md-accent-fg-color--transparent: #971b2f1a;
  --md-typeset-a-color: var(--testudo-maroon);
  --md-default-fg-color--light: var(--testudo-slate);
  --testudo-rule: #4b556333;
}

[data-md-color-scheme="slate"] {
  --md-hue: 220;
  --md-default-bg-color: #16181d;
  --md-code-bg-color: #20232a;
  --md-accent-fg-color: var(--testudo-gold);
  --md-accent-fg-color--transparent: #ffb5001a;
  --md-typeset-a-color: var(--testudo-gold);
  --md-footer-bg-color: #101216;
  --md-footer-bg-color--dark: #0b0d10;
  --testudo-rule: #9ca3af33;
}

/* Rounder buttons, everywhere. */
.md-typeset .md-button {
  border-radius: 0.8rem;
}

/* The site's name in the header is the logo's lettering. */
.md-header__title .md-header__topic:first-child .md-ellipsis {
  background: url("../logo_text.svg") left center / contain no-repeat;
  color: transparent;
  display: block;
  height: 1.3rem;
  margin-top: 0.55rem;
  width: 7.6rem;
}

/* Going back up the Dashboard page. */
.tx-top {
  background: var(--testudo-maroon);
  border: 1px solid var(--testudo-gold);
  border-radius: 1.2rem;
  bottom: 1.2rem;
  box-shadow: 0 0.3rem 1rem #00000040;
  color: #ffffff;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0;
  padding: 0.35rem 0.85rem;
  pointer-events: none;
  position: fixed;
  right: 1.2rem;
  transform: translateY(0.5rem);
  transition: opacity 250ms, transform 250ms;
  z-index: 3;
}
.tx-top--shown {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.tx-top:hover {
  background: var(--testudo-maroon-dark);
}
/* This page has its own button: Material's only shows while scrolling up. */
body:has(.tx-top) .md-top {
  display: none;
}

/* The header stays maroon in both schemes, with a gold edge. */
.md-header {
  background-color: var(--testudo-maroon);
  border-bottom: 2px solid var(--testudo-gold);
}
.md-tabs {
  background-color: var(--testudo-maroon-dark);
}
.md-tabs__item--active .md-tabs__link {
  box-shadow: inset 0 -2px 0 var(--testudo-gold);
}
.md-header__button.md-logo img {
  height: 1.7rem;
  width: auto;
}

.md-typeset h1 {
  color: var(--md-default-fg-color);
  font-weight: 700;
}
.md-typeset h2 {
  border-bottom: 1px solid var(--testudo-rule);
  font-weight: 650;
  padding-bottom: 0.2rem;
}
.md-typeset h2::after {
  background: var(--testudo-gold);
  content: "";
  display: block;
  height: 2px;
  margin-bottom: -0.25rem;
  margin-top: 0.2rem;
  width: 2.5rem;
}

.md-typeset table:not([class]) th {
  background-color: var(--testudo-slate);
  color: #ffffff;
}

/* A code's entry: its anchor is the stable link to it. */
.md-typeset h3[id] code {
  font-size: 0.95em;
}

/* Severity badges. Each carries its icon, since WARN and ERROR sit close to the brand colors. */
.md-typeset .sev {
  border-radius: 0.2rem;
  color: #ffffff;
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
  padding: 0 0.4rem;
  white-space: nowrap;
}
.md-typeset .sev-ok { background-color: #15803d; }
.md-typeset .sev-warn { background-color: #facc15; color: #1f2937; }
.md-typeset .sev-error { background-color: #dc2626; }
.md-typeset .sev-stale { background-color: #a21caf; }

/* Home page: the wordmark is the title, the heading stays for search and screen readers. */
.md-typeset h1.testudo-page-title {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

/* Every page opens with one larger sentence. */
.md-content__inner > h1 + p {
  color: var(--md-default-fg-color--light);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* Screenshots read as terminal windows. */
.md-typeset img[src*="assets/media"],
.md-typeset video.tx-loop {
  border: 1px solid #4b556366;
  border-radius: 0.45rem;
  box-shadow: 0 0.4rem 1.4rem #0000002e;
  display: block;
  max-width: 100%;
}

/* Videos behave like GIFs: nothing to click on. */
.md-typeset video.tx-loop {
  pointer-events: none;
  width: 100%;
}

/* A two-column facts table has no header to show. */
.md-typeset table:not([class]):has(thead th:empty) thead {
  display: none;
}
.md-typeset table:not([class]):has(thead th:empty) td:first-child {
  font-weight: 650;
  white-space: nowrap;
}

/* A code's entry stands out from the text around it. */
.md-typeset h3[id*="-00"],
.md-typeset h3[id*="-01"] {
  background: var(--md-accent-fg-color--transparent);
  border-left: 3px solid var(--testudo-maroon);
  border-radius: 0 0.25rem 0.25rem 0;
  margin-top: 2rem;
  padding: 0.35rem 0.6rem;
}

/* Cards. */
.md-typeset .grid.cards > ul > li {
  border-radius: 0.45rem;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.md-typeset .grid.cards > ul > li:hover {
  border-color: var(--testudo-gold);
  box-shadow: 0 0.3rem 1rem #0000001f;
  transform: translateY(-2px);
}
.md-typeset .grid.cards .twemoji {
  color: var(--testudo-maroon);
}
[data-md-color-scheme="slate"] .md-typeset .grid.cards .twemoji {
  color: var(--testudo-gold);
}
.md-typeset .tx-mini.grid.cards {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media screen and (max-width: 76em) {
  .md-typeset .tx-mini.grid.cards {
    grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  }
}
.md-typeset .tx-mini.grid.cards > ul > li > p {
  font-size: 0.68rem;
  margin: 0.2rem 0 0;
}
.md-typeset .tx-mini.grid.cards > ul > li > p:first-child {
  font-size: 0.75rem;
  margin: 0;
}

/* Home page hero: a dark panel in both color schemes, so the gold wordmark always reads. */
.md-typeset .tx-hero {
  background: radial-gradient(circle at 50% 0, #4a1420 0, #16181d 68%);
  border-bottom: 3px solid var(--testudo-gold);
  border-radius: 0.6rem;
  color: #e5e7eb;
  margin: 0 0 1.5rem;
  padding: 2.2rem 1.5rem 1.6rem;
  text-align: center;
}
.md-typeset .tx-hero__logo {
  max-width: min(26rem, 100%);
  width: 100%;
}
.md-typeset .tx-hero__title {
  color: #ffffff;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 1rem 0 0.7rem;
}
.md-typeset .tx-hero__text {
  color: #d1d5db;
  font-size: 0.86rem;
  margin: 0 auto 1.2rem;
  max-width: 40rem;
}
.md-typeset .tx-hero .md-button {
  border-color: #ffffff80;
  color: #ffffff;
  margin: 0.2rem;
}
.md-typeset .tx-hero .md-button--primary {
  background: var(--testudo-gold);
  border-color: var(--testudo-gold);
  color: #1f2937;
}
.md-typeset .tx-hero .md-button:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #1f2937;
}
.md-typeset ul.tx-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
}
.md-typeset ul.tx-pills li {
  border: 1px solid #ffffff33;
  border-radius: 1rem;
  color: #d1d5db;
  font-size: 0.64rem;
  margin: 0;
  padding: 0.1rem 0.6rem;
}
.md-typeset .tx-caption {
  color: var(--md-default-fg-color--light);
  font-size: 0.68rem;
  margin-top: 0.5rem;
  text-align: center;
}

/* The comparison's last row is the answer. */
.md-typeset .tx-compare .md-typeset__table {
  display: block;
  width: 100%;
}
.md-typeset .tx-compare table:not([class]) {
  display: table;
  width: 100%;
}
.md-typeset .tx-compare tbody tr:last-child td {
  background: var(--md-accent-fg-color--transparent);
  border-top: 2px solid var(--testudo-gold);
}

/* Text beside a picture, alternating sides. */
.md-typeset .tx-split {
  align-items: center;
  display: grid;
  gap: 1.8rem;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  margin: 2rem 0;
}
.md-typeset .tx-split--flip {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}
.md-typeset .tx-split--flip > div {
  order: 2;
}
.md-typeset .tx-split h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 0;
}
@media screen and (max-width: 60em) {
  .md-typeset .tx-split,
  .md-typeset .tx-split--flip {
    grid-template-columns: minmax(0, 1fr);
  }
  .md-typeset .tx-split--flip > div {
    order: 0;
  }
}

/* The closing call to action. */
.md-typeset .tx-cta {
  background: var(--md-accent-fg-color--transparent);
  border-radius: 0.6rem;
  margin-top: 2.5rem;
  padding: 1.5rem;
  text-align: center;
}

/* The home page has nothing to edit-link from its hero. */
.md-content__inner:has(.tx-hero) > .md-content__button {
  display: none;
}

/* The dashboard, its areas numbered, and the legend for those numbers. */
.md-typeset figure.tx-anatomy {
  display: block;
  margin: 1.2rem 0;
  max-width: none;
  width: 100%;
}
.tx-anatomy__frame {
  position: relative;
}
.md-typeset .tx-anatomy__frame img {
  width: 100%;
}
.tx-zone {
  border: 2px solid var(--testudo-callout);
  border-radius: 0.2rem;
  box-shadow: 0 0 0 1px #14161ccc;
  box-sizing: border-box;
  position: absolute;
}
.tx-zone b,
.md-typeset .tx-legend li::before {
  background: var(--testudo-maroon);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--testudo-callout);
  color: #ffffff;
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  height: 1.15rem;
  line-height: 1.15rem;
  text-align: center;
  width: 1.15rem;
}
.tx-zone b {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
}
.md-typeset figure.tx-anatomy figcaption {
  font-style: normal;
  max-width: none;
  text-align: left;
}
.md-typeset ol.tx-legend {
  counter-reset: zone;
  display: grid;
  gap: 0.45rem 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}
.md-typeset ol.tx-legend li {
  counter-increment: zone;
  font-size: 0.72rem;
  margin: 0;
  padding-left: 1.6rem;
  position: relative;
}
.md-typeset .tx-legend li::before {
  content: counter(zone);
  left: 0;
  position: absolute;
  top: 0.05rem;
}

/* The Dashboard page: parts of the screenshot with their pieces marked. Only the overview's panes are links. */
.md-typeset figure.tx-map {
  display: block;
  margin: 1.5rem auto;
  padding: 0.6rem 1.2rem;
  width: 100%;
}
.tx-map__frame {
  position: relative;
}
.tx-map__view {
  border-radius: 0.2rem;
  height: 100%;
  overflow: hidden;
  position: relative;
  width: 100%;
}
.md-typeset .tx-map__view img {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  max-width: none;
  position: absolute;
}
.md-typeset .tx-spot {
  border: 1.5px solid var(--testudo-callout);
  border-radius: 0.15rem;
  box-shadow: 0 0 0 1px #14161ccc;
  box-sizing: border-box;
  position: absolute;
}
.md-typeset a.tx-spot--pane {
  transition: background-color 160ms;
}
.md-typeset a.tx-spot--pane:hover,
.md-typeset a.tx-spot--pane:focus-visible {
  background-color: #f5ead62e;
  z-index: 2;
}
.tx-spot b,
.md-typeset .tx-num,
.md-typeset .tx-pane-link b {
  background: var(--testudo-maroon);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--testudo-callout);
  color: #ffffff;
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  height: 0.85rem;
  line-height: 0.85rem;
  text-align: center;
  width: 0.85rem;
}
.tx-spot b {
  position: absolute;
  z-index: 1;
}
.tx-spot__badge--top { left: 0; top: -0.6rem; }
/* On a one-line strip the numbers sit above the text instead of over it. */
.md-typeset figure.tx-map--strip {
  padding-top: 1.3rem;
}
.tx-map--strip .tx-spot__badge--top { left: 50%; top: -1.15rem; transform: translateX(-50%); }
.tx-spot__badge--bottom { bottom: -0.6rem; left: 0; }
.tx-spot__badge--left { left: -1rem; top: 50%; transform: translateY(-50%); }
.tx-spot__badge--right { right: -1rem; top: 50%; transform: translateY(-50%); }
.tx-spot__badge--bottom-right { bottom: -0.6rem; right: 0; }
.tx-spot__badge--inside { bottom: 0.3rem; right: 0.3rem; }
.md-typeset a.tx-spot--pane {
  border-width: 2px;
}
/* Status glyphs stay text: some systems would draw ▶ as a colored emoji. */
.md-typeset code {
  font-variant-emoji: text;
}
.md-typeset .tx-pane-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
  justify-content: center;
}
.md-typeset .tx-pane-link {
  font-size: 0.72rem;
}
