:root {
    --main-margin: 10px;
    --main-menu-height: 40px;
    --main-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
    'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue';
    --main-font-size: 15px;
    --main-color: #4d4d4d;
    --main-border-radius: 3px;
    --main-info-nth-section-background: #f5f5f5;
    --main-footer-color: #f5f5f5;
    --main-link-color: #ee5341;
    --main-link-color-highlight: #ce4838;
    --main-footer-background: #4d4d4d;
    --main-news-button-background-highlight: #f170ac;

    --main-static-dropdown-menu-background: #656565;
    --main-static-dropdown-menu-color: #fff;
    --main-static-dropdown-selected-background: #fff;
    --main-static-dropdown-selected-color: var(--main-color);
    --main-static-dropdown-background-highlight: #7a7a7a;
    --main-static-dropdown-selected-background-highlight: #f0f0f0;

    --fa-font-solid: normal 900 1em/1 'Font Awesome 6 Solid';
    --fa-font-regular: normal 400 1em/1 'Font Awesome 6 Regular';
    --fa-font-light: normal 300 1em/1 'Font Awesome 6 Light';
    --fa-font-thin: normal 100 1em/1 'Font Awesome 6 Thin';
    --fa-font-duotone: normal 900 1em/1 'Font Awesome 6 Duotone';
    --fa-font-brands: normal 400 1em/1 'Font Awesome 6 Brands';

    --ad-width-wide-skyscraper: 160px;
    --ad-width-large-skyscraper: 300px;
    --ad-height: 100%;
    --ad-margin: 40px; /* this 40px is extra padding added by playwire */
    --ad-width: var(--ad-width-large-skyscraper);
}

html {
    margin: 0;
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--main-font-family);
    font-size: var(--main-font-size);
    font-weight: normal;
    color: var(--main-color);
    line-height: 1.5em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.default {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.contents {
    flex: 1;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 100px;
}

@media only screen and (max-width: 920px) {
    /* max-width of 900px + 2*10px margin */
    .contents {
        margin-left: 10px;
        margin-right: 10px;
    }
}

#root {
    margin: 0;
    width: 100%;
    /*height: calc(100vh - var(--main-menu-height));*/
    height: calc(100vh);
    background: var(--jeo-background);
    overflow: hidden;
}

h1,
h2 {
    font-size: 200%;
    margin: 0;
    padding: 2em 0 0; /* when using an anchor, the text must be visible below the sticky menu */
    font-weight: normal;
    line-height: 1.3em;
}

h1 a,
h2 a {
    position: relative;
    color: inherit;
    text-decoration: none;
}

h1 a:hover,
h2 a:hover {
    color: var(--main-link-color-highlight);
}

h1 a:hover:before,
h2 a:hover:before {
    position: absolute;
    top: 0;
    left: -1em;
    content: '# ';
}

h3 {
    font-size: 150%;
    font-weight: normal;
    margin: 0;
    padding: 2em 0 0;
}

h3 a {
    position: relative;
    color: inherit;
    text-decoration: none;
}

h3 a:hover {
    color: var(--main-link-color-highlight);
}

h3 a:hover:before {
    position: absolute;
    top: 0;
    left: -1em;
    content: '# ';
}

.info h1 {
    /*margin: 0;*/
    /*padding: 0 0 1em;*/
}

.info {
    line-height: 1.5em;
}

.info .section {
}

.info .section:nth-child(2n) {
    background: var(--main-info-nth-section-background);
}

.info .section .section-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 2em 0 4em;
    /* h1 also has 2em padding, therefore we only need 2em top padding here */
}

.info .section h3 {
    font-size: 120%;
    font-weight: bold;
    color: inherit;
    margin: 0;
    padding-bottom: 0;
    text-decoration: none;
}

@media only screen and (max-width: 820px) {
    /* max-width of 800 + 2*10px margin */
    .info .section .section-inner {
        margin-left: 10px;
        margin-right: 10px;
    }
}

.info .news-item {
    border-top: 1px solid #e6e6e6;
}

.info .date {
    font-size: 90%;
    margin-bottom: calc(2 * var(--main-margin));
    font-style: italic;
}

.info .columns {
    display: flex;
    flex-wrap: wrap;
    gap: calc(2 * var(--main-margin));
}

.info .column {
    overflow: auto;
    max-width: 100%;
}

.info .column.left {
    flex: 1;
    min-width: 300px;
}

.info .column img {
    background: #f5f5f5;
    display: block;
    margin: var(--main-margin) 0;
}

.footer {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
    padding: 10px 10px 40px;

    color: var(--main-footer-color);
    background: var(--main-footer-background);
}

.footer .column {
    max-width: 200px;
}

.footer h2 {
    font-size: 100%;
    font-weight: bold;
}

a {
    color: var(--main-link-color);
}

a:hover {
    color: var(--main-link-color-highlight);
}

a:hover {
    color: var(--main-link-color-highlight);
}

blockquote {
    background: #efefef;
    border-left: 5px solid #9d9d9d;
    margin-left: 20px;
}

blockquote p {
    padding: 10px;
}

.footer a {
    color: var(--main-footer-color);
}

.footer a:hover,
.footer a:active {
    color: var(--main-link-color); /* not the highlight color, that is too dark */
}

p {
    line-height: 1.5em;
}

code {
    background: #f5f5f5;
    font-family: monospace;
    font-size: inherit;
    padding: 3px;
}

ul {
    padding-left: 0;
    margin-left: 10px;
}

ul li {
    margin-left: 10px;
}

/* menu */
.menu {
    display: flex;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    width: 100%;
    min-height: var(--main-menu-height);
    box-sizing: border-box;
    padding: 5px;
    box-shadow: 0 0 4px 2px rgba(0, 0, 0, 0.4);
    color: white;
    z-index: 1; /* needed for index.html */

    background: #4d4d4d url('http://cdn.xieboke.net/static_root/json_format/images/header_background.png') 0 / 4px 4px repeat;
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .menu {
        background: url('http://cdn.xieboke.net/static_root/json_format/images/header_background%402x.png') 0 / 4px 4px repeat;
    }
}

.menu .logo {
    width: 200px;
    height: 32px;
    background: url('http://cdn.xieboke.net/static_root/json_format/images/logo.png') 0 / 200px 32px no-repeat;
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .menu .logo {
        background: url('http://cdn.xieboke.net/static_root/json_format/images/logo%402x.png') 0 / 200px 32px no-repeat;
    }
}

.menu a.name {
    height: 100%;
    line-height: 40px;
}

.menu .space {
    flex: 1;
}

.menu .menu-button-group {
    min-width: 200px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.ad-margin {
    width: calc(var(--ad-width-large-skyscraper) + var(--ad-margin) + var(--main-margin));
}

@media only screen and (max-width: 1580px) {
    .ad-margin {
        width: calc(var(--ad-width-wide-skyscraper) + var(--ad-margin) + var(--main-margin));
    }
}

@media only screen and (max-width: 980px) {
    .ad-margin {
        width: var(--main-margin);
    }
}

.menu .button {
    color: #fff;
    background: none;
    border: none;
    padding: 3px var(--main-margin);
    font-size: var(--main-font-size);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    height: auto;
    box-sizing: border-box;
}

.menu .button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.menu .button.news-highlight {
    background: var(--main-news-button-background-highlight);
    border-radius: var(--main-border-radius);
    display: none;
}

.menu.has-news .button.news-highlight {
    display: inline-block;
}

.menu .theme-toggle-placeholder {
    display: inline-block;
}

.static-dropdown-button {
    position: relative;
}

.static-dropdown-button .static-dropdown-description {
    height: auto;
}

.static-dropdown-button .static-dropdown-menu {
    display: none;
    position: absolute;
    white-space: normal;
    top: 100%;
    right: 0;
    z-index: 100; /* must be above the "loading..." overlay */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    background: var(--main-static-dropdown-menu-background);
    color: var(--main-static-dropdown-menu-color);
}

.static-dropdown-button:hover .static-dropdown-menu,
.static-dropdown-button:focus .static-dropdown-menu {
    display: flex;
    flex-direction: column;
}

.static-dropdown-button .static-dropdown-menu.right {
    right: unset;
    left: 0;
}

.static-dropdown-button .static-dropdown-menu .dropdown-menu-button {
    color: inherit;
    background: inherit;
    font-family: inherit;
    font-size: inherit;
    width: 100%;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    border-radius: 0;
    padding: 10px 15px;
}

.static-dropdown-button .static-dropdown-menu .dropdown-menu-button svg {
    margin-right: var(--main-margin);
}

.static-dropdown-button .static-dropdown-menu .dropdown-menu-button.selected {
    background: var(--main-static-dropdown-selected-background);
    color: var(--main-static-dropdown-selected-color);
}

.static-dropdown-button .static-dropdown-menu .dropdown-menu-button:hover,
.static-dropdown-button .static-dropdown-menu .dropdown-menu-button:focus {
    background: var(--main-static-dropdown-background-highlight);
}

.static-dropdown-button .static-dropdown-menu .dropdown-menu-button.selected:hover,
.static-dropdown-button .static-dropdown-menu .dropdown-menu-button.selected:focus {
    background: var(--main-static-dropdown-selected-background-highlight);
}

/* when the dropdown main item is clickable too */
.static-dropdown-button.clickable-main-item {
    padding: 0;
}

.static-dropdown-button.clickable-main-item .main-item:hover {
    background: none;
}

.menu svg {
    width: calc(var(--main-font-size) + 1px);
    height: var(--main-font-size);
}

.svg-inline--fa {
    vertical-align: -0.125em;
}

