/* Demo fonts served from this site (no request to Google); SIL OFL 1.1, see fonts/OFL-*.txt */

@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/roboto-latin.woff2") format("woff2");
    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: "Roboto";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/roboto-latin-ext.woff2") format("woff2");
    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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Gothic A1";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/gothic-a1-400-latin.woff2") format("woff2");
    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: "Gothic A1";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/gothic-a1-400-latin-ext.woff2") format("woff2");
    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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body, h1, ul {
    margin: 0;
}

body {
    /* demo-only shades derived from the theme, so they follow every theme and scheme */
    --demo-line: color-mix(in srgb, var(--dnr-text) 18%, transparent);
    /* Canvas is white or near-black from the theme's color-scheme, tinted towards the text */
    --demo-field: color-mix(in srgb, var(--dnr-text) 5%, Canvas);
    --demo-radius: min(var(--dnr-btn-radius), 12px);
    --demo-gutter: clamp(16px, 5vw, 60px);
    min-height: 100vh;
    color: var(--dnr-text);
    /* background, not background-color: --dnr-page may be a gradient (glassmorphism) */
    background: var(--dnr-page);
    background-attachment: fixed;
}

h1, h2, h3, p, a, span, button {
    font-style: normal;
}

h1, h2, h3 {
    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
}

p, a, span, button, label, select, input, output, summary {
    font-family: "Gothic A1", sans-serif;
}

/* code: near-opaque field, so the colorful page behind the glass never shows through the text */

code {
    font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
    font-size: .9em;
}

.code {
    overflow: hidden;
    color: var(--dnr-text);
    background-color: var(--demo-field);
    border: 1px solid var(--demo-line);
    border-radius: var(--demo-radius);
}

/* language on the left, Copy on the right, above the code, so the button never covers a line */
.code__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    padding: 4px 6px 4px 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--demo-line);
}

.code pre {
    margin: 0;
    padding: 12px 16px 14px;
    font-size: 14px;
    line-height: 1.55;
    /* long lines wrap instead of scrolling sideways, phones included */
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.code pre code {
    font-size: inherit;
}

.code--long {
    max-height: 420px;
    overflow-y: auto;
}

.code--long:focus-visible {
    outline: var(--dnr-focus-ring);
    outline-offset: -3px;
}

.dnr-btn.code__copy {
    min-width: 68px;
    padding: 5px 10px;
    font-size: 13px;
}

.theme-css summary {
    cursor: pointer;
    font-family: "Gothic A1", sans-serif;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.theme-css summary span {
    font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
    font-size: .9em;
}

.theme-css summary:focus-visible {
    outline: var(--dnr-focus-ring);
    outline-offset: 2px;
}

.theme-css[open] summary {
    margin-bottom: 1em;
}

/* header */

.nav {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 40px;
    padding: 12px var(--demo-gutter);
    background-color: color-mix(in srgb, var(--dnr-surface) 88%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--demo-line);
}

.nav h1 {
    font-size: clamp(1.4rem, 4vw, 2rem);
    line-height: 1.15;
    white-space: nowrap;
}

.brand__tagline {
    margin: 4px 0 0;
    font-size: 14px;
    color: color-mix(in srgb, var(--dnr-text) 80%, transparent);
}

.config-box {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
}

.config-box__element {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.config-box__element label {
    font-size: 13px;
    font-weight: 600;
}

.config-box select,
.config-box__color {
    height: 38px;
    font-size: 14px;
    color: inherit;
    background-color: var(--demo-field);
    border: 1px solid var(--demo-line);
    border-radius: var(--demo-radius);
}

/* native selects size and place their arrow differently in every browser (tiny in Safari),
   so the arrow is drawn here: a chevron of two gradients in the text color */
.config-box select {
    appearance: none;
    min-width: 8.5em;
    padding: 0 36px 0 12px;
    font-size: 15px;
    line-height: 1.2;
    cursor: pointer;
    background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position:
        calc(100% - 20px) 50%,
        calc(100% - 15px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
}

.config-box select option {
    color: var(--dnr-text);
    background-color: var(--dnr-surface);
}

.config-box select:focus-visible,
.config-box__color:focus-within {
    outline: var(--dnr-focus-ring);
    outline-offset: 2px;
}

.config-box__color {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px 0 5px;
}

.config-box__color input {
    width: 28px;
    height: 28px;
    padding: 0;
    background: none;
    border: 1px solid var(--demo-line);
    border-radius: calc(var(--demo-radius) / 2);
    cursor: pointer;
}

.config-box__color input:focus {
    outline: none;
}

.config-box__color input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.config-box__color input::-webkit-color-swatch {
    border: none;
    border-radius: calc(var(--demo-radius) / 2);
}

.config-box__color input::-moz-color-swatch {
    border: none;
    border-radius: calc(var(--demo-radius) / 2);
}

.config-box__color output {
    min-width: 7ch;
    font-family: ui-monospace, monospace;
    font-size: 13px;
}

/* page */

.container {
    padding: var(--demo-gutter);
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--demo-gutter);
}

.grid__element {
    min-width: 0;
}

@media (min-width: 856px) {
    .grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

@media (max-width: 600px) {
    .config-box {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .config-box select {
        width: 100%;
    }
}

.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
    padding: 0 var(--demo-gutter) var(--demo-gutter);
    font-family: "Gothic A1", sans-serif;
    font-size: 14px;
}

.footer a {
    color: inherit;
}

.dnr-tile-content + .dnr-tile-header {
    margin-top: 60px;
}

.theme-css p {
    margin: 0 0 1em;
}
