/* 1. General Settings ––––––––––––––––––––-–––––––––––––– */

/* Global variables. */
:root,
::backdrop {
  /* Set sans-serif & mono fonts */
  --sans-font:  Optima, Candara, 'Noto Sans', source-sans-pro, sans-serif;
  --serif-font: 'Iowan Old Style', 'Palatino Linotype', 'URW Palladio L', P052, serif;
  --mono-font: Consolas, Menlo, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
  
  /* misc */
  --standard-border-radius: 5px;
  --navspacer-large:2rem;
  --navspacer-small:0.9rem;
  --transition: 200ms;

  /* Default (light) theme */
  --bg: #faf8f6;
  --accent-bg: #fcfaf5;
  --bg-darker: #f3f3f3;
  --pre-bg: #1c2532;
  --text: #362b2b;
  --text-light: #645050;
  --text-lighter: #eae5e5;
  --text-dark: #211c1c;
  --text-darker: #070606;
  --text-hover: #faf8f6;
  --border: #a49989;
  --accent: #A70202;
  --accent-underline: #b32222;
  --accent-light: #ed8953;
  --accent-hover: #dd7327;
  --code: #c6461c;
  --preformatted: #444;
  --marked: #ffe875;
  --disabled: #efefef;
}

/* 2. Reset –––––––––––––––––––––––––––––––––––––––––––– */

/* Reset box-sizing */
*, *::before, *::after {
    box-sizing: border-box;
}
  
/* Reset default appearance */
textarea,
select,
input,
progress {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

html {
    font-family: var(--sans-font);
    scroll-behavior: smooth;
}


/* body */
body {
    color: var(--text);
    background-color: var(--bg);
    font-size: 1.15rem;
    line-height: 1.5;
    display: grid;
    grid-template-columns: 1fr min(85rem, 90%) 1fr;
    grid-template-rows: auto 1fr auto;
    margin: 0;
    min-height: 100vh;
}

body > * {
    grid-column: 2;
}

/* Headings */

/* Format headers */
h1 {
  font-size: 2.8rem;
  font-weight: 300;
}

h2 {
  font-size: 2.3rem;
  margin-top: 3rem;
  font-weight: 300;
  font-variant: small-caps;
}

h3 {
  font-size: 1.8rem;
  margin-top: 3rem;
  font-weight: 400;
}

h4 {
  font-size: 1.24rem;
  font-weight: 700;
}

h5 {
  font-size: 1.05rem;
  font-weight: 400;
}

h6 {
  font-size: 0.86rem;
  font-weight: 700;
  font-style: italic;
}

/* Prevent long strings from overflowing container */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* Fix line height when title wraps */
h1,
h2,
h3 {
  line-height: 1.1;
}

h1,h2,h3,h4,h5,h6 {
  font-family: var(--serif-font);
}


/* links */

a,
a:visited {
  color: var(--accent);
  text-decoration-color: var(--accent-underline);
  text-underline-offset: 3px;
  text-decoration-thickness: 0.8px;
  /* transition: all .1s ease-in-out; */
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.8px;
}

footer > p a {
  color: var(--text-darker);
}



/* lists */
ul, ol, dl { 
  margin: 1rem 0; padding: 0 0 0 2em; 
}

main > ul li:not(:last-child), dd:not(:last-child) { 
  margin-bottom: 0.5rem; 
}
dt { 
  font-weight: bold; 
}

/* tables */
td, th {
  padding: 0.5em 0.8em;
  text-align: right;
  border-bottom: 0.1rem solid var(--cmed);
  white-space: nowrap;
  font-size: 95%;
}
thead th[colspan] { padding: .2em 0.8em; text-align: center; }
thead tr:not(:only-child) td { padding: .2em 0.8em; }
thead+tbody tr:first-child td { border-top: 0.1rem  solid var(--cdark);  }
td:first-child, th:first-child { text-align: left; }
tr:hover{ background-color: var(--clight); }
table img { display: block; }


/* document sections */
article {
    margin-bottom: 1rem;
}

fieldset,
dialog {
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: var(--standard-border-radius);
  margin-bottom: 1rem;
}

article h2:first-child {
  margin-top: 1rem;
}

section {
  padding: 2rem 1rem;
}

/* Don't double separators when chaining sections */
section+section,
section:first-child {
  border-top: 0;
  padding-top: 0;
}

section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

details {
  padding: 0.7rem 1rem;
}

summary {
  cursor: pointer;
  font-weight: bold;
  padding: 0.7rem 1rem;
  margin: -0.7rem -1rem;
  word-break: break-all;
}

details[open]>summary+* {
  margin-top: 0;
}

details[open]>summary {
  margin-bottom: 0.5rem;
}

details[open]> :last-child {
  margin-bottom: 0;
}

/* aside and box */
aside,
details,
progress {
  background-color: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: var(--standard-border-radius);
  margin-bottom: 1rem;
}

aside {
  font-size: 1rem;
  width: 30%;
  padding: 0 15px;
  margin-inline-start: 15px;
  float: right;
}

*[dir="rtl"] aside {
  float: left;
}

/* Make aside full-width on mobile */
@media only screen and (max-width: 810px) {
  aside {
    width: 100%;
    float: none;
    margin-inline-start: 0;
  }
}

/* figures */
img,
video {
  max-width: 100%;
  height: auto;
  border-radius: var(--standard-border-radius);
}

figure {
  margin: 0;
  display: block;
  overflow-x: auto;
}

figcaption {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}


/* code */
/* Use mono font for code elements */
code,
pre,
pre span,
kbd,
samp {
  font-family: var(--mono-font);
  color: var(--code);
}

:not(pre) > code {
  font-size: 0.9em;
  word-spacing: -0.25em;
}

kbd {
  color: var(--preformatted);
  border: 1px solid var(--preformatted);
  border-bottom: 3px solid var(--preformatted);
  border-radius: var(--standard-border-radius);
  padding: 0.1rem 0.4rem;
}

pre {
  background-color: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: var(--standard-border-radius);
  margin-bottom: 1rem;
  padding: 1rem 1.4rem;
  max-width: 100%;
  overflow: auto;
  background: var(--bg-pre);
}

/* Fix embedded code within pre */
pre code {
  color: var(--text-light);
  background: none;
  margin: 0;
  padding: 0;
}

/* Code blocks */
pre[class*="language-"] {
  padding: 1em;
  margin: .5em 0;
  overflow: auto;
  border-radius: 0.3em;
}

:not(pre) > code[class*="language-"],
pre[class*="language-"] {
  background: var(--accent-bg);
}


/* misc */
hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 1rem auto;
}

blockquote {
	display: block;
	margin: 0.5rem 0rem 1rem;
	width: 100%;
	overflow: auto hidden;
	text-align: left;
    border-left: 0.4rem solid var(--border); 
    padding: 0 0 0 1rem;
    font-style: italic;
}

sup,
sub {
  vertical-align: baseline;
  position: relative;
}

sup {
  top: -0.4em;
}

sub {
  top: 0.3em;
}

input[type="range"] {
  padding: 0;
}

/* Set the cursor to '?' on an abbreviation and style the abbreviation to show that there is more information underneath */
abbr[title] {
  cursor: help;
  text-decoration-line: underline;
  text-decoration-style: dotted;
}

