:root {
    color-scheme: light dark;
    --fontsize: max(1em, 24px);
    --bg: light-dark(#eee,#181a1b);
    --bg2: light-dark(#ddd,#101010);
    --text: light-dark(#181a1b,#eee);
    --link1: light-dark(#BD0699,#5BCEFAEE);
    --link2: light-dark(#FA5BD9,#FA5BD9EE);
    --link3: light-dark(#7504FF,#c594ffEE);
    --italic: light-dark(#7504FF,#c594ff);
    --bold: light-dark(#2F8C00,#86ff48);
    --strike: light-dark(#181a1b99,#eeeeee99);
    --nextprev: light-dark(#07ACED,#7FD8FB);
    --nextprevdisabled: light-dark(#86abba, #7FD8FB99);
    --nextprevtext: #181a1b;
    --details: light-dark(#eee, #181a1b);
    --summary: light-dark(#ddd, #101010);
    --summarycolor: light-dark(#181a1b, #eee);
    --detailsborder: light-dark(#07ACED,#7FD8FB);
}

@font-face {
    font-family: NasinNanpa;
    src: url(/assets/nasin-nanpa-4.0.1-UCSUR.otf);
}

body {
    margin: 1rem;
    font-size: var(--fontsize);
    background-color: var(--bg);
    color: var(--text);
    font-family: NasinNanpa;
    @media only screen and (max-width: 650px) {
        margin: 0;
    }
}

/* Content */

main {
    max-width: 70%;
    @media only screen and (max-width: 650px) {
        max-width: 100%;
        padding: 0.5rem;
    }
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.3rem;
}

a {
    color: var(--link1);
    &:hover, &:active {
        color: var(--link2);
    }
    &:visited {
        color: var(--link3);
    }
}

i, em {
    color: var(--italic);
}

b, strong {
    color: var(--bold);
}

s {
    color: var(--strike);
}

img {
    max-width: 100%;
}

img.left {
    float: left;
    margin: 1em;
    @media only screen and (max-width: 650px) {
        float: unset;
        margin: 0;
        padding: 0;
    }
}

img.right {
    float: right;
    margin: 1em;
    @media only screen and (max-width: 650px) {
        float: unset;
        margin: 0;
        padding: 0;
    }
}

code {
    background-color: var(--bg2);
}

code {
    font-family: monospace monospace;
}

p code {
    display: inline;
    padding: 0 5px;
    margin: 0 5px;
}

pre code {
    display: block;
    padding: 10px;
    width: 75%;
    white-space: pre-wrap; 
}

blockquote cite {
    font-style: italic;
}

/* Admonitions, details, callouts */

details.head summary, .admonition-title {
    font-size: 1.5rem;
    font-weight: bold;
}

main details[open] p, .admonition p:not(.admonition-title) {
    padding: 0.25rem 0.5rem;
}

main details, .admonition {
    background-color: var(--details);
    border-left: 10px double var(--detailsborder);
}

details.fic, .admonition.fic {
    border: 0;
    margin: 10px 0;
}

main details summary, p.admonition-title {
    padding: 0.25rem 0.5rem;
    margin: 0;
    display: block;
    left: 0;
    width: 100%;
    background-color: var(--summary);
    color: var(--summarycolor);
}

div.admonition.success {
    border-left: 10px double var(--bold);
}

div.admonition.success p.admonition-title {
    color: var(--bold);
}

/* Nav bar */

nav.desktop {
    float: right;
    background-color: var(--bg2);
    max-width: 20%;
    margin: 0.5em;
    padding: 0.5em;
    @media only screen and (max-width: 650px) {
        display: none;
    }
}

nav.mobile {
    width: 100%;
    padding: 0.25em 0;
    background-color: var(--bg2);
    @media only screen and (min-width: 650px) {
        display: none;
    }
    summary.collapse {
        text-align: center;
        cursor: none;
    }
}

details.toc summary, details.nav summary {
    font-size: 1.35em;
    font-weight: bold;
}

/* Use this if I move the TOC to <main>

details.toc {
    display: inline;
    background-color: var(--bg2);
    border: 1px dashed var(--text);
    margin: 0.5em;
    padding: 0.5em;
}

*/

button {
    font-size: 1.2em;
    margin: 5px 0 20px 0;
}

/* Tables */

table {
    width: 100%;
    text-align: left;
}

table:not(.elem) tr:nth-child(even) {
    background-color: var(--bg2);
}

tr.header {
    background: var(--bg);
    opacity: 0.9;
    position: sticky;
    top: 0;
}

table td {
    min-width: 3em;
    margin: 0px;
    padding: 2px 10px;
    border: 0;
}

table td strong {
    color: var(--text);
}

td.nve {
    background: var(--red);
}

td.se {
    background: var(--green);
}

td.n {
    background: var(--bg2);
}

td:has(.redpigment) {
    background-color: var(--red);
    color: var(--pigmenttext);
}

td:has(.bluepigment) {
    background-color: var(--blue);
    color: var(--pigmenttext);
}

td:has(.brownpigment) {
    background-color: var(--brown);
    color: var(--pigmenttext);
}

td:has(.greenpigment) {
    background-color: var(--green);
    color: var(--pigmenttext);
}

td:has(.greypigment) {
    background-color: var(--grey);
    color: var(--pigmenttext);
}

td:has(.purplepigment) {
    background-color: var(--purple);
    color: var(--pigmenttext);
}

td:has(.yellowpigment) {
    background-color: var(--yellow);
    color: var(--yellowtext);
}

/* Pesterlogs */

div.pesterlog {
  width: 70%;
  margin-left: auto;
  margin-right: auto;
  background: var(--msg);
  border: 1px dashed gray;
  color: var(--text);
  padding-top: 10px;
  padding-bottom: 10px;
  padding-left: 35px;
  padding-right: 35px;
  font-family: "Courier New", monospace, monospace;
  font-weight: bold;
}

span.roxy {
    color: #ff6ff2;
}

span.dirk {
    color: #f2a400;
}

/* Brainscan */

p.msg {
    background: var(--bg2);
    padding: 10px;
    border-radius: 10px;
}

span.username {
    font-weight: bold;
    color: var(--accent3);
}

span.timestamp {
    color: var(--faint);
}

blockquote.richlink {
    background: var(--bg2);
    border-left: 10px solid var(--accent3);
    width: 75%;
    margin-left: auto;
    margin-right: 0;
    padding: 10px;
    border-radius: 0 10px 10px 0;
}

/* Radio boxes etc */

form.pronouns {
    float: right;
    background: var(--bg3);
    padding: 5px 10px;
    margin: 5px;
    border-radius: 10px;
}

radio-picker.tokiponatabs {
    display: flex;
    label {
      color: var(--nextprevtext);
      margin: 0 10px;
      &:has(input:checked) {
        background: var(--nextprev);
      }
      &:has(input:focus-visible) {
      }
      box-shadow: inset 0px 0px 1.2px 0px var(--bg);
      padding: 10px;
      cursor: pointer;
      background: var(--nextprevdisabled);
      &:hover { background: var(--nextprev); }
      &:active { background: var(--nextprev); }
    }
    input.switcher {
      /* To allow screen reader to still access these. */
      opacity: 0;
      position: absolute;
      pointer-events: none;
    }
}

body:has(#english:not(:checked)) #tab-english,
body:has(#lasina:not(:checked)) #tab-lasina,
body:has(#pona:not(:checked)) #tab-pona {
    display: none;
}