:root {
  --main-color: #29304e;
  --navbar-text-color: white;
  --navbar-text-color-clicked: black;
  --navbar-bg-contrast: whitesmoke;
  --navbar-hamburger-bg: rgba(0,0,0,0.8);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: sans-serif;
}

html, body {
  scroll-behavior: smooth;
}

body {
  padding: 0;
  margin:0;
  display: block;
  background-color: #855988;
}

main {
  padding: 125px 25px;
}

h2 {
  padding: 10px 0px;
}

h3 {
  padding: 10px;
}

p {
  padding: 5px 5px 5px 10px;
}

.main-text {
  font-size: 36px;
  color: white;
  font-style: italic;
  padding-bottom: 30px;
}

a {
  text-decoration: none;
}

h3 a {
  color: black;
}

.italics {
  font-style: italic;
}

.white-text {
  color: white;
}

.brand-logo {
  text-align: center;
}



/* --- Navbar --- */

nav {
  position: fixed;
  z-index: 10;
  left: 0;
  right: 0;
  top: 0;
  font-family: "sans-serif";
  height: 90px;
  background-color: var(--main-color);
  padding: 0 2%;
}

nav .logo {
  float: left;
  width: 40%;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 24px;
  color: var(--navbar-text-color);
}

nav .links {
  float: right;
  padding: 0;
  margin: 0;
  width: 40%;
  height: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

nav .links li {
  list-style: none;
}

nav .links a {
  display: block;
  padding: 1em;
  font-size: 16px;
  font-weight: bold;
  color: var(--navbar-text-color);
  text-decoration: none;
  position: relative;
}

nav .links a:hover {
  color: var(--navbar-text-color-clicked);
  background-color: var(--navbar-bg-contrast);
}

nav .links a::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--navbar-text-color);
  visibility: hidden;
  transform: scaleX(0);
  transition: all 0.3s ease-in-out 0s;
}

nav .links a:hover::before {
  visibility: visible;
  transform: scalesX(1);
  color: var(--navbar-text-color);
}

#nav-toggle {
  position: absolute;
  top: -100px;
}

nav .icon-burger {
  display: none;
  position: absolute;
  right: 5%;
  top: 45px;
  transform: translateY(-50%);
}

nav .icon-burger .line {
  width: 30px;
  height: 5px;
  background-color: var(--navbar-text-color);
  margin: 5px;
  border-radius: 3px;
  transition: all 0.5s ease-in-out;
}

@media screen and (max-width: 768px) {
  nav .logo {
      float: none;
      width: auto;
      justify-content: left;
  }

  nav .links {
      float: none;
      position: fixed;
      z-index: 9;
      left: 0;
      right: 0;
      top: 90px;
      bottom: 100%;
      width: auto;
      height: auto;
      flex-direction: column;
      justify-content: space-evenly;
      background-color: var(--navbar-hamburger-bg);
      overflow: hidden;
      transition: all 0.5s ease-in-out;
  }

  nav .links a {
      font-size: 20px;
  }

  nav :checked ~ .links {
      bottom: 0;
  }

  nav .icon-burger {
      display: block;
  }

  nav .icon-burger:hover {
    cursor:pointer;
  }

  nav :checked ~ .icon-burger .line:nth-child(1) {
      transform: translateY(10px) rotate(225deg);
  }

  nav :checked ~ .icon-burger .line:nth-child(3) {
      transform: translateY(-10px) rotate(-225deg);
  }

  nav :checked ~ .icon-burger .line:nth-child(2) {
      opacity: 0;
  }
}



/* Footer */

footer {
  background-color: var(--main-color);
  margin: 0;
  padding: 10px;
  border: 0;
  width: 100%;
  bottom: 0;
  position: bottom;
  height: 60px;
  top: calc( 100vh - 60px );
  display: fixed;
}

address {
  display: flex;
  justify-content: center;
  margin: auto;
  font-style: italic;
  color: var(--navbar-text-color);
  font-family: sans-serif;
}



/* New Release Book Display */

.new-releases-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  width: 100%;
  max-width: 750px;
  margin: auto;
}

.book {
  width: 250px;
  height: 325px;
  margin: 25px;
  text-align: center;
}

.book img {
  box-shadow: 10px 10px 5px 5px rgba(0, 0, 0, 0.4);
  display: block;
  margin: 0 auto;
}

.book-title {
  padding-top: 25px;
}


@media (max-width: 768px) {
  .new-releases-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: auto;
  }
}


/* Future Releases  */




/* --- Publications --- */

.filters {
  text-align: center;
  margin-bottom: 2rem;
}

.filters * {
  display: inline-block;
}

.filters label {
  padding: 0.5rem 1rem;
  margin-bottom: 0.25rem;
  border-radius: 2rem;
  min-width: 50px;
  line-height: normal;
  cursor: pointer;
  transition: all 0.1s;
  border: 5px black solid;
}

.filters label:hover {
  background: var(--main-color);
  color: var(--navbar-text-color);
}

/* FILTERED ELEMENTS (POSTS) */
input[type="radio"] {
  position: absolute;
  left: -9999px;
}

.container .posts {
  display: flex;
  flex-direction: row;
  justify-content: center;
  width: 100%;
  max-width: 750px;
  margin: auto;
}

.posts {
  display: flex;
  width: 250px;
  height: 375px;
  margin: 25px;
  text-align: center;
}

.posts .post {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 250px;
  height: 375px;
  margin: 25px;
}

.post figure img {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin: auto;
  box-shadow: 10px 10px 5px 5px rgba(0, 0, 0, 0.4);
}

.posts figcaption {
  align-items: center;
  text-align: center;
}

.directions {
  text-align: center;
}

@media (max-width: 768px) {
  .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .container .posts {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 50%;
  }

  .posts .post {
    height: 300px;
  }
}



/* FILTERING RULES */
[value="All"]:checked ~ .filters [for="All"],
[value="Fiction"]:checked ~ .filters [for="Fiction"],
[value="Short Stories"]:checked ~ .filters [for="Short-Stories"] {
  background: var(--green);
  color: var(--white);
}

[value="All"]:checked ~ .posts [data-category] {
  display: block;
}

[value="Fiction"]:checked ~ .posts .post:not([data-category~="Fiction"]),
[value="Short-Stories"]:checked ~ .posts .post:not([data-category~="Short-Stories"]) {
  display: none;
}



/* Modals */

.modal {
  opacity: 0;
  visibility: hidden;
  position: fixed;
  top: 90px;
  right: 0;
  bottom: 0;
  left: 0;
  text-align: left;
  background: rgba(0,0,0, .9);
  transition: opacity .25s ease;
}

.modal-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  cursor: pointer;
}

.modal-state {
  display: none;
}

.modal-state:checked + .modal {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.modal-state:checked + .modal .modal-inner {
  top: 0;
}

.modal-inner {
  transition: top .25s ease;
  position: absolute;
  top: -20%;
  right: 0;
  bottom: 0;
  left: 0;
  width: 60%;
  margin: auto;
  overflow: auto;
  background: #cccac4;
  border-radius: 5px;
  padding: 1em 2em;
  height: 60%;
}

.modal-close {
  position: absolute;
  right: 1em;
  top: 1em;
  width: 1.1em;
  height: 1.1em;
  cursor: pointer;
}

.modal-close:after,
.modal-close:before {
  content: '';
  position: absolute;
  width: 2px;
  height: 1.5em;
  background: #ccc;
  display: block;
  transform: rotate(45deg);
  left: 50%;
  margin: -3px 0 0 -1px;
  top: 0;
  background-color: gray;
}

.modal-close:hover:after,
.modal-close:hover:before {
  background: #aaa;
}

.modal-close:before {
  transform: rotate(-45deg);
}

.btn {
  cursor: pointer;
  display: inline-block;
  padding: .5em 1em;
  color: black;
  border-radius: 3px;
}

.btn:hover,
.btn:focus {
  background: var(--main-color);
  color: var(--navbar-text-color);
}

.btn:active {
  background: whitesmoke;
  box-shadow: 0 1px 2px rgba(0,0,0, .2) inset;
}

.modal-header {
  margin: auto;
  text-align: center;
}

.modal-header img {
  box-shadow: 10px 10px 5px 5px rgba(0, 0, 0, 0.4);
}

.modal-header h2 {
  padding: 10px 0px 0px 0px;
}

.modal-header h3 {
  padding: 0px;
}

.modal-header p {
  padding: 0px;
}

@media screen and (max-width: 768px) {
    
  .modal-inner {
    width: 90%;
    height: 90%;
    box-sizing: border-box;
  }
}

.booklink {
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  padding-top: 10px;
}



/* Back to top */

.top {
  display: none;
}

@media (max-width: 768px) {
  .top {
    --offset: 0;

    position: sticky;
    bottom: 30px;
    margin-right: 5%;
    margin-left: 90%;
    margin-bottom: 10px;
    text-decoration: none;
    padding: 10px;
    font-family: sans-serif;
    font-size: 24px;
    text-align: center;
    color: var(--navbar-text-color);
    background: var(--main-color);
    border: solid black 1px;
    border-radius: 100px;
    white-space: nowrap;
    display: flex;
    justify-content: center;
    width: 33px;
  }
}