/* 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
   Inter, the text font of the website (tokens.css) */
@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Inter-Roman-latin.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Inter-Roman-latin-ext.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Inter-Italic-latin.woff2') format('woff2');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Inter-Italic-latin-ext.woff2') format('woff2');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* 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: var(--fontBody);
    font-size: var(--fontBase);
    font-weight: var(--weightBody);
    line-height: 1.6;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::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;
}

/* Where the website folds the follow links into a stack of bubbles at the
   bottom right of the screen, the docs keep them there */
@media screen and (min-width: 920px) and (max-width: 1240px) {
    #header .follow {
        position: fixed;
    }

    #header .follow a:hover {
        transform: scale(1.1);
    }
}

#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-family: var(--fontHeading);
    font-size: var(--fontH2);
    line-height: 1.15;
    font-weight: 700;
    margin: 1.6em 0 .6em;
}

/* The title of a page without breadcrumbs opens its body where the
   breadcrumbs of the other pages do: the body loses the margin that sits
   under them, and the title (after the empty toggle span of the theme)
   its top margin */
#head-tags:first-child + #body-inner {
    margin-top: 0;
}

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

/* Beside the sidebar, the breadcrumbs sit on the line of the version
   selector and the title on the line of the search box */
@media screen and (min-width: 769px) {
    #body .padding {
        padding-top: 28px;
    }

    #head-tags:not(:first-child) + #body-inner {
        padding-top: 42px;
    }
}

#body-inner h2, #body-inner h3, #body-inner h4, #body-inner h5, #body-inner h6 {
    font-family: var(--fontHeading);
    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: var(--fontMono);
}

#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);
}

/* The sidebar and the contents are fixed below the sticky header: they make
   room for the part of the news line still on screen, which banner.html
   publishes as --newsBarOffset */
#sidebar {
    top: calc(100px + var(--newsBarOffset, 0px));
}

@media screen and (min-width: 1401px) {
    .toc {
        top: calc(100px + var(--newsBarOffset, 0px));
    }
}

@media screen and (max-width: 768px) {
    #sidebar.show {
        padding-top: calc(100px + var(--newsBarOffset, 0px));
    }
}

.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);
}
