/* Journal page: flipbook + shop. Uses the shared theme variables, so dark mode follows automatically. */
.journal-page{padding-bottom:72px;background:var(--shell);transition:background-color .45s ease}
.journal-page .journal-intro{min-height:0;padding-bottom:4px;max-width:1120px;margin:0 auto;box-sizing:border-box}
.journal-intro h1{margin-bottom:12px}
.journal-lede{max-width:44rem;font-size:1.15rem}

/* ---------- Flipbook ---------- */
.journal-viewer{max-width:940px;margin:0 auto;padding:28px 5% 8px;text-align:center}
.fb-book{transition:transform .8s cubic-bezier(.45,.05,.35,1)}
/* On the cover only the right half has content, so shift the book to centre it. */
.fb-book.is-closed{transform:translateX(-25%)}
.fb-stage{position:relative;aspect-ratio:120/89;width:100%;perspective:2400px;cursor:pointer;touch-action:pan-y;
  user-select:none;-webkit-user-select:none;isolation:isolate}
.fb-half,.leaf-face{background-size:200% 100%;background-repeat:no-repeat}
.fb-half{position:absolute;top:0;bottom:0;width:50%;background-color:#fbf9f3;
  box-shadow:0 3px 0 #e3ddcf,0 6px 0 #faf6eb,0 8px 0 #b4ac9d,0 15px 24px -7px rgba(26,28,46,.28)}
.fb-left{left:0;background-position:left center;border-radius:5px 0 0 7px}
.fb-right{right:0;background-position:right center;border-radius:0 5px 7px 0}
.fb-half::after{content:"";position:absolute;inset:0;pointer-events:none;border-radius:inherit}
.fb-left::after{background:linear-gradient(90deg,rgba(118,91,57,.05),transparent 5%,transparent 85%,rgba(66,47,29,.14))}
.fb-right::after{background:linear-gradient(90deg,rgba(66,47,29,.17),transparent 13%,transparent 97%,rgba(118,91,57,.05))}
.fb-spine{position:absolute;inset:0 auto 0 50%;width:2px;margin-left:-1px;pointer-events:none;z-index:1;
  background:rgba(61,42,26,.15)}
.fb-book.is-closed .fb-left{background-color:transparent;box-shadow:none}
.fb-book.is-closed .fb-left::after{display:none}
.fb-book.is-closed .fb-right{border-radius:3px 6px 6px 3px}
.fb-book.is-closed .fb-spine{opacity:0}

.fb-leaf{position:absolute;top:0;bottom:0;width:50%;transform-style:preserve-3d;
  transition:transform .8s cubic-bezier(.45,.05,.35,1);will-change:transform;z-index:2}
.fb-leaf.dir-next{left:50%;transform-origin:left center}
.fb-leaf.dir-prev{left:0;transform-origin:right center}
.fb-leaf.dir-next.turning{transform:rotateY(-180deg)}
.fb-leaf.dir-prev.turning{transform:rotateY(180deg)}
.leaf-face{position:absolute;inset:0;background-color:#fbf9f3;backface-visibility:hidden;-webkit-backface-visibility:hidden;
  box-shadow:0 10px 18px -10px rgba(26,28,46,.25)}
.dir-next .face-front,.dir-prev .face-back{border-radius:0 5px 7px 0}
.dir-next .face-back,.dir-prev .face-front{border-radius:5px 0 0 7px}
.leaf-face::after{content:"";position:absolute;inset:0;opacity:0;transition:opacity .8s ease;pointer-events:none}
.fb-leaf.turning .leaf-face::after{opacity:1}
/* Front face is the page being lifted; the back face is the page it reveals. */
.dir-next .face-front{background-position:right center}
.dir-next .face-back{background-position:left center;transform:rotateY(180deg)}
.dir-prev .face-front{background-position:left center}
.dir-prev .face-back{background-position:right center;transform:rotateY(180deg)}
.dir-next .face-front::after{background:linear-gradient(90deg,rgba(39,41,74,.25),transparent 60%)}
.dir-prev .face-front::after{background:linear-gradient(270deg,rgba(39,41,74,.25),transparent 60%)}
.fb-stage.fb-fade{animation:fb-fade .35s ease}
@keyframes fb-fade{from{opacity:.25}to{opacity:1}}

.fb-controls{display:flex;align-items:center;justify-content:center;gap:18px;margin-top:32px}
.fb-turn{min-height:44px;padding:0 20px;border-radius:999px;border:2px solid var(--plum);background:var(--shell);
  color:var(--plum);font:600 1rem/1 var(--sans,inherit);cursor:pointer}
.fb-turn:hover:not(:disabled){background:var(--plum);color:var(--shell)}
.fb-turn:disabled{opacity:.4;cursor:default}
.fb-turn:focus-visible,.fb-dots button:focus-visible{outline:3px solid var(--cherry);outline-offset:3px}
.fb-count{margin:0;min-width:4.5em;font-weight:600;font-variant-numeric:tabular-nums}
.fb-dots{display:flex;justify-content:center;gap:6px;list-style:none;padding:0;margin:12px 0 0}
.fb-dots button{width:44px;height:32px;border:0;background:none;cursor:pointer;display:grid;place-items:center}
.fb-dots button span{width:10px;height:10px;border-radius:50%;background:var(--line);transition:transform .2s,background .2s}
.fb-dots button[aria-current="true"] span{background:var(--cherry);transform:scale(1.3)}
.fb-caption{max-width:38rem;margin:14px auto 0}
.fb-caption h2{margin:0 0 6px;font-size:clamp(1.4rem,2.4vw,1.9rem)}
.fb-caption p{margin:0 0 10px}
.fb-hint{margin:14px 0 0;font-size:.9rem;opacity:.7}

/* ---------- Shop ---------- */
.journal-shop{max-width:1180px;margin:56px auto 0;padding:44px 4% 48px;background:var(--rose-light);
  border-radius:28px;scroll-margin-top:96px}
.shop-intro{max-width:40rem;margin-bottom:28px}
.shop-intro h2{margin:0 0 10px;font-size:clamp(2rem,4vw,3rem)}
.journal-products{list-style:none;padding:0;margin:0;display:grid;gap:22px;grid-template-columns:repeat(4,minmax(0,1fr))}
.journal-product{display:flex;flex-direction:column;background:var(--shell);border:1px solid var(--line);border-radius:20px;overflow:hidden}
.journal-product img{width:100%;height:auto;aspect-ratio:1;object-fit:cover;display:block;background:#fff}
.product-body{display:flex;flex-direction:column;flex:1;padding:16px 18px 20px}
.product-body h3{margin:0 0 6px;font-size:1.2rem}
.product-body p{margin:0 0 10px;font-size:.95rem}
.product-price{margin-top:auto!important;font-size:1.1rem}
.product-actions{display:flex;align-items:center;flex-wrap:wrap;gap:14px}
.product-actions .button{min-height:44px}
.product-badge{align-self:flex-start;padding:4px 10px;border-radius:999px;background:var(--cherry);color:#fff;
  font-size:.78rem!important;font-weight:700;letter-spacing:.02em}
.sold-out{font-weight:600;opacity:.75}
/* The journal on the desk gets a wider card. */
.journal-product.is-featured{grid-column:1 / -1;flex-direction:row}
.journal-product.is-featured img{width:min(42%,420px);flex:none}
.journal-product.is-featured .product-body{padding:28px 32px;justify-content:center}
.journal-product.is-featured h3{font-size:clamp(1.5rem,2.6vw,2.1rem)}
.journal-product.is-featured .product-price{margin-top:6px!important}
.shop-note{margin:20px 0 0;font-size:.9rem;opacity:.75}

[data-theme="dark"] .journal-shop{background:rgba(255,255,255,.05)}
[data-theme="dark"] .journal-product img{filter:brightness(.92)}
[data-theme="dark"] .fb-stage{filter:brightness(.94)}

@media (max-width:980px){.journal-products{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:640px){
  .journal-viewer{padding:22px 5% 8px}
  .fb-book.is-closed{transform:translateX(-25%)}
  .fb-controls{gap:10px}
  .fb-turn{padding:0 14px}
  .journal-shop{border-radius:20px;padding:32px 5% 36px}
  .journal-products{grid-template-columns:1fr}
  .journal-product.is-featured{flex-direction:column}
  .journal-product.is-featured img{width:100%}
  .journal-product.is-featured .product-body{padding:18px}
}
@media (prefers-reduced-motion:reduce){
  .fb-book,.fb-leaf,.leaf-face::after{transition:none}
  .fb-stage.fb-fade{animation:none}
}

/* Close-up reading shares the scan treatment; the original photo stays one link away. */
.fb-read{border:0;background:transparent;color:var(--ink);font:inherit;cursor:pointer;min-height:44px;padding:4px 8px}
.journal-viewer:focus-visible{outline:3px solid var(--blue);outline-offset:-3px}
.fb-dots button{height:44px}
.fb-turn{font-family:var(--sans);font-size:1rem;font-weight:600;line-height:1}
.journal-product img{object-fit:contain;background:var(--rose-light)}
.journal-reader{width:min(1100px,94vw);max-width:94vw;max-height:94dvh;padding:0;border:1px solid var(--line);border-radius:16px;background:var(--shell);color:var(--ink);overflow:hidden}
.journal-reader[open]{display:flex;flex-direction:column}
.journal-reader::backdrop{background:rgba(13,18,43,.78)}
.reader-bar,.reader-tools{display:flex;gap:16px;align-items:center;padding:16px 20px;flex-shrink:0}
.reader-bar{justify-content:space-between;border-bottom:1px solid var(--line)}
.reader-bar h2{font-size:1.45rem;margin:0}
.reader-bar button,.reader-tools button{min-height:44px;border:1px solid var(--plum);background:var(--rose-light);color:var(--ink);border-radius:8px;padding:8px 16px;font:inherit;cursor:pointer}
.reader-tools{padding-top:10px;padding-bottom:10px;flex-wrap:wrap;font-size:.9rem}
.reader-tools span{opacity:.75}
.reader-scroll{overflow:auto;min-height:0;padding:8px;overscroll-behavior:contain;background:var(--rose-light)}
.reader-scroll img{display:block;width:100%;height:auto;max-width:none;margin:0 auto}
.reader-scroll.is-zoomed img{width:180%;min-width:1150px;margin:0}
[data-theme="dark"] .fb-stage{filter:none}
@media(max-width:640px){.reader-bar,.reader-tools{padding:10px 12px;gap:10px}.reader-bar h2{font-size:1.2rem}.reader-tools span{width:100%}}
@media(prefers-reduced-motion:reduce){.journal-page{transition:none}}
