/* Prairie Solutions — Portfolio Gallery widget */

.elementor-widget-ps-portfolio-gallery,
.ps-lb-host {
	--ps-accent: #BFA054;
	--ps-accent-hover: #D2B266;
	--ps-zoom: 1.1;
	--ps-border-w: 2px;
}

.ps-pg *,
.ps-lb * { box-sizing: border-box; }

/* ---------- GRID ---------- */
.ps-pg {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
}

.ps-pg__item {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	cursor: pointer;
}
div.ps-pg__item { cursor: default; }

.ps-pg__item .ps-pg__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform .5s cubic-bezier(.2, .7, .2, 1);
	will-change: transform;
}

.ps-pg__item::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	border: var(--ps-border-w) solid transparent;
	transition: border-color .3s ease;
}

.ps-pg__item:hover .ps-pg__img,
.ps-pg__item:focus-visible .ps-pg__img { transform: scale(var(--ps-zoom)); }

.ps-pg__item:hover::after,
.ps-pg__item:focus-visible::after { border-color: var(--ps-accent); }

.ps-pg__item:focus,
.ps-pg__item:focus-visible { outline: none; }

/* Theme button resets (Blocksy etc.) */
.ps-pg__item:hover,
.ps-pg__item:focus { background: transparent; box-shadow: none; }

/* ---------- LIGHTBOX ---------- */
.ps-lb {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: inherit;
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease, visibility .3s ease;
}
.ps-lb.is-open { opacity: 1; visibility: visible; }

.ps-lb__backdrop {
	position: absolute;
	inset: 0;
	background-color: rgba(12, 12, 12, .94);
	cursor: pointer;
}

.ps-lb__frame {
	position: relative;
	z-index: 1;
	width: min(1100px, 92vw);
	max-height: 92vh;
	overflow-y: auto;
	padding: 44px clamp(20px, 5vw, 70px);
	border: 1px solid rgba(255, 255, 255, .32);
	transform: translateY(14px) scale(.985);
	transition: transform .35s cubic-bezier(.2, .7, .2, 1);
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}
.ps-lb__frame::-webkit-scrollbar { width: 0; }
.ps-lb.is-open .ps-lb__frame { transform: none; }

.ps-lb .ps-lb__close {
	position: absolute;
	top: 22px;
	right: clamp(14px, 4vw, 42px);
	width: 46px;
	height: 46px;
	padding: 0;
	line-height: 1;
	background: none;
	border: 0;
	color: #fff;
	font-size: 40px;
	font-weight: 300;
	cursor: pointer;
	opacity: .9;
	transition: opacity .2s, transform .3s;
}
.ps-lb .ps-lb__close:hover { opacity: 1; transform: rotate(90deg); background: none; color: #fff; }

.ps-lb__stage {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 16 / 10;
	margin: 36px 0 26px;
	overflow: hidden;
	background-color: #4A5568;
}

.ps-lb__img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	opacity: 0;
	transition: opacity .28s ease;
}
.ps-lb__img.is-ready { opacity: 1; }

.ps-lb__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 20px;
}

.ps-lb__cat {
	color: var(--ps-accent);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .17em;
	text-transform: uppercase;
}
.ps-lb__cat:empty { display: none; }

.ps-lb__count {
	margin-left: auto;
	color: #fff;
	font-size: 17px;
	letter-spacing: .04em;
	font-variant-numeric: tabular-nums;
}

.ps-lb .ps-lb__title {
	color: #fff;
	font-size: clamp(28px, 4vw, 44px);
	font-weight: 900;
	line-height: 1.12;
	margin: 10px 0 12px;
}

.ps-lb .ps-lb__desc {
	color: #e6e6e6;
	font-size: 14px;
	line-height: 1.5;
	margin: 0 0 30px;
	max-width: 60ch;
}
.ps-lb__desc:empty { display: none; }

.ps-lb__nav {
	display: flex;
	justify-content: space-between;
	gap: 16px;
}

.ps-lb .ps-lb__btn {
	min-width: 165px;
	padding: 15px 24px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	border-radius: 0;
	cursor: pointer;
	transition: background-color .25s ease, color .25s ease, opacity .25s ease, border-color .25s ease;
}
.ps-lb .ps-lb__prev { background: transparent; color: #fff; border: 1px solid var(--ps-accent); }
.ps-lb .ps-lb__prev:hover { background: var(--ps-accent); color: #151515; }
.ps-lb .ps-lb__next { background: var(--ps-accent); color: #151515; border: 1px solid var(--ps-accent); }
.ps-lb .ps-lb__next:hover { background: var(--ps-accent-hover); border-color: var(--ps-accent-hover); color: #151515; }
.ps-lb .ps-lb__btn:disabled { opacity: .35; cursor: default; }

.ps-lb .ps-lb__btn:focus-visible,
.ps-lb .ps-lb__close:focus-visible { outline: 2px solid var(--ps-accent); outline-offset: 3px; }

body.ps-lb-open { overflow: hidden; }

/* Default responsive columns (overridden by the widget's Columns control) */
@media (max-width: 1024px) { .ps-pg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
	.ps-pg { grid-template-columns: minmax(0, 1fr); gap: 12px; }
	.ps-lb__frame { padding: 44px 18px 30px; width: 94vw; }
	.ps-lb__stage { aspect-ratio: 4 / 3; margin: 26px 0 20px; }
	.ps-lb .ps-lb__btn { min-width: 0; flex: 1; padding: 13px 8px; }
}

@media (prefers-reduced-motion: reduce) {
	.ps-pg__img, .ps-lb, .ps-lb__frame, .ps-lb__img, .ps-lb__close { transition: none !important; }
	.ps-pg__item:hover .ps-pg__img { transform: none; }
}
