/*! HTML5 Boilerplate v9.0.0-RC1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  --primary-bg-color: #366244;
  --primary-text-color: white;
  background-color: var(--primary-bg-color);
  color: var(--primary-text-color);
  font-family: sans-serif;
  font-size: 1em;
  line-height: 1.4;
}
::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}
::selection {
  background: #b3d4fc;
  text-shadow: none;
}
hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}
audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
  max-width: 100%;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}
textarea {
  resize: vertical;
}
.hidden,
[hidden] {
  display: none !important;
}
.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}
.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}
.invisible {
  visibility: hidden;
}
.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}
.clearfix::after {
  clear: both;
}

:target::before {
  --target-fix: 120px;
  content: "";
  display: block;
  height: var(--target-fix); /* fixed header height*/
  margin: -var(--target-fix) 0 0; /* negative fixed header height */
}

a, a:hover, a:focus, a:active {
  color: inherit;
}
/* End Boilerplate styles */

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

#page {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

header {
  padding: 2rem;
  padding-bottom: 0;
  background-color: #16421c;
  font-size: 1.1em;
  position: sticky;
  top: -6.4rem;
  z-index: 5;
  border-bottom: 2px var(--primary-bg-color) solid;
}

.widthbox {
  width: 80%;
  margin-left: auto;
  margin-right: auto;
  height: 100%;
}

header div.widthbox {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.headerimg {
  height: 4rem;
  margin-right: .5rem;
}

h1, .subtitle {
  font-family: 'Beleren', serif;
  margin: -.2em 0;
}

.subtitle {
  font-size: 1.33em;
}

main {
  background-color: var(--primary-bg-color);
  /*padding: 0 2rem 2rem;*/
  padding: 0 6vw 6vw;
  padding: 0 6dvw 6dvw;
}

article {
  min-height: 100%;
}

section {
  margin-bottom: 1rem;
}

section::after {
  content: "";
  clear: both;
  display: table;
}

section > span {
  display: inline-block;
  font-size: 1.5em;
}

section > span > span {
  display: inline-block;
  white-space: nowrap;
}

span h3 {
  display: inline-block;
  margin: .1rem;
}

section span i.ms {
  font-size: .8em;
  margin: 0 .1rem 0;
  vertical-align: baseline;
}

section .card:not(.lazy) {
  max-width: 300px;
  float: right;
  margin: .6rem -.6rem .6rem .6rem;
}

section:nth-of-type(even) .card:not(.lazy) {
  margin: .6rem .6rem .6rem -.6rem;
  float: left;
}

article a:not(.button) {
  background-image: linear-gradient(to bottom, white 0%, white 100%);
  background-position: 0 100%;
  background-repeat: repeat-x;
  background-size: 1px 1px;
  color: inherit;
  text-decoration: none;
}

article a:not(.button):hover {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 4'%3E%3Cstyle type='text/css'%3E.squiggle{animation:shift .3s linear infinite;}@keyframes shift {from {transform:translateX(0);}to {transform:translateX(-15px);}}%3C/style%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2' class='squiggle' d='M0,3.5 c 5,0,5,-3,10,-3 s 5,3,10,3 c 5,0,5,-3,10,-3 s 5,3,10,3'/%3E%3C/svg%3E");
  background-size: auto 4px;
}

img.card, .lite-light img {
  background-color: transparent;
  border-radius: 5%;
  max-width: 100vw;
  max-width: 100dvw;
}

nav.subnav {
  display: flex;
  width: 100%;
  /*margin: -1rem auto 1rem;
  padding: .2rem 0;*/
  margin: -1rem -2vw 1rem;
  margin: -1rem -2dvw 1rem;
  padding: .2rem 2vw;
  padding: .2rem 2dvw;
  justify-content: center;
  position: sticky;
  top: 3.8rem;
  background-color: rgba(54, 98, 68, 0.7);
  z-index: 1;
}

nav.subnav a {
  display: block;
  background-color: #2c5b3b;
  transition: background-color .2s;
  padding: .4rem;
  margin: .2rem;
  border-radius: 20%;
  flex-shrink: 1;
  line-height: 1px;
}

nav.subnav a:hover {
  background-color: #5a956c;
}

nav.subnav a.active {
  background-color: #5a956c;
}

footer {
  padding: 1rem 2rem;
  font-size: 0.8em;
  margin-top: auto;
  background-color: #16421c;
}

footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
}

table {
  width: 100%;
  border-collapse: collapse;
}

td, th {
  padding: 8px;
  hyphens: manual;
}

th {
  padding-top: 0px;
  padding-bottom: 0px;
  text-align: left;
  background-color: #16421c;
  color: white;
}

td:not(:last-child), th:not(:last-child) {
  width: 1%;
  white-space: nowrap;
}

td i.ms:first-child {
  margin-right: 0.3rem;
}

tr:nth-child(odd), details:nth-child(odd) {
  background-color: rgba(255,255,255, 0.1);
}

tr:hover, details > summary:hover {
  background-color: rgba(22, 66, 28, 0.3);
}

th h3 {
  margin: .8rem 0;
}

td hr {
  margin: 0.7rem 0 .3rem;
  border-top-style: dotted;
}

span[data-tippy-content] {
  text-decoration: underline;
  text-decoration-style: dotted;
  cursor: pointer;
  white-space: nowrap;
}

span[data-tippy-content]::after {
  content: attr(data-text);
  font-weight: bold;
  opacity: 0;
  pointer-events: none;
}

span[data-tippy-content]:hover {
  text-shadow: 0px 0px 1.5px white;
}

.tippy-box {
  border-radius: 1rem;
}

.tippy-content {
  padding: 0.4rem;
}

#mechanics ul {
  list-style: none;
  display: flex;
  width: 100%;
  padding: 0;
  justify-content: space-evenly;
  flex-wrap: wrap;
}

#mechanics ul li {
  margin: .2rem;
}

.lore {
  font-style: italic;
}

ol {
  display: inline-block;
  padding-left: 1rem;
  margin: 0;
}

/*  Accordion sections  */

.accordion > input[type="checkbox"] {
  position: absolute;
  left: -100vw;
}

.accordion .content {
  display: none;
  /*height: 0;
  transition: height 0.3s ease;*/
}

.accordion {
  margin-bottom: 1rem;
}

.accordion > input[type="checkbox"]:checked ~ .content {
  /*height: auto;
  padding: 15px;
  overflow: visible;*/
  display: block;
  border: 1px solid #e8e8e8;
  border-top: 0;
  border-radius: 0 0 .4rem .4rem;
  overflow: hidden;
}

.accordion .handle {
  margin: 0;
  font-size: 1.125em;
  line-height: 1.2em;
}

.accordion label {
  display: block;
  color: #333;
  cursor: pointer;
  padding: .5rem;
  background: #e8e8e8;
  border-radius: 0.4rem;
}

.accordion > input[type="checkbox"]:checked ~ .handle label {
  border-radius: .4rem .4rem 0 0;
}

.accordion label:hover,
.accordion label:focus {
  background: #d8d8d8;
}

details > summary {
  cursor: pointer;
  padding: 0.3rem 0.7rem;
  width: 100%;
}

details > summary::marker {
  content: '';
}

.accordion .handle label:before, details > summary:before {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath d='M471.1 297.4C483.6 309.9 483.6 330.2 471.1 342.7L279.1 534.7C266.6 547.2 246.3 547.2 233.8 534.7C221.3 522.2 221.3 501.9 233.8 489.4L403.2 320L233.9 150.6C221.4 138.1 221.4 117.8 233.9 105.3C246.4 92.8 266.7 92.8 279.2 105.3L471.2 297.3z'/%3E%3C/svg%3E");
  display: inline-block;
  margin-right: 10px;
  vertical-align: middle;
  height: 1.1em;
  width: 0.9em;
}

.accordion > input[type="checkbox"]:checked ~ .handle label:before, details[open] > summary:before {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath d='M297.4 470.6C309.9 483.1 330.2 483.1 342.7 470.6L534.7 278.6C547.2 266.1 547.2 245.8 534.7 233.3C522.2 220.8 501.9 220.8 489.4 233.3L320 402.7L150.6 233.4C138.1 220.9 117.8 220.9 105.3 233.4C92.8 245.9 92.8 266.2 105.3 278.7L297.3 470.7z'/%3E%3C/svg%3E");
}

details > summary:before {
  filter: invert(100);
  vertical-align: baseline;
}

.cardbox {
  display: grid;
  grid-gap: .5rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  width: calc(100% - 1rem);
  margin: 0;
  padding: 0.5rem;
}

.cardbox .card {
  width: 100%;
  height: auto;
  cursor: zoom-in;
}

i.rarity::before {
  width: 1.7rem;
  display: inline-block;
  margin-right: 0.5rem;
}

i.rarity.common::before {
  content: url("../img/setsymbol_C.svg");
}

i.rarity.uncommon::before {
  content: url("../img/setsymbol_U.svg");
}

i.rarity.rare::before {
  content: url("../img/setsymbol_R.svg");
}

i.rarity.mythic::before {
  content: url("../img/setsymbol_M.svg");
}

details .card.lazy {
  opacity: 0;
}
details .card:not(.initial) {
  transition: opacity 1s;
}
details .card.initial,
details .card.loaded,
details .card.error {
  opacity: 1;
}

details .card:not([src]) {
  visibility: hidden;
}

@media (max-width: 750px) {
  nav.subnav {
    margin: -1rem -6vw 1rem;
    margin: -1rem -6dvw 1rem;
    padding: .2rem 0;
    width: 100vw;
    width: 100dvw;
  }
  .widthbox {
    width: 100%;
  }
  table {
    width: calc(100% + 8vw);
    width: calc(100% + 8dvw);
    margin: 0 -4vw;
    margin: 0 -4dvw;
  }
  td:not(:last-child), th:not(:last-child), span[data-tippy-content] {
    white-space: normal;
  }
  td i.ms:first-child {
    margin-right: 0;
    margin-bottom: .3rem;
  }
  .accordion {
    width: 96vw;
    width: 96dvw;
    margin-left: -4vw;
    margin-left: -4dvw;
  }
}

@media (max-width: 550px) {
  :target::before {
    --target-fix: 22vw;
  }
  header {
    padding: 4vw 1vw 0;
    padding: 4dvw 1dvw 0;
    font-size: 3vw;
    font-size: 3dvw;
    top: -16vw;
    top: -16dvw;
  }
  header div.widthbox {
    margin-left: 6vw;
    margin-left: 6dvw;
    margin-right: 6vw;
    margin-right: 6dvw;
    max-width: 88vw;
    max-width: 88dvw;
  }
  .headerimg {
    height: 9vw;
    height: 9dvw;
  }
  section .card:not(.lazy) {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  nav.subnav {
    justify-content: space-evenly;
    margin-left: -6vw;
    margin-left: -6dvw;
    margin-right: -6vw;
    margin-right: -6dvw;
    max-width: 98vw;
    max-width: 98dvw;
    padding-left: 1vw;
    padding-left: 1dvw;
    padding-right: 1vw;
    padding-right: 1dvw;
    top: calc(7.8vw + 1rem);
    top: calc(7.8dvw + 1rem);
  }
  nav.subnav a {
    padding: 1vw;
    padding: 1dvw;
    margin: 0.5vw 0;
    margin: 0.5dvw 0;
  }
  nav.subnav a i {
    font-size: 5vw;
    font-size: 5dvw;
  }
  td i.ms {
    font-size: 1.25em;
  }
  footer {
    padding: 4vw 7vw;
    padding: 4dvw 7dvw;
  }
}
