/* Text: LINE Seed JP (Google Fonts, SIL OFL 1.1). Loaded here rather than via theme.font,
   which asks for weights the family does not have. */
@import url("https://fonts.googleapis.com/css2?family=LINE+Seed+JP:wght@400;700&family=Roboto+Mono:wght@400;700&display=swap");
:root {
  --md-text-font: "LINE Seed JP";
  --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;
  /* Dark header: site name in the body text colour, icons and the search placeholder in grey. */
  --md-primary-bg-color: #e2e4e9;
  --md-primary-bg-color--light: #9aa0a8;
  --md-accent-fg-color: #fff59d;
  --md-typeset-a-color: #ffd60a;
  /* Text brighter than Material's (#bec1c6, contrast 8.9) -> 12.7 on the dark background. */
  --md-typeset-color: #e2e4e9;
  /* Neutral dark grey page instead of Material's bluish slate. */
  --md-default-bg-color: #1f1f1f;
  --md-default-bg-color--light: #2728298a;
  --md-default-bg-color--lighter: #27282942;
  --md-default-bg-color--lightest: #27282912;
  --md-code-bg-color: #303132;
  --md-code-bg-color--light: #303132e6;
  --md-code-bg-color--lighter: #3031328a;
}
[data-md-color-scheme="slate"] body,
[data-md-color-scheme="slate"] .md-typeset,
[data-md-color-scheme="slate"] .md-typeset h1,
[data-md-color-scheme="slate"] .md-typeset h2,
[data-md-color-scheme="slate"] .md-typeset h3 {
  color: #e2e4e9;
}
/* 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;
}

/* Menu icons (tools/add_icons.py): the in-game icons are light grey, so they are darkened in light mode. */
.md-typeset img.nkk-icon {
  height: 2.2em;
  width: auto;
  vertical-align: middle;
  margin-right: 0.45em;
}
.md-nav--primary .md-nav__link > svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}
[data-md-color-scheme="default"] .md-typeset img.nkk-icon,
[data-md-color-scheme="default"] .md-nav image.nkk-nav-icon {
  filter: brightness(0.25);
}

/* Logo: white artwork, shown dark on the cream header in light mode. */
[data-md-color-scheme="default"] .md-logo img {
  filter: invert(1) brightness(0.12);
}
.md-header__button.md-logo img {
  height: 2.2rem;
}

/* Site name close to the logo (Material's own rule is [dir=ltr]-scoped, so this one is too). */
[dir=ltr] .md-header__title {
  margin-left: 0.15rem;
}
.md-header__button.md-logo {
  margin-right: 0;
  padding-right: 0.2rem;
}

/* Footer "前へ／次へ": more room between the small label and the page name. */
.md-footer__direction {
  display: block;
  margin-bottom: 0.6rem;
}

/* DESIGN.md: small text at least 14px (Material's tables are 0.64rem = 12.8px). */
.md-typeset table:not([class]) {
  font-size: 0.8rem;
}

/* DESIGN.md: body lines about 40 Japanese characters at most; tables keep the full width. */
.md-typeset p:not(.admonition-title):not(:has(img:not(.nkk-icon))),
.md-typeset ul,
.md-typeset ol {
  max-width: 40em;
}

/* DESIGN.md sizes. Material scales the whole page up on wide screens (root 22px / 24px);
   keep the root at 20px everywhere so the sizes below are what readers get. */
html {
  font-size: 125%;
}
/* Body 18px (0.9rem), sidebar 15px; the sidebar a little wider so page names stay on one line. */
.md-typeset {
  font-size: 0.9rem;
}
.md-nav {
  font-size: 0.75rem;
}
@media screen and (min-width: 76.25em) {
  .md-sidebar--primary {
    width: 14.5rem;
  }
  /* Material caps the inner width at 11.5rem whatever the sidebar width is. */
  [dir=ltr] .md-sidebar--primary .md-sidebar__inner {
    padding-right: calc(100% - 14rem);
  }
}
/* Headings bold (700), body regular (400). */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  font-weight: 700;
  color: var(--md-default-fg-color);
}

[data-md-color-scheme="slate"] .md-header__button.md-icon,
[data-md-color-scheme="slate"] .md-search__icon,
[data-md-color-scheme="slate"] .md-header__option .md-icon {
  color: #9aa0a8;
}

/* Faint, oversized logo mark behind the right side of the header (pre-faded PNGs, so the
   header's own background clips it and the search results are not affected). */
.md-header {
  background-repeat: no-repeat;
  background-position: right 16% center;
  background-size: auto 320%;
}
[data-md-color-scheme="slate"] .md-header {
  background-image: url("../assets/logo-overlay-dark.png");
}
[data-md-color-scheme="default"] .md-header {
  background-image: url("../assets/logo-overlay-light.png");
}

/* Footer: "Made with Material for MkDocs" smaller, a little space under the copyright line.
   The credit is bare text in .md-copyright, so the whole block is made smaller and the
   copyright line set back to its own size. */
.md-copyright {
  font-size: 0.5rem;
}
.md-copyright__highlight {
  font-size: 0.64rem;
  margin-bottom: 0.35rem;
}

/* Wider page (Material: 61rem); table item names such as 黄金螺旋グリッド stay on one line (on phones too);
   body text keeps its 40em limit, so only tables and images use the extra width. */
.md-grid {
  max-width: 68rem;
}
.md-typeset table:not([class]) td:first-child {
  white-space: nowrap;
}

/* Before/after slider (javascripts/compare.js): the ON image lies over the OFF image and is
   clipped at --pos; a transparent range input on top takes the drag. */
.md-typeset .nkk-compare {
  position: relative;
  margin: 1em 0 1.5em;
  border-radius: 6px;
  overflow: hidden;
  line-height: 0;
}
.md-typeset .nkk-compare p {
  margin: 0;
  max-width: none;
}
.md-typeset .nkk-compare img {
  display: block;
  width: 100%;
  height: auto;
}
.md-typeset .nkk-compare--on p + p,
.md-typeset .nkk-compare--on img + img {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 var(--pos, 50%));
}
.md-typeset .nkk-compare--on p + p img {
  height: 100%;
}
.nkk-compare input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
.nkk-compare__line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos, 50%);
  width: 2px;
  margin-left: -1px;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
/* The handle: two white triangles either side of the line, near the bottom of the photo. */
.nkk-compare__handle {
  position: absolute;
  top: 86%;
  left: var(--pos, 50%);
  width: 4.2rem;
  height: 2.1rem;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.nkk-compare__handle svg {
  width: 100%;
  height: 100%;
  fill: #ffffff;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.6));
}
.md-typeset img {
  border-radius: 6px;
}

/* Photo credit under a before/after slider (top page) */
.md-typeset .nkk-photo-credit {
  margin: -1em 0 1.5em;
  font-size: 0.7rem;
  color: var(--md-default-fg-color--light);
}

/* Easter eggs on the license and say-cheese pages: invisible until selected */
.md-typeset .nkk-secret {
  margin-top: 6em;
  color: var(--md-default-bg-color);
}
.md-typeset .nkk-secret--center {
  text-align: center;
}
.md-typeset .nkk-secret::selection,
.md-typeset .nkk-secret--shown {
  color: var(--md-default-fg-color);
}
