/*
TODO: Clean up this stylesheet.
*/

* {
  transition: all .2s ease-in-out;
}
  
body {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.07rem;
  text-rendering: optimizeLegibility;
  margin: 0.5rem;

	background-color: #DDD;
  color: #223;
}
@media (prefers-color-scheme: dark) {
  body {
    background: #222;
    color: #DDF;
  }
  
  img.dark {
      filter: invert(1);
  }
}

a {
  color: #33A;
  text-decoration: none;
}
a:hover {
  color: rgb(51, 111, 170);
}
@media (prefers-color-scheme: dark) {
  a {
    color: #88F;
  }
  a:hover {
    color: rgb(136, 190, 255);
  }
}

a.jump {
  color: #272;
}
@media (prefers-color-scheme: dark) {
  a.jump {
    color: #AEA;
  }
}

img {
  display: block;
  max-width: 100%;
  margin: 0.2rem;
}

header {
  text-align: center;
  max-width: 45rem;
  margin: 0 auto;
}
header h1 {
  font-size: 3rem;
  font-weight: normal;
  margin: 0 0.2rem 0 0;
  text-align: right;
  font-size: 2rem;
}
header h1 em {
  font-style: normal;
  color: #272;
}
.red header h1 em {
  color: #A00;
}
@media (min-width: 450px) {
  header h1 em {
    white-space: nowrap;
  }
}
@media (prefers-color-scheme: dark) {
  header h1 em {
    color: #AEA;
  }
  .red header h1 em {
    color: #F66;
  }
}

main {
  max-width: 45rem;
  margin: 0 auto;
}

nav {
  text-align: center;
  max-width: 45rem;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
  font-size: 1.5rem;
  margin: 0 auto 1rem auto;
  border-bottom: thin solid #272;
}
.red nav {
  border-bottom: thin solid #A00;
}
@media (prefers-color-scheme: dark) {
  nav {
    border-bottom: thin solid #AEA;
  }
  .red nav {
    border-bottom: thin solid #F66;
  }
}

footer {
  text-align: center;
  max-width: 45rem;
  margin-left: auto;
  margin-right: auto;
}
footer nav {
  margin: 2rem auto 0rem auto;
  border-top: thin solid #272;
  border-bottom: none;
}
.red footer nav {
  border-top: thin solid #A00;
  border-bottom: none;
}
@media (prefers-color-scheme: dark) {
  footer nav {
    border-top: thin solid #AEA;
    border-bottom: none;
  }
  .red footer nav {
    border-top: thin solid #F66;
    border-bottom: none;
  }
}

nav a {
  margin: 0 1rem;
  display: inline-block;
}

section {
  margin-top: 1.5rem;
}
section > div {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
input[type='checkbox'] {
  display: none;
}
label {
  display: block;
  cursor: pointer;
  font-size: 2rem;
  color: #272;
}
.red label {
  color: #A00;
}
@media (prefers-color-scheme: dark) {
  label {
    color: #AEA;
  }
  .red label {
    color: #F66;
  }
}
label::before {
  content: ' ';
  display: inline-block;

  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 5px solid currentColor;

  vertical-align: middle;
  margin-right: .7rem;
  transform: rotate(90deg) translateX(-3px);
}
input:checked + label::before {
  transform: translateY(-2px);
}
input:checked + label + div {
  max-height: 0;
  overflow: hidden;
}

header img {
  margin: 0.5rem auto 2rem auto;
  width: 80%;
  max-width: 500px;
}

tr td {
  text-align: right;
  padding-right: 1rem;
  padding-top: 0.2rem;
  vertical-align: top;
}
tr td + td {
  text-align: left;
}
table ul {
  margin: 0;
  padding-left: 1rem;
}

hr {
  border: none;
  height: 1px;
  background-color: #272;
}
@media (prefers-color-scheme: dark) {
  hr {
    background: #AEA;
  }
}
.red hr {
  background-color: #A00;
}
@media (prefers-color-scheme: dark) {
  .red hr {
    background: #F66;
  }
}

/* Primary (works on modern Chrome/Firefox/Safari 15+) */
span[title]{
  text-decoration-line: underline;
  text-decoration-style: dashed;   /* more reliable than 'underline dashed' */
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  cursor: help;                    /* harmless on touch; ignored */
}
/* Fallback for engines that don't support dashed/offset well */
@supports not (text-decoration-style: dashed) {
  span[title]{
    text-decoration: none;
    border-bottom: 1px dashed currentColor; /* universal */
    padding-bottom: 1px;                     /* fake a little offset */
  }
}
/* Simple CSS tooltip reusing the title text */
span[title]{ position: relative; }
span[title]:hover::after, span[title]:focus-visible::after{
  content: attr(title);
  position: absolute;
  font-size: 0.8rem;
  left: 0; top: 100%;
  margin-top: .25rem;
  padding: .25rem .5rem;
  background: #111;
  color: #fff;
  border-radius: .25rem;
  max-width: 30rem;
  white-space: normal;
  z-index: 1000;
}


.left {
  float: left;
}

h4 {
  font-size: 1.2rem;
}

.blurb {
  padding: 1rem 1.5rem;
  margin: 1.5rem auto;
}
.blurb .quote {
  display: block;
  font-style: italic;
  color: #272;
  margin-bottom: 0.75rem;
}
.red .blurb .quote {
  color: #A00;
}
@media (prefers-color-scheme: dark) {
  .blurb .quote {
    color: #AEA;
  }
  .red .blurb .quote {
    color: #F66;
  }
}
.blurb .source {
  display: block;
  text-align: right;
}


.cover {
  max-width: 20rem;
}
.cover.left {
  margin-right: 1rem;
}
#redHeartBlurbs {
  overflow: hidden;
}
#crystalCovers {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
}
#crystalCovers img {
  max-width: 30%;
}

@media (min-width: 768px) {
  header {
    max-width: 65rem;
    display: flex;           /* Arrange children (image and h1) in a row */
    align-items: center;     /* Vertically align the image and text */
  }

  header img {
    flex: 0 0 300px; /* Do not grow, do not shrink, and have a base width of 300px */
    width: 300px;
    max-width: 40%;
    margin: 0.5rem 1.5rem 0.5rem 0.5rem;
  }

  header h1 {
    flex: 1;
  }

  nav, footer {
    max-width: 65rem;
  }
}