/*Override nav bar styling*/
:root {
  --navBg: rgba(24, 26, 27, 1);
  --tabMenuHeight: 45px;

  --imageWidth: 50vw;
}

.dark {
  --overlayBg: rgba(24, 26, 27, .5);
  --overlayGradient: linear-gradient(to right, #005c97, #363795);
}

.light {
  --overlayBg: rgba(255, 255, 255, .5);
  --overlayGradient: linear-gradient(to right, #017ac6, #5d60f8);
}

html {
  scroll-behavior: smooth;
}

nav {
  border-bottom: 1px solid var(--highlightColor);
}

sup a {
  font-size: 11px;
}

div#info p a {
  color: #005c97;
}

.dark div#info p a {
  color: #6bc6ff;
}

/*Main CSS*/
div#content {
  padding: calc(var(--navBarSize) + var(--tabMenuHeight) + 2em) calc(var(--marginSize) * 3);
}

div#content #info h1 {
  letter-spacing: .1rem;
  font-weight: 900;
}

div#content #info h2 span {
  color: var(--captionColor);
  font-weight: 700;
}

div#content #info h2 span:nth-child(2) {
  float: right;
}

div#content p,
div#content #info span,
div#content #info li {
  font-size: 1.1em;
  /* font-weight: 500; */
}

div#content #info .imageContainer {
  display: flex;
  justify-content: center;
}

div#content #select {
  display: block;
  width: 100%;
  height: calc(var(--tabMenuHeight));
  border-bottom: 1px solid var(--highlightColor);
  white-space: no-wrap;
  overflow-y: hidden;
  overflow-x: auto;
  z-index: 3;
}

div#content #select.stick {
  position: fixed;
  width: calc(100% - var(--marginSize) * 2);
  top: var(--navBarSize);
  left: calc(var(--marginSize) - 5px);
  background-color: var(--bgColor);
  padding: 10px 8px;
  z-index: 1;
}

div#content #select div {
  width: max-content;
  display: block;
}

div#content #select button {
  display: inline-block;
  background-color: var(--highlightColor);
  font-size: 1.25em;
  border: none;
  border-top: 1px solid var(--highlightColor);
  border-left: 1px solid var(--highlightColor);
  border-right: 1px solid var(--highlightColor);
  border-radius: 5px 5px 0 0;
  padding: 0.5em 1em;
  margin: 0px;
  margin-right: 5px;
  height: var(--tabMenuHeight);
  box-sizing: border-box;
  cursor: pointer;
}

div#content #select button a {
  text-decoration: none;
  color: var(--fgColor);
}

div#content #select.stick button {
  border: 1px solid var(--highlightColor);
  border-radius: 5px;
}

div#content #select button.active {
  /* background-color: transparent;*/
  background: var(--overlayGradient) left / 100% no-repeat;
}

div#content #overlay {
  position: fixed;
  top: calc(var(--tabMenuHeight) + var(--navBarSize) + 16px);
  left: 0;
  background-color: var(--overlayBg);
  z-index: 3;
  height: calc(100vh - var(--tabMenuHeight) - var(--navBarSize) + 16px);
  width: 100vw;
  display: none;
  backdrop-filter: blur(.8em);
  box-sizing: border-box;
}

div#content #overlay ul {
  list-style: none;
  padding: 2em calc(var(--marginSize) * 1);
  width: 100%;
  height: min-content;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: min-content;
  gap: 16px;
}

div#content #overlay li {
  font-weight: bold;
  font-size: 1.5em;
  padding-bottom: .5em;
  cursor: pointer;
  width: 100%;
  padding: 16px;
  text-align: center;
  background: var(--overlayGradient) left / var(--p,0) no-repeat;
  transition: .25s, background-position 0s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  min-width: 0;
  box-sizing: border-box;
}

div#content #overlay li:hover {
  --p: 100%;
  background-position: right;
}

div#content #overlay li a {
  text-decoration: none;
  transition: color .25s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  height: 100%;
  text-align: center;
}

div#content #overlay li:hover a {
  color: white;
}

div#content #overlay div#noArticles {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  padding: 1rem;
  border-radius: 1rem;
  background-color: var(--overlayBg)
}

/* @media screen and (max-width: 1300px) {
  div#content #overlay ul {
    grid-template-columns: 1fr 1fr 1fr;
  }
} */

@media screen and (max-width: 900px) {
  :root {
    --imageWidth: 65vw;
  }
  
  div#content #overlay ul {
    grid-template-columns: 1fr 1fr;
  }
}

@media screen and (max-width: 450px) {
  :root {
    --imageWidth: 80vw;
  }
  
  div#content #overlay {
    padding: 0 32px;
  }
  div#content #overlay ul {
    grid-template-columns: 1fr;
  }
  div#content #info h2 span:nth-child(2) {
    display: block;
    float: none;
    margin-top: .5em;
  }
}

@media screen and (min-width: 4000px) {
  :root {
    --tabMenuHeight: 150px;
  }
}

@media (pointer:coarse) {
  div#content #overlay ul li {
    background: var(--highlightColor);
  }
}