/* Book pages — extends style.v10.css, reuses its tokens (--navy, --copper, --gold, --paper…) */
.bk-hero {
  --hero-a: #0f2438; --hero-b: #16324f; --hero-glow: rgba(201,161,90,.22);
  position: relative; overflow: hidden; color: #fbf5e8;
  background:
    radial-gradient(60% 70% at 72% 40%, var(--hero-glow), transparent 70%),
    linear-gradient(160deg, var(--hero-a), var(--hero-b));
  padding: clamp(28px, 5vw, 64px) 0 clamp(36px, 6vw, 72px);
  transition: background .6s ease;
}
/* «طاووس البراري»: emerald + gold, with faint peacock-feather "eyes". */
.theme-peacock .bk-hero {
  --hero-a: #062a26; --hero-b: #0c4a43; --hero-glow: rgba(212,175,95,.26);
}
.theme-peacock .bk-hero::before {
  content: ""; position: absolute; inset: -10%; pointer-events: none; opacity: .5;
  background:
    radial-gradient(circle at 12% 22%, rgba(212,175,95,.22) 0 2.2%, rgba(19,120,110,.28) 2.3% 4.6%, transparent 4.8%),
    radial-gradient(circle at 26% 78%, rgba(212,175,95,.18) 0 1.6%, rgba(19,120,110,.24) 1.7% 3.4%, transparent 3.6%),
    radial-gradient(circle at 88% 12%, rgba(212,175,95,.16) 0 1.8%, rgba(19,120,110,.2) 1.9% 3.8%, transparent 4%),
    radial-gradient(circle at 92% 82%, rgba(212,175,95,.2) 0 2.4%, rgba(19,120,110,.26) 2.5% 5%, transparent 5.2%);
  animation: plume 18s ease-in-out infinite alternate;
}
@keyframes plume { to { transform: translate3d(-2%, 1.5%, 0) scale(1.04); } }
html[data-book-mood="night"] .bk-hero { --hero-a: #05080f; --hero-b: #101a2c; --hero-glow: rgba(126,166,214,.16); }
html[data-book-mood="golden"] .bk-hero { --hero-a: #2a1606; --hero-b: #5a3410; --hero-glow: rgba(255,177,92,.32); }

.bk-hero-in { display: grid; grid-template-columns: minmax(280px, 1fr) 1.1fr; gap: clamp(20px, 4vw, 56px); align-items: center; position: relative; }
.b3d { position: relative; aspect-ratio: 4 / 5; max-height: 560px; display: grid; place-items: center; touch-action: pan-y; }
.b3d-poster {
  position: absolute; inset: 0; margin: auto; height: 74%; width: auto; max-width: 70%; object-fit: contain; border-radius: 4px 10px 10px 4px;
  box-shadow: -14px 22px 48px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.06);
  transform: perspective(1200px) rotateY(14deg); transition: opacity .7s ease;
}
.b3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .7s ease; cursor: grab; outline: none; }
.b3d-canvas:focus-visible { box-shadow: 0 0 0 3px var(--gold, #c9a15a); border-radius: 14px; }
.b3d.grabbing .b3d-canvas { cursor: grabbing; }
.b3d.is-3d .b3d-canvas { opacity: 1; }
.b3d.is-3d .b3d-poster { opacity: 0; }
.b3d-hint[hidden] { display: none; }
.b3d-hint { position: absolute; bottom: 4px; inset-inline: 0; text-align: center; font-size: 13px; opacity: .65; pointer-events: none; }

.bk-hero-text h1 { font-family: "Aref Ruqaa", serif; font-size: clamp(38px, 6vw, 68px); line-height: 1.2; margin: 6px 0 4px; color: #fff; }
.bk-eyebrow { color: var(--gold, #d8b57e); font-size: 14px; letter-spacing: .02em; }
.bk-author { font-size: 18px; opacity: .85; margin-bottom: 14px; }
.bk-lede { font-size: 17px; line-height: 1.9; opacity: .9; max-width: 34em; }
.b3d-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 12px; }
.b3d-tools[hidden] { display: none; }
.b3d-moods { display: inline-flex; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 3px; }
.b3d-btn, .b3d-mood, .bk-buy-jump, .share-quote {
  font: inherit; font-size: 15px; border-radius: 999px; cursor: pointer; transition: background .25s, color .25s, transform .2s ease-out;
  min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center;
}
.b3d-btn { background: var(--gold, #c9a15a); color: #10202f; border: 0; font-weight: 600; }
.b3d-mood { background: transparent; color: inherit; border: 0; padding: 0 14px; min-height: 38px; }
.b3d-mood[aria-pressed="true"] { background: rgba(255,255,255,.16); }
.bk-buy-jump { color: #fbf5e8; border: 1px solid rgba(255,255,255,.35); text-decoration: none; margin-top: 6px; }
.bk-buy-jump:hover, .b3d-mood:hover { background: rgba(255,255,255,.1); }
.b3d-btn:focus-visible, .b3d-mood:focus-visible, .bk-buy-jump:focus-visible, .share-quote:focus-visible { outline: 3px solid var(--gold, #c9a15a); outline-offset: 2px; }

.bk-detail { display: grid; gap: 26px; max-width: 920px; }
.bk-inner-quote { margin: 0; padding: clamp(22px, 4vw, 40px); border-radius: var(--radius, 14px); background: var(--card, #fffefb); box-shadow: var(--shadow-soft, 0 14px 40px rgba(15,36,56,.09)); text-align: center; }
.bk-inner-quote blockquote { margin: 0 0 12px; font-family: "Aref Ruqaa", serif; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.8; color: var(--navy, #16324f); }
.bk-inner-quote figcaption { font-size: 14px; color: var(--copper, #a8702c); margin-bottom: 16px; }
.share-quote { background: var(--navy, #16324f); color: #fbf5e8; border: 0; }
.share-quote:hover { background: var(--navy-deep, #0f2438); }
.share-quote[disabled] { opacity: .7; cursor: progress; }
.bk-buy h4 { font-size: 22px; }
.bk-back a { color: var(--copper, #a8702c); }
.bk-page-link { display: inline-block; margin-bottom: 8px; color: var(--copper, #a8702c); font-weight: 600; text-decoration: none; }
.bk-page-link:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .bk-hero-in { grid-template-columns: 1fr; text-align: center; }
  .b3d { max-height: 420px; width: min(100%, 360px); margin: 0 auto; }
  .bk-lede { margin-inline: auto; }
  .b3d-tools { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-peacock .bk-hero::before { animation: none; }
  .b3d-poster, .b3d-canvas { transition: none; }
}

/* Back-cover text, contents, author card, press list */
.bk-blurb, .bk-toc, .bk-press { background: var(--card, #fffefb); border-radius: var(--radius, 14px); padding: clamp(20px, 4vw, 36px); box-shadow: var(--shadow-soft, 0 14px 40px rgba(15,36,56,.09)); }
.bk-blurb h2, .bk-toc h2, .bk-press h2, .bk-authorcard h2 { font-family: "Aref Ruqaa", serif; font-size: clamp(26px, 3.6vw, 34px); margin: 0 0 12px; color: var(--navy, #16324f); }
.bk-blurb p { font-size: 18px; line-height: 2; margin: 0 0 12px; }
.bk-credit { font-size: 13px; color: var(--copper, #a8702c); margin: 6px 0 0; }
.bk-toc ol { list-style: none; counter-reset: st; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 18px; }
.bk-toc li { counter-increment: st; padding: 10px 0; border-bottom: 1px solid var(--line, #e5dcc8); font-size: 17px; display: flex; gap: 10px; align-items: baseline; }
.bk-toc li::before { content: counter(st, arabic-indic); color: var(--copper, #a8702c); font-family: "Aref Ruqaa", serif; min-width: 1.4em; }
.bk-press ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bk-press a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 14px; border: 1px solid var(--line, #e5dcc8); border-radius: 12px; text-decoration: none; color: inherit; transition: border-color .2s, transform .2s; }
.bk-press a:hover { border-color: var(--copper, #a8702c); transform: translateY(-1px); }
.bk-press a:focus-visible { outline: 3px solid var(--gold, #c9a15a); outline-offset: 2px; }
.pr-meta { font-size: 13px; color: var(--copper, #a8702c); grid-column: 1; }
.pr-title { font-size: 16px; line-height: 1.7; grid-column: 1; }
.pr-arrow { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--copper, #a8702c); }
.bk-authorcard { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: center; }
.bk-authorcard p { line-height: 1.95; margin: 0 0 6px; }
@media (max-width: 640px) { .bk-authorcard { grid-template-columns: 1fr; text-align: center; } .bk-authorcard .flash-photo { max-width: 200px; margin: 0 auto; } }

/* Press-camera flash: one white burst when the portrait first scrolls into view.
   Pure CSS on a pseudo-element (opacity + transform only = compositor, no layout). */
.flash-photo { position: relative; margin: 0; border-radius: 16px; overflow: hidden; background: #eef3fb; }
.flash-photo img { display: block; width: 100%; height: auto; }
.flash-photo::after { content: ""; position: absolute; inset: -20%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 70% 25%, #fff 0, rgba(255,255,255,.85) 18%, rgba(255,255,255,0) 55%); }
.reveal.on .flash-photo::after { animation: press-flash 1.1s .25s ease-out 1 both; }
.reveal.on .flash-photo img { animation: press-exposure 1.1s .25s ease-out 1 both; }
@keyframes press-flash { 0% { opacity: 0; transform: scale(.9); } 8% { opacity: 1; transform: scale(1); } 14% { opacity: .2; } 20% { opacity: .9; } 100% { opacity: 0; transform: scale(1.15); } }
@keyframes press-exposure { 0% { filter: none; } 10% { filter: brightness(1.6) contrast(.85); } 100% { filter: none; } }
@media (prefers-reduced-motion: reduce) { .reveal.on .flash-photo::after, .reveal.on .flash-photo img { animation: none; } }
.pr-meta time { unicode-bidi: isolate; }
