.project-gallery{margin:32px 0;padding:24px 0;border-top:1px solid var(--line,#dcc9aa)}.project-gallery-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.project-gallery-photo{font:inherit;text-align:left;border:1px solid #dcc9aa;border-radius:14px;padding:0;overflow:hidden;background:#fffaf1;color:#153f5b;cursor:pointer;min-width:0}.project-gallery-photo img{display:block;width:100%;height:180px;object-fit:cover}.project-gallery-photo span{display:block;padding:12px;font-size:16px;line-height:1.4}.project-gallery-photo:focus-visible,.project-gallery-dialog button:focus-visible{outline:3px solid #b67811;outline-offset:3px}.project-gallery-dialog{border:0;border-radius:16px;padding:16px;background:#fffaf1;color:#153f5b;width:min(960px,95vw);max-height:94dvh;overflow:auto}.project-gallery-dialog::backdrop{background:rgba(0,0,0,.85)}.project-gallery-dialog header{display:flex;justify-content:space-between;align-items:center;padding:0 0 12px;gap:12px}.project-gallery-dialog button{font:inherit;background:#153f5b;color:white;border:0;padding:10px 16px;border-radius:24px;cursor:pointer;min-height:44px}.project-gallery-dialog figure{margin:0;text-align:center}.project-gallery-dialog img{display:block;width:100%;max-height:65dvh;object-fit:contain}.project-gallery-dialog figcaption{padding:14px 0;font-size:18px}.project-gallery-dialog nav{display:flex;justify-content:space-between;gap:12px}.project-gallery-count{font-size:16px}@media(max-width:600px){.project-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.project-gallery-photo img{height:135px}.project-gallery-photo span{font-size:14px;padding:9px}.project-gallery-dialog nav button{font-size:15px;padding:10px}}
/* Immersive photo viewer: controls overlay the image, leaving its full area available. */
.project-gallery-dialog{position:fixed;inset:0;margin:0;width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;padding:0;border-radius:0;background:#080808;color:white;overflow:hidden;box-sizing:border-box}.project-gallery-dialog figure{position:absolute;inset:0;margin:0;display:flex;align-items:center;justify-content:center}.project-gallery-dialog img{width:100%;height:100%;max-height:none;object-fit:contain;touch-action:pinch-zoom;user-select:none;-webkit-user-select:none}.project-gallery-dialog header{position:absolute;z-index:2;top:0;left:0;right:0;padding:calc(12px + env(safe-area-inset-top)) 16px 24px;background:linear-gradient(#000b,transparent)}.project-gallery-dialog nav{position:absolute;z-index:2;bottom:0;left:0;right:0;padding:24px 16px calc(12px + env(safe-area-inset-bottom));background:linear-gradient(transparent,#000b)}.project-gallery-dialog figcaption{position:absolute;z-index:1;bottom:calc(70px + env(safe-area-inset-bottom));left:12px;right:12px;padding:10px;font-size:17px;color:white;text-shadow:0 1px 4px #000;background:#0006;border-radius:8px;pointer-events:none}.project-gallery-dialog button{background:#162f45cc;border:1px solid #ffffff66}.project-gallery-dialog header,.project-gallery-dialog nav,.project-gallery-dialog figcaption{transition:opacity .25s}.project-gallery-dialog.controls-hidden header,.project-gallery-dialog.controls-hidden nav,.project-gallery-dialog.controls-hidden figcaption{opacity:0;pointer-events:none}.project-gallery-dialog .project-gallery-count{text-shadow:0 1px 4px #000}@media(prefers-reduced-motion:reduce){.project-gallery-dialog header,.project-gallery-dialog nav,.project-gallery-dialog figcaption{transition:none}}

/* Show complete portrait thumbnails so faces are never cropped. */
.book-gallery .project-gallery-photo{align-self:start}
.book-gallery .project-gallery-photo img{height:auto;aspect-ratio:auto;object-fit:contain}

/* Compact book gallery with native touch scrolling and full portraits. */
.project-gallery .project-gallery-grid{display:flex;gap:16px;overflow-x:auto;scroll-snap-type:x mandatory;scroll-padding:0;overscroll-behavior-x:contain;padding:4px 2px 12px;scrollbar-width:thin}
.project-gallery .project-gallery-photo{flex:0 0 260px;scroll-snap-align:start;align-self:stretch}
.project-gallery .project-gallery-photo img{width:100%;height:250px;aspect-ratio:auto;object-fit:contain;background:#f2ebdf}
.project-gallery .gallery-strip-nav{display:flex;justify-content:space-between;gap:12px;margin:12px 0}
.project-gallery .gallery-strip-nav button{font:inherit;font-size:16px;min-height:44px;border:1px solid #dcc9aa;border-radius:24px;padding:10px 16px;background:#153f5b;color:white;cursor:pointer}
.project-gallery .gallery-strip-nav button:disabled{opacity:.45;cursor:default}
.project-gallery .project-gallery-grid:focus-visible{outline:3px solid #b67811;outline-offset:3px}
@media(max-width:600px){.project-gallery .project-gallery-photo{flex-basis:76%}.project-gallery .project-gallery-photo img{height:220px}.project-gallery .gallery-strip-nav button{font-size:14px;padding:10px 12px}}

.project-gallery .project-gallery-grid{position:relative;padding-right:12%;scroll-padding-right:12%}
.project-gallery .project-gallery-photo{flex-basis:88%}
.project-gallery .project-gallery-photo img{height:clamp(260px,45vw,420px);object-fit:contain;background:#f2ebdf}
.project-gallery .gallery-strip-nav{align-items:center;flex-wrap:wrap}
.gallery-strip-position{font-size:16px;white-space:nowrap;text-align:center}
.gallery-photo-story{font-size:17px;line-height:1.65;max-width:760px;margin:16px auto}
.gallery-share-action{text-align:center;margin-top:20px}
.gallery-share-link{display:inline-block;color:#153f5b;border:1px solid #b89a51;border-radius:24px;padding:12px 20px;text-decoration:none;font-weight:600}
@media(max-width:600px){.project-gallery .project-gallery-photo{flex-basis:88%}.project-gallery .project-gallery-photo img{height:300px}.gallery-strip-position{order:3;flex-basis:100%}}

.project-gallery-dialog .gallery-more-info{position:absolute;z-index:3;bottom:calc(132px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);max-width:90%;white-space:normal;font-size:16px;transition:opacity .25s}
.project-gallery-dialog.controls-hidden .gallery-more-info{opacity:0;pointer-events:none}
.project-gallery-dialog .gallery-info-panel{position:absolute;z-index:5;inset:calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));margin:auto;max-width:720px;max-height:85dvh;overflow-y:auto;overscroll-behavior:contain;background:#fffaf1;color:#153f5b;border-radius:16px;padding:24px;text-align:left;box-sizing:border-box}
.project-gallery-dialog .gallery-info-panel[hidden],.project-gallery-dialog .gallery-more-info[hidden]{display:none}
.project-gallery-dialog .gallery-info-panel p{font-size:19px;line-height:1.75;color:#2f2a25}
.project-gallery-dialog .gallery-info-panel h2{font-size:25px;line-height:1.3}
.project-gallery-dialog .gallery-info-panel button{background:#153f5b;color:white}

/* Transparent photo information with readable text over the image. */
.project-gallery-dialog .gallery-info-panel{background:rgba(0,0,0,.38);color:#fff;border:1px solid rgba(255,255,255,.25);text-shadow:0 1px 3px #000,0 2px 8px #000;box-shadow:none}
.project-gallery-dialog .gallery-info-panel p,.project-gallery-dialog .gallery-info-panel h2{color:#fff}
.project-gallery-dialog .gallery-info-panel button{background:rgba(21,63,91,.78);border:1px solid #ffffff80;text-shadow:none}

/* Match each complete photo card to the text column below it. */
.project-gallery .project-gallery-grid{width:100%;max-width:760px;margin-left:auto;margin-right:auto;padding:0 0 12px;scroll-padding:0;align-items:flex-start;box-sizing:border-box}
.project-gallery .project-gallery-photo{flex:0 0 100%;width:100%;box-sizing:border-box;align-self:flex-start}
.project-gallery .project-gallery-photo img{display:block;width:100%;height:auto;aspect-ratio:auto;object-fit:contain}
.project-gallery .gallery-strip-nav{max-width:760px;margin-left:auto;margin-right:auto}
.project-gallery .gallery-photo-story{width:100%;max-width:760px;box-sizing:border-box}

.project-gallery{scroll-margin-top:100px}

.project-gallery-dialog header{flex-wrap:wrap;gap:8px}.project-gallery-dialog header button{font-size:16px;padding:10px 13px}

/* Follow the visible card height, including landscape photos, without a portrait-sized gap. */
.project-gallery .project-gallery-grid{overflow-y:hidden;min-height:0;align-items:flex-start}

/* Discreet transparent controls keep the photograph visible. */
.project-gallery-dialog button,.project-gallery-dialog header button,.project-gallery-dialog .gallery-info-panel button{background:transparent;border-color:transparent;box-shadow:none;color:#fff;text-shadow:0 1px 3px #000,0 0 6px #000;font-size:14px;font-weight:400;padding:7px 9px;min-height:44px;border-radius:8px}
.project-gallery-dialog header,.project-gallery-dialog nav{background:none}
.project-gallery-dialog .gallery-more-info{background:transparent;font-size:14px;padding:6px 10px}
.project-gallery-dialog figcaption{background:transparent;font-size:15px;padding:6px;text-shadow:0 1px 3px #000,0 0 6px #000}
.project-gallery-dialog button:hover,.project-gallery-dialog button:focus-visible{background:#0002}

/* Photo stories appear automatically below the complete image and remain readable. */
.project-gallery-dialog.has-story figure{inset:calc(62px + env(safe-area-inset-top)) 0 45%}
.project-gallery-dialog.has-story figcaption{display:none}
.project-gallery-dialog.has-story .gallery-info-panel{position:absolute;inset:55% 0 calc(64px + env(safe-area-inset-bottom));width:100%;max-width:760px;max-height:none;margin:0 auto;padding:10px 20px 18px;border:0;border-radius:0;background:transparent;box-shadow:none;overflow-y:auto;touch-action:pan-y;scrollbar-width:thin;text-shadow:none}
.project-gallery-dialog.has-story .gallery-info-panel h2{font-size:18px;line-height:1.4;margin:0 0 10px}
.project-gallery-dialog.has-story .gallery-info-panel p{font-size:17px;line-height:1.6;margin:0;white-space:pre-line}
.project-gallery-dialog.has-story .gallery-info-panel button[hidden]{display:none}
@media(max-height:500px){.project-gallery-dialog.has-story figure{inset:52px 48% 55px 0}.project-gallery-dialog.has-story .gallery-info-panel{inset:52px 0 55px 52%;width:48%;padding:8px 14px}}

/* A single scrolling column: photo, navigation, then its story. */
.project-gallery-dialog{overflow-y:auto;overflow-x:hidden;padding:env(safe-area-inset-top) 16px env(safe-area-inset-bottom)}
.project-gallery-dialog header{position:relative;inset:auto;width:100%;max-width:760px;margin:0 auto;padding:8px 0;box-sizing:border-box}
.project-gallery-dialog figure,.project-gallery-dialog.has-story figure{position:relative;inset:auto;display:block;width:100%;max-width:760px;margin:0 auto}
.project-gallery-dialog img{display:block;width:100%;height:auto;max-height:none;object-fit:contain;touch-action:pan-y pinch-zoom}
.project-gallery-dialog figcaption{position:relative;inset:auto;padding:8px 0;margin:0}
.project-gallery-dialog nav{position:relative;inset:auto;width:100%;max-width:760px;margin:0 auto;padding:6px 0;box-sizing:border-box;display:flex;justify-content:space-between;gap:8px}
.project-gallery-dialog.has-story .gallery-info-panel{position:relative;inset:auto;width:100%;max-width:760px;max-height:none;margin:0 auto;padding:8px 0 24px;overflow:visible;box-sizing:border-box;touch-action:pan-y}
.project-gallery-dialog.controls-hidden nav{opacity:1;pointer-events:auto}
.project-gallery-dialog.has-story .gallery-info-panel h2{margin:0 0 10px}

/* The inline gallery mirrors the photo-first layout on its light background. */
.project-gallery .gallery-strip-nav{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:6px;margin:4px auto 8px;width:100%;max-width:760px}
.project-gallery .gallery-strip-nav button{background:transparent;color:#153f5b;border:1px solid transparent;border-radius:8px;box-shadow:none;font-size:14px;font-weight:400;min-height:44px;padding:6px 4px}
.project-gallery .gallery-strip-nav button:first-child{text-align:left;justify-self:start}
.project-gallery .gallery-strip-nav button:last-child{text-align:right;justify-self:end}
.project-gallery .gallery-strip-position{order:0;font-size:12px;flex-basis:auto;color:#686159}
.project-gallery .gallery-strip-nav button:focus-visible{outline:2px solid #b67811;outline-offset:2px}
.project-gallery .gallery-photo-story{margin:8px auto 0;padding:0;width:100%;max-width:760px}
.project-gallery .project-gallery-grid{padding-bottom:0}

/* Group gallery controls above the image; keep photo and story uninterrupted. */
.project-gallery .gallery-strip-nav{margin:4px auto 8px}
.project-gallery .gallery-strip-nav button{font-size:13px;line-height:1.3;max-width:100%}
.project-gallery .gallery-strip-position{font-size:12px}
.project-gallery-dialog nav{padding:0 0 8px}
.project-gallery-dialog.controls-hidden header{opacity:1;pointer-events:auto}
.project-gallery-dialog.has-story .gallery-info-panel{padding-top:12px}

.project-gallery .gallery-share-action{max-width:760px;margin:4px auto 0;text-align:right}
.project-gallery .gallery-share-action .gallery-share-link{border:0;border-radius:8px;padding:6px 4px;font-size:13px;font-weight:400;min-height:44px;box-sizing:border-box;display:inline-flex;align-items:center;background:transparent}

/* Unified warm gallery theme for book and project photos, including future entries. */
.project-gallery,.project-gallery-dialog{--gallery-paper:#f3ecdf;--gallery-ink:#35312c;--gallery-blue:#153f5b;--gallery-line:#d5c4a5}
.project-gallery-dialog{background:var(--gallery-paper);color:var(--gallery-ink)}
.project-gallery-dialog .gallery-info-panel,.project-gallery-dialog.has-story .gallery-info-panel{background:transparent;color:var(--gallery-ink);border:0;text-shadow:none;box-shadow:none}
.project-gallery-dialog .gallery-info-panel p,.project-gallery-dialog .gallery-info-panel h2,.project-gallery-dialog figcaption{color:var(--gallery-ink);text-shadow:none}
.project-gallery-dialog figcaption{background:transparent}
.project-gallery-dialog .gallery-toolbar,.project-gallery .gallery-inline-toolbar{width:100%;max-width:760px;margin:0 auto 8px;padding:0;box-sizing:border-box;background:transparent;color:var(--gallery-blue);border-bottom:1px solid var(--gallery-line)}
.project-gallery-dialog .gallery-toolbar header,.project-gallery-dialog .gallery-toolbar nav{background:transparent}
.project-gallery-dialog .gallery-toolbar button,.project-gallery-dialog .gallery-toolbar header button,.project-gallery-dialog .gallery-toolbar nav button,.project-gallery .gallery-inline-toolbar .gallery-strip-nav button,.project-gallery .gallery-inline-toolbar .gallery-share-link{background:transparent;color:var(--gallery-blue);border:0;border-radius:6px;box-shadow:none;text-shadow:none;font-weight:400;min-height:44px;padding:7px 6px}
.project-gallery-dialog .gallery-toolbar .project-gallery-count,.project-gallery .gallery-inline-toolbar .gallery-strip-position{color:var(--gallery-blue);text-shadow:none}
.project-gallery .gallery-inline-toolbar .gallery-share-action{margin:0;max-width:none}
.project-gallery .gallery-inline-toolbar .gallery-strip-nav{margin:0;max-width:none}
.project-gallery-dialog .gallery-toolbar button:hover,.project-gallery .gallery-inline-toolbar button:hover,.project-gallery .gallery-inline-toolbar a:hover{background:#153f5b0b}
.project-gallery-dialog .gallery-toolbar button:focus-visible,.project-gallery .gallery-inline-toolbar button:focus-visible,.project-gallery .gallery-inline-toolbar a:focus-visible{outline:2px solid var(--gallery-blue);outline-offset:1px}
.project-gallery .gallery-photo-story{color:var(--gallery-ink)}
.project-gallery .project-gallery-photo{background:var(--gallery-paper);border-color:var(--gallery-line)}
.project-gallery .project-gallery-photo span{background:var(--gallery-paper);color:var(--gallery-blue)}

/* Match the inline controls to the warm photo caption background. */
.project-gallery .gallery-inline-toolbar{background:var(--gallery-paper);border-radius:8px 8px 0 0}
.project-gallery .gallery-inline-toolbar .gallery-share-action,.project-gallery .gallery-inline-toolbar .gallery-strip-nav{background:transparent}
