/* ============================================================
   components.css — buttons, bookshelf, cards, reviews, videos
   ============================================================ */

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.75rem 1.6rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, color 150ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-gold {
  background: var(--gold);
  color: var(--plum-deep);
}

.btn-gold:hover {
  background: var(--gold-soft);
  color: var(--plum-deep);
}

.btn-outline {
  border-color: var(--lilac);
  color: var(--paper);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold-soft);
}

.btn-outline-dark {
  border-color: var(--plum);
  color: var(--plum);
  background: transparent;
}

.btn-outline-dark:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ---------- Stats strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}

@media (max-width: 48rem) {
  .stats {
    grid-template-columns: 1fr;
  }
}

.stat-number {
  font-family: var(--font-display);
  font-size: var(--step-4);
  color: var(--gold);
  display: block;
}

.stat-label {
  color: var(--lilac);
  font-size: 0.95rem;
}

/* ---------- Bookshelf (signature element) ---------- */

.bookshelf {
  display: flex;
  align-items: flex-end;
  gap: clamp(6px, 0.9vw, 10px);
  padding: 0 clamp(0.5rem, 2vw, 1.5rem) 0.9rem;
  border-bottom: 14px solid #4a2b1d;   /* the shelf plank */
  border-radius: 0 0 4px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.spine {
  --spine-color: var(--plum);
  --spine-size: 220px;
  --spine-indent: 0%;

  flex: 0 0 auto;
  position: relative;
  width: clamp(46px, 4.8vw, 64px);
  height: var(--spine-size);
  border: 0;
  border-radius: 4px 4px 0 0;
  box-shadow: var(--shadow-spine);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
  color: var(--paper);
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  /* Sheen over the book colour, so spines read as curved paper, not flat bars. */
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 35%, rgba(0, 0, 0, 0.3)),
    linear-gradient(180deg, var(--spine-color), #1a0730);
}

/* Gold binding bands near the head and tail of each spine. */
.spine::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg,
      transparent 7%, var(--gold) 7%, var(--gold) calc(7% + 2px), transparent calc(7% + 2px),
      transparent 91%, var(--gold) 91%, var(--gold) calc(91% + 2px), transparent calc(91% + 2px));
  opacity: 0.55;
}

.spine span {
  writing-mode: vertical-rl;
  max-height: calc(100% - 2.4rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(0.78rem, 0.95vw, 0.95rem);
}

.spine:hover,
.spine:focus-visible {
  transform: translateY(-14px);
}

.spine.is-active {
  transform: translateY(-14px);
  box-shadow: 0 0 0 3px var(--gold), var(--shadow-spine);
}

/* On narrow screens the shelf becomes a pile of books seen from the side:
   spines stack horizontally, titles read left to right. */
@media (max-width: 40rem) {
  .bookshelf {
    flex-direction: column;
    align-items: center;
    gap: 5px;
    overflow-x: visible;
  }

  .spine {
    width: calc(100% - var(--spine-indent));
    height: 46px;
  }

  .spine::after {
    background:
      linear-gradient(90deg,
        transparent 4%, var(--gold) 4%, var(--gold) calc(4% + 2px), transparent calc(4% + 2px),
        transparent 95%, var(--gold) 95%, var(--gold) calc(95% + 2px), transparent calc(95% + 2px));
  }

  .spine span {
    writing-mode: horizontal-tb;
    max-height: none;
    max-width: calc(100% - 2.4rem);
  }

  .spine:hover,
  .spine:focus-visible,
  .spine.is-active {
    transform: none;
  }
}

/* ---------- Book detail panel & cards ---------- */

.book-panel {
  margin-top: 3rem;
}

.book-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 2.5rem;
}

@media (max-width: 48rem) {
  .book-card {
    grid-template-columns: 1fr;
  }
}

.book-cover {
  border-radius: 6px;
  box-shadow: var(--shadow-card);
}

.cover-generated {
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  color: var(--paper);
  font-family: var(--font-display);
  text-align: center;
}

.cover-generated .cover-title {
  font-size: 1.3rem;
  line-height: 1.25;
  margin-block: auto;
}

.cover-generated .cover-author {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

.book-meta {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.9rem;
  color: #5c4a6e;
}

.book-meta strong {
  color: var(--plum);
}

.badge {
  display: inline-block;
  background: var(--gold-soft);
  color: var(--plum-deep);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.9rem;
  margin: 0 0.4rem 0.4rem 0;
}

/* ---------- Reviews ---------- */

.review {
  background: var(--white);
  border-left: 5px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-card);
}

.review blockquote {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-style: italic;
  color: var(--ink);
}

.review cite {
  font-style: normal;
  font-weight: 600;
  color: var(--plum);
  display: block;
}

.review .review-role {
  font-size: 0.85rem;
  color: #5c4a6e;
}

/* ---------- Video cards ---------- */

.video-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.video-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 0;
  display: block;
  background: var(--plum-deep);
}

.video-placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: linear-gradient(160deg, var(--plum-deep), var(--plum));
  color: var(--lilac);
  text-align: center;
  padding: 1rem;
}

.video-placeholder .play-glyph {
  font-size: 2.5rem;
  color: var(--gold);
}

.video-body {
  padding: 1.5rem 1.75rem 1.75rem;
}

.video-body h3 {
  margin-bottom: 0.35rem;
}

.video-body .video-tag {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Pull quote (book page) ---------- */

.pull-quote {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-style: italic;
  line-height: 1.4;
  color: var(--lilac);
  border-left: 5px solid var(--gold);
  padding-left: 1.5rem;
  max-width: 40ch;
  margin: 2rem 0;
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Catalog grid & filters ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.filter-btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  background: transparent;
  color: var(--plum);
  border: 2px solid var(--lilac);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.filter-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.filter-btn.is-active {
  background: var(--plum);
  border-color: var(--plum);
  color: var(--white);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.75rem;
}

.catalog-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.book-cover-sm,
.cover-generated-sm {
  width: 130px;
  margin-inline: auto;
}

.cover-generated-sm {
  padding: 0.9rem 0.7rem;
}

.cover-generated-sm .cover-title {
  font-size: 1rem;
}

.catalog-body h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.catalog-meta {
  font-size: 0.85rem;
  color: #5c4a6e;
  margin-bottom: 0.5rem;
}

.catalog-award {
  font-size: 0.82rem;
  color: var(--plum);
  background: var(--gold-soft);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  margin-bottom: 0.75rem;
}

.catalog-link {
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: auto;
}

.book-edition {
  font-size: 0.88rem;
  font-style: italic;
  color: #5c4a6e;
}

/* ---------- News list ---------- */

.news-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.5rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 40rem) {
  .news-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

.news-date {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--gold);
}

.news-item h3 {
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}

.news-item p {
  margin-bottom: 0;
}

/* ---------- Career timeline ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.75rem;
  border-left: 3px solid var(--gold);
}

.timeline-entry {
  position: relative;
  padding-bottom: 1.75rem;
}

.timeline-entry::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem - 8px);
  top: 0.45rem;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--paper);
}

.timeline-year {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--gold);
  display: block;
}

.timeline-text {
  margin: 0.25rem 0 0;
}

/* ---------- Press strip ---------- */

.press-strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  justify-content: center;
  align-items: baseline;
}

.press-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--lilac);
  letter-spacing: 0.04em;
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: var(--plum-deep);
  padding: 0.6rem 1.2rem;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* Panel placed inside the mobile pile (accordion mode) */
.bookshelf .book-panel {
  width: 100%;
  margin: 0.4rem 0 0.9rem;
}

/* Footer credit line */
.footer-credit {
  width: 100%;
  text-align: center;
  border-top: 1px solid rgba(185, 166, 217, 0.25);
  padding-top: 1rem;
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}
