/* Text: BIZ UDPGothic (Google Fonts; only 400 and 700 exist, so it is loaded here, not via theme.font). */
@import url("https://fonts.googleapis.com/css2?family=BIZ+UDPGothic:wght@400;700&family=Roboto+Mono:wght@400;700&display=swap");
:root {
  --md-text-font: "BIZ UDPGothic";
  --md-code-font: "Roboto Mono";
}

/* Header in the Booth cover colours: cream with black text (light), black with cream text (dark). */
:root, [data-md-color-scheme="default"] {
  --md-primary-fg-color: #f6e6b4;
  --md-primary-fg-color--light: #faefcf;
  --md-primary-fg-color--dark: #e9d28e;
  --md-primary-bg-color: #1d1d1d;
  --md-primary-bg-color--light: #1d1d1db3;
  --md-accent-fg-color: #c9861f;
  --md-typeset-a-color: #9a5a00;
}
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #1d1d1d;
  --md-primary-fg-color--light: #2a2a2a;
  --md-primary-fg-color--dark: #111111;
  --md-primary-bg-color: #f6e6b4;
  --md-primary-bg-color--light: #f6e6b4b3;
  --md-accent-fg-color: #fff59d;
  --md-typeset-a-color: #ffd60a;
}
/* Links in dark mode: bright yellow with an underline. */
[data-md-color-scheme="slate"] .md-typeset a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Colour bar from the Booth cover (orange, yellow, green, teal, purple, pink). */
.md-header::after {
  content: "";
  display: block;
  height: 8px;
  background: linear-gradient(90deg,
    #ec8a5e 0%, #ec8a5e 16.66%,
    #f2d95c 16.66%, #f2d95c 33.33%,
    #9ccb5e 33.33%, #9ccb5e 50%,
    #93d3b5 50%, #93d3b5 66.66%,
    #9b87c2 66.66%, #9b87c2 83.33%,
    #e98bb6 83.33%, #e98bb6 100%);
}

/* Background texture: put the image at docs/assets/bg.png and uncomment.
.md-main {
  background: url("../assets/bg.png") repeat;
}
*/

/* Sidebar as a tree: pages hang from their section heading (and "トップ" from the site title)
   on connecting lines. Desktop layout only; the mobile drawer keeps Material's own look. */
@media screen and (min-width: 76.25em) {
  /* Opaque colours, so the joins of the lines do not show as darker spots. */
  [data-md-color-scheme="default"] .md-nav--primary {
    --nkk-tree: #b3b3b3;
  }
  [data-md-color-scheme="slate"] .md-nav--primary {
    --nkk-tree: #5a5e68;
  }
  .md-nav--primary > .md-nav__list > .md-nav__item:not(.md-nav__item--section),
  .md-nav--primary .md-nav__item--section > .md-nav > .md-nav__list > .md-nav__item {
    position: relative;
    margin-left: 0.7rem;
    padding-left: 0.9rem;
    /* Keep the link's top margin inside the item so the lines of neighbouring items meet. */
    display: flow-root;
  }
  .md-nav--primary > .md-nav__list > .md-nav__item:not(.md-nav__item--section)::before,
  .md-nav--primary .md-nav__item--section > .md-nav > .md-nav__list > .md-nav__item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-left: 2px solid var(--nkk-tree);
  }
  .md-nav--primary > .md-nav__list > .md-nav__item:not(.md-nav__item--section)::after,
  .md-nav--primary .md-nav__item--section > .md-nav > .md-nav__list > .md-nav__item::after {
    content: "";
    position: absolute;
    left: 0;
    top: calc(0.625em + 0.65em);
    width: 0.6rem;
    border-top: 2px solid var(--nkk-tree);
  }
  /* The last page of a group ends the vertical line at its own branch. */
  .md-nav--primary > .md-nav__list > .md-nav__item:not(.md-nav__item--section):last-of-type::before,
  .md-nav--primary > .md-nav__list > .md-nav__item:not(.md-nav__item--section):has(+ .md-nav__item--section)::before,
  .md-nav--primary .md-nav__item--section > .md-nav > .md-nav__list > .md-nav__item:last-child::before {
    bottom: auto;
    height: calc(0.625em + 0.65em);
  }
}

/* No highlight on table rows under the mouse. */
.md-typeset table:not([class]) tbody tr:hover {
  background-color: transparent;
  box-shadow: none;
}

/* Easter egg page (say-cheese.md): the 200-column picture shrunk to the page width. */
.nkk-egg pre > code {
  font-size: clamp(2px, 0.62vw, 7px);
  line-height: 1.05;
  overflow: hidden;
  white-space: pre;
  color: var(--md-accent-fg-color);
}
.nkk-egg pre {
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.md-typeset .nkk-egg-text {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-top: 1.5em;
}
