/* ============================================================
   books.css  –  immersive reading-log styles
   Companion to books.qmd (closeread-html format)
   ============================================================ */

/* ---------- figures --------------------------------------- */
/* Quarto emits .figure-img without .img-fluid, so wide plots
   (the cover mosaic especially) overflow the column. */
figure.figure img.figure-img {
  max-width: 100%;
  height: auto;
}

/* ---------- stat row (used with Quarto .columns layout) ---- */
.stat-col {
  text-align: center;
  padding: 1.5rem 0.5rem;
  border-right: 1px solid #e8e0d8;
}

.stat-col:last-child {
  border-right: none;
}

.stat-number {
  display: block;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1;
  color: #3d2b1f;
  letter-spacing: -0.03em;
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8a7060;
  margin-top: 0.4rem;
}

/* ---------- section divider -------------------------------- */
.stat-row-wrap {
  border-top: 1px solid #e8e0d8;
  border-bottom: 1px solid #e8e0d8;
  margin: 1.5rem 0 2rem;
}

/* ---------- narrative text --------------------------------- */
.narrative {
  font-size: 1.05rem;
  line-height: 1.85;
  color: #3d2b1f;
}

/* ---------- section sub-headers ---------------------------- */
.section-lead {
  font-size: 1.05rem;
  color: #6a5244;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* ---------- interactive bookshelf -------------------------- */
.shelf-wrapper {
  width: 100%;
  margin: 1.5rem 0 2.5rem;
  overflow: visible;
}

.shelf-container {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  overflow-x: auto;
  padding: 14rem 2.5rem 0;
  background: linear-gradient(170deg, #fdf8f2 0%, #ede0cc 100%);
  scrollbar-width: thin;
  scrollbar-color: #c8a06a transparent;
  border-bottom: 16px solid #8b6347;
  box-shadow: inset 0 -4px 0 #7a5532;
}

.shelf-book {
  flex: 0 0 auto;
  width: 118px;
  cursor: pointer;
  position: relative;
  padding-bottom: 1.5rem;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.shelf-book:hover {
  transform: translateY(-14px);
  z-index: 100;
}

.shelf-book img {
  width: 100%;
  height: 178px;
  object-fit: cover;
  display: block;
  box-shadow: 4px 6px 16px rgba(0, 0, 0, 0.38);
  border-radius: 2px 3px 3px 2px;
}

.shelf-card {
  display: none;
  position: absolute;
  bottom: calc(100% - 1rem);
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  background: #ffffff;
  border-left: 4px solid var(--accent, #c8a06a);
  border-radius: 0 6px 6px 0;
  padding: 1rem 1.1rem;
  width: 240px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.16);
  z-index: 200;
  pointer-events: none;
}

.shelf-book:hover .shelf-card {
  display: block;
}

.shelf-card-title {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.3;
  color: #2c1f14;
  margin-bottom: 0.2rem;
}

.shelf-card-author {
  font-size: 0.76rem;
  color: #8a7060;
  margin-bottom: 0.45rem;
}

.shelf-card-stars {
  color: #d4850a;
  font-size: 0.85rem;
  margin-bottom: 0.45rem;
  letter-spacing: 0.04em;
}

.shelf-card-review {
  font-size: 0.76rem;
  line-height: 1.55;
  color: #4a3728;
  font-style: italic;
}

/* ---------- callout style tweaks for books page ------------ */
.callout.callout-style-minimal {
  border-left-width: 4px;
}

.callout-tip.callout-style-minimal {
  border-left-color: #c8a06a;
  background-color: #fdf8f2;
}

.callout-note.callout-style-minimal {
  border-left-color: #7a9cbf;
  background-color: #f5f8fc;
}

/* ---------- closeread overlay text color override ---------- */
.cr-section[data-layout="overlay-center"] .narrative-col p {
  color: #ffffff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
  font-size: 1.2rem;
  line-height: 1.7;
}

/* ---------- responsive tweaks ------------------------------ */
@media (max-width: 600px) {
  .stat-col {
    border-right: none;
    border-bottom: 1px solid #e8e0d8;
    padding: 1rem 0.5rem;
  }

  .shelf-book {
    width: 95px;
  }

  .shelf-book img {
    height: 140px;
  }

  .shelf-card {
    width: 190px;
  }
}
