/* trildaDevCenter wordmark: Futura Bold, with the closest free fallback (Jost) where Futura isn't installed. */
@import url("https://fonts.googleapis.com/css2?family=Jost:wght@700&display=swap");

:root {
  --brand-font: "Futura", "Futura PT", "Jost", "Century Gothic", sans-serif;
}

/* Site name in the header, and the home page title: keep the exact casing. */
.md-header__title .md-header__topic:first-child .md-ellipsis,
.md-typeset h1.brand-title {
  font-family: var(--brand-font);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.md-typeset h1.brand-title {
  font-size: 2.4em;
}

.md-header__button.md-logo img {
  height: 1.8rem;
}

/* Colours. The header is a dark ink band, so the coloured logo stands out, over a gold tab strip;
   the page body sits on a tinted background and the content on a raised panel. */
[data-md-color-scheme="default"] {
  --brand-header-bg: #1e2230;
  --brand-tabs-bg: #f5b301;
  --brand-tabs-fg: #1e2230;
  --md-default-bg-color: #ece6d8;
  --brand-panel-bg: #ffffff;
  --brand-panel-border: #d6ccb6;
  --brand-panel-shadow: 0 1px 3px rgba(30, 34, 48, 0.12), 0 4px 14px rgba(30, 34, 48, 0.08);
  --md-typeset-a-color: #9a4a00;
  --md-accent-fg-color: #d35400;
  --md-footer-bg-color: #1e2230;
  --md-footer-bg-color--dark: #151823;
}

[data-md-color-scheme="slate"] {
  --brand-header-bg: #0b0d12;
  --brand-tabs-bg: #d99a00;
  --brand-tabs-fg: #0b0d12;
  --md-default-bg-color: #1a1d24;
  --brand-panel-bg: #262a33;
  --brand-panel-border: #3a3f4b;
  --brand-panel-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 4px 14px rgba(0, 0, 0, 0.35);
  --md-typeset-a-color: #ffc94d;
  --md-accent-fg-color: #ffb020;
  --md-footer-bg-color: #0b0d12;
  --md-footer-bg-color--dark: #06070a;
}

[data-md-color-primary="custom"] {
  --md-primary-fg-color: var(--brand-header-bg);
  --md-primary-fg-color--light: var(--brand-header-bg);
  --md-primary-fg-color--dark: var(--brand-header-bg);
  --md-primary-bg-color: #ffffff;
  --md-primary-bg-color--light: rgba(255, 255, 255, 0.7);
}

.md-header {
  background-color: var(--brand-header-bg);
  color: #ffffff;
}

.md-tabs {
  background-color: var(--brand-tabs-bg);
  color: var(--brand-tabs-fg);
}

.md-tabs__link {
  opacity: 0.75;
  font-weight: 600;
}

.md-tabs__item--active .md-tabs__link,
.md-tabs__link:hover {
  color: var(--brand-tabs-fg);
  opacity: 1;
}

/* Raised content panel. */
.md-main__inner {
  margin-top: 1.2rem;
  margin-bottom: 1.2rem;
}

.md-content {
  background-color: var(--brand-panel-bg);
  border: 1px solid var(--brand-panel-border);
  border-radius: 0.6rem;
  box-shadow: var(--brand-panel-shadow);
}

/* Cards and tables inside the panel. */
.md-typeset .grid.cards > ul > li,
.md-typeset .grid > .card {
  border-color: var(--brand-panel-border);
  background-color: var(--md-default-bg-color);
}

.md-typeset .grid.cards > ul > li:hover {
  border-color: var(--brand-tabs-bg);
}

.md-typeset table:not([class]) {
  border-color: var(--brand-panel-border);
}

.md-typeset table:not([class]) th {
  background-color: var(--md-default-bg-color);
}

/* Buttons: gold, readable in both schemes. */
.md-typeset .md-button {
  color: var(--brand-tabs-fg);
  background-color: var(--brand-tabs-bg);
  border-color: var(--brand-tabs-bg);
}

.md-typeset .md-button:hover,
.md-typeset .md-button:focus {
  color: var(--brand-tabs-fg);
  background-color: var(--md-accent-fg-color);
  border-color: var(--md-accent-fg-color);
}

/* Key/value tables written with an empty header row (| | |): hide that row. */
.md-typeset table:not([class]) thead:has(th:empty:first-child + th:empty:last-child) {
  display: none;
}

/* Project logo (front matter `logo:`), before the name in the title and on the cards. */
.md-typeset h1 img.project-logo {
  width: 1.25em;
  height: 1.25em;
  margin-right: 0.35em;
  vertical-align: -0.25em;
  border-radius: 22%;
}

.md-typeset img.card-logo {
  width: 32px;
  height: 32px;
  vertical-align: middle;
  border-radius: 22%;
}

/* Store, web and server links (front matter `links:`). */
.md-typeset .md-button.project-link {
  margin: 0 0.4rem 0.6rem 0;
  padding: 0.4em 1.2em;
}

/* Header, once the page title has scrolled away: the project's logo before its name, where the site
   name was ("<icon> Name"). Only on project pages with a logo: overrides/main.html adds the content
   and the image; without it nothing is drawn. */
.md-header__topic[data-md-component="header-topic"] .md-ellipsis::before {
  content: none;
  display: inline-block;
  width: 1.4em;
  height: 1.4em;
  margin-right: 0.45em;
  vertical-align: -0.35em;
  border-radius: 22%;
  background: center / contain no-repeat;
}

/* Preview only (mkdocs serve, private site): the visibility filter above the catalogues, the
   "private" badge on cards and the banner on private pages. The public build emits none of them. */
.md-typeset .visibility-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}

.md-typeset .visibility-filter button {
  padding: 0.25em 0.9em;
  font: inherit;
  font-size: 0.75rem;
  color: var(--md-default-fg-color);
  background: transparent;
  border: 1px solid var(--brand-panel-border);
  border-radius: 1em;
  cursor: pointer;
}

.md-typeset .visibility-filter button[aria-pressed="true"] {
  color: var(--brand-tabs-fg);
  background: var(--brand-tabs-bg);
  border-color: var(--brand-tabs-bg);
}

.md-typeset .visibility-filter button:focus-visible {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 2px;
}

/* The filter hides cards with [hidden]: keep it stronger than the grid's own display rules. */
.md-typeset .grid.cards > ul > li[hidden] {
  display: none;
}

.md-typeset .card-private {
  font-weight: 700;
  color: var(--md-accent-fg-color);
}

/* The owner's line at the foot of each project card (hooks/visibility.py). */
.md-typeset .card-copyright {
  font-size: .65rem;
  opacity: .7;
}

/* A public project whose code is not open (hooks/visibility.py). */
.md-typeset .card-closed {
  font-weight: 700;
}

.md-typeset .admonition.private,
.md-typeset details.private {
  border-color: var(--md-accent-fg-color);
}

.md-typeset .private > .admonition-title,
.md-typeset .private > summary {
  background-color: color-mix(in srgb, var(--md-accent-fg-color) 12%, transparent);
}

.md-typeset .private > .admonition-title::before,
.md-typeset .private > summary::before {
  background-color: var(--md-accent-fg-color);
  -webkit-mask-image: var(--md-admonition-icon--private);
  mask-image: var(--md-admonition-icon--private);
}

:root {
  --md-admonition-icon--private: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 17a2 2 0 0 0 2-2 2 2 0 0 0-2-2 2 2 0 0 0-2 2 2 2 0 0 0 2 2m6-9a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V10a2 2 0 0 1 2-2h1V6a5 5 0 0 1 5-5 5 5 0 0 1 5 5v2zm-6-5a3 3 0 0 0-3 3v2h6V6a3 3 0 0 0-3-3"/></svg>');
}

/* Titles at every level, and the body text below them, shrink together as the window narrows: each
   size goes linearly from its minimum (320px wide) to its maximum (1200px and wider), and the minimums
   are in the same order as the maximums, so at any width the home title > h1 > h2 > ... > h6 > the
   body text, and the header's name stays above the tab labels (0.7rem). Material makes
   h5 and h6 smaller than the body: here they stay above it. The values come from a short calculation
   (doc/architecture.md, "Typography"); recompute them together rather than editing one.
   Titles made of parts separated by " / " also wrap between parts, never inside one, and a " / " left
   at the end of a line is hidden (javascripts/title-parts.js; hooks/visibility.py splits such headings). */
.md-typeset {
  font-size: clamp(0.720rem, 0.691rem + 0.182vw, 0.800rem);
}

.md-typeset h1.brand-title {
  font-size: clamp(1.152rem, 0.873rem + 1.745vw, 1.920rem);
}

.md-typeset h1 {
  font-size: clamp(1.044rem, 0.842rem + 1.264vw, 1.600rem);
}

.md-typeset h2 {
  font-size: clamp(0.900rem, 0.773rem + 0.795vw, 1.250rem);
}

.md-typeset h3 {
  font-size: clamp(0.814rem, 0.737rem + 0.478vw, 1.024rem);
}

.md-typeset h4 {
  font-size: clamp(0.778rem, 0.717rem + 0.378vw, 0.944rem);
}

.md-typeset h5 {
  font-size: clamp(0.749rem, 0.701rem + 0.298vw, 0.880rem);
}

.md-typeset h6 {
  font-size: clamp(0.734rem, 0.699rem + 0.222vw, 0.832rem);
}

.md-header__title .brand-name {
  font-size: clamp(0.820rem, 0.736rem + 0.523vw, 1.050rem);
}

.title-part {
  white-space: nowrap;
}

.title-sep.at-line-end {
  visibility: hidden; /* keeps its width: hiding it must not change where the lines break */
}

/* The header: its height follows the name, on one, two or three lines. */
.md-header__title {
  height: auto;
  min-height: 2.4rem;
  line-height: 1.2;
}

.md-header__title > .md-header__ellipsis {
  display: flex;
  align-items: center;
  min-height: 2.4rem;
}

.md-header__topic:first-child {
  position: relative; /* in the flow: its height is the header's; the page title still overlays it */
  display: block;
  padding: 0.3rem 0;
  white-space: normal;
}

.md-header__title .brand-name {
  display: block;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}

/* Below 360px, a part as long as "Open trildaDevCenter" no longer fits beside the header's buttons at a
   readable size (the minimums above are the legibility limits: about 16px for Futura in the header,
   14px for the body text). Rather than go smaller, the header lets a part wrap at its own spaces. */
.md-header__title {
  min-width: 0;
}

@media screen and (max-width: 22.4375em) {
  .md-header__title .title-part {
    white-space: normal;
  }
}

/* The avatar of an account, organisation or repository in a link button (scripts/sync-avatars.py),
   between the platform logo and the label. */
.md-typeset img.link-avatar {
  width: 1.3em;
  height: 1.3em;
  margin: 0 0.3em 0 0.45em;
  vertical-align: -0.3em;
  border-radius: 22%;
}

/* Bookshelf (hooks/bookshelf.py): covers on the cards and on a book's page, stars out of six, and
   the booksellers' buttons. */
.md-typeset img.book-cover-thumb {
  height: 3.2rem;
  width: auto;
  margin-right: 0.4rem;
  vertical-align: middle;
  border-radius: 0.15rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.md-typeset .book-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: flex-start;
}

.md-typeset img.book-cover {
  width: 9rem;
  height: auto;
  border-radius: 0.2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.md-typeset .book-cover-none {
  width: 9rem;
  height: 12rem;
  display: grid;
  place-items: center;
  border: 1px dashed var(--brand-panel-border);
  border-radius: 0.2rem;
}

.md-typeset .book-cover-none svg {
  width: 3rem;
  height: 3rem;
  opacity: 0.5;
}

.md-typeset .book-facts {
  flex: 1 1 18rem;
}

.md-typeset .book-facts table {
  margin: 0;
}

.md-typeset .book-stars {
  color: var(--md-accent-fg-color);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.md-typeset .book-stars-off {
  opacity: 0.25;
}

.md-typeset .md-button.book-shop {
  margin: 0 0.3rem 0.5rem 0;
  padding: 0.25em 0.9em;
  font-size: 0.75rem;
}

.md-typeset .book-subtitle {
  display: block;
  margin-top: -0.6rem;
  color: var(--md-default-fg-color--light);
}

/* Bookshelf: the "Reference" badge, and the All books / References filter (javascripts/book-filter.js).
   The project catalogues' filters (javascripts/visibility-filter.js) look the same. */
.md-typeset .book-ref {
  display: inline-block;
  margin-left: 0.4em;
  padding: 0 0.45em;
  font-size: 0.75em;
  font-weight: 700;
  color: var(--brand-tabs-fg);
  background: var(--brand-tabs-bg);
  border-radius: 0.6em;
  white-space: nowrap;
}

.md-typeset .book-filter,
.md-typeset .project-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  margin: 0 0 1rem;
}

.md-typeset .book-filter > span,
.md-typeset .project-filter > span {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.md-typeset .book-filter button,
.md-typeset .project-filter button {
  padding: 0.25em 0.9em;
  font: inherit;
  font-size: 0.75rem;
  color: var(--md-default-fg-color);
  background: transparent;
  border: 1px solid var(--brand-panel-border);
  border-radius: 1em;
  cursor: pointer;
}

.md-typeset .book-filter button[aria-pressed="true"],
.md-typeset .project-filter button[aria-pressed="true"] {
  color: var(--brand-tabs-fg);
  background: var(--brand-tabs-bg);
  border-color: var(--brand-tabs-bg);
}

.md-typeset .book-cards > ul > li[hidden],
.md-typeset .book-shelf[hidden] {
  display: none;
}

/* App screenshots: rows of three phones, whatever the page width (a project's "Screenshots"). */
.md-typeset .screenshots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 12rem));
  gap: 1rem;
}

.md-typeset .screenshots p {
  display: contents;
}

.md-typeset .screenshots img {
  width: 100%;
  height: auto;
  border-radius: 0.6rem;
}

/* A shelf page: previous shelf, up (the parent shelf, or the Bookshelf), next shelf. */
.md-typeset .shelf-nav,
.md-typeset .shelf-nav > p {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0 0 1rem;
}

.md-typeset .shelf-nav > p {
  width: 100%;
  margin: 0;
}

.md-typeset .shelf-nav .shelf-up {
  margin: 0 auto;
}

.md-typeset .shelf-nav .shelf-next {
  margin-left: auto;
}

@media screen and (max-width: 30em) {
  /* A phone: one link per line, rather than three squeezed on one. */
  .md-typeset .shelf-nav > p {
    flex-direction: column;
    align-items: flex-start;
  }

  .md-typeset .shelf-nav .shelf-up,
  .md-typeset .shelf-nav .shelf-next {
    margin: 0;
  }
}

/* The Share button (overrides/partials/share.html): with Material's page buttons, at the right of the
   title; its menu opens below it. */
.md-typeset .share {
  float: right;
  position: relative;
  margin: 0 0 0 0.4rem;
  z-index: 2;
}
.md-typeset .share > summary {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  list-style: none;
}
.md-typeset .share > summary::-webkit-details-marker {
  display: none;
}
.md-typeset .share__label {
  font-size: 0.7rem;
}
.md-typeset .share__menu {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 11rem;
  margin: 0.3rem 0 0;
  padding: 0.3rem 0;
  list-style: none;
  background: var(--md-default-bg-color);
  border-radius: 0.3rem;
  box-shadow: var(--md-shadow-z2);
}
.md-typeset .share__menu li {
  margin: 0;
}
.md-typeset .share__menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  color: var(--md-default-fg-color);
  font-size: 0.7rem;
}
.md-typeset .share__menu a:hover,
.md-typeset .share__menu a:focus {
  color: var(--md-accent-fg-color);
  background: var(--md-default-fg-color--lightest);
}
.md-typeset .share__menu svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

/* The PDF button, next to Share. */
.md-typeset .page-pdf {
  float: right;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0 0 0 0.4rem;
  background: none;
  border: 0;
  cursor: pointer;
}

/* Printed or saved as a PDF: the page's content only, without its buttons, header, menus and footer, nor
   the blocks marked { .no-pdf } (doc/sharing.md). */
@media print {
  .md-typeset .share,
  .md-typeset .page-pdf,
  .md-typeset .md-content__button,
  .md-header,
  .md-tabs,
  .md-sidebar,
  .md-footer,
  .md-top,
  .project-filter,
  .visibility-filter,
  .md-typeset .no-pdf {
    display: none !important;
  }
  .md-main__inner {
    margin: 0;
  }
  .md-content {
    max-width: none;
    margin: 0;
  }
}

/* A project's logo in the navigation, in place of its glyph (overrides/partials/nav-item.html) */
.md-nav__link img.nav-logo {
  width: 1.3em;
  height: 1.3em;
  border-radius: 0.25em;
  flex-shrink: 0;
  object-fit: cover;
}

/* A level's mini icon in its filter button (hooks/visibility.py, LEVELS; doc/petals.md) */
.project-filter img.level-icon {
  width: 1.25em;
  height: 1.25em;
  margin-right: 0.35em;
  vertical-align: -0.25em;
}
