/* A paper album whose individual leaves can be scrubbed in either direction. */
.heritage-home #family-album .album-frame.album-book{position:relative;margin:0;padding:0;background:none;border:0;box-shadow:none;transform:none;min-width:0;perspective:none;transition:none}
.album-book:focus-visible{outline:2px solid #886638;outline-offset:7px}
.album-book-stage{position:relative;min-width:0}
.album-book-track{position:relative;display:flex;gap:18px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:thin;scrollbar-color:#9a805c #e7dcc9;overscroll-behavior-x:contain;padding:6px 2px 17px}
.album-book-leaf{position:relative;flex:0 0 100%;min-width:0;scroll-snap-align:start;scroll-snap-stop:always;box-sizing:border-box;--page-shade:0}
.album-book-page-front{height:clamp(300px,43vh,490px);display:grid;grid-template-rows:minmax(0,1fr) auto auto;gap:12px;padding:22px 22px 14px;box-sizing:border-box;background:linear-gradient(105deg,#f4ecdc,#fffcf5 30%,#fbf5e9);border:1px solid #d7c7ab;box-shadow:0 3px 8px #37231318}
.album-book-photo{position:relative;min-height:0;display:flex;align-items:center;justify-content:center;background:#e9e1d3;border:1px solid #cabfae;box-shadow:inset 0 0 0 5px #ffffff55;padding:8px;box-sizing:border-box}
.album-book-photo::before{content:'';position:absolute;inset:0;background-image:var(--photo-backdrop);background-size:cover;background-position:center;filter:blur(12px) brightness(.86);opacity:.7;pointer-events:none}
.album-book-photo>img{position:relative}
.heritage-home #family-album .album-frame.album-book .album-book-photo img{display:block;width:100%;height:100%;min-height:0;max-height:100%;object-fit:contain;background:transparent;box-shadow:0 2px 6px #3b271224}
.heritage-home #family-album .album-frame.album-book .album-book-photo img[hidden]{display:none}
.album-book-photo-error{font:13px/1.7 var(--h-sans);color:#674e35;text-align:center;max-width:24ch;padding:15px}
.album-book-page-caption{font:italic 16px/1.35 var(--h-serif);color:#725638;text-align:center;margin:0}
.album-book-page-number{font:10px/1 var(--h-sans);letter-spacing:2px;color:#8b7457;text-align:right}
.heritage-home #family-album .album-frame.album-book>.album-book-caption{font:italic 16px/1.5 var(--h-serif);color:#725638;text-align:center;margin:12px 0 0}
.album-book-page-back,.album-book-cover,.album-book-spine{display:none}
.album-book.is-immersive .album-book-stage{height:clamp(260px,38vh,410px);perspective:1050px;transform-style:preserve-3d;background:#d9c9ac;border-radius:3px 7px 7px 3px;box-shadow:0 2px 0 #d6c3a2,0 5px 0 #fff8e9,0 7px 0 #b8a181,0 9px 0 #ead9bb,0 12px 0 #48301f,0 20px 30px #281b1640}
.album-book.is-immersive .album-book-track{position:absolute;inset:0;display:block;overflow:visible;padding:0;perspective:1050px;transform-style:preserve-3d;scroll-snap-type:none;z-index:2}
.album-book.is-immersive .album-book-leaf,.album-book.is-immersive .album-book-cover{position:absolute;left:50%;top:0;width:50%;height:100%;transform-origin:left center;transform-style:preserve-3d;will-change:transform}
.album-book.is-immersive .album-book-page-front,.album-book.is-immersive .album-book-page-back{position:absolute;inset:0;height:100%;backface-visibility:hidden;-webkit-backface-visibility:hidden;box-shadow:inset 10px 0 15px -12px #32200ca6,2px 2px 4px #2d1c0e20;border:1px solid #d7c7ab}
.album-book.is-immersive .album-book-page-front{gap:10px;padding:20px 15px 13px;transform:translateZ(.2px)}
.album-book.is-immersive .album-book-page-front::after{content:'';position:absolute;inset:0;pointer-events:none;background:#3c2712;opacity:var(--page-shade)}
.album-book.is-immersive .album-book-page-back::after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,#3c2712,transparent 52%,#3c2712);opacity:var(--page-shade)}
.album-book.is-immersive .album-book-page-back,.album-book-cover-back{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:linear-gradient(90deg,#fbf5e8,#fffaf0 70%,#e3d5bd);transform:rotateY(180deg);padding:25px;box-sizing:border-box;color:#765738}
.album-book-small{font:9px/1.4 var(--h-sans);letter-spacing:3px;color:#95744e}
.album-book-back-text,.album-book-dedication{font:italic clamp(18px,1.7vw,28px)/1.4 var(--h-serif);max-width:12ch;margin:30px 0 0}
.album-book-rule{display:block;width:36px;border-top:1px solid #c1a37a;margin-top:27px}
.album-book-back-number{position:absolute;bottom:16px;left:20px;font:10px/1 var(--h-sans);letter-spacing:2px;color:#8b7457}
.album-book.is-immersive .album-book-cover{display:block;pointer-events:none}
.album-book-cover-front,.album-book-cover-back{position:absolute;inset:0;backface-visibility:hidden;-webkit-backface-visibility:hidden}
.album-book-cover-front{display:flex;flex-direction:column;align-items:center;justify-content:center;background:repeating-linear-gradient(10deg,#ffffff02 0 1px,transparent 1px 4px),linear-gradient(112deg,#553d2d,#2b211b 77%);color:#d9bd91;box-shadow:inset 7px 0 0 #20180f,2px 6px 12px #28170766;transform:translateZ(1px)}
.album-book-cover-front::before{content:'';position:absolute;inset:16px;border:1px solid #b3915760}
.album-book-cover-kicker{font:9px/1.4 var(--h-sans);letter-spacing:4px}
.album-book-cover-title{font:italic clamp(25px,2.1vw,35px)/1.25 var(--h-serif);max-width:9ch;text-align:center;margin-top:25px;padding-inline:15px}
.album-book-cover-line{width:38px;border-top:1px solid #ac8b57;margin-top:24px}
.album-book-cover-mark{font:italic 26px/1 var(--h-serif);margin-top:25px}
.album-book.is-immersive .album-book-spine{display:block;position:absolute;top:0;bottom:0;left:calc(50% - 9px);width:18px;background:linear-gradient(90deg,transparent,#452c1033,transparent);pointer-events:none;z-index:150}
.album-book.is-immersive .album-book-photo{padding:5px}
.album-book.is-immersive .album-book-page-caption{font-size:14px}
.album-book.is-immersive .album-book-caption{font-size:13px!important}
.album-controls button:disabled{opacity:.38;cursor:default}
.album-controls button[hidden]{display:none}
@media(max-width:760px){
  .album-book-page-front{height:clamp(320px,52vh,460px);padding:16px 16px 12px}
  .album-book.is-immersive .album-book-stage{height:clamp(210px,30vh,280px);overflow:visible}
  .album-book.is-immersive .album-book-leaf,.album-book.is-immersive .album-book-cover{left:50%;width:50%}
  .album-book.is-immersive .album-book-spine{left:calc(50% - 9px)}
  .album-book.is-immersive .album-book-page-front{padding:12px 12px 10px;gap:8px}
  .album-book.is-immersive .album-book-cover-back,.album-book.is-immersive .album-book-page-back{visibility:visible;padding:12px}
  .album-book-page-caption{font-size:15px}
  .album-book-cover-title{font-size:28px}
  .heritage-home #family-album .album-frame.album-book>.album-book-caption{font-size:14px}
  .album-book.is-immersive .album-book-stage{height:clamp(210px,30vh,280px)}
  .album-book.is-immersive .album-book-page-front{padding:10px 10px 9px}
}
@media(max-height:700px) and (min-width:761px){.album-book.is-immersive .album-book-stage{height:240px}.album-book.is-immersive .album-book-page-front{padding:12px 12px 9px;gap:7px}}
@media(prefers-reduced-motion:reduce){.heritage-site:not(.motion-opted-in) .album-book-track{scroll-behavior:auto}.heritage-site:not(.motion-opted-in) .album-book-leaf,.heritage-site:not(.motion-opted-in) .album-book-cover{will-change:auto!important}}
.album-book.is-immersive[data-page-count="1"] .album-book-leaf{will-change:auto}

/* Admin captions remain readable without stretching a page beyond the book. */
.album-book-page-caption{overflow-wrap:anywhere;text-wrap:pretty}
.album-book-page-front{min-width:0;min-height:0}
.heritage-home .album-book-cover-mark img{display:block;width:40px!important;height:40px!important;object-fit:contain;background:transparent!important;box-shadow:none!important}
.home-refresh .portrait-corner{background:var(--h-paper)}
.home-refresh .portrait-corner img{display:block;width:100%;height:100%;object-fit:contain;border-radius:0}

/* Keep the binding and two paper pages even when camera motion is paused or
   the viewport is too short for a pinned journey. */
.album-book:not(.is-immersive) .album-book-stage{background:linear-gradient(90deg,#fff9ed 46%,#d7c5a6 50%,#fff9ed 54%);border:5px solid #573d2b;border-radius:4px;box-shadow:0 4px 0 #d5c3a6,0 7px 0 #573d2b,0 15px 28px #36241330}
.album-book:not(.is-immersive) .album-book-track{margin-left:50%;gap:0;padding:0;scrollbar-width:none}
.album-book:not(.is-immersive) .album-book-cover{display:block;position:absolute;inset:0 50% 0 0;pointer-events:none}
.album-book:not(.is-immersive) .album-book-cover-front{display:none}
.album-book:not(.is-immersive) .album-book-cover-back{transform:none;backface-visibility:visible;height:100%;padding:12px}
.album-book:not(.is-immersive) .album-book-page-front{height:clamp(240px,36vh,380px);padding:12px;gap:8px}
@media(max-width:760px){
  .album-book .album-book-dedication,.album-book .album-book-back-text{font-size:17px;line-height:1.45;margin-top:18px}
  .album-book .album-book-small{font-size:8px;letter-spacing:1.5px}
  .album-book .album-book-cover-title{font-size:22px;padding-inline:10px}
  .album-book .album-book-cover-kicker{font-size:8px;letter-spacing:2px}
  .album-book.is-immersive .album-book-page-caption,.album-book .album-book-page-caption{font-size:12px;line-height:1.3}
  .album-book:not(.is-immersive) .album-book-page-front{height:245px;padding:8px}
  .album-book .album-book-photo{padding:3px}
}
