:root {
    --body-padding: 40px;
    --popup-border: rgba(0, 0, 0, 0.12);
    --opaque-popup-border: #e0e0e0;
    --popup-shadow: rgba(49, 49, 49, 0.3);
    --grey-90-a10: rgba(12, 12, 13, 0.1);
    --grey-90-a20: rgba(12, 12, 13, 0.2);
    --grey-90-a30: rgba(12, 12, 13, 0.3);
    --grey-90-a80: rgba(12, 12, 13, 0.8);
    --grey-30: #d7d7db;
    --blue-40: #45a1ff;
    --blue-40-a30: rgba(69, 161, 255, 0.3);
    --blue-60: #0060df;
    --active-color: #0B83FF;
    --font-size: 12;
    --content-width: 22em;
    --line-height: 1.6em;
    --tooltip-background: var(--grey-90-a80);
    --tooltip-foreground: white;
    --toolbar-button-hover: var(--grey-90-a10);
    --toolbar-button-active: var(--grey-90-a20);
}

body {
    --main-background: #fff;
    --main-foreground: #333;
    --toolbar-border: var(--grey-90-a20);
    --toolbar-box-shadow: var(--grey-90-a10);
    --popup-button-hover: hsla(0,0%,70%,.4);
    --popup-button-active: hsla(240,5%,5%,.15);
    --popup-bgcolor: white;
    --popup-button: #edecf0;
    --selected-fonttype-background: var(--blue-40-a30);
    --selected-border: var(--blue-40);
    --popup-line: var(--grey-30);
    --font-value-border: var(--grey-30);
    --font-color: #000000;
    --icon-fill: #3b3b3c;
    --icon-disabled-fill: #8080807F;
    /* light colours */
}

body.sepia {
    --main-background: #f4ecd8;
    --main-foreground: #5b4636;
    --toolbar-border: #5b4636;
}

body.dark {
    --main-background: #333;
    --main-foreground: #eee;
    --toolbar-border: #4a4a4b;
    --toolbar-box-shadow: black;
    --toolbar-button-hover: var(--grey-90-a30);
    --toolbar-button-active: var(--grey-90-a80);
    --popup-button-active: hsla(0,0%,70%,.6);
    --popup-bgcolor: #4c4a50;
    --popup-button: #5c5c61;
    --popup-line: #5c5c61;
    --opaque-popup-border: #434146;
    --font-value-border: #656468;
    --font-color: #fff;
    --icon-fill: #fff;
    --icon-disabled-fill: #ffffff66;
    --tooltip-background: black;
    --tooltip-foreground: white;
    /* dark colours */
}

body {
    padding: 0 var(--body-padding);
    background-color: var(--main-background);
    color: var(--main-foreground);
    font-family: Helvetica, Arial, sans-serif;
    max-width: 1080px;
    margin: auto;
}

body.loaded {
    transition: color 0.4s, background-color 0.4s;
}

body.dark *::-moz-selection {
    background-color: #FFFFFF;
    color: #0095DD;
}
body.dark a::-moz-selection {
    color: #DD4800;
}

body.sans-serif,
body.sans-serif .remove-button {
    font-family: Helvetica, Arial, sans-serif;
}

body.serif,
body.serif .remove-button {
    font-family: Georgia, "Times New Roman", serif;
}

#header {
    display: block;
    padding: 30px 0;
    height: 100px;
    border-bottom: 2px solid #eee;
}

#logo-wrapper {
    display: inline-block;
}

#logo-wrapper a, #logo-wrapper a:visited {
    float: left;
    height: 100px;
}

#logo-wrapper img {
    height: 100px;
}

#nav-wrapper {
    display: inline-block;
}

body:not(.force-mobile-nav) #nav-wrapper > div {
    display: inline-block;
    margin: 0;
    top: -46px;
    position: relative;
}

#nav-wrapper div a, #nav-wrapper div a:visited {
    font-family: "proxima-nova","Helvetica Neue",Helvetica,Arial,sans-serif;
    font-size: 14px;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 1px;
    font-weight: 600;
    font-style: normal;
    line-height: 1em;
    color: #999;
    padding: 1em 1.5em !important;
}

#nav-wrapper div a:active, #nav-wrapper div a:hover {
    color: #295abe;
}

#nav-wrapper > div:last-child a {
    -webkit-border-radius: 300px;
    border-radius: 300px;
    background-color: transparent;
    -moz-osx-font-smoothing: auto;
    border: 2px solid #295abe;
    color: #295abe;
    font-family: "proxima-nova","Helvetica Neue",Helvetica,Arial,sans-serif;
    letter-spacing: 2px;
    margin-left: 1em;
    display: inline-block;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color .1s 0s ease-in-out,color .1s 0s ease-in-out;
}

#nav-wrapper > div:last-child a:hover {
    background-color: #295abe;
    color: #ffffff;
}

.container {
    margin-top: 2em;
    margin-right: auto;
    margin-left: auto;
    margin-bottom: 0;
    font-size: var(--font-size);
    line-height: var(--line-height);
}

/* Override some controls and content styles based on color scheme */

body.light > .container > .header > .domain {
    border-bottom-color: #333333 !important;
}

body.sepia > .container > .header > .domain {
    border-bottom-color: #5b4636 !important;
}

body.dark > .container > .header > .domain {
    border-bottom-color: #eeeeee !important;
}

body.sepia > .container > .footer {
    background-color: #dedad4 !important;
}

body.light blockquote {
    border-inline-start: 2px solid #333333 !important;
}

body.sepia blockquote {
    border-inline-start: 2px solid #5b4636 !important;
}

body.dark blockquote {
    border-inline-start: 2px solid #eeeeee !important;
}

.light-button {
    color: #333333;
    background-color: #ffffff;
}

.dark-button {
    color: #eeeeee;
    background-color: #333333;
}

.sepia-button {
    color: #5b4636;
    background-color: #f4ecd8;
}

/* Loading/error message */

.reader-message {
    margin-top: 40px;
    display: none;
    text-align: center;
    width: 100%;
    font-size: 0.9em;
}

/* Detector element to see if we're at the top of the doc or not. */
.top-anchor {
    position: absolute;
    top: 0;
    width: 0;
    height: 5px;
    pointer-events: none;
}

/* Header */

.header {
    text-align: start;
    display: none;
}

.domain {
    font-size: 0.9em;
    line-height: 1.48em;
    padding-bottom: 4px;
    font-family: Helvetica, Arial, sans-serif;
    text-decoration: none;
    border-bottom: 1px solid;
    color: #0095dd;
}

.header > h1 {
    font-size: 1.6em;
    line-height: 1.25em;
    width: 100%;
    margin: 30px 0;
    padding: 0;
}

.header > .credits {
    font-size: 0.9em;
    line-height: 1.48em;
    margin: 0 0 10px;
    padding: 0;
    font-style: italic;
}

.header > .meta-data {
    font-size: 0.65em;
    margin: 0 0 15px;
}

.reader-estimated-time {
    text-align: match-parent;
}

.button {
    position: relative;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 4px;
    margin: 4px 0;
    background-color: transparent;
    background-size: 16px 16px;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--font-color);
}

.button:hover,
.button:-moz-focusring {
    background-color: var(--toolbar-button-hover);
}

.open .button,
.button:active {
    background-color: var(--toolbar-button-active);
    color: var(--active-color);
    fill: var(--active-color);
}

.hover-label {
    position: absolute;
    top: 4px;
    inset-inline-start: 36px;
    line-height: 16px;
    white-space: pre; /* make sure we don't wrap */
    background-color: var(--tooltip-background);
    color: var(--tooltip-foreground);
    padding: 4px 8px;
    border-radius: 2px;
    visibility: hidden;
    pointer-events: none;
}

/* Don't show hover styles while dropdowns are open, except in the dropdown. */
:not(.dropdown-open) > .dropdown > li > .button:hover > .hover-label,
:not(.dropdown-open) > .dropdown > li > .button:-moz-focusring > .hover-label {
    visibility: visible;
}

button {
    -moz-context-properties: fill;
    color: var(--font-color);
    fill: var(--icon-fill);
}

button:disabled {
    fill: var(--icon-disabled-fill);
}

.toolbar button::-moz-focus-inner {
    border: 0;
}

.dropdown {
    text-align: center;
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.dropdown li {
    margin: 0;
    padding: 0;
}

/*======= Font style popup =======*/

.radio-button {
    /* We visually hide these, but we keep them around so they can be focused
     * and changed by interacting with them via the label, or the keyboard, or
     * assistive technology.
     */
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

.radiorow,
.buttonrow {
    display: flex;
}

.content-width-value,
.font-size-value,
.line-height-value {
    box-sizing: border-box;
    width: 36px;
    height: 15px;
    line-height: 15px;
    display: flex;
    justify-content: center;
    align-content: center;
    margin: auto;
    border-radius: 10px;
    border: 1px solid var(--font-value-border);
    background-color: var(--popup-button);
}

.buttonrow > button {
    border: 0;
    height: 60px;
    width: 90px;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
}

.buttonrow > button:enabled:hover,
.buttonrow > button:enabled:-moz-focusring {
    background-color: var(--popup-button-hover);
}

.buttonrow > button:enabled:active {
    background-color: var(--popup-button-active);
}

.radiorow:not(:last-child),
.buttonrow:not(:last-child) {
    border-bottom: 1px solid var(--popup-line);
}

.radiorow > label {
    position: relative;
    box-sizing: border-box;
    border-radius: 2px;
    border: 2px solid var(--popup-border);
}

.radiorow > label[checked] {
    border-color: var(--selected-border);
}

/* For the hover style, we draw a line under the item by means of a
 * pseudo-element. Because these items are variable height, and
 * because their contents are variable height, position it absolutely,
 * and give it a width of 100% (the content width) + 4px for the 2 * 2px
 * border width.
 */
.radiorow > input[type=radio]:-moz-focusring + label::after,
.radiorow > label:hover::after {
    content: "";
    display: block;
    border-bottom: 2px solid var(--blue-40);
    width: calc(100% + 4px);
    position: absolute;
    /* to skip the 2 * 2px border + 2px spacing. */
    bottom: -6px;
    /* Match the start of the 2px border of the element: */
    inset-inline-start: -2px;
}

.color-scheme-buttons > label {
    height: 34px;
    width: 70px;
    font-size: 12px;
    /* Center the labels horizontally as well as vertically */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* We want 10px between items, but there's no margin collapsing in flexbox. */
    margin: 10px 5px;
}

.color-scheme-buttons > input:first-child + label {
    margin-inline-start: 10px;
}

.color-scheme-buttons > label:last-child {
    margin-inline-end: 10px;
}

.font-type-buttons > label {
    height: 64px;
    width: 105px;
    /* Slightly more space between these items. */
    margin: 10px;
    /* Center the Sans-serif / Serif labels */
    text-align: center;
    background-size: 63px 39px;
    background-repeat: no-repeat;
    background-position: center 18px;
    background-color: var(--popup-button);
    fill: currentColor;
    -moz-context-properties: fill;
    /* This mostly matches baselines, but because of differences in font
     * baselines between serif and sans-serif, this isn't always enough. */
    line-height: 1;
    padding-top: 2px;
}

.font-type-buttons > label[checked] {
    background-color: var(--selected-fonttype-background);
}

/*======= Article content =======*/

/* Note that any class names from the original article that we want to match on
 * must be added to CLASSES_TO_PRESERVE in ReaderMode.jsm, so that
 * Readability.js doesn't strip them out */

.moz-reader-content {
    display: none;
    font-size: 1em;
}

@media print {
    .moz-reader-content p,
    .moz-reader-content code,
    .moz-reader-content pre,
    .moz-reader-content blockquote,
    .moz-reader-content ul,
    .moz-reader-content ol,
    .moz-reader-content li,
    .moz-reader-content figure,
    .moz-reader-content .wp-caption {
        margin: 0 0 10px !important;
        padding: 0 !important;
    }
}

.moz-reader-content h1,
.moz-reader-content h2,
.moz-reader-content h3 {
    font-weight: bold;
}

.moz-reader-content h1 {
    font-size: 1.6em;
    line-height: 1.25em;
}

.moz-reader-content h2 {
    font-size: 1.2em;
    line-height: 1.51em;
}

.moz-reader-content h3 {
    font-size: 1em;
    line-height: 1.66em;
}

.moz-reader-content a:link {
    text-decoration: underline;
    font-weight: normal;
}

.moz-reader-content a:link,
.moz-reader-content a:link:hover,
.moz-reader-content a:link:active {
    color: #0095dd;
}

.moz-reader-content a:visited {
    color: #c2e;
}

.moz-reader-content * {
    max-width: 100%;
    height: auto;
}

.moz-reader-content p,
.moz-reader-content p,
.moz-reader-content code,
.moz-reader-content pre,
.moz-reader-content blockquote,
.moz-reader-content ul,
.moz-reader-content ol,
.moz-reader-content li,
.moz-reader-content figure,
.moz-reader-content .wp-caption {
    margin: -10px -10px 20px;
    padding: 10px;
    border-radius: 5px;
}

.moz-reader-content li {
    margin-bottom: 0;
}

.moz-reader-content li > ul,
.moz-reader-content li > ol {
    margin-bottom: -10px;
}

.moz-reader-content p > img:only-child,
.moz-reader-content p > a:only-child > img:only-child,
.moz-reader-content .wp-caption img,
.moz-reader-content figure img {
    display: block;
}

.moz-reader-content img[moz-reader-center] {
    margin-inline: auto;
}

.moz-reader-content .caption,
.moz-reader-content .wp-caption-text
.moz-reader-content figcaption {
    font-size: 0.9em;
    line-height: 1.48em;
    font-style: italic;
}

.moz-reader-content code,
.moz-reader-content pre {
    white-space: pre-wrap;
}

.moz-reader-content blockquote {
    padding: 0;
    padding-inline-start: 16px;
}

.moz-reader-content ul,
.moz-reader-content ol {
    padding: 0;
}

.moz-reader-content ul {
    padding-inline-start: 30px;
    list-style: disc;
}

.moz-reader-content ol {
    padding-inline-start: 30px;
    list-style: decimal;
}

table,
th,
td {
    border: 1px solid currentColor;
    border-collapse: collapse;
    padding: 6px;
    vertical-align: top;
}

table {
    margin: 5px;
}

/* Visually hide (but don't display: none) screen reader elements */
.moz-reader-content .visually-hidden,
.moz-reader-content .visuallyhidden,
.moz-reader-content .sr-only {
    display: inline-block;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    border-width: 0;
}

/* Hide elements with common "hidden" class names */
.moz-reader-content .hidden,
.moz-reader-content .invisible {
    display: none;
}

/* Enforce wordpress and similar emoji/smileys aren't sized to be full-width,
 * see bug 1399616 for context. */
.moz-reader-content img.wp-smiley,
.moz-reader-content img.emoji {
    display: inline-block;
    border-width: 0;
    /* height: auto is implied from `.moz-reader-content *` rule. */
    width: 1em;
    margin: 0 .07em;
    padding: 0;
}

.reader-show-element {
    display: initial;
}
