/*.overlayIsOpen {*/
/*    overflow-y: hidden;*/
/*}*/

.ApiDocumentationView {
    width: min(100%, 80em);
    min-height: inherit;/** Align to top */
    margin: auto;
    padding-top: max(3vw, 1rem);
    container: main / inline-size;
}

.has-js .ApiDocumentationView--initialising {
    opacity: 0;
}

.ApiDocView__sectionTitle {
    margin-block: 3rem .5rem;
}

.ApiDocumentationView p {
    max-width: 40em;
}

.ApiDocumentationView:is(ul, ol) {
    list-style-position: outside;
    margin: initial;
    margin-bottom: 2em;
}

.ApiDocumentationView__overlay pre,
.ApiDocumentationView pre {
    margin: 0;
}

.js-examplePlaceholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 10em;
    border-radius: 0.7em;
    color: #ddd;
    background: #4c4b4d;
}

.js-examplePlaceholder::after {
    content: '';
    width: 2em;
    height: 2em;
    margin-left: 0.5em;
    opacity: .7;
    background: #fff;
    mask-image: url(cogs.svg);
    -webkit-mask-image: url(cogs.svg);
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
}

/**
 * Test overlay
 */

.ApiDocumentationView__overlay {
    position: fixed;
    inset: .5rem;
    width: auto;
    height: calc(100dvh - 1em);
    background: white;
    z-index: +1;
    margin: auto;
    padding: 1.2em 2em 2em;
    box-shadow: 0 10px 30px -5px #000;
    animation: grow .2s;
    transition: transform .2s ease-out;
    will-change: transform;
}

.ApiDocumentationView__overlay .apiMethod__example {
    display: grid;
    grid-template-areas:
        'title title'
        'request response';
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 2.5rem 1fr;
    gap: 2rem 3rem;
    height: 100%;
    overflow: hidden;
}

.ApiDocumentationView__overlay .apiMethod__example--noEdit {
    grid-template-areas:
        'title title'
        'response response';
}

.apiMethod__example--noEdit .apiMethod__exampleRequest {
    display: none;
}

.ApiDocumentationView__overlay .apiMethod__panel {
    position: relative;
    background: #fff;
}

.ApiDocumentationView__overlay.--loading .apiMethod__exampleBox {
    background: #313033 url(/ui/uibase/img/loader-white.svg) no-repeat center;
}

.ApiDocumentationView__overlay.--loading .CodeMirror,
.ApiDocumentationView__overlay.--loading .apiMethod__source {
    opacity: 0;
}

.ApiDocumentationView__overlay .apiMethod__source--example,
.ApiDocumentationView__overlay .apiMethod__exampleDescription,
.ApiDocumentationView__overlay .apiMethod__button--test {
    display: none;
}

/**
 * Overlay tools
 */

.ApiDocumentationView__overlayTools {
    position: absolute;
    top: 1.4rem;
    right: 2rem;
    display: flex;
    gap: .3rem;
    max-width: 7em;
}

[class^='overlayTool'] {
    display: block;
    width: 2rem;
    height: 2rem;
    padding: .4rem;
    overflow: hidden;
    border-radius: 4px;
    line-height: unset;
    color: transparent;
    opacity: .6;
    cursor: pointer;
}

[class^='overlayTool']:hover {
    background: #d4d0e099;
    opacity: 1;
}

[class^='overlayTool']:before {
    display: block;
    width: .9rem;
    height: .9rem;
    margin: auto;
}

.overlayTool--fullscreen:before {
    content: url(expand-alt.svg);
}

.overlayTool--minify:before {
    content: url(window-minimize.svg);
}

.overlayTool--close:before {
    content: url(times.svg);
}

/**
 * Overlay layout
 */

.ApiDocumentationView__overlay .apiMethod__exampleRequest {
    grid-area: request;
}
.ApiDocumentationView__overlay .apiMethod__exampleResponse {
    grid-area: response;
}

.ApiDocumentationView__overlay .apiMethod__exampleHeader {
    grid-area: title;
    display: flex;
    align-items: center;
    max-width: calc(100% - 8em);
    justify-content: flex-end;
    gap: 1em;
}

/**
 * Overlay header
 */

.ApiDocumentationView__overlay .apiMethod__exampleUrl {
    flex: 1;
    display: flex;
    text-align: center;
    justify-content: center;
    position: relative;
    max-width: 56em;
    margin-left: auto;
}

button.apiMethod__requestBodyButtonExecute,
.apiMethod__testInput {
    padding: .5rem 1.2em;
    margin-right: auto;
    line-height: 1.2rem;
}

.apiMethod__testInput {
    flex-grow: 1;
    padding-left: 5.5em;
    flex-shrink: 0;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
}

.ApiDocumentationView__overlay .apiMethod__exampleTitle {
    margin: unset;
    line-height: 1rem;
}

.ApiDocumentationView__overlay .apiMethod__method {
    position: absolute;
    left: 1em;
    top: 50%;
    transform: translateY(-50%);
}

.ApiDocumentationView__overlay .apiMethod__exampleTitle:after {
    content: 'live test';
    display: inline-block;
    margin-left: .3em;
    vertical-align: middle;
    padding: 0 .4em 0 1.6em;
    border-radius: 4px;
    font-size: .875rem;
    color: #fff;
    background: rgb(255,130,47) url(cogs.svg) no-repeat .3em 50%;
    background-size: .875rem;
}

/**
 * Code blocks
 */

/** (prism.css) fix to give pre/code height */
.ApiDocumentationView__overlay .code-toolbar,
.ApiDocumentationView__overlay .apiMethod__source--test {
    position: absolute;
    inset: 0;
}

.ApiDocumentationView__overlay .code-toolbar {
    top: 3rem;
}

.ApiDocumentationView__overlay [contenteditable] {
    caret-color: #fff !important;
}

/**
 * Show/hide/close overlay
 */

.ApiDocumentationView__overlay.--minified {
    transform: translate3d(0px, calc(100% - 3.5em), 0px);
    overflow: hidden;
    padding: 1em;
}

.ApiDocumentationView__overlay:not(.--minified) .overlayTool--fullscreen,
.ApiDocumentationView__overlay.--minified .overlayTool--minify,
.ApiDocumentationView__overlay .apiMethod__exampleRequest .code-toolbar {
    display: none;
}

.ApiDocumentationView__overlay.--minified .apiMethod__requestBodyButtonExecute,
.overlayIsOpen .apiMethod__button--test:not(.--current) {
    border-color: #dcdcdd;
    background-color: #dcdcdd;
    pointer-events: none;
}

@keyframes grow {
    from {
        transform: scale(.95);
    }

    to {
        transform: scale(1);
    }
}

/**
 * Copy button
 */

.ApiDocumentationView__copy {
    position: absolute;
    top: 3.5em;
    right: 1em;
    z-index: 200;
    height: 3em;
    width: 3em;
    overflow: hidden;
    padding: 0 3em 0 0;
    border-radius: 0;
    border: 0;
    white-space: nowrap;
    color: transparent;
    background: transparent url(copy.svg) no-repeat calc(100% - 1em) 50%;
    background-size: 1em;
}

.ApiDocumentationView__copy:hover {
    width: auto;
    color: #fff;
}