/*
===============================================================================================================================
Dark Mode CSS for Quark Open Publishing (loaded when Dark Mode is On, or for Auto when the visitor's OS prefers dark).
Palette based on Quark 2's dark surfaces, with Quark's blue lightened for links and accents.
===============================================================================================================================
*/

:root {
    --qop-dark-bg: #08090b;
    --qop-dark-card: #1a1c21;
    --qop-dark-recessed: #2a2d34;
    --qop-dark-text: #e4e4e7;
    --qop-dark-strong: #ffffff;
    --qop-dark-muted: #9a9aa0;
    --qop-dark-border: rgba(255, 255, 255, 0.14);
    --qop-dark-divider: rgba(255, 255, 255, 0.1);
    --qop-dark-link: #72acf3;
    --qop-dark-link-hover: #9cc5f7;
    color-scheme: dark;
}

/* Keep embedded pages (e.g. Embedly cards) transparent instead of on a white backdrop */
iframe {
    color-scheme: normal;
}

/* Base: page, text, links, headings */

body {
    background: var(--qop-dark-bg);
    color: var(--qop-dark-text);
}

a,
a:visited {
    color: var(--qop-dark-link);
}

a:hover,
a:focus,
a:active {
    color: var(--qop-dark-link-hover);
}

/* the Hide/Show sidebar button at the top of a guide's side list */
.reader-sidebar-toggle {
    color: var(--qop-dark-text);
}

.reader-sidebar-toggle:hover,
.reader-sidebar-toggle:focus {
    background: var(--qop-dark-recessed);
    color: var(--qop-dark-link-hover);
}

.reader-sidebar-toggle:focus-visible {
    outline-color: var(--qop-dark-link);
}

.reader-sections-hidden .reader-sidebar-toggle {
    border-color: var(--qop-dark-divider);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--qop-dark-strong);
}

hr,
.divider,
.reader-side-box {
    border-color: var(--qop-dark-divider);
}

.divider {
    border-top-color: var(--qop-dark-divider);
}

::selection {
    background: rgba(114, 172, 243, 0.35);
    color: var(--qop-dark-strong);
}

.bg-gray {
    background: var(--qop-dark-card) !important;
}

.text-gray {
    color: var(--qop-dark-muted) !important;
}

/* Keyboard focus: Quark removes link outlines, so show a clear ring for keyboard users only */

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--qop-dark-link) !important;
    outline-offset: 2px;
}

/* Header and menus (header is always dark in Dark Mode) */

#header,
.header-dark #header:not(.scrolled) {
    background: var(--qop-dark-bg);
    color: var(--qop-dark-text);
    border-bottom-color: var(--qop-dark-divider);
}

.header-transparent #header:not(.scrolled),
.header-dark.header-transparent #header:not(.scrolled) {
    background: rgba(8, 9, 11, 0.35);
}

#header a,
.header-dark #header:not(.scrolled) a {
    color: rgba(242, 242, 243, 0.8) !important;
}

#header a.active,
#header a:hover,
.header-dark #header:not(.scrolled) a.active {
    color: var(--qop-dark-strong) !important;
}

#header .logo svg path {
    fill: var(--qop-dark-strong);
}

.dropmenu ul ul {
    background: var(--qop-dark-card);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.header-dark #header:not(.scrolled) .dropmenu ul ul a,
.dropmenu ul ul a {
    color: var(--qop-dark-text) !important;
}

.dropmenu ul li a:hover,
.dropmenu ul li a:focus,
.dropmenu ul li a.active {
    color: var(--qop-dark-link) !important;
}

.mobile-menu .button_container span {
    background: var(--qop-dark-link);
}

.treemenu li {
    background: rgba(255, 255, 255, 0.05);
}

.treemenu li a:hover,
.treemenu li a:focus,
.treemenu li a.active {
    color: var(--qop-dark-link) !important;
}

.menu {
    background: var(--qop-dark-card);
    box-shadow: 0 0.05rem 0.4rem rgba(0, 0, 0, 0.5);
}

.menu .menu-item > a:hover {
    background: var(--qop-dark-recessed);
    color: var(--qop-dark-link);
}

/* Blog: cards, meta, tags, pagination, breadcrumbs, sidebar */

.card {
    background: var(--qop-dark-card);
    border-color: rgba(255, 255, 255, 0.07);
}

.blog-listing .card {
    box-shadow: 0 10px 45px -9px rgba(0, 0, 0, 0.6);
}

.label {
    background: var(--qop-dark-recessed);
    color: var(--qop-dark-text);
}

/* Section badges: lighter colours on a soft tint */
.section-badge.label,
.section-badge-blue.label { color: var(--qop-dark-link); background: rgba(114, 172, 243, 0.15); }
.section-badge-green.label { color: #86efac; background: rgba(134, 239, 172, 0.12); }
.section-badge-yellow.label { color: #fde047; background: rgba(253, 224, 71, 0.12); }
.section-badge-red.label { color: #fca5a5; background: rgba(252, 165, 165, 0.12); }
.section-badge-purple.label { color: #d8b4fe; background: rgba(216, 180, 254, 0.12); }
.section-badge-plain.label { color: var(--qop-dark-muted); background: transparent; box-shadow: inset 0 0 0 0.05rem var(--qop-dark-border); }

/* Keep My Place: the "Continue reading" bar on the Section List page */
.reader-resume {
    background: rgba(114, 172, 243, 0.15);
}

.reader-resume > .fa,
.reader-resume-title {
    color: var(--qop-dark-link);
}

.reader-resume-dismiss:hover,
.reader-resume-dismiss:focus {
    background: rgba(255, 255, 255, 0.1);
}

.reader-resume-dismiss:focus-visible {
    outline-color: var(--qop-dark-link);
}

.label.label-secondary {
    background: rgba(114, 172, 243, 0.15);
    color: var(--qop-dark-link);
}

.label.label-primary,
.pagination .page-item.active a {
    background: var(--qop-dark-link);
    color: var(--qop-dark-bg);
}

.pagination .page-item a {
    color: var(--qop-dark-text);
}

.pagination .page-item a:hover {
    color: var(--qop-dark-link);
}

.breadcrumb .breadcrumb-item:not(:last-child) a,
.nav .nav-item a {
    color: var(--qop-dark-muted);
}

.nav .nav-item.active > a,
.nav .nav-item a:hover {
    color: var(--qop-dark-text);
}

#breadcrumbs span:not(:first-child)::before,
#breadcrumbs a:not(:first-child)::before {
    color: var(--qop-dark-border);
}

#sidebar ul.related-pages li {
    border-bottom-color: var(--qop-dark-divider);
}

#footer {
    color: var(--qop-dark-muted);
}

/* Content: code, quotes, tables, notices, misc */

code {
    background: var(--qop-dark-recessed);
    color: #f6a5ab;
}

pre code,
pre code:not(.hljs):not([class*="language-"]) {
    background: var(--qop-dark-recessed);
    color: var(--qop-dark-text);
}

/* Syntax-highlighted code (Prism Highlight plugin): One Dark colours for the default One Light theme */

pre[class*="language-"],
code[class*="language-"] {
    background: var(--qop-dark-recessed);
    color: #abb2bf;
    text-shadow: none;
}

:not(pre) > code[class*="language-"] {
    background: var(--qop-dark-recessed);
}

/* Mirrors the One Light selectors so none of its colours show through; red and comment grey lightened to meet WCAG AA (4.5:1) on the code background */

.token.comment,
.token.prolog,
.token.cdata,
.language-markdown .token.blockquote.punctuation,
.language-markdown .token.hr.punctuation {
    color: #969ba5;
}

.token.doctype,
.token.punctuation,
.token.entity,
.token.attr-value > .token.punctuation.attr-equals,
.token.special-attr > .token.attr-value > .token.value.css,
.language-css .token.property,
.language-json .token.operator,
.language-markdown .token.url,
.language-markdown .token.url > .token.operator,
.language-markdown .token.url-reference.url > .token.string {
    color: #abb2bf;
}

.token.attr-name,
.token.class-name,
.token.boolean,
.token.constant,
.token.number,
.token.atrule,
.language-json .token.null.keyword,
.language-markdown .token.bold .token.content {
    color: #d19a66;
}

.token.keyword,
.language-css .token.important,
.language-css .token.atrule .token.rule,
.language-javascript .token.operator,
.language-markdown .token.italic .token.content {
    color: #c678dd;
}

.token.property,
.token.tag,
.token.symbol,
.token.deleted,
.token.important,
.language-css .token.selector,
.language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation,
.language-markdown .token.strike .token.content,
.language-markdown .token.strike .token.punctuation,
.language-markdown .token.list.punctuation,
.language-markdown .token.title.important > .token.punctuation {
    color: #eb7d86;
}

.token.selector,
.token.string,
.token.char,
.token.builtin,
.token.inserted,
.token.regex,
.token.attr-value,
.token.attr-value > .token.punctuation,
.language-css .token.url > .token.string.url,
.language-markdown .token.code-snippet {
    color: #98c379;
}

.token.variable,
.token.operator,
.token.function,
.language-markdown .token.url > .token.content {
    color: #61afef;
}

.token.url,
.language-css .token.function,
.language-css .token.url > .token.function,
.language-markdown .token.url > .token.url,
.language-markdown .token.url-reference.url {
    color: #56b6c2;
}

.token.token.tab:not(:empty):before,
.token.token.cr:before,
.token.token.lf:before,
.token.token.space:before {
    color: rgba(171, 178, 191, 0.3);
}

.line-highlight.line-highlight {
    background: rgba(255, 255, 255, 0.05);
}

/* Code toolbar (e.g. Copy button) */

div.code-toolbar > .toolbar.toolbar > .toolbar-item > a,
div.code-toolbar > .toolbar.toolbar > .toolbar-item > button,
div.code-toolbar > .toolbar.toolbar > .toolbar-item > span {
    background: rgba(255, 255, 255, 0.1);
    color: #c0c4cc;
}

div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover,
div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus,
div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover,
div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus,
div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover,
div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus {
    background: rgba(255, 255, 255, 0.18);
    color: var(--qop-dark-strong);
}

blockquote {
    border-left-color: var(--qop-dark-border);
}

.table td,
.table th,
#body-wrapper table:not([class]) td,
#body-wrapper table:not([class]) th {
    border-bottom-color: var(--qop-dark-divider);
}

.table.table-striped tbody tr:nth-of-type(odd) {
    background: var(--qop-dark-card);
}

mark {
    background: #5c4a14;
    color: var(--qop-dark-strong);
    border-bottom-color: #8a6d1d;
}

.chip,
.empty {
    background: var(--qop-dark-recessed);
    color: var(--qop-dark-text);
}

.panel {
    border-color: var(--qop-dark-border);
}

.notices.yellow {
    background: rgba(240, 173, 78, 0.12);
    color: #f5c27a;
}

.notices.red {
    background: rgba(217, 83, 79, 0.12);
    color: #f19a97;
}

.notices.blue {
    background: rgba(91, 192, 222, 0.12);
    color: #8fd3e8;
}

.notices.green {
    background: rgba(92, 184, 92, 0.12);
    color: #92d492;
}

.hero h1 {
    color: var(--qop-dark-strong);
}

.hero h2 {
    color: rgba(242, 242, 243, 0.8);
}

/* Forms: buttons and search */

.btn {
    background: transparent;
    border-color: var(--qop-dark-link);
    color: var(--qop-dark-link);
}

.btn:hover,
.btn:focus {
    background: rgba(114, 172, 243, 0.15);
    border-color: var(--qop-dark-link-hover);
    color: var(--qop-dark-link-hover);
}

.btn.btn-primary {
    background: var(--qop-dark-link);
    border-color: var(--qop-dark-link);
    color: var(--qop-dark-bg);
}

.btn.btn-primary:hover,
.btn.btn-primary:focus {
    background: var(--qop-dark-link-hover);
    border-color: var(--qop-dark-link-hover);
    color: var(--qop-dark-bg);
}

.form-input,
.search-wrapper .search-input {
    background: var(--qop-dark-card);
    border-color: var(--qop-dark-border);
    color: var(--qop-dark-text);
}

.form-input::placeholder,
.search-wrapper .search-input::placeholder {
    color: var(--qop-dark-muted);
}

.form-input:focus,
.search-wrapper .search-input:focus {
    border-color: var(--qop-dark-link);
    box-shadow: 0 0 0 0.1rem rgba(114, 172, 243, 0.25);
}

.search-submit {
    background: var(--qop-dark-recessed);
    border-color: var(--qop-dark-border);
}

/* Optional TNTSearch plugin: dark results dropdown and readable search word highlights */
.tntsearch-dropdown ~ .tntsearch-results .row {
    background: var(--qop-dark-card);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.tntsearch-results .info {
    color: var(--qop-dark-muted);
}

.tntsearch-results em {
    background-color: rgba(255, 183, 0, 0.35);
    color: inherit;
}

/* Quark Open Publishing extras */

.gitrepo-link-note {
    color: var(--qop-dark-muted);
}

/* Multi-page content (Section List page and its sections): Quark's dark greys, dark cards like the blog's, and the lighter link blue */
.reader-section-label,
.section-card-author,
.reader-subtitle,
.reader-edition,
.reader-progress-text,
.reader-attribution,
.reader-nav-label,
.reader-content .footnotes p,
.reader-content .footnotes li {
    color: var(--qop-dark-muted);
}

.reader-attribution a:hover,
.reader-attribution a:focus {
    color: var(--qop-dark-text);
}

.reader-header,
.reader-prev-next,
.reader-part-heading,
.section-list-below h2,
.section-list-below h3,
.section-list-below h4 {
    border-color: var(--qop-dark-divider);
}

#sections-nav .reader-part-label,
.reader-prev-next-top-divider {
    color: var(--qop-dark-muted);
}

.reader-progress .bar {
    background: var(--qop-dark-recessed);
}

.reader-progress .bar .bar-item {
    background: var(--qop-dark-link);
}

.section-card,
.reader-nav-tile {
    background: var(--qop-dark-card);
    box-shadow: 0 10px 45px -9px rgba(0, 0, 0, 0.6);
}

.section-card:hover,
.reader-nav-tile:hover {
    box-shadow: 0 12px 45px -9px rgba(0, 0, 0, 0.8), 0 0 0 0.05rem var(--qop-dark-border);
}

.reader-nav-tile .fa {
    color: var(--qop-dark-muted);
}

.reader-nav-tile:hover .fa,
.reader-nav-tile:focus .fa {
    color: var(--qop-dark-link);
}

.section-card:focus-within {
    outline-color: var(--qop-dark-link);
}

.reader-prev-next .reader-nav-tile:focus-visible {
    outline-color: var(--qop-dark-link) !important;
}

/* [badge] shortcode in Dark mode: the same lighter colours as the section card badges above */
.content-badge,
.content-badge-blue { color: var(--qop-dark-link); background: rgba(114, 172, 243, 0.15); }
.content-badge-green { color: #86efac; background: rgba(134, 239, 172, 0.12); }
.content-badge-yellow { color: #fde047; background: rgba(253, 224, 71, 0.12); }
.content-badge-red { color: #fca5a5; background: rgba(252, 165, 165, 0.12); }
.content-badge-purple { color: #d8b4fe; background: rgba(216, 180, 254, 0.12); }
.content-badge-plain { color: var(--qop-dark-muted); background: transparent; box-shadow: inset 0 0 0 1px var(--qop-dark-border); }

/* Search boxes in Dark Mode: a clearer edge, at least 3:1 against the page or card behind them (see css/theme.css) */
.search-box .form-input:not(:focus) {
    border-color: rgba(255, 255, 255, 0.42);
}

.search-box .form-input::placeholder {
    color: var(--qop-dark-muted);
}

/* the section being read in the side list, in Dark Mode (see css/reader.css) */
#sections-nav .reader-page-sections a.is-current {
    color: var(--qop-dark-text);
}

/* the Previous/Next bar at the bottom of the screen on phones (see css/reader.css) */
.reader-prev-next-bar {
    background: var(--qop-dark-card);
    border-top-color: var(--qop-dark-divider);
}

.reader-bar-prev {
    border-right-color: var(--qop-dark-divider);
}

.reader-bar-label,
.reader-bar-link .fa {
    color: var(--qop-dark-muted);
}

.reader-bar-link:hover .fa,
.reader-bar-link:focus .fa {
    color: var(--qop-dark-link);
}

/* Code blocks in dark mode: the Prism Highlight plugin uses one colour theme in both modes (One Light by default),
   so these switch code blocks to the matching One Dark colours (with comments a little lighter, to be easier to read).
   ":root body" lets them win over the plugin's colours for particular languages, such as .language-css .token.property */
:root body code[class*="language-"],
:root body pre[class*="language-"] {
    background: hsl(220, 13%, 18%);
    color: hsl(220, 14%, 71%);
    text-shadow: none;
}

:root body .token.comment, :root body .token.prolog, :root body .token.cdata { color: hsl(220, 10%, 60%); }
:root body .token.doctype, :root body .token.punctuation, :root body .token.entity { color: hsl(220, 14%, 71%); }
:root body .token.attr-name, :root body .token.class-name, :root body .token.boolean, :root body .token.constant, :root body .token.number, :root body .token.atrule { color: hsl(29, 54%, 61%); }
:root body .token.keyword { color: hsl(286, 60%, 67%); }
:root body .token.property, :root body .token.tag, :root body .token.symbol, :root body .token.deleted, :root body .token.important { color: hsl(355, 65%, 65%); }
:root body .token.selector, :root body .token.string, :root body .token.char, :root body .token.builtin, :root body .token.inserted, :root body .token.regex, :root body .token.attr-value { color: hsl(95, 38%, 62%); }
:root body .token.variable, :root body .token.operator, :root body .token.function { color: hsl(207, 82%, 66%); }
:root body .token.url { color: hsl(187, 47%, 55%); }

:root body div.code-toolbar > .toolbar .toolbar-item > button {
    background: hsl(220, 13%, 26%);
    color: hsl(220, 14%, 71%);
}

/* glossary definition box (css/glossary.css), like the section cards */
.glossary-popover {
    --glossary-popover-bg: var(--qop-dark-card);
    --glossary-popover-text: var(--qop-dark-text);
    --glossary-popover-border: 0;
    --glossary-popover-shadow: 0 12px 45px -9px rgba(0, 0, 0, 0.8), 0 0 0 0.05rem var(--qop-dark-border);
}
