/* Timber Build universal gallery v1.0 — scoped styles, no page-wide resets. */
:where(.tbGallery,.tbGalleryViewer){--tbg-ink:#242424;--tbg-muted:#626866;--tbg-brown:#654321;--tbg-border:#d1cfc9;--tbg-cream:#f4f1ea;--tbg-red:#d90000;color:var(--tbg-ink);font-family:inherit;line-height:1.5}
.tbGallery,.tbGallery *,.tbGalleryViewer,.tbGalleryViewer *{box-sizing:border-box}
.tbGallery [hidden],.tbGalleryViewer [hidden]{display:none!important}
.tbGallery{width:100%;min-width:0;container:tb-gallery / inline-size}
.tbGallery-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.tbGallery[data-columns="4"] .tbGallery-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.tbGallery[data-columns="5"] .tbGallery-grid{grid-template-columns:repeat(5,minmax(0,1fr))}
.tbGallery .tbGallery-card{display:flex;flex-direction:column;min-width:0;margin:0;overflow:hidden;border:1px solid var(--tbg-border);border-radius:8px;background:#fff;color:var(--tbg-ink);text-decoration:none!important;box-shadow:none;transition:border-color .15s,box-shadow .15s}
.tbGallery .tbGallery-card:hover{color:var(--tbg-ink);border-color:#a89b8b;box-shadow:0 3px 10px #6543211a;text-decoration:none}
.tbGallery-card:focus-visible,.tbGalleryViewer :is(button,a):focus-visible{outline:3px solid #276a85;outline-offset:3px}
.tbGallery-media{position:relative;aspect-ratio:1;background:var(--tbg-cream);overflow:hidden}
.tbGallery-media img{display:block;width:100%;height:100%;max-width:none;object-fit:cover;margin:0;padding:0;border:0}
.tbGallery-placeholder{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;padding:20px;background:var(--tbg-cream);color:var(--tbg-brown);font-size:13px;text-align:center}
.tbGallery .tbGallery-placeholder svg{display:none}
.tbGallery-placeholder::before{content:'';width:22px;height:22px;border:2px solid #dedbd3;border-top-color:#9c8b76;border-radius:50%}
.tbGallery[data-loading] .tbGallery-placeholder>svg{animation:tbGallery-pulse 1.2s ease-in-out infinite alternate}
@keyframes tbGallery-pulse{to{opacity:.25}}
.tbGallery-count{position:absolute;bottom:10px;right:10px;background:#fffffff2;color:var(--tbg-brown);border:1px solid #ffffffb3;border-radius:4px;padding:3px 8px;font-size:12px;font-weight:700;line-height:1.5;box-shadow:0 1px 4px #0002}
.tbGallery-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;flex:1;padding:10px 12px;min-height:68px;background:#fff}
.tbGallery-footer h3{flex:1 1 90px;margin:0;color:var(--tbg-ink);font-size:13px;font-weight:700;line-height:1.4;letter-spacing:.035em;text-transform:uppercase;overflow-wrap:anywhere}
.tbGallery-action,.tbGalleryViewer .tbGallery-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;border:1px solid var(--tbg-border);border-radius:4px;background:var(--tbg-cream);color:var(--tbg-brown);padding:8px 11px;font-family:inherit;font-size:13px;font-weight:700;line-height:1.3;text-decoration:none!important;white-space:nowrap;box-shadow:0 2px 0 var(--tbg-border)}
.tbGallery-action{flex:none;font-size:12px}
.tbGallery :is(svg),.tbGalleryViewer svg{display:block;width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
.tbGallery-action svg{width:16px;height:16px}
.tbGallery-card{container:tb-gallery-card / inline-size}
/* Keep the full accessible name on the tile. Only the visual action label collapses. */
@container tb-gallery-card (max-width:270px){
 .tbGallery-actionLabel{display:none}
 .tbGallery-action{width:44px;min-width:44px;height:44px;padding:0;gap:0}
 .tbGallery-action svg{width:20px;height:20px}
}
/* The theme's shared compact/mobile breakpoint is 800px. */
@media(max-width:800px){
 .tbGallery-actionLabel{display:none}
 .tbGallery-action{width:44px;min-width:44px;height:44px;padding:0;gap:0}
 .tbGallery-action svg{width:20px;height:20px}
}
.tbGallery-note{font-size:13px;color:var(--tbg-muted);margin:14px 0 0}
@container tb-gallery (max-width:1140px){.tbGallery[data-columns="5"] .tbGallery-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@container tb-gallery (max-width:940px){.tbGallery[data-columns] .tbGallery-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@container tb-gallery (max-width:720px){.tbGallery[data-columns] .tbGallery-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@container tb-gallery (max-width:480px){.tbGallery[data-columns] .tbGallery-grid{grid-template-columns:minmax(0,1fr)}.tbGallery-media{aspect-ratio:4/3}}
@supports not (container-type:inline-size){@media(max-width:980px){.tbGallery[data-columns] .tbGallery-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:560px){.tbGallery[data-columns] .tbGallery-grid{grid-template-columns:minmax(0,1fr)}}}
.tbGalleryViewer{position:fixed;inset:0;display:none;width:min(1280px,calc(100vw - 48px));height:min(960px,calc(100dvh - 48px));max-width:none;max-height:none;margin:auto;padding:0;border:1px solid var(--tbg-border);border-radius:8px;background:#fff;overflow:hidden;box-shadow:0 24px 80px #0007}
.tbGalleryViewer[open]{display:flex;flex-direction:column}
.tbGalleryViewer::backdrop{background:#14120ed9}
.tbGalleryViewer-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 16px;border-bottom:1px solid var(--tbg-border);flex:none}
.tbGalleryViewer-heading{min-width:0;display:flex;align-items:center;gap:10px}
.tbGalleryViewer-heading>svg{color:var(--tbg-brown);width:23px;height:23px}
.tbGalleryViewer-heading h2{margin:0;font-size:17px;line-height:1.3;overflow-wrap:anywhere}
.tbGalleryViewer .tbGallery-close{width:44px;padding:0;box-shadow:none;flex:none}
.tbGalleryViewer-stage{position:relative;min-height:80px;flex:1;background:#171716;isolation:isolate;touch-action:pan-y pinch-zoom}
.tbGalleryViewer-photo{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;overflow:hidden}
.tbGalleryViewer-photo img{display:block;width:100%;height:100%;object-fit:contain;opacity:0}
.tbGalleryViewer-photo img[data-ready]{opacity:1}
.tbGalleryViewer-photo img.tbGalleryViewer-preview{position:absolute;inset:0;opacity:1;pointer-events:none}
.tbGalleryViewer .tbGallery-arrow{position:absolute;top:50%;transform:translateY(-50%);width:44px;height:44px;padding:0;border-radius:50%;background:#fffffff2;box-shadow:0 2px 6px #0003;z-index:2}
.tbGallery-arrow--prev{left:12px}.tbGallery-arrow--next{right:12px}
.tbGalleryViewer .tbGallery-button{cursor:pointer}
.tbGalleryViewer .tbGallery-button:hover{background:#e9e4da}
.tbGalleryViewer button:disabled{opacity:.35;cursor:default}
.tbGalleryViewer-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:8px 16px 0;background:#fff}
.tbGalleryViewer-toolbar p{margin:0;font-size:13px;font-weight:700;font-variant-numeric:tabular-nums;min-width:68px}
.tbGalleryViewer-toolbar>div{display:flex;align-items:center;gap:10px}
.tbGalleryViewer .tbGallery-original{font-size:12px;box-shadow:none;background:white}
.tbGalleryViewer-thumbs{display:flex;gap:8px;flex:none;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;padding:10px 16px 13px;scroll-padding-inline:16px;scrollbar-width:thin;scrollbar-color:#a89b8b #f4f1ea;background:#fff}
.tbGallery-thumb{display:block;position:relative;flex:0 0 76px;width:76px;height:60px;min-height:44px;border:2px solid transparent;background:var(--tbg-cream);border-radius:5px;overflow:hidden;cursor:pointer;padding:2px}
.tbGallery-thumb img{display:block;width:100%;height:100%;object-fit:cover;border-radius:2px}
.tbGallery-thumb[aria-current="true"]{border-color:var(--tbg-red)}
.tbGalleryViewer-note{margin:0;padding:0 16px 10px;color:var(--tbg-muted);font-size:12px}
.tbGalleryViewer-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:16px;z-index:1;pointer-events:none}
.tbGalleryViewer-loadingCard{display:flex;align-items:center;gap:16px;max-width:370px;padding:18px 20px;border:1px solid #b9cdd2;border-radius:12px;background:#fffffff7;box-shadow:0 3px 0 #d5e3e6,0 8px 24px #173d491f;color:#173d49;pointer-events:auto}
.tbGalleryViewer-loadingCard p{margin:0;font-size:14px;font-weight:600;line-height:1.5}
.tbGalleryViewer-loadingCard button{margin-top:10px}
.tbGalleryViewer-mark{position:relative;display:grid;place-items:center;flex:0 0 54px;width:54px;height:54px;background:#fff;border-radius:50%}
.tbGalleryViewer-mark::after{content:'';position:absolute;inset:0;border:2px solid #d4eaef;border-top-color:#08738f;border-right-color:#21a6c4;border-radius:50%;animation:tbGallery-orbit 1.25s linear infinite}
.tbGalleryViewer-mark img{width:40px;height:40px;object-fit:contain}
.tbGalleryViewer-loading[data-error] .tbGalleryViewer-mark::after{animation:none;border-color:#a8bcc1}
.tbGalleryViewer-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@keyframes tbGallery-orbit{to{transform:rotate(360deg)}}
@media(max-width:600px){
 .tbGalleryViewer{width:100%;height:100vh;height:var(--tbg-visible-height,100dvh);top:var(--tbg-visible-top,0px);bottom:auto;max-width:100%;margin:0;border:0;border-radius:0}
 .tbGalleryViewer-header{padding:calc(8px + env(safe-area-inset-top)) 12px 8px;gap:8px}
 .tbGalleryViewer-heading{gap:8px}.tbGalleryViewer-heading h2{font-size:15px}
 .tbGalleryViewer-heading>svg{display:none}
 .tbGalleryViewer-toolbar{padding:8px 10px 0;gap:6px}.tbGalleryViewer-toolbar>div{gap:6px}
 .tbGalleryViewer .tbGallery-button{font-size:12px;padding-inline:9px}.tbGalleryViewer .tbGallery-close,.tbGalleryViewer .tbGallery-arrow{padding:0}
 .tbGalleryViewer-thumbs{padding:10px 12px calc(12px + env(safe-area-inset-bottom));gap:7px}
 .tbGallery-arrow--prev{left:8px}.tbGallery-arrow--next{right:8px}
 .tbGalleryViewer-mark{flex-basis:44px;width:44px;height:44px}.tbGalleryViewer-mark img{width:32px;height:32px}.tbGalleryViewer-loadingCard{gap:12px;padding:14px}
}
@media(prefers-reduced-motion:reduce){.tbGalleryViewer-mark::after,.tbGallery[data-loading] .tbGallery-placeholder>svg{animation:none}.tbGallery-card{transition:none}}

/* Category directory: opt-in links only; existing single-album galleries are unchanged. */
.tbGalleryCategory,.tbGalleryCategory *{box-sizing:border-box}
.tbGalleryCategory{--tbg-ink:#242424;--tbg-muted:#626866;--tbg-brown:#654321;--tbg-border:#d1cfc9;--tbg-cream:#f4f1ea;--tbg-red:#d90000;position:fixed;inset:0 auto 0 0;display:none;flex-direction:column;width:min(1100px,92vw);height:100dvh;max-width:100%;max-height:none;margin:0;padding:0;border:0;border-right:1px solid var(--tbg-border);background:#fff;color:var(--tbg-ink);font-family:inherit;line-height:1.5;overflow:hidden;box-shadow:12px 0 60px #0004}
.tbGalleryCategory[open]{display:flex}
.tbGalleryCategory [hidden]{display:none!important}
.tbGalleryCategory::backdrop{background:#14120ea6}
.tbGalleryCategory-header{display:flex;align-items:center;justify-content:space-between;gap:16px;flex:none;padding:18px 24px;border-bottom:1px solid #e6e3dc;background:#fcfdfd}
.tbGalleryCategory-header>div{min-width:0}
.tbGalleryCategory-header h2{margin:0;font-size:22px;line-height:1.3;overflow-wrap:anywhere}
.tbGalleryCategory-header p{margin:4px 0 0;font-size:14px;color:var(--tbg-muted)}
.tbGalleryCategory .tbGallery-button,.tbGallery-categoryAction{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;border:1px solid var(--tbg-border);border-radius:5px;background:var(--tbg-cream);color:var(--tbg-brown);padding:10px 14px;text-decoration:none!important;cursor:pointer}
.tbGallery-categoryAction{font-family:inherit;font-size:14px;font-weight:700;line-height:1.35}
.tbGalleryCategory .tbGallery-button{font-family:inherit;font-size:14px;font-weight:700;line-height:1.35}
.tbGalleryCategory .tbGallery-button:hover,.tbGallery-categoryAction:hover{background:#e5e0d5;color:var(--tbg-brown)}
.tbGalleryCategory [data-category-close]{flex:none;width:44px;padding:0}
.tbGalleryCategory svg,.tbGallery-categoryAction svg{display:block;width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.tbGalleryCategory :is(button,a,input):focus-visible,.tbGallery-categoryAction:focus-visible{outline:3px solid #276a85;outline-offset:3px}
.tbGalleryCategory button:disabled{opacity:.5;cursor:default}
.tbGalleryCategory-tools{flex:none;padding:16px 24px 12px;border-bottom:1px solid #ece9e2;background:#fff}
.tbGalleryCategory-tools label{display:block;margin-bottom:6px;font-size:14px;font-weight:700}
.tbGalleryCategory .tbGalleryCategory-searchToggle{display:none}
.tbGalleryCategory-searchRow{display:flex;gap:10px;align-items:center}
/* Override the storefront's more-specific type=search content-box reset. */
.tbGalleryCategory-tools input[type="search"]{box-sizing:border-box;min-width:0;width:100%;height:46px;min-height:46px;margin:0;padding:10px 12px;border:1px solid #bcbab4;border-radius:5px;background:#fff;color:#242424;font:inherit;font-size:16px;line-height:1.4;box-shadow:none}
.tbGalleryCategory-tools input:disabled{background:#f4f1ea}
.tbGalleryCategory-tools p{min-height:21px;margin:8px 0 0;color:var(--tbg-muted);font-size:13px}
.tbGalleryCategory-content{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:20px 24px 24px;scrollbar-gutter:stable}
.tbGalleryCategory-content:focus-visible{outline:3px solid #276a85;outline-offset:-3px}
.tbGalleryCategory-page+.tbGalleryCategory-page{margin-top:16px}
.tbGalleryCategory [data-category-status]{padding:24px 16px;text-align:center;border:1px solid var(--tbg-border);border-radius:8px;background:var(--tbg-cream);color:var(--tbg-brown);font-size:15px}
.tbGalleryCategory [data-category-status][data-loading]::before{content:'';display:inline-block;width:18px;height:18px;margin-right:10px;border:2px solid #d1cfc9;border-top-color:#654321;border-radius:50%;vertical-align:middle;animation:tbGallery-orbit 1s linear infinite}
.tbGalleryCategory [data-category-retry]{margin-top:12px}
.tbGalleryCategory .tbGalleryCategory-more{display:flex;min-width:220px;margin:24px auto 0}
.tbGalleryCategory-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;flex:none;padding:12px 24px;border-top:1px solid #e6e3dc;background:#fcfdfd;font-size:12px;color:var(--tbg-muted)}
.tbGalleryCategory-footer .tbGallery-button{font-size:12px;flex:none}
.tbGallery-categoryLinks{display:flex;justify-content:center;flex-wrap:wrap;gap:12px;margin:18px 0 22px}
.tbGallery-intro{margin:0 0 16px;font-size:16px;line-height:1.6}
@media(max-width:800px){
 .tbGalleryCategory{width:100%;height:100vh;height:var(--tbg-visible-height,100dvh);top:var(--tbg-visible-top,0px);bottom:auto;border:0}
 .tbGalleryCategory-header{padding:calc(8px + env(safe-area-inset-top)) 16px 8px;gap:12px}
 .tbGalleryCategory-header h2{font-size:19px}
 .tbGalleryCategory-header p{display:none}
 .tbGalleryCategory-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:0 12px;padding:8px 16px}
 .tbGalleryCategory .tbGalleryCategory-searchToggle{display:inline-flex;grid-column:2;grid-row:1;padding:8px 10px;gap:6px}
 .tbGalleryCategory-searchToggle svg:last-child{width:16px;height:16px}
 .tbGalleryCategory-searchToggle[aria-expanded="true"] svg:last-child{transform:rotate(180deg)}
 .tbGalleryCategory-tools p{grid-column:1;grid-row:1;margin:0;min-height:0;line-height:1.4}
 .tbGalleryCategory-searchPanel{display:none;grid-column:1/-1;grid-row:2;padding-top:10px}
 .tbGalleryCategory[data-search-open] .tbGalleryCategory-searchPanel{display:block}
 .tbGalleryCategory-searchPanel label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 .tbGalleryCategory-content{padding:16px}
 .tbGalleryCategory-footer{padding:6px 16px calc(6px + env(safe-area-inset-bottom));justify-content:flex-end}
 .tbGalleryCategory-footer>span{display:none}
}
@media(prefers-reduced-motion:reduce){.tbGalleryCategory [data-category-status][data-loading]::before{animation:none}}
