/* Stone Edge Project Gallery */
.seg-gallery {
	--seg-green: #6ab43e;
	--seg-green-dark: #4f8d2c;
	--seg-ink: #1d1f1c;
	--seg-muted: #6b6f68;
	--seg-line: #e3e6df;
	--seg-gap: 12px;
	font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--seg-ink);
}

/* Filter bar */
.seg-filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin: 0 0 8px;
}
.seg-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border: 1.5px solid var(--seg-line);
	border-radius: 999px;
	background: #fff;
	color: var(--seg-ink);
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s;
}
.seg-chip:hover {
	border-color: var(--seg-green);
	color: var(--seg-green-dark);
}
.seg-chip:focus-visible {
	outline: 3px solid rgba(106, 180, 62, .35);
	outline-offset: 2px;
}
.seg-chip.is-active {
	background: var(--seg-green);
	border-color: var(--seg-green);
	color: #fff;
	box-shadow: 0 4px 14px rgba(106, 180, 62, .30);
}
.seg-count {
	display: inline-block;
	min-width: 22px;
	padding: 2px 7px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .06);
	font-size: 12px;
	font-weight: 600;
	text-align: center;
}
.seg-chip.is-active .seg-count {
	background: rgba(255, 255, 255, .25);
}
.seg-hint {
	margin: 0 0 22px;
	text-align: center;
	font-size: 13px;
	color: var(--seg-muted);
}

/* Grid */
.seg-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--seg-gap);
}
@media (max-width: 1024px) {
	.seg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
	.seg-gallery { --seg-gap: 8px; }
	.seg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.seg-chip { padding: 8px 14px; font-size: 13px; }
}

.seg-item {
	margin: 0;
	transition: opacity .3s ease, transform .3s ease;
}
.seg-item.is-hidden {
	display: none;
}
.seg-item.is-entering {
	opacity: 0;
	transform: scale(.97);
}
.seg-link {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 10px;
	background: #eef0ea;
	text-decoration: none;
}
/* Extra specificity + !important so theme/Elementor "img { height: auto }" rules can't
   shrink wide photos and leave an empty band at the bottom of the tile. */
.seg-gallery .seg-grid .seg-link img {
	position: absolute !important;
	top: 0;
	left: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: cover;
}
.seg-link img {
	position: absolute;
	inset: 0;
	display: block;
	max-width: none;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s ease;
}
.seg-link:hover img,
.seg-link:focus-visible img {
	transform: scale(1.05);
}
.seg-link:focus-visible {
	outline: 3px solid var(--seg-green);
	outline-offset: 2px;
}
.seg-tag {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 28px 12px 10px;
	background: linear-gradient(to top, rgba(0, 0, 0, .65), rgba(0, 0, 0, 0));
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: .02em;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity .25s, transform .25s;
}
.seg-link:hover .seg-tag,
.seg-link:focus-visible .seg-tag {
	opacity: 1;
	transform: none;
}
@media (hover: none) {
	.seg-tag { display: none; }
}
.seg-none,
.seg-empty {
	text-align: center;
	color: var(--seg-muted);
	padding: 40px 0;
}

/* Lightbox */
.seg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(12, 14, 11, .94);
	opacity: 0;
	transition: opacity .2s ease;
	touch-action: pan-y;
}
.seg-lightbox.is-open {
	opacity: 1;
}
.seg-lightbox[hidden] {
	display: none;
}
.seg-lb-figure {
	margin: 0;
	max-width: 92vw;
	max-height: 86vh;
	display: flex;
	flex-direction: column;
	align-items: center;
}
.seg-lb-img {
	max-width: 92vw;
	max-height: 78vh;
	width: auto;
	height: auto;
	border-radius: 6px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
	user-select: none;
	-webkit-user-drag: none;
}
.seg-lb-cap {
	margin-top: 14px;
	color: #e9ece5;
	font-family: "Poppins", system-ui, sans-serif;
	font-size: 14px;
	text-align: center;
}
.seg-lb-cap .seg-lb-num {
	color: #9aa195;
	margin-left: 10px;
}
.seg-lb-btn {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .10);
	color: #fff;
	cursor: pointer;
	transition: background-color .2s;
}
.seg-lb-btn:hover,
.seg-lb-btn:focus-visible {
	background: var(--seg-green, #6ab43e);
	outline: none;
}
.seg-lb-btn svg {
	width: 24px;
	height: 24px;
}
.seg-lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.seg-lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.seg-lb-close { right: 20px; top: 20px; width: 46px; height: 46px; }
@media (max-width: 600px) {
	.seg-lb-prev, .seg-lb-next { top: auto; bottom: 18px; transform: none; }
	.seg-lb-prev { left: 18px; }
	.seg-lb-next { right: 18px; }
	.seg-lb-img { max-height: 70vh; }
}
/* Lightbox thumbnail strip */
.seg-lb-thumbs {
	position: absolute;
	top: 14px;
	left: 80px;
	right: 80px;
	display: flex;
	gap: 6px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: thin;
	scrollbar-color: rgba(255,255,255,.3) transparent;
	padding: 4px 2px 6px;
	-webkit-overflow-scrolling: touch;
}
.seg-lb-thumb {
	flex: 0 0 auto;
	width: 64px;
	height: 48px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 6px;
	overflow: hidden;
	background: #2a2d28;
	cursor: pointer;
	opacity: .55;
	transition: opacity .2s, border-color .2s;
}
.seg-lb-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	max-width: none;
}
.seg-lb-thumb:hover { opacity: .9; }
.seg-lb-thumb.is-current {
	opacity: 1;
	border-color: var(--seg-green, #6ab43e);
}
.seg-lb-thumb:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 1px;
}
.seg-lightbox .seg-lb-figure { margin-top: 70px; }
.seg-lightbox .seg-lb-img { max-height: calc(86vh - 90px); }
@media (max-width: 600px) {
	.seg-lb-thumbs { left: 10px; right: 66px; top: 12px; }
	.seg-lb-thumb { width: 52px; height: 40px; }
	.seg-lb-close { top: 14px; right: 12px; }
	.seg-lightbox .seg-lb-figure { margin-top: 0; }
	.seg-lightbox .seg-lb-img { max-height: 62vh; }
}
body.seg-lb-lock {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.seg-item, .seg-link img, .seg-tag, .seg-lightbox, .seg-chip { transition: none; }
}
