html, body { width: 100%; height: 100%; margin: 0; padding: 0; background-color: white; color: black; }
body { display: flex; flex-direction: column; font-family: "Inter", sans-serif; font-size: 13pt; font-weight: 300; }
:link { color: #0000EE; }
:visited { color: #551A8B; }
:link:active, :visited:active { color: #FF0000; }

header { height: 60px; margin-top: 30px; margin-bottom: 60px; }
header > .container { display: flex; align-items: center; }
#header-action-buttons { text-align: right; }
#header-logo { height: 100%; padding: 10px; padding-left: 0; box-sizing: border-box; }
#header-logo img { height: 100%; }
#header-logo-container { display: flex; align-items: center; height: 100%; }
#header-logo a { text-decoration: none; }
#logo-heading { color: #2185d0; font-weight: 700; font-size: 28pt; margin-left: 10px; }
#contents-button { display: none; }

main { flex: 1; }
main > .container { display: flex; }

#sidebar { display: flex; flex-direction: column; padding: 50px 10px; background: #2185d0; color: white; font-weight: 500; box-sizing: border-box; }
#sidebar nav { width: 350px; box-sizing: border-box; flex: 1; }
#sidebar nav .fas { width: 30px; text-align: center; }
#sidebar nav a { text-decoration: none; color: white; }
#sidebar nav ul { list-style-type: none; padding: 0; margin: 0; }
#sidebar .nav-section a { display: block; padding: 7px 10px; margin: 0 -10px 5px; background: #4595d3; font-size: 12pt; }
#sidebar .nav-section:hover a, #sidebar .nav-section.active a { background: #27628f; margin-left: -15px; padding-left: 15px; padding-right: 15px; margin-right: -15px; }
#sidebar .nav-second-level a { font-size: 11pt; }
#sidebar .nav-second-level ul { margin-left: 15px; padding: 7px 0; }
#sidebar .nav-second-level li { margin-bottom: 10px; }
#sidebar .nav-second-level a:hover, #sidebar .nav-second-level a.active { text-decoration: underline; }
#sidebar .sidebar-close-button { display: none; position: relative; text-align: right; top: -35px; }
#sidebar .sidebar-close-button a:hover { color: red; }
#sidebar .section-collapse-button { margin-left: 0 !important; padding-left: 5px !important; }
#sidebar .section-collapse-button:hover { color: #cfffff; }
#sidebar .section-link { margin-right: 0 !important; padding-right: 5px !important; }
#sidebar-overlay { display: none; opacity: 0; position: fixed; width: 100%; height: 100%; z-index: 999; background: #000a; }
.sidebar-overlay-in { opacity: 1; }

article { padding: 50px 0; width: 800px; }
article :first-child { margin-top: 0; }

article h1 { font-size: 34pt; }
article h2 { font-size: 26pt; }
article h3 { font-size: 20pt; }
article h4 { font-size: 16pt; }
article h5 { font-size: 14pt; }
article h6 { font-size: 12pt; }

article blockquote, article img, article pre { box-sizing: border-box; }
article blockquote, article pre { background: #eee; padding: 30px; margin: 0; border-left: 5px solid #2185d0; overflow: auto; }
article blockquote p:last-of-type { margin-bottom: 0; }
article blockquote blockquote { background: #ddd; }
article code { background: #eee; border-radius: 5px; padding: 1px 3px; }
article pre code { background: none; border-radius: none; padding: 0; }
article img { border: 5px solid #eee; max-width: 100%; }
article p { hyphens: auto; max-width: 100%; }
article table { border-collapse: collapse; }
article td, th { padding: 15px; }
article th { background: #ddd; }
article tr:nth-of-type(even) { background: #eee; }
article hr { width: 80%; border: 1px solid #eee; }

.contribution-invitation hr { margin-top: 70px; margin-bottom: 30px; }

footer { background: #f5f5f5; text-align: center; font-size: 8pt; padding: 15px; margin-top: 60px; }

#mobile-action-buttons { text-align: center; display: none; }
#mobile-contents-button { display: none; }
#mobile-contents-button a { color: #2185D0; font-size: 35px; }


.action-buttons { flex: 1; }
.action-buttons a { text-decoration: none; color: black; margin-left: 10px; }
.action-buttons a:hover { text-decoration: underline; }
.collapsible { overflow-y: hidden; transition: max-height 500ms; }
.container { max-width: 1300px; margin: auto; height: 100%; }
.flex-spacer { flex: 99; }

.narrow-only { display: none; }

@media screen and (max-width: 1400px) {
    .wide-only { display: none; }
    .narrow-only { display: initial; }

    #header-logo { margin-left: 0; }
    #sidebar { display: block; position: fixed; overflow-y: auto; left: 0; top: 0; height: 100%; transform: translateX(-400px); z-index: 9999; }
    #sidebar .sidebar-close-button { display: block; }
    #sidebar nav { width: 300px; }
    #sidebar .nav-section a { font-size: 11pt; }

    #sidebar-overlay.sidebar-overlay-in { display: block; }
    article { margin-left: 0; margin-right: 0; padding-top: 0; width: 100%; }
    .container { max-width: 780px; padding: 0 50px; }
    #contents-button { display: inline-block; background: #eee; border-radius: 5px; padding: 5px; width: 20px; height: 20px; text-align: center; }
    #contents-button:hover { background: #ccc; }
}

@media screen and (max-width: 750px) {
    #header-action-buttons { display: none; }
    #mobile-action-buttons { display: block; }
    #mobile-contents-button { display: block; }

    .container { padding: 0 20px; }
    article p { text-align: left; }
    header { margin-top: 15px; margin-bottom: 30px; height: 50px; }
    #header-logo { flex: 1; }
    #logo-heading { font-size: 22pt; }
    #mobile-contents-button a { font-size: 30px; }

    article h1 { font-size: 28pt; }
    article h2 { font-size: 22pt; }
    article h3 { font-size: 18pt; }
}

@keyframes slideSidebar {
    from { transform: translateX(-300px); }
    to { transform: translateX(0); }
}

@keyframes fadeOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-color-scheme: dark) {
    #logo-heading { color: #94cddc; }
    html, body { background-color: #373B49; color: #9ba8bb; }

    footer { background: #0b0b0b; color: #bbb; }
    footer a { color: #36aaff; }
    footer a:visited { color: #86afcc; }

    .action-buttons a { color: #9cd9e8; }

    :link { color: #449ddc; }
    :visited { color: #5d8499; }
    :link:active, :visited:active { color: #828f55; }

    code, pre { color: #9eaa96 !important; }

    article h1 { color: #c6cfee; text-decoration: underline; }
    article h2, article h3, article h4, article h5 { color: #c6cfee; }
    article code { background: #2e3440; color: #9eaa96; }
    article hr { border: 1px solid #91bbdb; }
    article blockquote, article pre { background: #21242d; border-left: 5px solid #355379; color: #7f8a95; }

    #sidebar { background: #2c303c; color: #879cb3; }
    #sidebar nav a { color: #8aa9b9; }
    #sidebar .nav-section a { background: #304862; font-size: 12pt; }
    #sidebar .nav-section:hover a, #sidebar .nav-section.active a { background: #20374f; }
}
