/* ==========================================================================
   Dark theme (active when <html> has the class "dark-theme")
   ========================================================================== */
html.dark-theme { color-scheme: dark; }

html.dark-theme body {
    color: #f0f0f0;
    background-color: #191919
}

/* Links that are not the inline blue ones */
html.dark-theme a { color: #f0f0f0 }
html.dark-theme a:visited { color: #c0c0c0 }
html.dark-theme a:hover,
html.dark-theme a:focus { color: #fff }
html.dark-theme .author-social,
html.dark-theme .author-social:visited { color: #f0f0f0 }
html.dark-theme .fa-3 { color: #f0f0f0 }

/* Text selection */
html.dark-theme ::-moz-selection { color: #fff; background-color: #404040 }
html.dark-theme ::selection { color: #fff; background-color: #404040 }

/* Little triangle under the header image */
html.dark-theme .image-wrap:after { border-bottom-color: #191919 }

/* Lines and borders */
html.dark-theme hr { border-top-color: #373838; border-bottom-color: #191919 }
html.dark-theme #index h3 { border-bottom-color: #373838 }
html.dark-theme .top-navigation li { border-bottom-color: rgba(255, 255, 255, 0.12) }
html.dark-theme .top-navigation li:last-child { border-bottom-color: transparent }
html.dark-theme .article-wrap p>a,
html.dark-theme .article-wrap li>a { border-bottom-color: #5c5c5c }
html.dark-theme blockquote { border-color: #373838; border-left-color: #7a7a7a }
html.dark-theme pre { border-color: #373838 }
html.dark-theme fieldset { border-color: #373838 }
html.dark-theme .article-wrap img[style*="solid black"] { border-color: #5c5c5c !important }

/* Mobile menu button */
html.dark-theme .nav .navtoogle { background-color: #303030 }

/* Boxes */
html.dark-theme .notice,
html.dark-theme .well { background-color: #252525; border-color: #373838 }
html.dark-theme div.bibtex { background: #252525; border-color: #373838 }
html.dark-theme figcaption,
html.dark-theme .image-credit,
html.dark-theme .image-credit a { color: #9c9c9c }

/* Buttons and form fields */
html.dark-theme .btn { color: #191919; background-color: #f0f0f0; border-color: #f0f0f0 }
html.dark-theme .btn:visited { color: #191919 }
html.dark-theme .btn:hover { color: #f0f0f0; background-color: #191919 }
html.dark-theme label,
html.dark-theme form legend { color: #f0f0f0 }
html.dark-theme form legend { border-bottom-color: #373838 }
html.dark-theme input,
html.dark-theme textarea,
html.dark-theme select { color: #f0f0f0; background-color: #252525; border-color: #373838 }

/* Emoji silhouettes (the grey trophies) */
html.dark-theme mark,
html.dark-theme .dark_emoji { text-shadow: 0 0 0 #c0c0c0 }

/* The theme button itself */
#theme-toggle { cursor: pointer }
#theme-toggle .fa-sun-o { display: none }
html.dark-theme #theme-toggle .fa-moon-o { display: none }
html.dark-theme #theme-toggle .fa-sun-o { display: inline-block }

/* Accent colour for the inline-coloured links, slightly brighter body text */
html.dark-theme body { color: #f0f0f0 }
html.dark-theme font[color="1DA1F2" i],
html.dark-theme font[color="#1DA1F2" i] { color: #c4937f }
html.dark-theme a[style*="1DA1F2" i] { color: #c4937f !important }

/* Word cloud on the Research page: white text on the dark background */
html.dark-theme img[src$="wordcloud.png"] {
    -webkit-filter: invert(1) brightness(0.9);
    filter: invert(1) brightness(0.9);
    mix-blend-mode: screen
}

/* Hidden image at the bottom of the publications page: white instead of black */
html.dark-theme .hiddenimage img {
    -webkit-filter: invert(1);
    filter: invert(1)
}

/* Accent links: matching underline, and a lighter shade on hover */
html.dark-theme .article-wrap a:has(font[color="1DA1F2" i]) { border-bottom-color: rgba(196, 147, 127, 0.4) }
html.dark-theme a:hover font[color="1DA1F2" i],
html.dark-theme a:focus font[color="1DA1F2" i] { color: #dcb3a3 }
