:root {
  --brown: #4e3929;
  --deep-brown: #2c1e13;
  --white: #FFFFFF;
  --light-gray: #bbbbbb;
  --gray: #a7a7a7;
  --dark-gray: #969696;
  --deep-gray: #868686;
  --abyss-gray: #585858;
  --black: rgb(0, 0, 0);
  --card-shadow: 0em 0em 0.5em var(--abyss-gray);
}

.siteButtons, .siteButtonsNoRandom{
  margin: 1em;
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
}

.siteButtonsNoRandom{
  flex-direction:column;
  max-width:11em;
}
.siteButtons img, .siteButtonsNoRandom img{
  image-rendering: crisp-edges;
  height: 62px;
  padding:0.5em;
  transition: all 0.3s ease-in-out;
  align-self: center;
}

.siteButtons img:hover, .siteButtonsNoRandom img:hover{
  transform: scale(1.1);
}lego clipPath

html, body {
  background-image: url("photos/background.avif");
  background-repeat: repeat;
  background-color: var(--brown);
  color: var(--white);
  font-family: "Eirian";
  font-size: 1.2em;
  margin: 0;
}

main {
  max-width: 50em;
  margin: auto;
  padding-left: 3em;
  padding-right: 3em;
  background-color: var(--brown)
}

header {
  font-family: "Mochi";
  margin-top: 0em;
  margin-bottom: 1em;
  font-size: 1em;
}

header a {
  text-decoration: none;
}

h1 {
  text-shadow: 0 0 0.15em black;
}

.navbar {
  display: flex;
  justify-content: start;
  align-items: center;
  padding: 1em 2em;
  background-image: url("photos/backgroundtop.avif");
  background-repeat: repeat;
  background-position: 1em 2.5em;
  background-color: #1f1b1b;
  max-height: 2.5em;
  box-shadow: var(--card-shadow);
}

.comic-article-content{
  width: 35em;
  margin: auto;
}


.logo img {
  max-height: 2.5em;
  align-content: center;
}

a {
  color: var(--white);
}

.container {
  display: block;
  width: 100%;
}

.navbar-item {
  position: relative;
  align-content: center;
  flex-shrink: 0;
  min-width: max-content;
}

.navbar-item:hover .dropdown-menu {
  display: block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #444;
  list-style: none;
  margin: 0;
  padding: 1em 0;
  box-shadow: 0 1em 2em rgba(0, 0, 0, 0.2);
}

.dropdown-menu li {
  padding: 0.25em 1em;
  font-family: "Eirian";
  font-size: 1em;
}

.sort-controls {
  text-align: center;
  margin-bottom: 1rem;
}

.gallery-container {
  display: flex;
  justify-content: space-evenly;
  flex-wrap: wrap;
  background-color: var(--deep-gray);
  box-shadow: var(--card-shadow);
}

.gallery-item {
  max-width: 5em;
  max-height: 8em;
  min-width: 5em;
  min-height: 8em;
  border: solid;
  background-color: var(--gray);
  border-width: 0.5em;
  border-top-color: var(--light-gray);
  border-left-color: var(--dark-gray);
  border-right-color: var(--gray);
  border-bottom-color: var(--deep-gray);
  box-shadow: var(--card-shadow);
  margin-top: 0.2em;
  margin-bottom: 0.2em;
  text-overflow: clip;
}

.gallery-picture {
  position: relative;
}

.gallery-download {
  filter: invert();
  font-size: .5em;
  position: absolute;
  top: -1em;
  right: -1em;
  display: none;
  padding: 0em;
  z-index: 2;
  cursor: pointer;
}

.gallery-picture:hover .gallery-download {
  display: inline-block;
}

.gallery-item:hover {
  box-shadow: 0em 0em 0.5em var(--black);
  border-top-color: var(--gray);
  border-left-color: var(--deep-gray);
  background-color: var(--dark-gray);
  border-right-color: var(--dark-gray);
  border-bottom-color: var(--abyss-gray);
}

.gallery-picture img {
  width: 5em;
  height: 5em;
  box-shadow: var(--card-shadow);
}

.gallery-link {
  margin: 0.25em;
  text-align: center;
  overflow: hidden;
  max-height: 2.25em;
}

.article-thumbnail img {
  max-width: 25em;
  height: auto;
  margin: auto;
  display: flex;
}

/* ========== Instruction Pages ========== */

.instruction-pages {
  display: flex;
  flex-direction: column;
  gap: 2em;
  align-items: center;
}

.instruction-thumbnail {
  position: relative;
  max-width: 88%;
  margin: auto;
  width: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.instruction-thumbnail img {
  border-radius: 1em;
  box-shadow: 0 0.5em 1em rgba(0, 0, 0, 0.3);
  width: 100%;
}

.instruction-page {
  position: relative;
  background: linear-gradient(135deg, var(--deep-gray), var(--abyss-gray));
  padding: 2em;
  border-radius: 1em;
  box-shadow: 0 0.5em 1em rgba(0, 0, 0, 0.3);
  max-width: 80%;
  margin: auto;
  width: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.instruction-page img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: auto;
}

.page-number {
  position: absolute;
  top: 1em;
  left: 1em;
  font-weight: bold;
  font-size: 1em;
  background: rgba(255, 255, 255, 0.5);
  padding: 0.3em 0.7em;
  border-radius: 0.5em;
  color: var(--black);
  font-family: "Eirian";
}

.piece-box {
  position: absolute;
  top: 1em;
  right: 1em;
  display: flex;
  gap: 1em;
  flex-wrap: wrap;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5em;
  border-radius: 0.5em;
  justify-content: flex-end;
}

.piece-entry {
  position: relative;
  display: block;
  border: 0.3em solid;
  border-radius: 0.5em;
  width: 3em;
  overflow: hidden;
  background-color: var(--deep-brown);
  box-shadow: var(--card-shadow);
}

.piece-entry img.desaturated {
  width: 100%;
  height: auto;
  filter: grayscale(100%);
  display: block;
}

.piece-count {
  position: absolute;
  bottom: 0.2em;
  right: 0.2em;
  font-size: 0.7em;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.5);
  color: var(--white);
  padding: 0.1em 0.2em;
  border-radius: 0.3em;
  pointer-events: none;
}
.instruction-page.text-summary {
  background: var(--deep-brown);
  color: var(--white);
  padding: 2em;
  border-radius: 1em;
  box-shadow: var(--card-shadow);
  width: 80%;
  max-width: 50em;
}

.text-piece-summary {
  padding-top: 1em;
}

.color-header {
  margin-top: 1em;
  font-size: 1.2em;
  font-weight: bold;
  color: var(--white);
  background: var(--black);
  padding: 0.2em 0.6em;
  border-left: 0.5em solid var(--white);
  border-radius: 0.3em;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1));
  text-shadow: 0 0 0.15em black;
  border-color: var(--white);
}

.color-header::before {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  background-color: var(--color);
  border: 0.15em solid var(--white);
  border-radius: 50%;
  margin-right: 0.5em;
  vertical-align: middle;
}

.color-header {
  color: var(--color);
  border-left-color: var(--color);
}

.text-piece-summary ul {
  list-style-type: disc;
  padding-left: 2em;
  margin-bottom: 1em;
}

.text-piece-summary li {
  margin-bottom: 0.5em;
}

.navbar-layout {
  display: flex;
  align-items: center;
  width: 100%;
}

.logo {
  flex-shrink: 0;
  margin-right: 1em;
}
.logo img {
  max-height: 2.5em;
}

.navbar-scroll-container {
  display: flex;
  align-items: center;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.navbar-menu {
  margin: 0.5em;
  justify-content: space-evenly;
  display: flex;
  gap: 1em;
  padding: 0;
  margin: 0;
  list-style: none;
  overflow-x: auto;
  flex: 1;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
}
.navbar-menu::-webkit-scrollbar {
  display: none;
}

.scroll-btn {
  background: var(--brown);
  color: var(--white);
  border: none;
  padding: 0.4em 0.6em;
  cursor: pointer;
  z-index: 10;
  font-size: 1.5em;
  display: none;
}



/* ========== Fonts ========== */

@font-face {
  font-family: "Mochi";
  src: url('Fonts/TMT-MiniMochi-Sweet.otf') format('opentype');
}

@font-face {
  font-family: "Eirian";
  src: url('Fonts/Eirian.ttf') format('truetype');
}


/* ========== Responsive ========== */

@media (max-width: 900px) {
  header {
    font-size: 0.7em;
  }

  .page-number{
    font-size: 0.5em;
  }

  .piece-box{
    padding: 0.125em;
    gap: 0.1em;
    font-size: 0.5em;
  }


}

@media (max-width: 650px) {
  main {
    padding-left: 1em;
    padding-right: 1em;
  }

  html, body {
    font-size: 1.25em;
  }

  header {
    font-size: 0.5em;
  }

  .navbar {
    padding: 1em 0em;
  }

  .navbar-menu {
    margin: 0em 0.25em;
  }

  .gallery-item {
  max-width: 4em;
  max-height: 7em;
  min-width: 4em;
  min-height: 7em;
}

.gallery-picture img {
  width: 4em;
  height: 4em;
}
}