/* ABOUTME: Book detail page styles: cover presentation, facts list, store button, description and tutorial card. */
/* ABOUTME: Also the "more from this series" carousel and its controls. */

.book-page {
  padding-top: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  background: linear-gradient(var(--cream), var(--cream)) top / 100% clamp(260px, 30vw, 420px) no-repeat, var(--paper);
}

.book-detail {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 1rem + 5vw, 6rem);
  align-items: start;
  padding-bottom: clamp(3rem, 2rem + 4vw, 5rem);
}

.book-detail__cover-col {
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  display: grid;
  gap: 1.5rem;
}

.book-detail__cover {
  position: relative;
  max-width: 420px;
  margin-inline: auto;
  perspective: 1200px;
}

.book-detail__cover img {
  width: 100%;
  border-radius: 2px 6px 6px 2px;
  box-shadow: 0 2px 3px rgb(38 23 37 / 0.1), 0 20px 30px -10px rgb(38 23 37 / 0.35), 0 50px 70px -30px rgb(38 23 37 / 0.4);
  transform-origin: left center;
  transition: transform 0.7s var(--ease), box-shadow 0.7s var(--ease);
}

/* A soft highlight down the spine edge, as on a printed cover. */
.book-detail__cover::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 14px;
  border-radius: 2px 0 0 2px;
  background: linear-gradient(90deg, rgb(0 0 0 / 0.18), rgb(255 255 255 / 0.18) 40%, rgb(0 0 0 / 0.05) 70%, transparent);
  pointer-events: none;
  transition: transform 0.7s var(--ease);
  transform-origin: left center;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .book-detail__cover:hover img,
  .book-detail__cover:hover::after {
    transform: rotateY(-8deg);
  }

  .book-detail__cover:hover img {
    box-shadow: 0 2px 3px rgb(38 23 37 / 0.1), 18px 26px 36px -10px rgb(38 23 37 / 0.35), 30px 60px 70px -30px rgb(38 23 37 / 0.4);
  }
}

.book-detail__extra img {
  max-width: 420px;
  margin-inline: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.book-detail__info {
  padding-top: clamp(0rem, -1rem + 3vw, 2rem);
}

.book-detail__info .eyebrow a {
  color: inherit;
  text-decoration: none;
}

.book-detail__info h1 {
  font-size: clamp(2rem, 1.5rem + 2.2vw, 3.25rem);
  color: var(--plum);
  margin-bottom: 1.5rem;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0;
  margin: 0 0 2rem;
  padding: 0;
  border-block: 1px solid var(--line);
}

.facts > div {
  flex: 1 1 140px;
  padding: 0.9rem 1.25rem 0.9rem 0;
}

.facts > div + div {
  padding-left: 1.25rem;
  border-left: 1px solid var(--line);
}

.facts dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.facts dd {
  margin: 0.2rem 0 0;
  font-weight: 600;
}

.facts a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1.5px solid var(--rose-300);
  transition: border-color 0.2s, color 0.2s;
}

.facts a:hover {
  color: var(--plum);
  border-color: var(--plum);
}

@media (max-width: 480px) {
  .facts > div + div {
    padding-left: 0;
    border-left: 0;
  }
}

.buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 2.5rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}

.button--buy {
  min-height: 54px;
  padding-inline: 1.75rem;
  font-size: 1.05rem;
}

.buy__note {
  flex: 1 1 220px;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.book-detail__description h2,
.book-detail__description h3 {
  font-size: var(--step-2);
  margin-top: 1.5em;
}

.book-detail__description > :first-child {
  margin-top: 0;
}

.learn-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 2.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  background: var(--plum);
  color: var(--white);
  text-decoration: none;
  transition: background-color 0.25s, transform 0.25s var(--ease);
}

.learn-card:hover {
  background: var(--plum-800);
  color: var(--white);
  transform: translateY(-2px);
}

.learn-card__icon {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f6f0ed' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 8.5 12 4l10 4.5-10 4.5Z'/%3E%3Cpath d='M6 10.3V15c0 1.5 2.7 3 6 3s6-1.5 6-3v-4.7M22 8.5v5'/%3E%3C/svg%3E") no-repeat center / 28px;
}

.learn-card__text {
  display: grid;
  gap: 0.1rem;
  flex: 1;
}

.learn-card__eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rose-300);
}

.learn-card__text strong {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
}

.learn-card__text span:last-child {
  font-size: 0.92rem;
  opacity: 0.8;
}

.learn-card__arrow {
  font-size: 1.5rem;
  transition: transform 0.25s var(--ease);
}

.learn-card:hover .learn-card__arrow {
  transform: translateX(4px);
}

@media (max-width: 860px) {
  .book-detail {
    grid-template-columns: 1fr;
  }

  .book-detail__cover-col {
    position: static;
  }

  .book-detail__cover {
    max-width: min(320px, 70vw);
  }

  .book-detail__info h1 {
    text-align: center;
  }

  .book-detail__info > .eyebrow {
    display: flex;
    justify-content: center;
  }
}

/* More from this series */

.more-books {
  padding-block: clamp(3rem, 2rem + 4vw, 5rem);
  background: var(--cream);
}

.more-books .book-row {
  padding-bottom: 1rem;
}

.more-books__all {
  margin: 1rem 0 0;
}

.carousel-controls {
  display: flex;
  gap: 0.5rem;
}

.carousel-button {
  width: 46px;
  height: 46px;
  border: 1.5px solid var(--plum-300);
  border-radius: 50%;
  background: var(--white);
  color: var(--plum);
  font-size: 1.15rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, opacity 0.2s;
}

.carousel-button:hover:not(:disabled) {
  background: var(--plum);
  border-color: var(--plum);
  color: var(--white);
}

.carousel-button:disabled {
  opacity: 0.35;
  cursor: default;
}
