/* Brings the docs close to mino.bot: its colours, its system font, and its dark header with the white logo. */

html {
    --mino-navy: #0b1020;
    --mino-navy-soft: #111733;
    --mino-indigo: #4f46e5;
    --mino-indigo-hover: #4338ca;
    --mino-cyan: #22d3ee;

    --pst-font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --pst-font-family-heading: var(--pst-font-family-base);
}

html[data-theme="light"] {
    --pst-color-primary: var(--mino-indigo);
    --pst-color-primary-bg: #eef2ff;
    --pst-color-secondary: #0e7490; /* The site's cyan is too light for text on white. */
    --pst-color-secondary-bg: #ecfeff;
    --pst-color-link: var(--mino-indigo);
    --pst-color-link-hover: var(--mino-indigo-hover);
    --pst-color-accent: #0e7490;
    --pst-color-background: #ffffff;
    --pst-color-on-background: #f7f8fc;
    --pst-color-text-base: var(--mino-navy);
    --pst-color-inline-code: #3730a3;
}

html[data-theme="dark"] {
    --pst-color-primary: #818cf8; /* The site's indigo is too dark for text on navy. */
    --pst-color-primary-bg: #1e1b4b;
    --pst-color-secondary: var(--mino-cyan);
    --pst-color-secondary-bg: #083344;
    --pst-color-link: #a5b4fc;
    --pst-color-link-hover: var(--mino-cyan);
    --pst-color-accent: var(--mino-cyan);
    --pst-color-background: var(--mino-navy);
    --pst-color-on-background: var(--mino-navy-soft);
    --pst-color-surface: #161d3d;
    --pst-color-inline-code: #c7d2fe;
}

/* ---------- Header: dark in both themes, as on mino.bot ---------- */

.bd-header {
    background: var(--mino-navy) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none !important;
}

.bd-header .navbar-brand img {
    height: 34px;
}

.bd-header .navbar-brand,
.bd-header .navbar-brand p.title {
    color: rgba(255, 255, 255, 0.92) !important;
    font-weight: 600;
}

.bd-header .navbar-nav .nav-link,
.bd-header .pst-navbar-icon,
.bd-header .theme-switch-button,
.bd-header .version-switcher__button,
.bd-header .primary-toggle,
.bd-header .secondary-toggle,
.bd-header .search-button {
    color: rgba(255, 255, 255, 0.82) !important;
}

.bd-header .navbar-nav .nav-link:hover,
.bd-header .pst-navbar-icon:hover,
.bd-header .theme-switch-button:hover,
.bd-header .version-switcher__button:hover {
    color: #fff !important;
    text-decoration: none;
}

.bd-header .navbar-nav li.current > .nav-link,
.bd-header .navbar-nav li.active > .nav-link {
    color: #fff !important;
    border-bottom-color: var(--mino-cyan) !important;
}

.bd-header .search-button-field {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
}

.bd-header .search-button-field:hover {
    border-color: rgba(255, 255, 255, 0.35);
}

.bd-header .search-button-field .kbd-shortcut__modifier,
.bd-header .search-button-field kbd {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    box-shadow: none;
}

.bd-header .version-switcher__button {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.2);
}

/* ---------- Interface reference ---------- */

table.ros-iface-table {
    width: 100%;
}

table.ros-iface-table td {
    vertical-align: top;
}

table.ros-iface-table td p {
    margin-bottom: 0.4rem;
}

table.ros-iface-table td ul {
    margin-bottom: 0.4rem;
    padding-left: 1.2rem;
}

table.ros-iface-table td:first-child code {
    font-weight: 600;
}

dl.ros-iface-summary {
    margin-top: 1rem;
}

details.ros-iface-definition {
    margin-top: 2rem;
}

details.ros-iface-definition summary {
    cursor: pointer;
    font-weight: 600;
}

/* Long ROS names and types wrap instead of overflowing tables and the page's table of contents. Only the
   names and types, which are links or code: on whole cells, plain words such as "Subscribes" could break
   between any two letters too, and the table then shrank their column to one letter wide. */
.bd-article table td a,
.bd-article table td code,
.bd-toc-nav .nav-link {
    overflow-wrap: anywhere;
}

/* "Docs" is a link of its own, to the docs' landing page, set apart from the logo, which goes to the site's
   home page. */
.bd-header .navbar-header-items__start {
    align-items: center;
}

.bd-header a.navbar-docs-title {
    margin-left: 0.9rem;
    padding-left: 0.9rem;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
}

.bd-header a.navbar-docs-title:hover {
    color: #fff;
    text-decoration: none;
}

/* The header's items are the top level of the docs, so they are larger than the text below them. */
html {
    --pst-header-height: 4.75rem;
}

.bd-header .navbar-nav .nav-link {
    font-size: 1.2rem;
    font-weight: 500;
}

.bd-header .navbar-nav > li {
    margin-inline: 0.35rem;
}
