/* Shared layout for /books/*. Each page sets its own colors, type and cover treatment. */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.75 var(--body, 'Libre Baskerville'), Georgia, serif;
}
a { color: inherit; text-underline-offset: 3px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

.top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px 24px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 22px; font-size: .9375rem; }
.top a { text-decoration: none; }
.top a:hover { text-decoration: underline; }
.top nav { display: flex; gap: 24px; color: var(--dim); }
.top .name { font-weight: 700; }

.front { position: relative; isolation: isolate; overflow: clip; background: var(--front, var(--bg)); }
.front .wrap { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 72px; align-items: center; padding-top: 52px; padding-bottom: 84px; }
.front .cover { width: 100%; box-shadow: 0 24px 60px rgba(0, 0, 0, .65); }
.flip .front .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 400px); }
.flip .front .cover { order: 2; }
.mid .front .wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 40px; }
.mid .front .cover { max-width: 360px; }
.mid .hook { margin-inline: auto; }
.mid .buys { justify-content: center; }

h1 { font: 400 var(--size, clamp(3rem, 6.4vw, 5.4rem))/1.02 var(--display), serif; color: var(--title, var(--ink)); overflow-wrap: break-word; text-wrap: balance; }
.hook { font-size: clamp(1.125rem, 1.6vw, 1.3rem); line-height: 1.6; margin: 24px 0 30px; max-width: 28em; }
.buys { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.buy { background: var(--btn); color: var(--btn-ink); text-decoration: none; font-weight: 700; line-height: 1.2; padding: 16px 26px; border: 2px solid var(--btn); }
.buy:hover { filter: brightness(1.1); }
.alt { text-decoration: none; line-height: 1.2; padding: 16px 20px; border: 2px solid var(--edge, var(--dim)); }
.alt:hover { border-color: var(--ink); }
.facts { margin-top: 18px; color: var(--facts, var(--dim)); font-size: .9375rem; }
.gone { font-weight: 700; }

.edge { position: absolute; z-index: -1; left: 0; bottom: -1px; width: 100%; height: 150px; display: block; pointer-events: none; }

.inside { max-width: 660px; margin: 0 auto; padding: 76px 28px 70px; }
.inside p + p { margin-top: 1.25em; }
.inside blockquote { margin-top: 52px; padding-left: 24px; border-left: 4px solid var(--accent); font-style: italic; }
.inside cite { display: block; margin-top: 8px; font-style: normal; font-size: .9375rem; color: var(--dim); }
.inside details { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 20px; font-size: .9375rem; }
.inside summary { cursor: pointer; }
.inside details p { margin-top: 10px; color: var(--dim); }
.inside .small { margin-top: 22px; color: var(--dim); font-size: .9375rem; }

.more { border-top: 1px solid var(--line); padding: 46px 0 70px; }
.more h2 { font: 400 1.6rem/1.2 var(--display), serif; margin-bottom: 22px; }
.related-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.related-grid img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.related-grid a:hover img { filter: brightness(1.12); }
.more .all { margin-top: 24px; }

.foot { border-top: 1px solid var(--line); padding: 30px 0 44px; color: var(--dim); font-size: .9375rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot p { margin-top: 16px; }

@media (max-width: 820px) {
  .front .wrap, .flip .front .wrap { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 28px; padding-bottom: 64px; }
  .flip .front .cover { order: 0; }
  .front .cover, .mid .front .cover { max-width: 280px; margin: 0 auto; }
  .inside { padding-top: 56px; padding-bottom: 52px; }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top nav { gap: 18px; }
  .edge { height: 90px; }
}
