/*
 * Robonine docs skin.
 *
 * Material ships a complete design; this pulls it towards the main site —
 * the site's own header and footer above and below, the same typeface and
 * type scale, the same monochrome palette, the same squared-off shapes — so a
 * reader arriving from robonine.com does not feel handed off to somebody
 * else's website.
 */

:root {
  --md-text-font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --md-code-font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* The site's text is pure black on white, not Material's 87% grey. */
  --md-default-fg-color: #000000;
  --md-default-fg-color--light: #51525c;
}

/*
 * Links. With a white primary colour Material falls back to indigo for links;
 * the site's links are the text colour, underlined. The selector matches the
 * body attribute Material uses for its own rule, so this one wins by order.
 */
[data-md-color-primary="white"] {
  --md-typeset-a-color: var(--md-default-fg-color);
}

.md-typeset a:not(.md-button):not(.robonine-card):not(.glightbox):not(.headerlink) {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.md-typeset a:not(.md-button):not(.robonine-card):not(.glightbox):not(.headerlink):hover {
  text-decoration: none;
}

/*
 * Type scale, taken from the site's article pages: body 16/24, h1 36/40,
 * h2 24/36, h3 22/32, h4 20/30, all headings bold in the text colour. Material
 * sizes in rem with the root at 125%, so 0.8rem is 16px.
 */
.md-typeset {
  font-size: 0.8rem;
  line-height: 1.5;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  color: var(--md-default-fg-color);
  font-weight: 700;
  letter-spacing: 0;
}

.md-typeset h1 {
  font-size: 1.8rem;
  line-height: 1.12;
  margin-bottom: 1.2rem;
}

.md-typeset h2 {
  font-size: 1.2rem;
  line-height: 1.5;
  margin: 1.8em 0 0.8em;
}

.md-typeset h3 {
  font-size: 1.1rem;
  line-height: 1.45;
  margin: 1.6em 0 0.7em;
}

.md-typeset h4 {
  font-size: 1rem;
  line-height: 1.5;
}

/* The site's navigation is set at 16px; Material's default is 14px. */
.md-nav,
.md-tabs__link {
  font-size: 0.8rem;
}

.md-sidebar--secondary .md-nav {
  font-size: 0.75rem;
}

/*
 * The main site's header, mounted by assets/robonine-chrome.js above
 * Material's. Until it arrives — or if it never does — the fallback is the
 * logo on the same white band with the site's bottom border.
 */
.robonine-header {
  background: #ffffff;
  border-bottom: 1px solid #d1d5db;
}

.robonine-chrome--live {
  border-bottom: 0;
}

.robonine-header__fallback {
  margin: 0 auto;
  max-width: 64rem;
  padding: 0.8rem 1.6rem;
}

.robonine-header__logo {
  display: inline-block;
}

.robonine-header__logo img {
  display: block;
  height: 2rem;
  width: auto;
}

/*
 * Material's header, reduced to the docs' own navigation: white, with the
 * tabs and the search on one line and a hairline below, under the site's
 * header. The site's header carries the language switcher, so Material's is
 * hidden. On narrower screens Material's header keeps its usual shape — the
 * drawer button, the page title, the search — since the tabs are not shown
 * there.
 */
.md-header,
.md-header--shadow {
  box-shadow: none;
  border-bottom: 1px solid #d1d5db;
}

.md-header .md-select {
  display: none;
}

/* The docs grid is the site's container: 1280px, so the two line up. */
.md-grid {
  max-width: 64rem;
}

@media screen and (min-width: 76.25em) {
  .md-header__inner {
    height: 2.6rem;
    justify-content: flex-end;
    left: 0;
    padding: 0 0.2rem;
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 1;
  }

  .md-header__inner > * {
    pointer-events: auto;
  }

  .md-header__button.md-logo,
  .md-header__button[for="__drawer"],
  .md-header__title {
    display: none;
  }

  .md-tabs__item {
    height: 2.6rem;
  }

  /* Room on the right for the search box. */
  .md-tabs__list {
    padding-right: 13rem;
  }
}

/*
 * The left-hand navigation. Three kinds of line, three looks:
 *   - the part's name ("For learners"): larger, bold, the text colour;
 *   - a group of pages ("Before you start"): bold, the text colour, set off
 *     from the group above — a heading, not a destination;
 *   - a page: regular weight, muted; the open page in bold, the text colour.
 * Material styles all three alike, which is what made them hard to tell apart.
 */
.md-nav--primary .md-nav__link {
  color: var(--md-default-fg-color--light);
  font-weight: 400;
}

.md-nav--primary .md-nav__link:hover {
  color: var(--md-default-fg-color);
}

.md-nav--primary .md-nav__link--active,
.md-nav--primary .md-nav__link--active:hover {
  color: var(--md-default-fg-color);
  font-weight: 700;
}

@media screen and (min-width: 76.25em) {
  .md-nav--primary > .md-nav__list > .md-nav__item--section > .md-nav__container > .md-nav__link {
    color: var(--md-default-fg-color);
    font-size: 0.9rem;
    font-weight: 700;
  }

  .md-nav--primary .md-nav[data-md-level="1"] > .md-nav__list > .md-nav__item--section > label.md-nav__link {
    color: var(--md-default-fg-color);
    font-weight: 700;
    margin-top: 1rem;
  }

  .md-nav--primary .md-nav[data-md-level="1"] > .md-nav__list > .md-nav__item--section:first-child > label.md-nav__link {
    margin-top: 0.5rem;
  }
}

/*
 * The previous/next strip. Material paints it in the primary colour; kept in
 * the page colours with a hairline above, so the site footer below it reads
 * as the footer.
 */
.md-footer {
  --md-footer-bg-color: var(--md-default-bg-color);
  --md-footer-bg-color--dark: var(--md-default-bg-color);
  --md-footer-fg-color: var(--md-default-fg-color);
  --md-footer-fg-color--light: var(--md-default-fg-color--light);
  --md-footer-fg-color--lighter: var(--md-default-fg-color--lighter);
  border-top: 1px solid var(--md-default-fg-color--lightest);
}

/*
 * The main site's footer, mounted by assets/robonine-chrome.js. Until it
 * arrives — or if it never does — the fallback is the same black band with
 * the logo and the copyright line, so the page ends the same way either way.
 */
.robonine-footer {
  background: #000000;
  color: #ffffff;
}

.robonine-footer__fallback {
  margin: 0 auto;
  max-width: 64rem;
  padding: 3.2rem 1.6rem 2.4rem;
}

.robonine-footer__logo {
  display: inline-block;
}

.robonine-footer__logo img {
  display: block;
  height: 2rem;
  width: auto;
}

.robonine-footer__copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: #d1d5db;
  font-size: 0.8rem;
  line-height: 1.5;
  margin: 1.6rem 0 0;
  padding-top: 1.6rem;
  text-align: center;
}

/* Square corners, like the buttons and cards on the site. */
.md-typeset .admonition,
.md-typeset details,
.md-typeset pre > code,
.md-typeset .tabbed-set > .tabbed-content {
  border-radius: 0;
}

/* The landing cards on the front page of the docs. */
.robonine-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 1.5rem 0;
}

.robonine-card {
  border: 1px solid var(--md-default-fg-color--lightest);
  display: block;
  padding: 1.1rem 1.2rem;
  text-decoration: none !important;
  transition: border-color 120ms ease;
}

.robonine-card:hover {
  border-color: var(--md-default-fg-color--light);
}

.robonine-card h3 {
  margin: 0 0 0.35rem;
}

.robonine-card p {
  color: var(--md-default-fg-color--light);
  margin: 0;
}

/* Tables of keyboard shortcuts and specifications read better full width. */
.md-typeset table:not([class]) {
  display: table;
  width: 100%;
}

/*
 * Screenshots of the Lab interface. A hairline frame separates a white UI
 * capture from the white page; the caption sits tight under the image, in the
 * secondary text colour, the way a figure caption does in print.
 */
.md-typeset figure.robonine-shot {
  margin: 1.6rem 0;
}

.md-typeset figure.robonine-shot img {
  border: 1px solid var(--md-default-fg-color--lightest);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
  display: block;
  height: auto;
  max-width: 100%;
}

.md-typeset figure.robonine-shot figcaption {
  color: var(--md-default-fg-color--light);
  font-size: 0.72rem;
  line-height: 1.5;
  margin-top: 0.55rem;
  max-width: none;
}

/* Narrow crops (a dialog, a button) should not be stretched to the column. */
.md-typeset figure.robonine-shot--narrow img {
  max-width: 34rem;
}

