/* Fallback fonts for mobile */

@font-face {
  font-family: "MPlus1";
  src: url(/font/MPLUS1.ttf);
  size-adjust: 88%;
  font-display: swap;
}

@font-face {
  font-family: "IPAMJM";
  src: url(/font/ipamjm.ttf);
  font-display: swap;
}

:root {
  --width: 720px;
  --font-main: Mingliu, Simsun, MS Mincho, IPAMJM, Hiragino Mincho Pro W3, ヒラギノ明朝 Pro W3, lisongpro, umingtw, monospace;
  --font-secondary: MS PGothic, ms ui gothic, MPLUS1, hiragino kaku gothic pro w3, ヒラギノ角ゴPro W3,  Jung Gothic, Takao PGothic, monospace;
  --font-code: monospace;
  --font-scale: 1em;
  --background-color: rgba(255,255,255,0.8);
  --heading-color: #222;
  --text-color: #444;
  --link-color: #008463;
  --visited-color: #8b6fcb;
  --blockquote-color: #222;
  --accent-color: #00d26a;
  --table-accent: #eee;
  --background-image: url(/images/graph.png);
  --border-image: url(/images/border.gif);
}

/*To do: Change Hugo markdown rendering to make this a class*/

img[title=invertible] {
  filter: none;
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background-color: rgba(1, 36, 46,.8);
    --heading-color: #eee;
    --text-color: #ddd;
    --link-color: #8cc2dd;
    --visited-color: #8b6fcb;
    --blockquote-color: #ccc;
    --table-accent: #202a30;
    --accent-color:#008463;
    --background-image: url(/images/stars.gif);
  }
  
  img[title=invertible] {
    filter: invert(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --background-image: none;
    --border-image: url(/images/border.png);
  }
}

body {
  margin:0;
  background-color: var(--background-color);
  background-image: var(--background-image);
  background-repeat: repeat;
  background-position: center;
  cursor: url(/cursor/Hand.cur), auto;
  background-attachment: fixed;
}

input {
  cursor: url(/cursor/Pray.cur), auto;
}

.main {
  font-family: var(--font-secondary);
  font-size: var(--font-scale);
  margin: auto;
  padding: 20px;
  max-width: var(--width);
  text-align: left;
  background-color: var(--background-color);
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.5;
  color: var(--text-color);
  min-height:calc(100vh - 40px);
}

.left {
  background-color: transparent;
  height: 577px;
  position: fixed;
  width: calc(50vw - (570px/2));
  bottom: 0;
  left: 0;
  background-image: url(images/canola2.png);
  background-repeat: no-repeat;
  background-position: bottom 0px right 0px;
  pointer-events: none;
}

.right {
  background-color: transparent;
  height: 577px;
  position: fixed;
  width: calc(50vw - (570px/2));
  bottom: 0;
  right: 0;
  background-image: url(images/canola.png);
  background-repeat: no-repeat;
  background-position: bottom -5px left 0px;
  pointer-events:none;
}

.topright {
  background-color: transparent;
  height: 200px;
  position: fixed;
  width: calc(50vw - (570px/2));
  top: 0;
  right: 0;
  background-image: url(images/dove.gif);
  background-repeat: no-repeat;
  background-position: top 5px right 75px;
  pointer-events: none;
  transform: scaleX(-1);
}

.topleft {
  background-color: transparent;
  height: 200px;
  position: fixed;
  width: calc(50vw - (570px/2));
  top: 0;
  left: 0;
  background-image: url(images/dove.gif);
  background-repeat: no-repeat;
  background-position: top 25px right 75px;
  pointer-events: none;
}

.top {
  background-image: var(--border-image);
  width: 100%;
  background-position: top;
  height: 25px;
  position: absolute;
  top: 0px;
  background-repeat: repeat-x;
  pointer-events: none;
}

.bottom {
  background-image: var(--border-image);
  width: 100%;
  background-position: bottom;
  height: 25px;
  position:relative;
  bottom: 0px;
  background-repeat:repeat-x;
  pointer-events: none;
  margin-top: -25px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-main);
  color: var(--heading-color);
  margin-bottom: 0em;
}

h4, h5,h6 {
  font-size:1em;
}

h1, h4 {
  text-decoration: underline var(--accent-color);
}

h2, h5 {
  text-decoration: underline dashed var(--accent-color);
}

h3, h6 {
  text-decoration: underline dotted var(--accent-color);
}

p {
  margin-bottom: 0.5em;
  margin-top: 0.5em;
}

a {
  color: var(--link-color);
  cursor: pointer;
  text-decoration: underline var(--accent-color);
  transition: box-shadow 100ms;
  cursor: url(/cursor/Pray.cur), pointer;
}

a:hover {
  color: var(--heading-color);
  text-decoration: none;
  box-shadow: 0em -3em inset var(--accent-color);

}

a:has(img):hover {
  box-shadow:none;
}

nav a {
  margin-right: 8px;
}

textarea {
  display: block;
  max-width: 100%;
  width: 250px;
  border: 1px solid var(--accent-color);
  border-radius: 3px;
}

strong,
b {
  color: var(--link-color);
  font-family: var(--font-main);
}

em, i {
  color: var(--link-color);
  font-family: var(--font-main);
  font-style: normal;
}

b i, i b, strong i, i strong, strong em, em strong, strong em, em b, b em {
  color: var(--link-color);
  font-style: italic;
}

button {
  margin: 0;
  cursor: pointer;
}

time {
  font-family: monospace;
  font-style: normal;
  font-size: 15px;
}

main {
  line-height: 1.6;
}

table {
  width: 100%;
}

hr {
  outline:0;
  border: 0;
  text-align:left;
  height:1.5em; 
  line-height:1.5em;
  position:relative;
}

hr::after {
  content:attr(data-content);
  position:relative;
  display:inline-block;
  font-size:2em;
  padding:0;
  line-height:.8em;
  background:var(--background-color);
  color:var(--accent-color);
}

hr::before {
  content: '';
  background: repeating-linear-gradient(90deg, var(--accent-color), var(--accent-color) 3px, transparent 3px, transparent 5px);
  position:absolute;
  left:0;
  top:50%;
  width:100%;
  height:1px;
}

img {
  max-width: 100%;
}

code {
  font-family: monospace;
  padding: 2px;
  border-radius: 3px;
}

blockquote {
  border-left: 2px solid var(--accent-color);
  color: var(--blockquote-color);
  padding-left: 20px;
  font-style: normal;
}

footer {
  padding: 25px 0;
  text-align: center;
}

.title:hover {
  text-decoration: none;
  box-shadow:none;
}

.title h1, .title h2 {
  font-size: 1.5em;
}

.inline {
  width: auto !important;
}

.highlight,
.code {
  border-radius: 3px;
  margin-block-start: 1em;
  margin-block-end: 1em;
  overflow-x: auto;
}

/* blog post list */
ul.blog-posts {
  list-style-type: none;
  padding: unset;
}

ul.blog-posts li {
  display: flex;
  flex-wrap: wrap;
}

ul.blog-posts li span {
  flex: 0 0 130px;
}

ul.blog-posts li span:nth-child(2) {
  flex: 1 0 130px;
}

ul.blog-posts li span.description {
  display:inline-block; 
  flex:5 0 130px; 
  text-align:right; 
  font-size:0.8em
}

/*Media max width*/
@media (max-width:760px) {
  ul.blog-posts li span.description {
    flex: 5 0 100%;
    text-align:left;
  }
  ul.blog-posts li span:nth-child(2) {
    flex: 1 0 130px;
  }
  .main {
    margin-left: 16px;
    margin-right: 16px;
  }
}

ul.blog-posts li a:visited {
  color: var(--visited-color);
}

ul.blog-posts li a:hover {
  color: var(--heading-color);!important
}

.title {
  text-decoration:none;
  flex: 1 1 260px;
}

table {
  border-collapse:collapse;
  border-bottom: 2px solid var(--accent-color);
  border-spacing:1px;
  width:fit-content;
  max-width:100%;
  margin-left:auto;
  margin-right:auto;
}

thead {
  background-color:var(--accent-color);
  border-bottom: 1px solid var(--accent-color);
  font-style:strong;
}
th,td {
  padding:0.1em 1ch;
}
th:not(:first-child) {
  border-left: solid 1px var(--background-color);
}
tbody tr:nth-child(even) {
  border-top: solid 1px var(--table-accent);
  background-color: var(--table-accent);
}
tbody tr:nth-child(even) td:not(:first-child) {
  border-left: solid 1px var(--background-color);
}
tbody tr:nth-child(odd){
  border-bottom: solid 1px var(--table-accent);
  background-color: var(--background-color);
}
tbody tr:nth-child(odd) td:not(:first-child) {
  border-left: solid;
  border-left-width: 1px;
  border-left-color: var(--table-accent);
}

ol {
  list-style: lower-roman;
}

ul {
  list-style: circle;
}

ul li::marker, ol li::marker {
  color: var(--link-color);
}

li p {
  margin-bottom:0;
  margin-top:0;
}

::selection, ::-moz-selection, ::-webkit-selection {
  background-color: var(--accent-color);
}

code {
  background-color: var(--table-accent);
  font-family: var(--font-code);
  
}

.highlight pre code {
  color: #444;
  background-color: #f0f0f0;
}

.highlight pre {
  white-space: pre-wrap;
  word-break: break-all;
  padding-right: 1ch;
  font-size: 1em;
  border-radius: 2px;
}

.footerboxes a:hover {
  box-shadow:none;!important
}

.footerboxes img {
  padding: 0 1px;
  border-radius: 0!important;
}

.footerboxes {
  padding-top:0.5em;
}

.mood {
  font-family: monospace;
  font-size: 15px;
  color: var(--link-color);
  margin-top:-0.5em;
}

.moodwrapper {
  font-family: monospace; 
  text-align:right; 
  flex: 1 1 280px;
  display:inline-block;
  margin-top:2.3em;
  margin-bottom:auto;
  padding-left:5ch;
}

@media (max-width: 700px) {
  .moodwrapper {
    text-align:left!important;
    margin-top:auto;
    padding-left:0;
    flex: 1 1 100%;
    display:block;
  }
  .title {
    flex: 1 1 100%;
  }
}


@media (max-width:780px) {
  .left, .right, .topleft, .topright {
    display:none;
  }
}

@media (max-height: 650px) {
  .topleft, .topright {
    display:none;
  }
}

.imood {
  vertical-align: -4px;
}
.imood:hover {
  box-shadow:none;
}

content img, content iframe, main img {
  border-radius:3px;
}