/* Shared image-only gallery presentation. */
:is(#project-one,#project-two,#project-three) .book-support-body:has(.p1-gallery){padding:0!important;margin:0!important;max-width:none!important;width:100%}
:is(#project-one,#project-two,#project-three) .book-support-body:has(.p1-gallery)>h3{display:none!important}
:is(#project-one,#project-two,#project-three) .book-scroll:has(.p1-gallery){padding:12px 22px 20px!important;overflow-y:auto;overflow-x:hidden}
.p1-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;align-items:start}
.p1-gallery .p1-gallery-item{display:block;width:100%;min-width:0;padding:0;margin:0;border:0;border-radius:0;background:none;box-shadow:none;cursor:zoom-in;overflow:hidden;transform:none}
.p1-gallery .p1-gallery-item:focus-visible{outline:3px solid #7852ff;outline-offset:3px}
.p1-gallery-visual{position:relative;display:block;overflow:hidden;background:#161514;container-type:inline-size;isolation:isolate}
.p1-gallery-visual>img{position:relative;display:block;width:100%;height:auto;max-height:none;object-fit:contain;margin:0;border:0;border-radius:0}
.p1-gallery-focused>img:not(.p1-gallery-backdrop){clip-path:var(--p1-focus)}
.p1-gallery-focused>img.p1-gallery-backdrop{position:absolute;inset:0;width:100%;height:100%;filter:blur(5cqw) brightness(.42);transform:scale(1.12);pointer-events:none}
.p1-gallery-preview{width:min(100%,calc((100dvh - 150px)*1.775));margin:auto}
@media(max-width:900px){.p1-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}}
@media(max-width:560px){.p1-gallery{grid-template-columns:1fr}:is(#project-one,#project-two,#project-three) .book-scroll:has(.p1-gallery){padding:10px 12px 16px!important}}
/* Portrait showcase uses the full available page height. */
#project-three .book-scroll:has(.p3-gallery){display:flex;flex-direction:column;padding:8px 0!important;overflow:hidden;scrollbar-gutter:auto}
#project-three .book-support-body:has(.p3-gallery){height:100%;min-height:0;flex:1}
.p1-gallery.p3-gallery{display:flex;height:100%;min-height:0;gap:16px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#a9bee8 transparent;padding-bottom:8px;box-sizing:border-box}
.p3-gallery .p1-gallery-item{flex:0 0 auto;width:auto;height:92%;align-self:center;aspect-ratio:640/1136;scroll-snap-align:start}
.p3-gallery .p1-gallery-visual{height:100%;width:100%;container-type:normal;background:transparent}
.p3-gallery .p1-gallery-visual>img{width:100%;height:100%;object-fit:contain}
.p1-gallery-preview:has(img[src*="p3-showcase"]){width:auto;height:calc(100dvh - 150px)}
.p1-gallery-preview:has(img[src*="p3-showcase"]) .p1-gallery-visual{height:100%;background:transparent;container-type:normal}
.p1-gallery-preview img[src*="p3-showcase"]{height:100%;width:auto;max-width:100%;margin:auto;object-fit:contain}
/* Consistent landscape frames; crop only the supplied side gutters. */
#project-two .p1-gallery-visual{aspect-ratio:16/9;background:#252728}
#project-two .p1-gallery-visual>img{width:100%;height:100%;object-fit:cover}
#project-two .p1-gallery-visual>img[src*="p2-showcase-09"]{object-fit:contain}
