/* BUILD 1.6.0 — 2026-10-07 */
/* =====================================================================
   Boscoo — gallery.css  (Boscoo Gallery + Gallery Hero widgets)
   Loaded right after widgets.css. Uses the existing Boscoo tokens
   (--boscoo-*), section shell, eyebrow / h2, filter pill and button —
   this file only adds what the Gallery itself needs.
   Every colour reads an optional --boscoo-gal-* override (set from the
   widget's Style tab) and falls back to the site token.
   ===================================================================== */

/* =====================================================================
   1. SECTION SHELL + LOCAL TOKENS
   Doubled class (.boscoo-section.boscoo-gallery) so these rules win over
   the generic .boscoo-section shell whatever order the two sheets print in.
   ===================================================================== */
.boscoo-section.boscoo-gallery {
	--boscoo-gal-cols: var(--boscoo-gal-cols-m, 2);
	--boscoo-gal-gutter: calc(var(--boscoo-gal-gap, 16px) * 0.625);
	padding-block: 3.5rem 4.5rem;
	background: var(--boscoo-gal-bg, var(--boscoo-bg));
	max-width: 100%;
	overflow-x: hidden;
	overflow-x: clip;
}
@media (min-width: 768px) {
	.boscoo-section.boscoo-gallery {
		--boscoo-gal-cols: var(--boscoo-gal-cols-t, 2);
		--boscoo-gal-gutter: var(--boscoo-gal-gap, 16px);
		padding-block: 5rem 6rem;
	}
}
@media (min-width: 1024px) {
	.boscoo-section.boscoo-gallery { --boscoo-gal-cols: var(--boscoo-gal-cols-d, 3); }
}

/* Gallery hero — same Shop hero, framed a little higher for interiors */
.boscoo-shop-hero.boscoo-gallery-hero { background-position: center 58%; }

/* Excluded from the generic scroll-reveal (the grid is filterable) */
.boscoo-gallery.boscoo-no-reveal { opacity: 1; transform: none; }

/* =====================================================================
   2. HEADING — editorial split: title left, lead right
   ===================================================================== */
.boscoo-gallery-head {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.25rem;
	align-items: end;
}
@media (min-width: 900px) {
	.boscoo-gallery-head { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: 4rem; }
}
.boscoo-gallery-head-main { min-width: 0; }
.boscoo-gallery .boscoo-gallery-eyebrow { color: var(--boscoo-gal-eyebrow, var(--boscoo-bronze)); }
.boscoo-gallery .boscoo-gallery-title { color: var(--boscoo-gal-title, var(--boscoo-primary)); }
.boscoo-gallery-body {
	margin: 0;
	color: var(--boscoo-gal-text, var(--boscoo-stone));
	line-height: 1.7;
	max-width: 26rem;
}
@media (min-width: 900px) {
	.boscoo-gallery-body { justify-self: end; padding-bottom: 0.375rem; }
}

/* =====================================================================
   3. FILTER BAR — existing .boscoo-pill + image counts
   ===================================================================== */
.boscoo-gallery-bar {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--boscoo-gal-rule, var(--boscoo-border));
}
.boscoo-gallery-head + .boscoo-gallery-bar { margin-top: 2.5rem; }
@media (min-width: 768px) {
	.boscoo-gallery-head + .boscoo-gallery-bar { margin-top: 3.25rem; }
}
.boscoo-gallery-bar:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.boscoo-gallery-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	min-width: 0;
	max-width: 100%;
}

/* Theme-proof pill states (themes style <button>:hover/:focus globally) */
.boscoo-gallery .boscoo-gallery-pill,
.boscoo-gallery .boscoo-gallery-pill:focus {
	-webkit-appearance: none; appearance: none;
	display: inline-flex; align-items: center; flex: 0 0 auto;
	margin: 0;
	padding: 0.5rem 1rem;
	border: 1px solid var(--boscoo-gal-pill-border, var(--boscoo-border));
	border-radius: 9999px;
	background: transparent;
	background-image: none;
	box-shadow: none;
	color: var(--boscoo-gal-pill-text, var(--boscoo-primary));
	font-family: var(--boscoo-font);
	font-size: 0.6875rem; font-weight: 500; line-height: 1.2;
	letter-spacing: 0.22em; text-transform: uppercase; text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	outline: 0;
}
.boscoo-gallery .boscoo-gallery-pill:hover {
	background: var(--boscoo-gal-pill-hover, var(--boscoo-muted));
	color: var(--boscoo-gal-pill-text, var(--boscoo-primary));
	border-color: var(--boscoo-gal-pill-border, var(--boscoo-border));
}
.boscoo-gallery .boscoo-gallery-pill.is-active,
.boscoo-gallery .boscoo-gallery-pill.is-active:hover,
.boscoo-gallery .boscoo-gallery-pill.is-active:focus {
	background: var(--boscoo-gal-pill-on-bg, var(--boscoo-primary));
	border-color: var(--boscoo-gal-pill-on-bg, var(--boscoo-primary));
	color: var(--boscoo-gal-pill-on-fg, #fff);
}
.boscoo-gallery .boscoo-gallery-pill:focus-visible {
	outline: 2px solid var(--boscoo-gal-accent, var(--boscoo-bronze));
	outline-offset: 2px;
	box-shadow: none;
}
.boscoo-gallery-pill-label { display: inline-block; }
.boscoo-gallery-pill-n {
	display: inline-block;
	margin-left: 0.5rem;
	font-size: 0.625rem; letter-spacing: 0.06em;
	font-variant-numeric: tabular-nums;
	opacity: 0.5;
}
.boscoo-gallery-pill.is-active .boscoo-gallery-pill-n { opacity: 0.7; }

/* Mobile: one swipeable row of pills instead of three wrapped rows */
@media (max-width: 767px) {
	.boscoo-gallery-pills {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		-ms-overflow-style: none;
		margin-inline: -1.25rem;
		padding-inline: 1.25rem;
		max-width: none;
		scroll-padding-inline: 1.25rem;
	}
	.boscoo-gallery-pills::-webkit-scrollbar { display: none; }
}

/* =====================================================================
   4. GRID — masonry
   Before JS / without JS: CSS multi-column. With JS: equal flex columns,
   each image dropped into the shortest column (reads left → right and
   "View More" only ever adds below — nothing reshuffles).
   ===================================================================== */
.boscoo-gallery-grid {
	margin-top: 1.5rem;
	column-count: var(--boscoo-gal-cols);
	column-gap: var(--boscoo-gal-gutter);
	animation: boscoo-gal-failsafe 0.01s linear 3s both; /* never stay hidden if JS fails */
}
@media (min-width: 768px) { .boscoo-gallery-grid { margin-top: 2rem; } }
.boscoo-gallery.is-js .boscoo-gallery-grid { animation: none; opacity: 1; }
@keyframes boscoo-gal-failsafe { from { opacity: 0; } to { opacity: 1; } }

.boscoo-gallery-grid.is-cols {
	display: flex;
	align-items: flex-start;
	gap: var(--boscoo-gal-gutter);
	column-count: auto;
}
.boscoo-gallery-col {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: var(--boscoo-gal-gutter);
}

/* =====================================================================
   5. TILE
   ===================================================================== */
.boscoo-gallery .boscoo-gallery-item {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: var(--boscoo-gal-ratio, 0.8);
	margin: 0 0 var(--boscoo-gal-gutter);
	overflow: hidden;
	border-radius: var(--boscoo-gal-radius, 0);
	background: var(--boscoo-gal-tile-bg, var(--boscoo-muted));
	color: var(--boscoo-gal-caption, #fafafa);
	text-decoration: none;
	cursor: zoom-in;
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	-webkit-tap-highlight-color: transparent;
	outline: 0;
	isolation: isolate;
}
.boscoo-gallery-grid.is-cols .boscoo-gallery-item { margin-bottom: 0; }
.boscoo-gallery .boscoo-gallery-item[hidden] { display: none !important; }
.boscoo-gallery[data-lightbox="0"] .boscoo-gallery-item { cursor: pointer; }

.boscoo-gallery .boscoo-gallery-item .boscoo-gallery-img {
	position: absolute; inset: 0;
	display: block;
	width: 100% !important; height: 100% !important; max-width: none !important;
	object-fit: cover !important;
	border-radius: 0;
	transform: scale(1.001);
	transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1), filter 0.6s ease;
	will-change: transform;
}

.boscoo-gallery-shade {
	position: absolute; inset: 0; z-index: 1;
	background: linear-gradient(to top, rgba(15, 15, 15, 0.74) 0%, rgba(15, 15, 15, 0.22) 38%, rgba(15, 15, 15, 0) 64%);
	opacity: 0;
	transition: opacity 0.5s ease;
	pointer-events: none;
}
.boscoo-gallery-frame {
	position: absolute; inset: 0.75rem; z-index: 2;
	border: 1px solid var(--boscoo-gal-accent, var(--boscoo-sand));
	opacity: 0;
	transform: scale(1.035);
	transition: opacity 0.5s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
	pointer-events: none;
}
.boscoo-gallery-caption {
	position: absolute; z-index: 3;
	left: 1.5rem; right: 1.5rem; bottom: 1.375rem;
	display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.45s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
	pointer-events: none;
}
.boscoo-gallery-cat {
	min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
	font-family: var(--boscoo-font);
	font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.28em; text-transform: uppercase;
	color: var(--boscoo-gal-accent, var(--boscoo-sand));
}
.boscoo-gallery-num {
	flex: 0 0 auto;
	font-family: var(--boscoo-font-display);
	font-size: 1.25rem; line-height: 1;
	color: var(--boscoo-gal-caption, #fafafa);
}
.boscoo-gallery-zoom {
	position: absolute; z-index: 3;
	top: 1.375rem; right: 1.375rem;
	display: grid; place-items: center;
	width: 2.25rem; height: 2.25rem;
	border-radius: 9999px;
	background: rgba(250, 250, 250, 0.94);
	color: var(--boscoo-primary);
	opacity: 0;
	transform: scale(0.82);
	transition: opacity 0.4s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
	pointer-events: none;
}
.boscoo-gallery-zoom svg { display: block; width: 14px; height: 14px; }

/* Hover (pointer devices) + keyboard focus */
@media (hover: hover) {
	.boscoo-gallery .boscoo-gallery-item:hover .boscoo-gallery-img { transform: scale(1.055); }
	.boscoo-gallery .boscoo-gallery-item:hover .boscoo-gallery-shade,
	.boscoo-gallery .boscoo-gallery-item:hover .boscoo-gallery-frame,
	.boscoo-gallery .boscoo-gallery-item:hover .boscoo-gallery-caption,
	.boscoo-gallery .boscoo-gallery-item:hover .boscoo-gallery-zoom { opacity: 1; transform: none; }
}
.boscoo-gallery .boscoo-gallery-item:focus-visible .boscoo-gallery-shade,
.boscoo-gallery .boscoo-gallery-item:focus-visible .boscoo-gallery-frame,
.boscoo-gallery .boscoo-gallery-item:focus-visible .boscoo-gallery-caption,
.boscoo-gallery .boscoo-gallery-item:focus-visible .boscoo-gallery-zoom { opacity: 1; transform: none; }
.boscoo-gallery .boscoo-gallery-item:focus-visible {
	outline: 2px solid var(--boscoo-gal-accent, var(--boscoo-bronze));
	outline-offset: 3px;
	box-shadow: none;
}
.boscoo-gallery .boscoo-gallery-item:active .boscoo-gallery-img { transform: scale(1.02); }

/* Entrance — the Gallery's own reveal (JS adds .is-in as tiles scroll in) */
.boscoo-gallery.is-js .boscoo-gallery-item {
	opacity: 0;
	transform: translateY(26px);
	transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
	transition-delay: var(--boscoo-gal-delay, 0ms);
}
.boscoo-gallery.is-js .boscoo-gallery-item.is-in { opacity: 1; transform: none; }

/* =====================================================================
   6. FOOT — live counter, progress line, View More
   ===================================================================== */
.boscoo-gallery-foot {
	display: flex; flex-direction: column; align-items: center;
	margin-top: 3rem;
	text-align: center;
}
@media (min-width: 768px) { .boscoo-gallery-foot { margin-top: 4rem; } }
.boscoo-gallery-status {
	margin: 0;
	font-size: 0.6875rem; font-weight: 500;
	letter-spacing: 0.28em; text-transform: uppercase;
	color: var(--boscoo-gal-text, var(--boscoo-stone));
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}
.boscoo-gallery-meter {
	position: relative;
	width: min(15rem, 60vw); height: 1px;
	margin-top: 1rem;
	background: var(--boscoo-gal-rule, var(--boscoo-border));
	overflow: hidden;
}
.boscoo-gallery-meter-bar {
	position: absolute; inset: 0;
	background: var(--boscoo-gal-accent, var(--boscoo-bronze));
	transform-origin: left center;
	transform: scaleX(var(--boscoo-gal-meter, 0));
	transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.boscoo-gallery-more { display: flex; justify-content: center; margin-top: 2rem; }
.boscoo-gallery-more:first-child { margin-top: 0; }
.boscoo-gallery-more[hidden] { display: none; }
.boscoo-gallery .boscoo-gallery-more-btn,
.boscoo-gallery .boscoo-gallery-more-btn:focus {
	-webkit-appearance: none; appearance: none;
	min-width: 13rem;
	padding: 1rem 2.25rem;
	border: 1px solid var(--boscoo-gal-btn, var(--boscoo-primary));
	border-radius: 0;
	background: transparent;
	background-image: none;
	color: var(--boscoo-gal-btn, var(--boscoo-primary));
	font-family: var(--boscoo-font);
	font-size: 0.75rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; text-decoration: none;
	outline: 0;
}
.boscoo-gallery .boscoo-gallery-more-btn:hover {
	background: var(--boscoo-gal-btn, var(--boscoo-primary));
	border-color: var(--boscoo-gal-btn, var(--boscoo-primary));
	color: var(--boscoo-gal-btn-on-fg, #fff);
}
.boscoo-gallery .boscoo-gallery-more-btn:focus-visible {
	outline: 2px solid var(--boscoo-gal-accent, var(--boscoo-bronze));
	outline-offset: 3px;
	box-shadow: none;
}
.boscoo-gallery-noscript { margin: 2rem 0 0; text-align: center; color: var(--boscoo-stone); font-size: 0.875rem; }

/* =====================================================================
   7. LIGHTBOX (single instance, appended to <body> by gallery.js)
   ===================================================================== */
html.boscoo-gal-lock, html.boscoo-gal-lock body { overflow: hidden !important; }

.boscoo-lightbox {
	position: fixed; inset: 0; z-index: 100001;
	display: none; flex-direction: column;
	background: var(--boscoo-gal-lb-bg, #0d0d0d);
	color: var(--boscoo-gal-lb-fg, #fafafa);
	font-family: var(--boscoo-font);
	line-height: 1.4;
	opacity: 0;
	transition: opacity 0.35s ease;
	overscroll-behavior: contain;
	-webkit-tap-highlight-color: transparent;
	-webkit-font-smoothing: antialiased;
}
.boscoo-lightbox.is-open { display: flex; }
.boscoo-lightbox.is-visible { opacity: 1; }

.boscoo-lightbox-top {
	flex: 0 0 auto;
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
	padding: 1rem 1rem 0.75rem 1.25rem;
}
@media (min-width: 768px) { .boscoo-lightbox-top { padding: 1.5rem 1.75rem 1rem 2.5rem; } }
.boscoo-lightbox-meta { display: flex; align-items: baseline; gap: 1.125rem; min-width: 0; margin: 0; padding: 0; }
.boscoo-lightbox-cat {
	min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
	font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.28em; text-transform: uppercase;
	color: var(--boscoo-gal-accent, var(--boscoo-sand));
}
.boscoo-lightbox-count {
	flex: 0 0 auto;
	font-family: var(--boscoo-font-display);
	font-size: 1.25rem; line-height: 1; letter-spacing: 0.02em;
	font-variant-numeric: lining-nums tabular-nums;
	white-space: nowrap;
}
.boscoo-lightbox-count-total { opacity: 0.5; }

.boscoo-lightbox-stage {
	position: relative;
	flex: 1 1 auto; min-height: 0;
	display: flex; align-items: center; justify-content: center;
	padding: 0 0.75rem;
	touch-action: pan-y;
}
@media (min-width: 768px) { .boscoo-lightbox-stage { padding: 0 6rem; } }

.boscoo-lightbox .boscoo-lightbox-img {
	display: block;
	max-width: 100%; max-height: 100%;
	object-fit: contain;
	border-radius: 0;
	box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9);
	opacity: 0;
	transform: scale(0.985);
	transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
	-webkit-user-select: none; user-select: none;
	-webkit-user-drag: none;
	cursor: default;
}
.boscoo-lightbox .boscoo-lightbox-img.is-shown { opacity: 1; transform: none; }
.boscoo-lightbox .boscoo-lightbox-img.is-dragging { transition: none; }

/* Round controls — close / previous / next (theme-proof button states) */
.boscoo-lightbox .boscoo-lightbox-btn,
.boscoo-lightbox .boscoo-lightbox-btn:focus {
	-webkit-appearance: none; appearance: none;
	display: grid; place-items: center; flex: 0 0 auto;
	width: 2.75rem; height: 2.75rem; min-width: 0;
	margin: 0; padding: 0;
	border: 1px solid rgba(250, 250, 250, 0.24);
	border-radius: 9999px;
	background: rgba(15, 15, 15, 0.35);
	background-image: none;
	box-shadow: none;
	color: var(--boscoo-gal-lb-fg, #fafafa);
	font: inherit; line-height: 1; text-decoration: none;
	cursor: pointer;
	outline: 0;
	transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.boscoo-lightbox .boscoo-lightbox-btn:hover {
	background: var(--boscoo-gal-accent, var(--boscoo-bronze));
	border-color: var(--boscoo-gal-accent, var(--boscoo-bronze));
	color: #fff;
}
.boscoo-lightbox .boscoo-lightbox-btn:focus-visible {
	outline: 2px solid var(--boscoo-gal-accent, var(--boscoo-sand));
	outline-offset: 3px;
	box-shadow: none;
}
.boscoo-lightbox .boscoo-lightbox-btn svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; }

.boscoo-lightbox .boscoo-lightbox-nav { position: absolute; top: 50%; z-index: 2; margin-top: -1.375rem; }
.boscoo-lightbox .boscoo-lightbox-prev { left: 0.5rem; }
.boscoo-lightbox .boscoo-lightbox-next { right: 0.5rem; }
@media (min-width: 768px) {
	.boscoo-lightbox .boscoo-lightbox-nav { width: 3.25rem; height: 3.25rem; margin-top: -1.625rem; }
	.boscoo-lightbox .boscoo-lightbox-prev { left: 1.75rem; }
	.boscoo-lightbox .boscoo-lightbox-next { right: 1.75rem; }
	.boscoo-lightbox .boscoo-lightbox-prev:hover { transform: translateX(-3px); }
	.boscoo-lightbox .boscoo-lightbox-next:hover { transform: translateX(3px); }
}
.boscoo-lightbox.is-single .boscoo-lightbox-nav,
.boscoo-lightbox.is-single .boscoo-lightbox-bottom { visibility: hidden; }

/* Phones: the arrows leave the photograph and sit either side of the
   progress line, so nothing covers the image (swipe works as well). */
@media (max-width: 767px) {
	.boscoo-lightbox-stage { position: static; }
	.boscoo-lightbox .boscoo-lightbox-nav {
		top: auto; margin-top: 0;
		bottom: calc(0.875rem + env(safe-area-inset-bottom, 0px));
	}
	.boscoo-lightbox .boscoo-lightbox-prev { left: 1.25rem; }
	.boscoo-lightbox .boscoo-lightbox-next { right: 1.25rem; }
	.boscoo-lightbox-bottom {
		align-items: center;
		min-height: 4.5rem;
		padding: 0 5rem calc(env(safe-area-inset-bottom, 0px));
	}
}

.boscoo-lightbox-bottom {
	flex: 0 0 auto;
	display: flex; justify-content: center;
	padding: 1.125rem 1.25rem 1.5rem;
}
@media (min-width: 768px) { .boscoo-lightbox-bottom { padding: 1.5rem 2.5rem 2rem; } }
.boscoo-lightbox-progress {
	position: relative;
	width: min(15rem, 56vw); height: 1px;
	background: rgba(250, 250, 250, 0.2);
	overflow: hidden;
}
.boscoo-lightbox-progress-bar {
	position: absolute; inset: 0;
	background: var(--boscoo-gal-accent, var(--boscoo-bronze));
	transform-origin: left center;
	transform: scaleX(var(--boscoo-gal-progress, 0));
	transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* =====================================================================
   8. EDITOR PREVIEW + REDUCED MOTION — content is never left hidden
   ===================================================================== */
.elementor-editor-active .boscoo-gallery-grid,
body.elementor-editor-preview .boscoo-gallery-grid,
.elementor-edit-area-active .boscoo-gallery-grid { animation: none !important; opacity: 1 !important; }
.elementor-editor-active .boscoo-gallery .boscoo-gallery-item,
body.elementor-editor-preview .boscoo-gallery .boscoo-gallery-item,
.elementor-edit-area-active .boscoo-gallery .boscoo-gallery-item { opacity: 1 !important; transform: none !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
	.boscoo-gallery-grid { animation: none !important; opacity: 1 !important; }
	.boscoo-gallery .boscoo-gallery-item,
	.boscoo-gallery.is-js .boscoo-gallery-item { opacity: 1 !important; transform: none !important; transition: none !important; }
	.boscoo-gallery .boscoo-gallery-item .boscoo-gallery-img,
	.boscoo-gallery-shade, .boscoo-gallery-frame, .boscoo-gallery-caption, .boscoo-gallery-zoom,
	.boscoo-lightbox, .boscoo-lightbox .boscoo-lightbox-img, .boscoo-lightbox .boscoo-lightbox-btn,
	.boscoo-lightbox-progress-bar, .boscoo-gallery-meter-bar { transition: none !important; }
	.boscoo-gallery .boscoo-gallery-item:hover .boscoo-gallery-img { transform: none; }
}
