/* [1.vars.css] */

:root {
  --body-color: #B2DFDB;
  --inner-body-color: white;
  --link-color: #007185;
  --border-color: #999;
  --title-font: "Literata", serif;
  --action-bg: var(--link-color);
  --action-fg: white;
  --cover-well-bg: color-mix(in srgb, var(--body-color), white 45%);

  --grey1: #333;
  --grey2: #666;
  --grey3: #999;
}

@media (prefers-color-scheme: dark) {
  :root {
    --body-color: #003B3B;
    --link-color: #80D8FF;
    --border-color: #555;
    --inner-body-color: black;
    --action-bg: #F9D92C;
    --action-fg: #111;
    --cover-well-bg: #062626;

    --grey1: #f0f0f0;
    --grey2: #c0c0c0;
    --grey3: #999999;
  }
}


/* [2.layout.css] */

body {
  background: var(--body-color);
  min-width: 280px;
  padding: 10px;
  @media (max-width: 500px) {
    padding: 3px;
  }
}

header {
  padding: 30px 10px;
  a.logo {
    max-width: 40%;
    min-width: 100px;
    margin: 0 auto;
    display: block;
    width: 150px;
    @media (prefers-color-scheme: dark) {
      filter: invert(1);
    }
  }
}

footer {
  text-align: center;
  padding-bottom: 20px;
  color: var(--grey2);

  .footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 10px;
    font-size: 0.95em;

    a {
      color: var(--grey2);
      &:hover {
        color: var(--link-color);
      }
    }
  }

  .copyright {
    font-size: 0.9em;
  }
}

main {
  max-width: 2000px;
  margin: 0px auto;
  margin-bottom: 100px;
  background: var(--inner-body-color);
  border-radius: 3px;
  box-shadow: 0 3px 6px 3px rgba(0, 0, 0, 0.1);
  padding: 20px;
  @media (max-width: 500px) {
    padding: 14px;
  }
}


/* [3.typography.css] */

body {
  font-family: "Assistant", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: 1rem;
  font-style: normal;
  color: var(--grey1);
}

a {
  text-decoration: none;
  color: inherit;
  &:hover {
    color: var(--link-color);
  }
}

h1 {
  font-family: var(--title-font);
  font-size: 2.1em;
  @media (min-width: 480.1px) and (max-width: 1024px) {
    font-size: 2em;
  }
  @media (max-width: 480px) {
    font-size: 2em;
  }
  font-weight: 500;
  font-style: normal;
  margin-top: 0px;
  margin-bottom: 30px;
}

h2 {
  font-family: var(--title-font);
  font-weight: 500;
  font-size: 1.5em;
  font-style: normal;
  margin-top: 0px;
  color: var(--grey1);
}

h3 {
  font-size: 1.1em;
  font-weight: 300;
  color: var(--grey2);
}


/* [4.images.css] */

img {
  width: 100%;
}

.book-image {
  border: 1px solid var(--border-color);
}

@media (min-width: 512px) {
  .book-image {
    aspect-ratio: 7 / 10;
    height: auto;
    object-fit: fill;
    display: block;
  }
}



/* [5.modifiers.css] */

.quiet {
  color: var(--grey3);
}

.italic {
  font-style: italic;
}

.large {
  font-size: 1.25em;
}

.larger {
  font-size: 1.5em;
}

h1, h2, h3, p {
  &.tight { margin-bottom: 0.2em };
  @media (max-width: 1024px) {
    &.tight { margin-bottom: 0.5em };
  }
}

/* [6.buttons.css] */

a.button {
  background: #F9D92C;
  border-radius: 80px;
  box-shadow: 0px 10px 14px -7px #3e7327;
  border: 2px double #FFEA4D;
  white-space: nowrap;
  font-weight: 500;

  font-size: 1.5em;
  padding: 12px 60px;
  color: black;

  @media (min-width: 480.1px) and (max-width: 1024px) {
    font-size: 1.25em;
    padding: 12px 40px;
  }
  @media (max-width: 480px) {
    font-size: 1em;
    padding: 12px 30px;
  }

  &:hover, &:active {
    color: inherit;
    background: linear-gradient(to bottom, #FFEB4D, #F9D92C);
  }

  &:active {
    position: relative;
    top: 2px;
  }
}


/* [book-grid.css] */

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;

  .item {
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    gap: 14px;
    min-width: 0;
    border: 1px solid color-mix(in srgb, var(--border-color), transparent 55%);
    border-radius: 6px;
    padding: 14px;
    background: color-mix(in srgb, var(--inner-body-color), var(--body-color) 8%);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  }

  .cover-link {
    display: block;
    background: var(--cover-well-bg);
    border-radius: 4px;
    padding: 8px;
  }

  .book-copy {
    h2 {
      margin-bottom: 8px;
      font-size: 1.14em;
      line-height: 1.18;
    }

    h3 {
      margin: 0;
      line-height: 1.25;
    }
  }

  .series-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    a {
      border: 1px solid color-mix(in srgb, var(--link-color), transparent 55%);
      border-radius: 999px;
      color: var(--link-color);
      font-size: 0.85em;
      line-height: 1;
      padding: 7px 9px;
    }
  }

  .card-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .look-inside,
  .amazon-link {
    border-radius: 4px;
    display: block;
    font-weight: 600;
    padding: 10px;
    text-align: center;
  }

  .look-inside {
    background: var(--action-bg);
    color: var(--action-fg);
    &:hover {
      color: var(--action-fg);
      filter: brightness(1.08);
    }
  }

  .amazon-link {
    border: 1px solid color-mix(in srgb, var(--border-color), transparent 35%);
    color: var(--grey1);
    &:hover {
      color: var(--link-color);
    }
  }

  @media (max-width: 520px) {
    grid-template-columns: 1fr;
    gap: 18px;

    .item {
      padding: 12px;
    }
  }
}


/* [book-page.css] */

#book-page {
  .header {
    align-items: center;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color), transparent 65%);
    display: grid;
    gap: 24px;
    margin-bottom: 28px;
    padding-bottom: 26px;
    grid-template-columns: 4fr 2fr;

    h1 {
      margin-bottom: 8px;
    }

    h2 {
      color: var(--grey2);
      font-family: "Assistant", sans-serif;
      font-size: 1.25em;
      font-weight: 300;
      line-height: 1.25;
      margin-bottom: 18px;
    }

    .buy {
      justify-self: end;
      width: min(260px, 100%);
    }

    .buy-link {
      background: var(--action-bg);
      border-radius: 4px;
      color: var(--action-fg);
      display: block;
      font-weight: 600;
      padding: 13px 18px;
      text-align: center;

      &:hover {
        color: var(--action-fg);
        filter: brightness(1.08);
      }
    }

    @media (max-width: 1024px) {
      grid-template-columns: 1fr;
      gap: 18px;

      .title {
        text-align: center;
      }

      .buy {
        justify-self: center;
      }
    }
  }

  .body {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: auto repeat(2, 1fr);

    .look-inside-title {
      grid-column: 1 / -1;
      margin: 0;
    }

    .front-cover {
      grid-column: 1 / span 2;
      grid-row: 2 / span 2;
    }
    @media (min-width: 480.1px) and (max-width: 1024px) {
      grid-template-columns: repeat(3, 1fr);
      grid-template-rows: auto repeat(4, 1fr);
    }
    @media (max-width: 480px) {
      grid-template-columns: 1fr;
      grid-template-rows: auto repeat(9, 1fr);
      .front-cover {
        grid-column: 1 / span 1;
        grid-row: 2 / span 1;
      }
    }
  }

  .footer {
    padding: 20px;
    text-align: center;

    .more-like-this {
      font-size: 1.25em;

      p {
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        gap: 9px;
        justify-content: center;
      }

      a {
        border: 1px solid color-mix(in srgb, var(--link-color), transparent 55%);
        border-radius: 999px;
        color: var(--link-color);
        display: inline-block;
        font-style: normal;
        font-weight: 500;
        line-height: 1;
        padding: 8px 12px;
      }
    }
  }
}


/* [home.css] */

#index {
  .intro {
    max-width: 640px;
    margin: 0 auto 32px;
    text-align: center;

    h1 {
      color: var(--grey1);
      font-size: 1.5em;
      font-weight: 500;
      line-height: 1.22;
      margin-bottom: 9px;
    }

    p {
      color: var(--grey2);
      font-size: 1.12em;
      line-height: 1.45;
      margin: 0;

      a {
        color: var(--link-color);
        font-weight: 500;
        text-decoration: underline;
        text-decoration-color: color-mix(in srgb, var(--link-color), transparent 65%);
        text-underline-offset: 3px;

        &:hover {
          text-decoration-color: currentColor;
        }
      }
    }
  }

  @media (max-width: 520px) {
    .intro {
      text-align: left;
      margin-bottom: 18px;

      h1 {
        font-size: 1.35em;
      }

      p {
        font-size: 1em;
      }
    }
  }
}


/* [v.image-zoom.css] */

/* =============================================================================
Image Zoom JS v0.0.1 | MIT License | https://github.com/alecrios/image-zoom-js
============================================================================= */

[data-zoom-backdrop] {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 900;
	background-color: rgba(255, 255, 255, 0.8);
	opacity: 0;
	transition: opacity 300ms ease;
	pointer-events: none;
}

[data-zoom-backdrop='active'] {
	opacity: 1;
	pointer-events: auto;
}

[data-zoom-image] {
	position: relative;
	z-index: 800;
	transform: none;
	transition: transform 300ms ease;
	cursor: zoom-in;
}

[data-zoom-image='active'] {
	z-index: 1000;
	cursor: zoom-out;
}
