body {
    font-family: Helvetica, sans-serif;
    font-size: 16px;
    background-color: #FCFCFC;
}

body * {
    color: inherit;
    background-color: inherit;
}

body.interactive-theme-transition {
    transition: background-color 0.2s;
}

body[theme=dark] {
    background-color: #0E0E0E;
    color: #f7f4f7;
}

/* Apparently Bootstrap's reboot.css set text-align: left unconditionally! */
html[dir="rtl"] body {
    text-align: right;
}

h1 {
    font-weight: bold;
    font-family: Georgia, serif;
    font-size: 34px;
}

a {
    color: #0645AD;
    /* Why would bootstrap unset this? :( */
    text-decoration: underline;
}

body[theme=dark] a {
    color: #6D9FF0;
}

a:focus {
    outline: none;
}

button {
    font-size: inherit;
}

button:focus {
    outline: none;
}

#in-page {
    font-size: 17px;
}

#snippet {
    position: relative;
    font-size: 17px;
    line-height: 22px;
    text-align: justify;
    margin: 5px auto 0 auto;
    /* Apparently I need to set both for overflow to work! */
    min-height: 140px;
    max-height: 140px;
}

/* text-align: justify looks ugly on very narrow screens, so we just revert back
 * to left/right (depending on ltr/rtl) in small screens.
 * https://getbootstrap.com/docs/4.1/layout/overview/#responsive-breakpoints
*/
@media (max-width: 575.98px) {
    #snippet {
        text-align: unset;
    }
}

#quotation {
    position: absolute;
    top: 30px;
    font-size: 100px;
    opacity: 0.1;
    font-family: Fondamento, cursive;
    z-index: 0;  /* or the top of this element may cover part of #in-page. */
}

html[dir="ltr"] #quotation {
    left: -24px;
}

html[dir="rtl"] #quotation {
    right: -24px;
    transform: scale(-1, 1);
}

.ch-snippet {
    padding: 5px;
    overflow-y: scroll;
    max-height: inherit;
}

.ch-snippet ul, ol {
    /* Don't indent lists */
    list-style: inside;
    padding: 0;
}

.button {
    border-radius: 4px;
    text-decoration: none;
    color: black;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    height: 50px;
    transition: box-shadow 0.1s ease-in-out, opacity 0.1s ease-in-out;
}

.button:active {
    opacity: 0.85;
}

#button-wikilink {
    color: white;
    background: #00AF89;
    box-shadow: 1px -1px 5px #008C6E inset, 0 2px 3px #BABABA;
    border: 2px solid #1C6F2C;
}

body[theme=dark] #button-wikilink {
    box-shadow: 1px -1px 5px #008C6E inset, 0 2px 3px #5f5f54;
}

#button-wikilink:hover, #button-wikilink:focus {
    box-shadow: 1px -1px 5px #1C6F2C inset, 0 2px 3px #BABABA;
}

body[theme=dark] #button-wikilink:hover, #button-wikilink:focus {
    box-shadow: 1px -1px 5px #1C6F2C inset, 0 2px 3px #5f5f54;
}

#button-next {
    color: white;
    background: #347BFF;
    box-shadow: -1px -1px 5px #2A62CC inset, 0 2px 3px #BABABA;
    transition: box-shadow 0.1s, opacity 0.1s;
    border: 2px solid #41499F;
}

body[theme=dark] #button-next {
    box-shadow: -1px -1px 5px #2A62CC inset, 0 2px 3px #5f5f54;
}

#button-next:hover, #button-next:focus {
    box-shadow: -1px -1px 5px #41499F inset, 0 2px 3px #BABABA;
}

body[theme=dark] #button-next:hover, #button-next:focus {
    box-shadow: -1px -1px 5px #41499F inset, 0 2px 3px #5f5f54;
}

#js-disabled-category-warning {
    color: crimson;
    text-align: center;
}

#lang-selector {
    color: inherit;
    text-overflow: ellipsis;
    border: 2px solid #937E7E;
    border-radius: 2px;
}

#bottom {
    margin: 0 20px;
}

#category-filter-wrapper {
    display: inline-block;
}

#form-next {
    width: 100%;
}

.spinner {
    /* required by spin.js */
    position: relative;
}

html[dir="ltr"] #category-filter-spinner {
    margin-left: 5px;
}

html[dir="rtl"] #category-filter-spinner {
    margin-right: 5px;
}

.info {
    color: #5f5f54;
}

body[theme=dark] .info {
    color: #d7d7ca;
}

#instructions p {
    line-height: 20px;
    margin: 10px 0;
}

#fixed-count-container {
    text-align: center;
}

#nfixed {
    font-weight: bold;
}

#footer {
    font-size: 14px;
    line-height: 17px;
    text-align: center;
}

#footer p {
    margin: 0px auto;
    max-width: 450px;
}

#footer:before {
    content: "⁓";
    display: block;
    margin-bottom: 3px;
    font-size: 18px;
}

#leaderboard-link {
    text-align: end;
}

#leaderboard {
    margin: 20px auto;
    width: 50%;
}

html[dir="ltr"] #leaderboard {
    text-align: left;
}

html[dir="rtl"] #leaderboard {
    text-align: right;
}

#leaderboard td {
    padding-top: 2px;
    padding-bottom: 2px;
}

html[dir="ltr"] #leaderboard td {
    padding-left: 10px;
}

html[dir="rtl"] #leaderboard td {
    padding-right: 10px;
}

#leaderboard th {
    font-weight: bold;
    font-size: 18px;
}

.snippet-notice {
    height: 30px;
    width: 30px;
    border-radius: 30px;
    border: 2px solid black;
    padding: 2px 0;  /* must be equal to border */
    text-align: center;
    font-weight: bolder;
    cursor: pointer;
    margin: 0 2px;
}

.snippet-notice-modal {
    background-color: inherit;
}

.lead-hint {
    background-color: #EEF31A;
    color: #0E0E0E;
}

.old-hint {
    background-color: #71B6FF;
    background-image: url("../icon/ic_clock.svg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 80%;
}

#hamburguer-label {
    z-index: 4;  /* cover the menu itself */
    display: block;
    cursor: pointer;
    width: 30px;
    height: 30px;  /* must be smaller than the padding-top of #hamburguer-menu */
    font-size: 30px;
    text-align: center;
    line-height: 30px;
    background: transparent;
}

#hamburguer-menu-trigger {
    display: none;
}

#hamburguer-menu {
    position: fixed;
    top: 0;
    height: 100%;
    z-index: 3;  /* cover the snippet */
    font-size: 17px;
    transform-origin: 0% 0%;
    transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0);
    padding-top: 50px;  /* must be greater than the height of #hamburguer-label */
    background: linear-gradient(90deg, #EAEAEA 0%, #F6F6F6 100%);
    border-color: #EBEBEB;
    border: 0;
}

html[dir="ltr"] #hamburguer-menu {
    right: 0;
    transform: translate(100%, 0);
    border-left-width: 2px;
}

html[dir="ltr"] body[theme="dark"] #hamburguer-menu {
    background: linear-gradient(90deg, #1A1A1A 0%, #0E0E0E 100%);
}

html[dir="rtl"] #hamburguer-menu {
    left: 0;
    transform: translate(-100%, 0);
    border-right-width: 2px;
}

html[dir="rtl"] #hamburguer-menu {
    background: linear-gradient(270deg, #EAEAEA 0%, #F6F6F6 100%);
}

html[dir="rtl"] body[theme="dark"] #hamburguer-menu {
    background: linear-gradient(270deg, #1A1A1A 0%, #0E0E0E 100%);
}

body[theme=dark] #hamburguer-menu {
    border-color: #0C0C0C;
}

#hamburguer-menu-trigger:checked ~ #hamburguer-menu {
    transform: none;
}

#hamburguer-menu-trigger:checked ~ #hamburguer-label::before {
    font-size: 25px;
    content: "✕";
}

#hamburguer-menu-trigger ~ #hamburguer-label::before {
    content: "☰";
}

#hamburguer-menu .menu-item {
    /* Make it look like a link. */
    color: #0645AD;
    text-decoration: underline;
    cursor: pointer;
}

body[theme=dark] #hamburguer-menu .menu-item {
    color: #6D9FF0;
}
