/* Book page content. Layout, tokens, header and footer come from shared/site.css. */

.book-section {
  padding-block: 88px;
}

.book-section-alt {
  background: var(--theme-bg-secondary);
}

.book-eyebrow {
  margin-bottom: 12px;
  color: var(--theme-color-primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.book-title {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 700;
}

.book-prose {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  color: var(--theme-text-secondary);
  font-size: 17px;
}

.book-status {
  margin-top: 32px;
  color: var(--theme-text-secondary);
}

/* Buttons */

.book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.book-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--theme-radius-md);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.book-button-primary {
  background: var(--theme-color-primary);
  color: #ffffff;
  box-shadow: var(--theme-shadow-sm);
}

.book-button-primary:hover {
  box-shadow: var(--theme-shadow-md);
}

.book-button-outline {
  border-color: var(--theme-border-default);
  color: var(--theme-text-primary);
}

.book-button-outline:hover {
  border-color: var(--theme-color-primary);
}

/* Hero */

.book-hero {
  padding-block: 72px;
}

.book-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(32px, 6vw, 112px);
}

.book-hero-title {
  font-size: clamp(2.25rem, 5.4vw, 3.75rem);
  font-weight: 800;
}

.book-hero-lead {
  margin-top: 20px;
  color: var(--theme-text-secondary);
  font-size: clamp(17px, 1.6vw, 20px);
}

.book-hero-byline {
  margin-top: 16px;
  color: var(--theme-text-tertiary);
  font-size: 15px;
  font-weight: 600;
}

.book-cover {
  display: block;
  border-radius: var(--theme-radius-md);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  transition: transform 160ms ease;
}

.book-cover:hover {
  transform: translateY(-3px);
}

.book-cover img {
  display: block;
  width: clamp(200px, 22vw, 340px);
  height: auto;
  border-radius: var(--theme-radius-md);
}

/* Icons */

.book-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--theme-radius-md);
  background: var(--site-primary-soft);
  color: var(--theme-color-primary);
}

.book-tile-large {
  width: 72px;
  height: 72px;
  border-radius: var(--theme-radius-lg);
}

/* Table of contents */

.book-parts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 48px;
  margin-top: 40px;
}

.book-part-title {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--theme-border-default);
  font-size: 17px;
}

.book-chapters {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.book-chapter {
  display: flex;
  gap: 14px;
  padding: 8px 10px;
  border-radius: var(--theme-radius-sm);
  color: var(--theme-text-primary);
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease;
}

.book-chapter:hover {
  background: var(--theme-surface-raised);
  color: var(--theme-color-primary);
}

.book-chapter-id {
  flex: none;
  width: 32px;
  color: var(--theme-color-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Text sections with a large icon */

.book-split {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}

/* Breakpoints */

@media (max-width: 768px) {
  .book-section {
    padding-block: 64px;
  }

  .book-hero {
    padding-block: 48px;
  }

  .book-hero-inner,
  .book-parts,
  .book-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .book-cover {
    grid-row: 1;
    justify-self: start;
  }

  .book-cover img {
    width: 160px;
  }
}

@media (max-width: 560px) {
  .book-section {
    padding-block: 48px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .book-cover {
    transition: none;
  }

  .book-cover:hover {
    transform: none;
  }
}
