/* Site-wide alignment layer (30 Nov 2026). Loaded last; shared rules only, no per-page fixes. */

/* Book, topic and Terra title blocks: centred, and never clipped at any zoom. */
.complete-book-title,.reader-heading{text-align:center;overflow:visible;height:auto;min-height:0}
.complete-book-title h1,.reader-heading h1{margin-inline:auto;max-width:22ch;overflow-wrap:break-word}
.complete-book-title .eyebrow,.reader-heading .eyebrow{margin-inline:auto}
.complete-book-title+.native-topline{justify-content:center;flex-wrap:wrap;text-align:center;overflow:visible;height:auto;min-height:0;line-height:1.6;padding-block:14px 22px}

/* Listening panels share the reading column instead of the full page width. */
.collection-listening,.reader-article>.audio-panel{max-width:900px;margin-inline:auto;box-sizing:border-box}

/* Expand / Explain / Play under an image: centred, the same width as the rendered image. */
figure .image-action-tools[data-media-width]{width:min(100%,var(--media-w,100%));max-width:none;margin:12px auto 0;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,8.5rem),1fr));justify-content:center;box-sizing:border-box}
figure .image-action-tools[data-media-width] .motion-preview-toggle{grid-column:1/-1;width:100%}
/* Captions line up with the image, not the padded frame around it. */
.native-figure>figcaption{width:min(100%,var(--media-w,100%));margin-inline:auto;box-sizing:border-box}

/* Account title and its listening controls sit centred in the image column. */
.collection-article>.account-heading{text-align:center}
.collection-article>.account-heading h2{margin-inline:auto;max-width:30ch}
.collection-article>.collection-reading-actions,.collection-article>.collection-reference{justify-content:center;text-align:center}

/* The site menu never breaks a link over two lines when the browser is zoomed. */
.site-header nav a{white-space:nowrap}
@media(max-width:1200px){.site-header nav[aria-label]{gap:clamp(10px,1.6vw,22px)}.site-header nav[aria-label] a{font-size:clamp(14px,1.35vw,17px)}}

/* Terra and other reader headings: the heading box itself is centred, not only its text. */
.reader-heading,.cinematic-reader-head .reader-heading{margin-inline:auto}
.reader-heading>p:not(.eyebrow){margin-inline:auto;max-width:62ch}
.reader-heading .reader-actions{justify-content:center}

/* Cover heroes: the Larger view / Play controls sit centred under the cover. */
.cinematic-controls{justify-content:center}
.collection-article>.collection-reading-actions>*{justify-content:center;text-align:center}

/* ---- Home page (30 Nov 2026) ---- */
/* Header: Light, EN/ES and Explore sit right after the menu in the same row. */
@media(min-width:801px){
 .site-header{justify-content:flex-start}
 .site-header>nav[aria-label]{margin-left:auto}
 .site-header>.header-tools{margin-left:clamp(16px,2vw,32px);margin-right:auto}
}

/* Why I write: title and text start at the same height; the text column is wider. */
.experience-home .editorial-intro{grid-template-columns:minmax(0,.8fr) minmax(0,1.5fr);gap:clamp(32px,5vw,80px);align-items:start;padding-block:clamp(56px,8vw,96px)}
.experience-home .editorial-intro h2{margin-top:0}
.experience-home .editorial-intro .eyebrow{margin-top:0}
.experience-home .editorial-prose>p:first-child{margin-top:0}
/* The full reading panel stays closed behind Listen, opening below the text at full width. */
.experience-home .editorial-intro .home-audio{display:none}
.experience-home .editorial-intro.audio-open .home-audio{display:block;margin-top:24px}
@media(max-width:800px){.experience-home .editorial-intro{grid-template-columns:1fr;gap:20px}}

/* Readable text and controls on desktop. */
@media(min-width:801px){
 .experience-home main p,.experience-home .editorial-prose p{font-size:1.125rem;line-height:1.7}
 .experience-home .home-books p,.experience-home .terra-feature p{font-size:1.0625rem}
 .experience-home .inline-actions a,.experience-home .inline-actions button,.experience-home .home-books .volume-copy>a{font-size:1.0625rem}
 .experience-home .image-action-tools button,.experience-home .motion-preview-toggle{font-size:.95rem;min-height:48px;padding:12px 16px}
 .experience-home .button,.experience-home .welcome-enter{font-size:1rem}
}

/* Explore the collection: bigger cards, readable text, easy arrows. */
.experience-home .journey-strip a{min-width:min(340px,80vw);min-height:220px;padding:30px 28px;gap:14px}
.experience-home .journey-strip a span{font-size:.8rem;letter-spacing:.14em}
.experience-home .journey-strip a strong{font-size:clamp(1.5rem,2.1vw,1.9rem);line-height:1.2}
.experience-home .journey-strip a small{font-size:1rem}
.experience-home .journey-navigation-heading h2{font-size:clamp(1.8rem,3vw,2.4rem)}
.experience-home .journey-navigation-heading button{width:56px;height:56px;font-size:2rem;border-width:2px;cursor:pointer}
.experience-home .journey-navigation-heading>div{display:flex;gap:12px}

/* Welcome splash: a clearly visible Pause / Play control. */
.welcome-theater.welcome-splash .cinematic-toggle{min-height:48px;padding:12px 20px;font:600 .95rem/1.2 var(--sans)}

/* Interpretive Terra animations: badge and Show still image (30 Nov 2026). */
.motion-preview-frame{position:relative}.motion-interpretive-badge{position:absolute;left:10px;top:10px;z-index:2;padding:5px 10px;border-radius:2px;background:rgba(7,24,47,.82);color:#f3d48e;font:600 .72rem/1.2 var(--sans);letter-spacing:.06em;text-transform:uppercase;pointer-events:none}

/* ---- Button rule and mobile fixes (30 Nov 2026) ---- */
/* One row under every image, the image's width: Expand | Explain | Play [| Show still image], equal widths filling the row. */
.image-action-tools[data-media-width]{display:grid!important;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);grid-template-columns:none!important;gap:6px;width:min(100%,var(--media-w,100%))!important;max-width:none!important;margin:10px auto 0!important;box-sizing:border-box}
.image-action-tools[data-media-width]>*{grid-column:auto!important;grid-row:auto!important;width:100%!important;min-width:0!important;max-width:none!important;margin:0!important;white-space:normal;display:inline-flex;align-items:center;justify-content:center;text-align:center;box-sizing:border-box}
.image-action-tools[data-media-width] button{min-height:44px;padding:8px 6px;font:600 .8rem/1.2 var(--sans)}
@media(max-width:600px){.image-action-tools[data-media-width]{gap:4px}.image-action-tools[data-media-width] button{font-size:.7rem;padding:6px 3px}}
.motion-preview-frame+.image-action-tools,.motion-preview+.image-action-tools{margin-bottom:0!important}

/* Previous at the far left, Next at the far right, one row, everywhere. */
.manuscript-sheet>figcaption{display:flex!important;flex-direction:column;align-items:stretch;gap:8px}
.manuscript-pager{display:flex!important;flex-wrap:nowrap!important;justify-content:space-between!important;align-items:center;width:100%;gap:12px}
.manuscript-pager a{flex:0 0 auto!important;min-width:min(44%,180px)}
.manuscript-pager a[rel=next]{margin-left:auto}
.reading-pagination{display:flex!important;flex-wrap:nowrap;justify-content:space-between!important;align-items:center}
.reading-pagination>[rel=prev]{margin-right:auto}.reading-pagination>[rel=next]{margin-left:auto}

/* Interpretive badge: smaller on phones. */
@media(max-width:600px){.motion-interpretive-badge{font-size:.6rem;padding:3px 7px;left:6px;top:6px}}

/* Phone header: logo, book icon, theme and EN/ES stay inside one bar at every width. */
@media(max-width:800px){
 .site-header{flex-wrap:nowrap!important;height:auto!important;min-height:64px;gap:8px!important}
 .site-header>.brand{flex:1 1 auto;min-width:0}
 .site-header .brand-nameplate{width:clamp(84px,30vw,150px)!important;height:auto!important}
 .site-header .brand-crest{width:clamp(36px,11vw,56px)!important;height:auto!important}
 .site-header>.header-tools{flex:0 0 auto;gap:clamp(4px,2vw,12px)!important}
 .site-header .theme-toggle>span{display:none}
}

/* Phone splash: Enter the library, Explore the animation gallery and Pause share one smaller width. */
@media(max-width:800px){
 .welcome-theater.welcome-splash .welcome-enter,.welcome-theater.welcome-splash .cinematic-entry-actions .button.outline,.welcome-theater.welcome-splash .cinematic-toggle{width:min(250px,76vw)!important;min-height:44px!important;padding:10px 12px!important;font-size:.8rem!important;letter-spacing:.06em!important;display:inline-flex!important;justify-content:center;align-items:center;box-sizing:border-box;margin-inline:auto}
 .welcome-theater.welcome-splash .cinematic-controls{left:50%!important;right:auto!important;transform:translateX(-50%)}
}

/* Phone Explore the collection: compact cards. */
@media(max-width:800px){
 .experience-home .journey-strip a{min-height:0!important;padding:16px 16px!important;min-width:min(240px,70vw)!important;gap:6px!important}
 .experience-home .journey-strip a strong{font-size:1.2rem!important}
 .experience-home .journey-strip a small{font-size:.85rem!important}
}

/* Page ending: photo, then signature, then the title, centred; no Expand/Explain buttons. */
.page-author-signature{display:flex!important;flex-direction:column!important;align-items:center!important;text-align:center!important;gap:10px}
.page-author-signature .author-signature-composition{display:flex!important;flex-direction:column!important;align-items:center!important;gap:10px}
.page-author-signature .image-action-tools{display:none!important}
/* Gallery cards follow the same one-row rule. */
.gallery-image-actions.image-action-tools{display:grid!important;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);grid-template-columns:none!important;gap:6px;width:min(100%,var(--media-w,100%))!important;max-width:none!important;margin:10px auto 0!important;box-sizing:border-box}
.gallery-image-actions.image-action-tools>*{grid-column:auto!important;width:100%!important;min-width:0!important;margin:0!important;white-space:normal;display:inline-flex;align-items:center;justify-content:center;text-align:center;min-height:44px;padding:8px 6px;font:600 .8rem/1.2 var(--sans);box-sizing:border-box}
@media(max-width:600px){.gallery-image-actions.image-action-tools>*{font-size:.7rem;padding:6px 3px}}
@media(max-width:800px){.welcome-theater.welcome-splash .welcome-enter{max-width:none!important;flex:0 0 auto}
 .experience-home .journey-strip{align-items:flex-start!important}.experience-home .journey-strip a{min-width:min(270px,76vw)!important;padding:14px 16px!important}}

/* iPhone video fixes (30 Nov 2026). */
.cinematic-background video{opacity:.01}
.cinematic-background.background-playing video{opacity:1}
.motion-preview-frame>video{opacity:.01}
.motion-preview.is-playing .motion-preview-frame>video{opacity:1}
.image-action-tools .motion-preview-toggle,.gallery-image-actions .motion-preview-toggle{background:var(--panel,#102541)!important;color:#f4f0e6!important;border:1px solid rgba(230,195,126,.55)!important}
.image-action-tools .motion-preview-toggle[aria-pressed=true],.gallery-image-actions .motion-preview-toggle[aria-pressed=true]{background:#e6c37e!important;color:#07172f!important}
[data-theme=light] .image-action-tools .motion-preview-toggle,[data-theme=light] .gallery-image-actions .motion-preview-toggle{background:#f4efe1!important;color:#192a39!important;border-color:#b99a56!important}
.image-action-tools button,.gallery-image-actions button,.motion-preview-toggle,.cinematic-controls button{touch-action:manipulation;-webkit-tap-highlight-color:rgba(230,195,126,.25);position:relative;z-index:1}
.motion-preview-toggle [data-preview-label]{display:inline!important;color:inherit!important;font-size:inherit!important}

/* ---- Compact home bottom, hero controls, narrow button labels (30 Nov 2026) ---- */
/* Cover hero: Larger view and Play/Pause background video in one centred row with a gap (never overlapping). */
.cinematic-controls{display:flex!important;flex-wrap:wrap;justify-content:center!important;align-items:center;gap:12px!important}
.cinematic-controls .cinematic-toggle,.cinematic-controls .cinematic-fit{position:static!important;inset:auto!important;transform:none!important;margin:0!important;max-width:none}
@media(max-width:600px){.cinematic-controls{gap:8px!important}.cinematic-controls button{flex:0 1 auto}}
/* Button rows: the label is enough; the small play icon is dropped so narrow rows never overflow. */
.image-action-tools[data-media-width] .motion-preview-toggle>span[aria-hidden],.gallery-image-actions .motion-preview-toggle>span[aria-hidden]{display:none}
.image-action-tools[data-media-width] button{overflow-wrap:normal;word-break:normal;hyphens:none}
.volume-art .image-action-tools[data-media-width] button,.reading-card .image-action-tools[data-media-width] button{font-size:.68rem;padding:6px 3px;line-height:1.15}
/* Home: compact space after the book cards, the Terra Realm block and the page ending. */
.experience-home .home-books{padding-bottom:clamp(16px,3vw,32px)!important;margin-bottom:0!important}
.experience-home .terra-feature{padding-block:clamp(24px,4vw,48px)!important;margin-block:0!important;min-height:0!important;gap:clamp(20px,4vw,56px)!important;align-items:center}
.experience-home .terra-feature img{max-height:min(520px,60vh);width:auto;height:auto}
@media(max-width:800px){.experience-home .terra-feature img{max-height:none;width:min(100%,300px);margin-inline:auto}}
/* Page ending: photo, signature and title close together. */
.page-author-signature{padding-block:clamp(20px,3vw,32px)!important;margin-block:clamp(16px,3vw,32px)!important;min-height:0!important;gap:6px!important}
.page-author-signature .author-signature-composition{gap:6px!important;min-height:0!important;padding:0!important;margin:0!important}
.page-author-signature .signature-portrait{width:72px!important;height:72px!important;margin:0!important}
.page-author-signature .signature-calligraphy-vector,.page-author-signature svg,.page-author-signature .saved-author-signature{max-width:min(340px,80vw)!important;max-height:120px!important;width:auto;height:auto;margin:0!important}
.page-author-signature p{margin:0!important}

/* Real-iPhone fixes (30 Nov 2026). */
/* Hero video visible on load (the poster shows until frames arrive); no reduced-motion hiding. */
.cinematic-background video{opacity:1!important}
@media(prefers-reduced-motion:reduce){.welcome-theater.welcome-splash .cinematic-background video{display:block!important}.welcome-theater.welcome-splash .cinematic-toggle,.cinematic-controls .cinematic-toggle{display:inline-flex!important}}
/* Signature images by theme. */
.signature-calligraphy-vector{display:inline-block;line-height:0}
.signature-ink img{display:block;width:min(340px,80vw);height:auto}
.signature-ink-on-light{display:none}
[data-theme=light] .signature-ink-on-dark{display:none}
[data-theme=light] .signature-ink-on-light{display:block}
/* Narrow button rows: text scales with the row so whole words fit (no overflow, no split words). */
.image-action-tools[data-media-width][style*="--media-w"],.gallery-image-actions{container-type:inline-size}
@supports(font-size:1cqi){.image-action-tools[data-media-width][style*="--media-w"] button,.gallery-image-actions button{font-size:clamp(.56rem,4.3cqi,.8rem)!important;padding-inline:3px!important;letter-spacing:0}}

/* Animated images (30 Nov 2026): the video is always visible over the still (iOS will not play an invisible muted video).
   With no source it paints nothing, so the still shows until frames arrive. */
.motion-preview-frame>video,.motion-preview .motion-preview-frame>video{opacity:1!important;visibility:visible!important;background:transparent!important}
.motion-preview.showing-still .motion-preview-frame>video{opacity:0!important}

/* Illustrated signatures as images (30 Nov 2026): light ink on the dark theme, dark ink on the light theme; no filters. */
.signature-design{display:block;line-height:0;margin-inline:auto;max-width:min(420px,86vw)}
.signature-design img{display:block;width:100%;height:auto;filter:none!important;background:transparent!important;mix-blend-mode:normal!important}
.signature-design-on-light{display:none}
[data-theme=light] .signature-design-on-dark{display:none}
[data-theme=light] .signature-design-on-light{display:block}
.signature-collection .signature-design{max-width:min(640px,100%)}
.page-author-signature .signature-design{max-width:min(380px,82vw)}
/* iOS draws its own large "start playback" button on a <video autoplay> it has not started; our still image and
   Play/Pause button already cover that, so the native overlay is hidden (30 Nov 2026). */
.motion-preview video::-webkit-media-controls-start-playback-button,.cinematic-background video::-webkit-media-controls-start-playback-button{display:none!important;-webkit-appearance:none;opacity:0!important}
.motion-preview video::-webkit-media-controls,.cinematic-background video::-webkit-media-controls,
.motion-preview video::-webkit-media-controls-overlay-play-button,.cinematic-background video::-webkit-media-controls-overlay-play-button,
.motion-preview video::-webkit-media-controls-panel,.cinematic-background video::-webkit-media-controls-panel,
.motion-preview video::-webkit-media-controls-play-button,.cinematic-background video::-webkit-media-controls-play-button{display:none!important;-webkit-appearance:none}
