/* Our books. The cover is the link; the label appears on approach or keyboard focus. */
.catalogue-head { padding-block: clamp(110px, 11vw, 148px) clamp(25px, 3vw, 40px); }
.catalogue-head h1 { margin-top: 0; font-size: clamp(2.75rem, 5.2vw, 4.6rem); }
.catalogue-head .lede { margin-top: 10px; }
.books-page { padding-top: clamp(22px, 3.5vw, 44px); }
.book-grid.cover-shelf {
  grid-template-columns: repeat(auto-fill, minmax(144px, 1fr));
  gap: clamp(12px, 2vw, 26px);
  align-items: start;
}
.shelf-item { position: relative; min-width: 0; padding: 8px; }
.shelf-cover { position: relative; display: block; color: inherit; text-decoration: none; }
.shelf-cover-art {
  position: relative;
  z-index: 1;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 3px 6px 6px 3px;
  background: #2c2024;
  box-shadow: 3px 1px 0 #d6c5a3, 6px 2px 0 #ad9976, 0 17px 27px -19px #24141d;
  transition: transform .24s ease, box-shadow .24s ease;
}
.shelf-cover-art img, .shelf-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.shelf-placeholder { display: grid; place-items: center; padding: 12px; color: var(--gold-hi); text-align: center; }
.shelf-summary {
  --shelf-enter-x: -15px;
  position: absolute;
  top: -2%;
  left: calc(107.5% + 6px);
  box-sizing: border-box;
  width: var(--shelf-summary-width, 250px);
  min-height: 104%;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px clamp(14px, 1.55vw, 22px);
  border: 1px solid #b69458;
  border-radius: 5px;
  background: linear-gradient(145deg, #fff8e7, #f3e5ca);
  color: #2a1920;
  box-shadow: 0 18px 34px #2c16175e;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(var(--shelf-enter-x));
  transition: transform .22s ease, opacity .22s ease, visibility .22s;
}
.shelf-summary::before {
  content: "";
  position: absolute;
  inset-block: 0;
  right: 100%;
  width: 14px;
}
.shelf-item.shelf-left .shelf-summary { --shelf-enter-x: 15px; left: auto; right: calc(107.5% + 6px); }
.shelf-item.shelf-left .shelf-summary::before { right: auto; left: 100%; }
.shelf-item.shelf-below .shelf-summary {
  top: calc(107.5% + 6px);
  right: auto;
  left: 0;
  width: 100%;
  min-height: 0;
  transform: translateY(-10px);
}
.shelf-item.shelf-below .shelf-summary::before { inset: auto 0 100%; width: auto; height: 14px; }
.shelf-summary-kind, .shelf-summary-more {
  color: var(--burgundy);
  font-size: .71rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.shelf-summary strong { font: 700 clamp(1.35rem, 2vw, 1.75rem)/.99 var(--serif); }
.shelf-summary-author { font-size: .87rem; }
.shelf-summary-description { margin: 3px 0; font-size: .81rem; line-height: 1.35; }
.shelf-summary small { color: #6a493a; font-size: .73rem; line-height: 1.3; }
.shelf-summary-price { color: var(--burgundy); font: 700 1.24rem/1.1 var(--serif); }
.shelf-summary-more { margin-top: 3px; }
.shelf-cover:focus-visible { outline: none; }
.shelf-cover:focus-visible .shelf-cover-art { outline: 3px solid var(--burgundy); outline-offset: 5px; }
.shelf-item:focus-within { z-index: 3; }
.shelf-item:not(.shelf-dismissed):focus-within .shelf-cover-art {
  transform: scale(1.15);
  box-shadow: 3px 1px 0 #d6c5a3, 6px 2px 0 #ad9976, 0 22px 34px -16px #24141d;
}
.shelf-item:not(.shelf-dismissed):focus-within .shelf-summary {
  transform: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
@media (hover: hover) and (pointer: fine) {
  .shelf-item:hover { z-index: 4; }
  .shelf-item:not(.shelf-dismissed):hover .shelf-cover-art {
    transform: scale(1.15);
    box-shadow: 3px 1px 0 #d6c5a3, 6px 2px 0 #ad9976, 0 22px 34px -16px #24141d;
  }
  .shelf-item:not(.shelf-dismissed):hover .shelf-summary {
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

.book-detail-section { padding-block: clamp(100px, 12vw, 150px) clamp(56px, 9vw, 104px); }
.book-back { color: var(--burgundy); font-weight: 600; text-underline-offset: 4px; }
.book-loading { margin-top: 20px; }
.book-detail {
  display: grid;
  grid-template-columns: minmax(220px, 370px) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 90px);
  align-items: start;
  margin: 28px 0 0;
}
.book-detail[hidden] { display: none; }
.book-jacket { margin: 0 auto; width: 100%; }
.book-jacket img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px 8px 8px 4px;
  box-shadow: 5px 1px #d6c5a3, 9px 2px #ad9976, 0 30px 45px -26px #2d1828;
}
.book-information { min-width: 0; }
.book-information h1 { margin: 4px 0; color: var(--burgundy); font-size: clamp(2.5rem, 5vw, 4.5rem); line-height: .95; }
.book-detail-subtitle { font: italic 600 clamp(1.2rem, 2.5vw, 1.75rem)/1.2 var(--serif); color: #604238; margin-top: 10px; }
.book-detail-author { color: #5b3a34; margin-top: 10px; font-weight: 600; }
.book-description { max-width: 55ch; margin: 20px 0; line-height: 1.55; }
.book-specifications {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
  margin: 25px 0 0;
}
.book-specifications div { padding: 10px 0; border-bottom: 1px solid #8f695744; }
.book-specifications dt { color: #644939; font-size: .78rem; font-weight: 600; }
.book-specifications dd { margin: 3px 0 0; font-size: .94rem; }
.book-order {
  display: grid;
  grid-template-columns: minmax(125px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 16px 28px;
  margin-top: 25px;
  padding: 16px 20px;
  background: #fff3d36b;
  border: 1px solid #bc9a6482;
  border-radius: 5px;
}
.book-order h2 { margin: 0; color: #5b3a34; font: 600 .8rem/1.3 var(--sans); }
.book-price { margin: 2px 0 0; color: var(--burgundy); font: 700 2rem/1.1 var(--serif); }
.book-order-actions p { margin: 0 0 8px; font-size: .83rem; }
.book-guest-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.book-guest-actions[hidden], .book-order [hidden], .book-order[hidden], .book-specifications div[hidden] { display: none; }
.book-order .btn { min-height: 40px; padding: 9px 13px; font-size: .72rem; }

.book-preview {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: min(1080px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100% - 24px);
  margin: auto;
  padding: 12px clamp(10px, 2.5vw, 22px) 14px;
  color: #fff1d0;
  background: #28191f;
  border: 1px solid #a47c46;
  border-radius: 7px;
  box-shadow: 0 25px 80px #120710cc;
}
.book-preview::backdrop { background: #130a11c9; }
.sample-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sample-toolbar h2 { font: 650 clamp(1.2rem, 3.2vw, 1.7rem)/1.05 var(--serif); margin: 0; }
.sample-toolbar small { display: block; margin-top: 3px; font: 500 .73rem/1.2 var(--sans); color: #d8bb86; }
.sample-close {
  width: 40px;
  min-height: 40px;
  background: #362529;
  color: #fff0cb;
  border: 1px solid #bc945a88;
  border-radius: 4px;
  font-size: 1.55rem;
  line-height: 1;
}
.sample-frame {
  display: block;
  width: 100%;
  height: clamp(230px, calc(100dvh - 148px), 740px);
  border: 1px solid #bc945a55;
  border-radius: 4px;
  background: #0e0b0d;
}
.sample-transcript { margin-top: 8px; font-size: .85rem; }
.sample-transcript summary { width: fit-content; color: #f1d498; cursor: pointer; }
.sample-transcript div { max-width: 68ch; padding: 12px 0 4px; }
.sample-transcript p { margin-top: 7px; }

/* Home page: the Our books section as two cover shelves */
.home-shelves .shelf-caption {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 6px;
  color: #6a493a;
  font: 600 .78rem/1.3 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.home-shelves .shelf-caption::after { content: ""; flex: 1; height: 1px; background: #8f695755; }
.home-shelves .book-grid + .shelf-caption { margin-top: clamp(26px, 3.5vw, 44px); }
.home-shelves .book-grid.cover-shelf { margin-top: 0; grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 900px) { .home-shelves .book-grid.cover-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

@media (max-width: 700px) {
  .book-grid.cover-shelf { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .book-detail { grid-template-columns: 1fr; }
  .book-jacket { max-width: 275px; }
}
@media (max-width: 440px) {
  .book-order { grid-template-columns: 1fr; }
  .shelf-summary strong { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .shelf-cover-art, .shelf-summary { transition: none; }
}
.home-shelves [hidden] { display: none; }
