:root {
  --orange: rgb(222, 117, 31);
  --orange-light: #f9e6d8;
  --yellow: #fcd947;
  --yellow-light: #f8e69c;
  --yellow-dark: #e8ab72;
  --ochre: #c9a025;
  --gray: rgb(220, 220, 220);
  --border-width: 2px;
}

/* Reset */
* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: white;
  color: black;
  line-height: 1.5;
}

h1,
h2,
h3 {
  margin: 0;
  padding: 0;
}

/* owl selector */
main *+* {
  margin: 1rem 0;
}

.login *+*,
ul *+*,
.grid *+*,
.shelves *+* {
  margin: 0;
}

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

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

label {
  font-weight: bold;
}

nav {
  background: #ed8936;
  color: white;
  text-align: center;
  padding: 1.5rem;
  padding-bottom: 2.5rem;

  p {
    font-size: 1.125rem;
    margin: 0;
  }

  h1 {
    font-weight: bold;
    font-size: 1.875rem;
    letter-spacing: -0.025em;

    a {
      color: inherit;
      text-decoration: none;
      border-bottom: 2px solid transparent;

      &:hover {
        border-bottom: 2px solid white;
      }
    }

    @media (min-width: 768px) {
      font-size: 3rem;
    }
  }

  .button {
    font-size: 1.125rem;
  }

  .nav-links {
    margin: auto;
    margin-top: 1rem;
    display: grid;
    grid-auto-flow: row;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;

    .button {
      font-weight: 700;
    }

    @media (min-width: 768px) {
      grid-auto-flow: column;
      gap: 1.5rem;
      margin-top: 1rem;
      margin-bottom: 0.5rem;
      grid-template-columns: repeat(4, 1fr);
      width: 740px;

      .button {
        font-size: 1.125rem;
        text-align: center;
      }
    }
  }
}

/* titlebar link */
.star-link {
  position: relative;
  border-bottom: 2px solid transparent;

  .star {
    display: inline-block;
    transition: all 200ms ease;
    vertical-align: middle;
    font-size: 1.25rem;

    @media (min-width: 768px) {
      font-size: 1.5rem;
    }
  }

  &:hover {
    border-bottom: 2px solid white;

    .star:nth-child(1) {
      transform: rotate(-20deg) translateX(-2px) translateY(-4px);
    }

    .star:nth-child(2) {
      transform: rotate(20deg) translateX(2px) translateY(-4px);
    }
  }
}

button,
.button {
  padding: 0.5rem 0.75rem;
  border: 1px solid black;
  border-radius: 0.5rem;
  color: black;
  background: var(--yellow);
  text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.75);
  box-shadow: 2px 2px var(--yellow-dark), 6px 6px black;
  transition: all 100ms ease;
  line-height: 1.2em;
  font-weight: bold;
  cursor: pointer;
  font-size: inherit;
  text-decoration: none;

  &:hover {
    background: var(--yellow-light);
  }

  &:active {
    background: var(--yellow);
    transform: translateX(4px) translateY(4px);
    box-shadow: 0px 0px var(--yellow-dark), 0px 0px black;
  }
}


.shelves {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, max-content));

  @media (max-width: 450px) {
    grid-template-columns: 1fr;
  }

  gap: 2rem;
}


.shelf2::after {
  content: "";
  position: absolute;
  --width: 20px;
  top: calc(var(--width) * -0.4);
  left: calc(var(--width) * -0.4);
  right: calc(var(--width) * -0.4);
  bottom: calc(var(--width) * -0.4);

  border: var(--width) solid transparent;
  border-image-source: url('/static/images/star-pixel-one.png');
  border-image-slice: 50%;
  border-image-repeat: stretch;

  z-index: -1;
}

.shelf2:hover::after {
  border-image-source: url('/static/images/star-pixel-two.png');
}


.shelf2.medium {
  grid-column: span 2;

  @media (max-width: 450px) {
    grid-column: span 1;
  }
}

.shelf2.big {
  grid-column: span 3;

  @media (max-width: 450px) {
    grid-column: span 1;
  }
}

.shelf2 {
  background: #fdf9ee;
  display: flex;
  flex-direction: column;
  grid-column: span 1;
  border-radius: 2rem;
  padding: 2rem;
  padding-top: .5rem;
  padding-bottom: 1rem;
  position: relative;
  box-shadow:
    0 0 0 1.5px #c9a025,
    0 0 0 4.5px white,
    0 0 0 6px #c9a025;

  h2 {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: .5rem;
  }

  .button {
    /* font-size: .8rem; */
    /* padding: .2rem; */
    display: inline-block;
    margin-left: auto;
    margin-top: auto;
    /* box-shadow: 1px 1px var(--yellow-dark), 3px 3px black; */
  }

  .button:active {
    transform: translateX(2px) translateY(2px);
    box-shadow: 0px 0px var(--yellow-dark), 0px 0px black;
  }

  &:hover .icon {
    transform: rotate(-5deg);
  }

  .icon {
    height: 20px;
    position: absolute;
    --spacing: -15px;
  }

  .icon-1 {
    left: var(--spacing);
    top: var(--spacing);
  }

  .icon-2 {
    right: var(--spacing);
    top: var(--spacing);
  }

  .icon-3 {
    left: var(--spacing);
    bottom: var(--spacing);

  }

  .icon-4 {
    right: var(--spacing);
    bottom: var(--spacing);
  }

  figure {
    width: min-content;
    margin: 0;

    figcaption {
      font-size: .6rem;
      font-weight: bold;
      text-align: center;
    }
  }

  figure img {
    height: 80px;
    width: auto;
    border-bottom-width: 4px;
    border: 2px solid #210;
    border-right-width: 4px;

    &:hover {
      transform: rotate(1deg);
    }
  }

  .zines {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: .5rem;
  }
}

.buy-buttons {
  text-align: center;
  margin: 2rem 0;

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

/* login form */

.login {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;

  label {
    display: block;
  }

  p {
    margin: 1rem 0;
  }

  img {
    width: 300px;
  }

  form {
    max-width: 400px;
  }

  button {
    margin-top: 1rem;
  }

  input[type="email"] {
    padding: 12px;
    font-size: inherit;
    border: 2px solid black;
    border-radius: 6px;
    margin-right: .5rem;
  }
}

@media (max-width: 800px) {

  main,
  section {
    padding: 1rem;
    box-shadow: none;
  }

  h1 {
    font-size: 2rem;
  }
}

/* squiggle */

.squiggle-top,
.squiggle-bottom {
  position: relative;
  /* background-color: inherit; */
}

.squiggle-top {
  margin-top: 32px;
}

.squiggle-bottom {
  margin-bottom: 32px;
}

.squiggle-top::before,
.squiggle-bottom::after {
  content: " ";
  position: absolute;
  width: 100%;
  left: 0;
  height: 32px;
}

.squiggle-top::before {
  bottom: calc(100% - 1px);
  background: url("/static/images/squiggle-top-invert.svg") repeat top center;
  background-color: inherit;
  -webkit-mask: url("/static/images/squiggle-top-mask.svg") repeat top center;
  mask: url("/static/images/squiggle-top-mask.svg") repeat top center;
}

.squiggle-bottom::after {
  top: calc(100% - 1px);
  background: url("/static/images/squiggle-bottom-invert.svg") repeat bottom center;
  background-color: inherit;
  -webkit-mask: url("/static/images/squiggle-bottom-mask.svg") repeat bottom center;
  mask: url("/static/images/squiggle-bottom-mask.svg") repeat bottom center;
}


/* zine shelves */


.zine {
  display: inline-block;
  position: relative;
  border: var(--border-width) solid black;
  z-index: 1;
  transition: all 400ms cubic-bezier(0.215, 0.61, 0.355, 1);
  background: white;
  margin-top: 2em;
}

.zine::before,
.zine::after {
  content: " ";
  position: absolute;
  border: var(--border-width) solid black;
  top: calc(var(--border-width) + 1px);
  bottom: calc(var(--border-width) + 1px);
  left: calc(var(--border-width) + 1px);
  right: calc(var(--border-width) + 1px);
  z-index: -1;
  transition: all 450ms cubic-bezier(0.215, 0.61, 0.355, 1);
  background: white;
}

.zine img {
  max-height: 400px;
  max-width: 100%;
  display: block;
}

.zine .new {
  position: absolute;
  top: -25px;
  right: -28px;
  background: var(--yellow);
  text-align: center;
  width: 70px;
  height: 70px;
  line-height: 70px;
  border: var(--border-width) solid black;
  border-radius: 50%;
  transform: rotate(20deg);
  font-weight: bold;
}


/* horizontal */
.zine.horizontal {
  transform: SkewX(-5deg);
  border-right: 0;
}

.zine.zine.horizontal img {
  border-right: var(--border-width) solid black;
}

.zine.horizontal::before,
.zine.horizontal::after {
  transform: SkewX(10deg) translateX(-5px);
  transform-origin: top left;
  top: calc(-1 * var(--border-width));
}

.zine.horizontal::before {
  transform: SkewX(10deg) translateX(5px);
}

.zine.horizontal:hover {
  transform: SkewX(-10deg) SkewY(2deg) translateY(-20px);
  z-index: 99;
}

.zine.horizontal:hover::after {
  transform: SkewX(20deg) translateX(-5px);
}

.zine.horizontal:hover::before {
  transform: SkewX(20deg) translateX(5px);
}

/* vertical */
.zine.vertical {
  transform: SkewY(5deg);
  transform-origin: bottom left;
  border-top: 0;
}

.zine.zine.vertical img {
  border-top: var(--border-width) solid black;
}

.zine.vertical::before,
.zine.vertical::after {
  transform: SkewY(-10deg) translateY(-5px);
  transform-origin: bottom left;
  left: calc(-1 * var(--border-width));
}

.zine.vertical::after {
  transform: SkewY(-10deg) translateY(5px);
}

.zine.vertical:hover {
  transform: SkewY(5deg) translateY(-15px);
  z-index: 99;
}

.zine.vertical:hover::before {
  transform: SkewY(-15deg) translateY(-5px);
}

.zine.vertical:hover::after {
  transform: SkewY(-15deg) translateY(5px);
}

/* shelf */
.grid .shelf-grid-item {
  position: relative;
}

.grid .shelf-grid-item:nth-child(2) {
  grid-row: 2 / 2;
}

.grid .shelf-grid-item:nth-child(4) {
  grid-row: 4 / 4;
}

.grid .shelf-grid-item:nth-child(6) {
  grid-row: 6 / 6;
}

.grid .shelf-grid-item:nth-child(8) {
  grid-row: 8 / 8;
}

.grid .shelf-grid-item:nth-child(10) {
  grid-row: 10 / 10;
}

.grid .shelf-grid-item:nth-child(12) {
  grid-row: 12 / 12;
}

.grid .shelf-grid-item:nth-child(14) {
  grid-row: 14 / 14;
}

.grid .shelf-grid-item:nth-child(16) {
  grid-row: 16 / 16;
}

.grid .shelf-grid-item:nth-child(18) {
  grid-row: 18 / 18;
}

.grid .shelf-grid-item:nth-child(20) {
  grid-row: 20 / 20;
}

.grid .shelf-grid-item:nth-child(22) {
  grid-row: 22 / 22;
}

.grid .shelf-grid-item:nth-child(24) {
  grid-row: 24 / 24;
}

.shelf {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% + 2em);
  margin: -1.75em 0 0 -1.5em;
  background: white;
}

.shelf::before,
.shelf::after {
  content: " ";
  position: absolute;
  width: 100%;
  bottom: 0;
  left: 0;
  background: white;
}


.shelf::before {
  border: var(--border-width) solid black;
  height: 60px;
  bottom: calc(50px - 12px);
  transform: SkewX(-20deg);
  transform-origin: bottom left;
}

.shelf::after {
  height: 40px;
  border: var(--border-width) solid black;
  background: white;
}

/* zine title */
h3.zine-title {
  position: relative;
  background: white;
  border: var(--border-width) solid black;
  display: inline-block;
  margin: 0 auto -4em;
  z-index: 100;
  padding: 0.5em 0.35em;
}

.zine-title-wrapper {
  position: absolute;
  top: calc(100% - 44px);
  left: 0;
  width: 100%;
}

.zine-grid {
  --columns: 3;
  padding-left: 2rem;
  padding-right: 2rem;
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 2rem;
  row-gap: 0;
  margin-bottom: 1.5rem;
  margin-left: auto;
  margin-right: auto;
  margin-top: -2rem;
}

.zine-grid.cols-4 {
  --columns: 4;
}

@media (min-width: 768px) {
  .zine-grid {
    grid-template-columns: repeat(var(--columns), 1fr);
    width: 90%;
  }
}

.zine-item {
  display: flex;
  align-items: flex-end;
  width: 100%;
  text-align: center;
  padding-right: 1rem;
  padding-bottom: 2rem;

  a {
    outline: none;
    text-decoration: none;
    color: black;
    font-size: 1rem;
    margin: auto;
    margin-bottom: 0;
    padding-bottom: 4rem;
    position: relative;

    &:hover {
      color: black;
    }
  }
}

.shelf-grid-item {
  grid-column: span 1;
}

@media (min-width: 768px) {
  .shelf-grid-item {
    grid-column: span var(--columns);
  }
}

.missing {
  margin-top: 4rem;
}

.buy-buttons {
  margin-top: 4rem;
}
