/* Uses everforest palette: https://github.com/sainnhe/everforest */

/* Light mode (default) */
:root {
  --color-bg-dim: #fef9ed;
  --color-bg0: #fdf6e3;
  --color-bg1: #f4f0d9;
  --color-bg2: #efebd4;
  --color-bg3: #e6e2cc;
  --color-bg4: #e0dcc7;
  --color-bg5: #bdc3af;
  --color-bg-visual: #eaedc8;
  --color-bg-red: #fde3da;
  --color-bg-yellow: #faedcd;
  --color-bg-green: #f0f1d2;
  --color-bg-blue: #e9f0e9;
  --color-bg-purple: #fae8e2;
  --color-fg: #5c6a72;
  --color-red: #f85552;
  --color-orange: #f57d26;
  --color-yellow: #dfa000;
  --color-green: #8da101;
  --color-aqua: #35a77c;
  --color-blue: #3a94c5;
  --color-purple: #df69ba;
  --color-grey0: #a6b0a0;
  --color-grey1: #939f91;
  --color-grey2: #829181;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg-dim: #232a2e;
    --color-bg0: #2d353b;
    --color-bg1: #343f44;
    --color-bg2: #3d484d;
    --color-bg3: #475258;
    --color-bg4: #4f585e;
    --color-bg5: #56635f;
    --color-bg-visual: #543a48;
    --color-bg-red: #514045;
    --color-bg-yellow: #4d4c43;
    --color-bg-green: #425047;
    --color-bg-blue: #3a515d;
    --color-bg-purple: #4a444e;
    --color-fg: #d3c6aa;
    --color-red: #e67e80;
    --color-orange: #e69875;
    --color-yellow: #dbbc7f;
    --color-green: #a7c080;
    --color-aqua: #83c092;
    --color-blue: #7fbbb3;
    --color-purple: #d699b6;
    --color-grey0: #7a8478;
    --color-grey1: #859289;
    --color-grey2: #9da9a0;
  }
}

/* Responsive Typography  */
/* Base font size */
html {
  font-size: 16px;
}

/* Tablet */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  h1 {
    font-size: 2em;
  }

  h2 {
    font-size: 1.75em;
  }
}

/* Mobile */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  h1 {
    font-size: 1.75em;
  }

  h2 {
    font-size: 1.5em;
  }
}

/* Print Styles  */
@media print {

  /* Remove backgrounds */
  * {
    background: white !important;
    color: black !important;
  }

  /* Remove shadows and borders */
  img,
  pre,
  blockquote {
    box-shadow: none !important;
    border: 1px solid var(--color-bg1) !important;
  }

  /* Page breaks */
  h1,
  h2,
  h3 {
    page-break-after: avoid;
  }

  /* Show link URLs */
  a::after {
    content: " (" attr(href) ")";
  }
}

/* THEME START */

/* Global styles */
* {
  box-sizing: border-box;
}

html {
  line-height: 1.6;
  color: var(--color-fg);
  background: var(--color-bg0);
}

body {
  max-width: min(100vw, max(90vw, 900px));
  padding: 10px;
  margin: 10px auto;
}

/* Headers */
#header {
  position: sticky;
  bottom: 0;
  width: 100%;
  display: flex;
  flex-direction: row;
  z-index: 9999;
}

.sub-header {
  padding: 5px;
  display: flex;
  background: var(--color-bg0);
  flex-direction: row;
  flex: 1;
}

.header-item {
  font-size: 1em;
  font-family: inherit;
  text-align: center;
  color: var(--color-fg);
  flex: 1;
  margin: 5px;
  padding: 5px;
  border-radius: 2px;
  background: var(--color-bg1);
  border: none;
  cursor: pointer;
}

.header-item-highlighted {
  background: var(--color-bg4);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.25;
  margin-top: 0.8em;
  margin-bottom: 0.5em;
}

h1 {
  font-size: 2.5em;
  color: var(--color-red);
  border-bottom: 3px solid var(--color-red);
  padding-bottom: 0.3em;
}

h2 {
  font-size: 2em;
  color: var(--color-aqua);
  border-bottom: 2px solid var(--color-aqua);
  padding-bottom: 0.3em;
}

h3 {
  font-size: 1.5em;
  color: var(--color-purple);
  border-bottom: 2px solid var(--color-purple);
  padding-bottom: 0.3em;
}

/* Code */
code,
pre {
  font-family: "Fira Code", "Courier New", monospace;
}

code {
  background-color: var(--color-bg2);
  color: var(--color-fg);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

pre {
  background-color: var(--color-bg2);
  color: var(--color-fg);
  padding: 1.5em;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.5;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Links */
a {
  color: var(--color-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-green);
  text-decoration: underline;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5em 0;
}

th,
td {
  padding: 12px 15px;
  text-align: left;
  border: 1px solid var(--color-bg-visual);
}

th {
  background-color: var(--color-bg1);
  font-weight: 600;
  color: var(--color-text);
}

tr:hover {
  background-color: var(--color-bg2);
}

/* Blockquotes */
blockquote {
  margin: 0.5em 0;
  padding: 0.5em 1.0em;
  border-left: 3px solid var(--color-yellow);
  background-color: var(--color-bg-yellow);
  font-style: italic;
}

/* Task lists */
input[type="checkbox"] {
  margin-right: 0.5em;
}

/* References */
sub {
  font-size: 0.7em;
}

/* Biblenote symbols as separators */
.seperator {
  text-align: center;
  font-size: 1.5em;
}

/* Verse block */
.verses {
  padding: 1em 0;
}

.verses small {
  color: var(--color-grey1);
  font-size: 1em;
}

.verses code {
  white-space: nowrap;
  color: var(--color-green);
  background-color: var(--color-bg-green);
}
