/* Book page (book.html): a large cover beside the title, price, buy buttons and description.
   The 404 page and the returns page use the book-page class and this file too. */

.book-page #header {
  background: #029fa8;
}

/* Keep the footer at the bottom of the window when a page is shorter than the screen
   (the 404 and returns pages, or a book that couldn't be found). The home page is always
   taller than the screen, and this layout would change how its sections' margins combine. */
body.book-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.book-page #main {
  flex: 1;
  padding: 96px 0 40px;
}

.all-books-link {
  margin: 0 0 20px;
  font-family: "Jost", sans-serif;
}

.all-books-link a {
  color: #37517e;
}

.all-books-link a:hover {
  color: #47b2e4;
}

.book-detail {
  row-gap: 28px;
}

/* The cover stays in view while the description scrolls past */
.book-detail-cover {
  align-self: flex-start;
  position: sticky;
  top: 96px;
}

/* The cover, filled in by functions/books/[handle].js; drop-shadow follows the cover, not the box */
.book-detail-cover img {
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.22));
}

.book-detail-info h1 {
  font-family: "Jost", sans-serif;
  font-size: 36px;
  font-weight: 600;
  line-height: 1.15;
  color: #37517e;
  margin: 0 0 14px;
}

.book-detail-info .shop-price-block {
  align-items: flex-start;
  min-width: 0;
  margin: 0 0 18px;
  font-size: 20px;
}

.book-detail-info .shop-price {
  text-align: left;
}

.book-detail-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 420px;
}

.book-detail-buttons .shop-button {
  flex: 1;
  padding: 10px 20px;
  font-size: 16px;
}

.book-detail-note {
  margin: 12px 0 28px;
  font-size: 14px;
  color: #6b7a90;
}

/* Description from Shopify. Its first heading repeats the title, so it's hidden;
   the Author/ISBN/Publisher paragraph that follows is shown as a small facts box. */
.book-detail-description {
  line-height: 1.7;
}

.book-detail-description h2:first-child {
  display: none;
}

.book-detail-description h2:first-child + p {
  padding: 12px 16px;
  background: #f3f5fa;
  border-radius: 6px;
  font-size: 15px;
}

.book-detail-description ul {
  padding-left: 20px;
}

.book-detail-description blockquote {
  margin: 20px 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid #47b2e4;
  color: #555;
  font-style: italic;
}

.book-missing {
  text-align: center;
  padding: 40px 0;
}

.book-missing h1 {
  font-size: 28px;
  color: #37517e;
}

/* Phones and small tablets: one column, cover first and not sticky */
@media (max-width: 767px) {
  .book-detail-cover {
    position: static;
  }

  .book-detail-cover img {
    max-width: 300px !important; /* beats the img's inline max-width */
  }

  .book-detail-info h1 {
    font-size: 28px;
    text-align: center;
  }

  .book-detail-info .shop-price-block {
    align-items: center;
  }

  .book-detail-buttons {
    margin: 0 auto;
  }

  .book-detail-note {
    text-align: center;
  }
}
