@import 'fonts.css';

nav > ul {
    padding: var(--base-padding);
}

nav > ul > li {
    height: 100%;
    width: 100%;
    display: inline-flex;
}

nav > ul > li > a {
    width: 100%;
    padding: 1rem;
    text-decoration: none;
    color: var(--color-text);
    border-radius: var(--border-radius-small);
    transition: var(--transition-1);
}

nav > ul > li > a:hover {
    background-color: var(--color-surface-selected);
    text-decoration: underline;
}

nav > ul > li > .nav-openable:hover {
    background-color: var(--color-surface-selected);
    box-shadow: none;
    text-decoration: underline;
}

nav > ul > li > .nav-openable {
    padding: 1rem;
    display: inline-flex;
    justify-content: space-between;
    background-color: var(--color-surface);
    color: var(--color-text); /* added because text was otherwise white and vanishes in sidemenu*/
}

nav > ul > li > .nav-openable::after {
    content: url('/assets/icons/expand-arrow-down.svg');
    filter: brightness(50%);
    align-self: center;
    justify-self: center;
}

nav > ul > li > .nav-openable-active::after {
    content: url('/assets/icons/expand-arrow-up.svg');
}

.nav-openable-active + ul {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    list-style-type: none;
    padding: 0;
}

nav > ul > li > ul > li {
    width: 100%;
    height: 100%;
    display: inline-flex;
}

nav > ul > li > ul > li > a {
    width: 100%;
    padding: 1rem 1rem 1rem 2rem;
    text-decoration: none;
    color: var(--color-text);
    border-radius: var(--border-radius-small);
    transition: var(--transition-1);
}

nav > ul > li > ul > li > a:hover {
    background-color: var(--color-surface-selected);
    text-decoration: underline;
}

nav > ul > li > div {
    width: 100%;
    padding: 1rem;
    text-decoration: none;
    color: var(--color-text);
    border-radius: var(--border-radius-small);
    transition: var(--transition-1);
    cursor: pointer;
}

.nav-active {
    background-color: var(--color-surface-selected);
}

.dropdown-button:has(+ div.dropdown-active) {
    box-shadow: none;
    background-color: var(--color-primary-selected);
}

footer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    margin-top: 1rem;
}

/*
 * Site buttons. Explicitly excluded from Swagger UI, which ships its own button
 * styling for model toggles, tab links and section headers. Without the guard
 * this rule paints every one of them pink with white text on a light background,
 * which is unreadable.
 */
button:not(.swagger-ui button) {
    color: var(--color-text-light);
    border: none;
    border-radius: var(--border-radius-small);
    padding: var(--base-padding);
    background-color: var(--color-button);
    transition: var(--transition-1);
    cursor: pointer;
}

button:not(.swagger-ui button):hover {
    box-shadow: var(--drop-shadow-light);
    background-color: var(--color-button-light);
}

main {
    border-radius: var(--border-radius);
    margin-top: 1rem;

    padding: var(--card-padding);

    @media screen and (min-width: 700px) {
        margin: auto;
        margin-top: 2rem;
    }
}

img {
    max-width: 100%;
}

.header-logo-link {
    grid-area: header-logo;
    align-self: center;
    justify-self: center;
    text-decoration: none;
    min-width: 0;

    display: initial;

    @media screen and (min-width: 700px) {
        display: none;
    }
}

.screenshot-container {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.shadowed-image .image-container {
    box-shadow: var(--drop-shadow-medium);
}

.image-container, .image-container img {
    max-width: 100%;
}

.image-container-phone {
    max-width: 400px;
}

.dropdown-button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    column-gap: 0.5rem;
    position: relative;
    background-color: transparent;
    border: none;
    color: var(--color-text-light);
}

.dropdown-button:hover {
    box-shadow: none;
    background-color: var(--color-primary-selected);
}

.dropdown-container > ul {
    list-style-type: none;
    padding-left: 0;
}

.dropdown-container > ul > li {
    background-color: var(--color-surface);
}

.dropdown-container a {
    display: flex;
    align-items: center;
    column-gap: 0.5rem;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: var(--color-text);
}

.dropdown-container a:hover {
    background-color: var(--color-surface-selected);
}

#sidebar-button {
    justify-self: start;
    @media screen and (min-width: 700px) {
        display: none;
    }
}

.sidebar-container {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;
    justify-items: center;

    @media screen and (min-width: 700px) {
        align-items: initial;
        justify-items: initial;
        justify-content: start;
        max-width: var(--sidebar-max-width);
    }
}

.sidebar-logo-link {
    @media (min-width: 700px) {
        display: initial;
    }
}

.sidebar-logo {
    padding: 1rem;

    @media (min-width: 700px) {
        padding: 1rem 2.5rem;
        margin-top: 1.2rem;
    }
}

/* Constrained to fit inside the --header-height bar on mobile. */
.header-logo {
    max-height: 40px;
    max-width: 100%;
    width: auto;
    height: auto;
}


.language-selector {
    align-self: center;
    justify-self: end;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(155, 155, 155, 0.5);
    border-radius: var(--border-radius);
    border: transparent;
}

/* CSS Reset (moreso, sensible defaults) */
/* Source: https://www.joshwcomeau.com/css/custom-css-reset/ */

/*
  1. Use a more-intuitive box-sizing model.
*/
*, *::before, *::after {
    box-sizing: border-box;
}

/*
  2. Remove default margin

  Scoped away from Swagger UI, which relies on default element margins for
  spacing inside its schema tables and response panels.
*/
*:where(:not(.swagger-ui, .swagger-ui *)) {
    margin: 0;
}

/*
  Typographic tweaks!
  3. Add accessible line-height
  4. Improve text rendering
*/
body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/*
  5. Improve media defaults
*/
/* Swagger UI uses inline SVG for its expand/collapse arrows; forcing
   display:block on those breaks their alignment inside buttons. */
:where(img, picture, video, canvas, svg):where(:not(.swagger-ui *)) {
    display: block;
    max-width: 100%;
}

/*
  6. Remove built-in form typography styles

  Excluded from swagger-ui because otherwise `Schemas` section was not pretty at all.
*/
:where(input, button, textarea, select):where(:not(.swagger-ui *)) {
    font: inherit;
}

/*
  7. Avoid text overflows
*/
p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

/*
  8. Create a root stacking context
*/
#root, #__next {
    isolation: isolate;
}

hr {
    margin: 1rem 0;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
}

p {
    margin-bottom: .5rem;
}
