/*
 * Use a sans-serif font for easier screen reading, make the background darker
 * so it doesn't kill my eyes and soften the contrast between the background
 * color and the text color.
 *
 * Also, make paragraphs look a bit like lined paper, code blocks like graph
 * paper, and block quotes like cards.
 */

body {
    margin-top: 0em;
    margin-left: 0.5em;
    margin-right: 0.5em;
    font-family: "Parchment MF";
    font-size: 1.0em; /* parchment MF is tiny */
    color: #1a1a1a;
    text-align: justify;

    background:
        linear-gradient(-90deg, rgba(0,0,0,.05) 1px, transparent 1px),
        linear-gradient(rgba(0,0,0,.05) 1px, transparent 1px);
    background-size:
        1em 1em,
        1em 1em;
}

nav#TOC {
    float: right;
}

pre.sourceCode {
  border: 0.25em solid rgba(0, 0, 0, .2);
  border-radius: 0.25em;
  padding: 0.5em;
}

table {
    background-color: rgba(231,201,169,.25);
    margin: 1em;
}

pre {
    background-color: rgba(231,201,169,.25);
    white-space: pre-wrap;
    padding-left: 20px;
    font-size: 0.5em;
    font-family: mono;
}

pre.sourceCode, tbody, thead {
    background-color: rgba(231,201,169,.5);
}

pre.quote {
    white-space: pre-wrap;
    padding-left: 20px;
    font-style: italic;
    box-shadow: 0px 0px 5px 0px #888;
    background: #e7c9a9;
}

caption {
    font-weight: bold;
}

blockquote {
    font-style: italic;
    --margin-line: #941c5a;
    --lines: #1d97b8;
    box-shadow: 0px 0px 5px 0px #888;
    background: #e7c9a9;
}

blockquote::before {
}

p {
    /*
     * neat paper effect, but gets tedious...
    background-image: repeating-linear-gradient(white 0px, white 1.0em, teal 1.1em);
    */
    margin-bottom: 4px;
    padding: 4px 4px 4px 4px;
}

div.figure {
    /* position: relative; */
    padding: 20px;
    text-align: center;
}

div.line-block {
    background-color: rgba(231,201,169,.5);
}

/* And figure captions are centered/bold. */
p.caption {
    font-weight: bold;
    text-align: center;
}
p.backlink {
	text-align: center;
}

/* Remove underlines from links */
a {
    text-decoration: none;
}

/* Put links in blocks so they stand out more, for example: [link]. */
a::before {
    content: "[";
}
a::after {
    content: "]";
}

div.tags {
	margin-left: 0.5em;
	float: right;
}

a.tag {
    text-transform: uppercase;
    color: green;
}

a.tag::before {
    content: "#";
}

a.tag::after {
    content: "";
}


.sourceCode a::before {
    content: "";
}

.sourceCode a::after {
    content: "";
}

/* not visited link */
a:link {
    color: #7a7a7a;
}

/* visited link */
a:visited {
    color: #acacac;
}

/* mouse over link */
a:hover {
    color: #9a9a9a;
}

/* selected link */
a:active {
    color: #7a7a7a;
}

/* for footnotes */
ol {
    display: block;
}

h1 {
    font-size: 3em;
    color: brown;
}

h1.title {
	text-align: center;
}

h2 {
    font-size: 2.0em;
    padding-top: 1em;
}

h3 {
    font-size: 1.50em;
    padding-top: 1em;
}

h4 {
    font-size: 1.25em;
    padding-top: 1em;
}


/* I saw a cool wordcloud from css effect I liked.  trying that here...
 * credit: https://dev.to/alvaromontoro/create-a-tag-cloud-with-html-and-css-1e90
 */
ul.cloud {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  line-height: 2.75rem;
  width: 80%;
}

ul.cloud a {
  /*   
  Not supported by any browser at the moment :(
  --size: attr(data-weight number); 
  */
  --size: 15;
  --color: #a33;
  color: var(--color);
  font-size: calc(var(--size) * 0.25rem + 0.5rem);
  display: block;
  padding: 0.125rem 0.25rem;
  position: relative;
  text-decoration: none;
  /* 
  For different tones of a single color
  opacity: calc((15 - (9 - var(--size))) / 15); 
  */
}

ul.cloud a[data-weight="1"] { --size: 5; }
ul.cloud a[data-weight="2"] { --size: 10; }
ul.cloud a[data-weight="3"] { --size: 15; }
ul.cloud a[data-weight="4"] { --size: 20; }
ul.cloud a[data-weight="5"] { --size: 25; }
ul.cloud a[data-weight="6"] { --size: 30; }
ul.cloud a[data-weight="7"] { --size: 35; }
ul.cloud a[data-weight="8"] { --size: 40; }
ul.cloud a[data-weight="9"] { --size: 45; }

ul[data-show-value] a::after {
  content: " (" attr(data-weight) ")";
  font-size: 1rem;
}

ul.cloud li:nth-child(2n+1) a { --color: #181; }
ul.cloud li:nth-child(3n+1) a { --color: #33a; }
ul.cloud li:nth-child(4n+1) a { --color: #c38; }

ul.cloud a:focus {
  outline: 1px dashed;
}

ul.cloud a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 100%;
  background: var(--color);
  transform: translate(-50%, 0);
  opacity: 0.15;
  transition: width 0.25s;
}

ul.cloud a:focus::before,
ul.cloud a:hover::before {
  width: 100%;
}

@media (prefers-reduced-motion) {
  ul.cloud * {
    transition: none !important;
  }
}
