/* The docs in the look of the website, on top of the sg-doc theme: its
   fonts and type scale, its colors and its header */

/* The docs theme sets Poppins everywhere: the faces below render it as
   Exo 2, the font of the website */
@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Exo2-Regular.woff2') format('woff2');
    font-weight: 300 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Exo2-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Exo2-Bold.woff2') format('woff2');
    font-weight: 600 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Exo2-Italic.woff2') format('woff2');
    font-weight: 300 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Exo2-BoldItalic.woff2') format('woff2');
    font-weight: 500 900;
    font-style: italic;
    font-display: swap;
}

/* Colors: the ones of the website in each theme (tokens.css), for the
   variables of the docs theme. Code takes the code palette of the theme
   (tokens.css, code.css). */
body {
    --baseGradient: linear-gradient(to bottom right, var(--baseColor), var(--baseLightColor));
    --invertedGradient: linear-gradient(to bottom left, var(--baseColor), var(--baseLightColor));
    --inlineCode: var(--lBlue);
    --mutedText: var(--themeMuted);
}

[data-theme="light"] body {
    --inlineCode: var(--themeAccent);
}

html, body {
    background: var(--bgColor);
}

body {
    font-family: 'Exo 2', sans-serif;
    font-size: var(--fontBase);
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: .15px;
}

::selection {
    background: var(--baseColor);
    color: var(--darkBlue);
}

/* Header: the one of the website, without the leftovers of the old one */
#header {
    box-shadow: 0 2px 12px #0000001A;
}

#header .follow, #mainMenu {
    margin-top: 0;
}

#header .container {
    padding-left: 15px;
    padding-right: 15px;
}

#header nav a, #header nav a:visited {
    color: var(--textColor);
    font-size: var(--fontBase);
    font-weight: 500;
}

#header nav .active > a {
    font-weight: bold;
}

#header nav .active > a:after {
    background-image: none;
    background: var(--horizontalGradient);
}

#header .headerLogo span {
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--textColor);
}

#header .headerLogo svg {
    position: static;
}

#header a.slack svg, #header a.github svg {
    position: static;
}

/* The header of sg-doc places the logo, the links and the burger of
   narrower screens elsewhere: they stay in the row of the header */
#header #logo {
    position: static;
    transform: none;
    opacity: 1;
}

#header .follow {
    position: static;
}

#header .follow a {
    position: static;
    line-height: inherit;
}

#header .follow a:hover {
    transform: none;
}

#header .follow a svg path {
    fill: var(--baseColor);
}

#header #navToggle {
    position: static;
    transform: none;
}

#header #mainMenu li:last-child:after {
    content: none;
}

@media screen and (max-width: 920px) {
    #header nav a, #header nav a:visited, #header nav a:hover {
        color: var(--textColor) !important;
    }
}

/* Content */
#body {
    background: var(--bgColor);
}

/* The title of the page, and the sections a level below */
#body-inner h1 {
    font-size: var(--fontH2);
    line-height: 1.15;
    font-weight: 700;
    margin: 1.6em 0 .6em;
}

#body-inner > h1:first-child {
    font-size: var(--fontH1);
    margin: 0 0 32px;
}

#body-inner h2, #body-inner h3, #body-inner h4, #body-inner h5, #body-inner h6 {
    color: var(--textColor) !important;
    font-weight: 700;
    line-height: 1.25;
    text-transform: none;
    letter-spacing: 0;
}

#body-inner h2 {
    font-size: var(--fontH3);
    margin: 2.2em 0 .6em;
}

#body-inner h3 {
    font-size: var(--fontLead);
    margin: 1.8em 0 .5em;
}

#body-inner h4 {
    font-size: var(--fontBase);
}

#body-inner h5, #body-inner h6 {
    font-size: var(--fontBase);
}

#body-inner p, #body-inner li, #body-inner td, #body-inner th {
    font-size: var(--fontBase);
    line-height: 1.6;
}

#body a, #body a:visited {
    color: var(--baseColor);
}

#body a:hover {
    color: var(--baseLightColor);
}

/* Code */
code, kbd, pre, samp {
    font-family: 'Ubuntu Mono', monospace;
}

#body-inner :not(pre) > code {
    background: var(--activeBg);
    border: 1px solid var(--codeBorder);
    color: var(--inlineCode);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: .95em;
}

/* Code blocks stand on the surface color, like the notices, as the code
   palette's background is too close to the page */
#body-inner pre {
    background: var(--activeBg) !important;
    border: 1px solid var(--codeBorder);
    border-radius: 8px;
    padding: 0;
}

#body-inner pre code, .hljs {
    background: transparent !important;
    color: var(--codeText);
    font-size: var(--fontBase);
    line-height: 1.6;
}

#body-inner pre code {
    display: block;
    padding: 16px 20px;
    overflow-x: auto;
}

/* Tables */
#body-inner table {
    border-collapse: collapse;
    background: none;
}

#body-inner th, #body-inner td {
    border: 0;
    border-bottom: 1px solid var(--borderColor);
    background: none;
    color: var(--textColor);
    padding: 10px 12px;
    text-align: left;
}

#body-inner thead tr, #body-inner thead th {
    background: var(--activeBg);
}

#body-inner tr:nth-child(even) {
    background: var(--themeHover);
}

/* Swagger UI of the REST API */
#ohpen_swagger_ui svg:not(.btn svg) {
    fill: var(--mutedText);
}

/* Notices and quotes */
#body-inner blockquote {
    background: var(--activeBg);
    border-left: 4px solid var(--baseColor);
    color: var(--textColor);
}

/* Sidebar */
#sidebar {
    background: var(--bgColor);
}

.versionSelector label {
    color: var(--mutedText);
    font-size: var(--fontSmall);
    font-weight: 700;
}

.versionSelector select {
    color: var(--textColor);
    font-size: var(--fontSmall);
}

#sidebar a, #sidebar ul.topics > li > a {
    font-size: var(--fontBase);
}

#sidebar ul li.active > a {
    background: var(--activeBg);
}

/* The toggles of the sections draw their plus and minus with bars, centered
   in their box, and sit at one distance from the edge whether the section is
   open (its item has a right padding) or not */
#sidebar ul.topics .toggleToc, #sidebar ul.topics .parent .toggleToc {
    right: 16px;
    top: 13px;
    width: 14px;
    height: 14px;
    font-size: 0;
    line-height: 0;
    display: block;
}

#sidebar ul.topics .toggleToc:before, #sidebar ul.topics .parent .toggleToc:before,
#sidebar ul.topics .toggleToc:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background: currentColor;
    transform: translate(-50%, -50%);
}

#sidebar ul.topics .toggleToc:before, #sidebar ul.topics .parent .toggleToc:before {
    width: 8px;
    height: 2px;
}

#sidebar ul.topics .toggleToc:after {
    width: 2px;
    height: 8px;
}

#sidebar ul.topics .parent .toggleToc:after {
    display: none;
}

#sidebar .searchbox, #sidebar .searchbox input, .versionSelector select {
    background: var(--inputBg);
    color: var(--textColor);
    border-color: var(--borderColor);
}

/* Where the sidebar shows on narrow screens, the content takes the width
   beside it */
@media screen and (min-width: 769px) and (max-width: 920px) {
    #body {
        width: auto;
        max-width: none;
    }
}

/* Table of contents */
.toc h2 {
    color: var(--mutedText) !important;
    font-size: var(--fontSmall);
    font-weight: 700;
    letter-spacing: .08em;
}

#TableOfContents a, .toc #TableOfContents li a {
    font-size: var(--fontSmall);
}
