/* Portfolio gallery — Portfolio page only */
.bns-pg[hidden] {
	display: none !important;
}

.bns-pg {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
}

.bns-pg__overlay {
	position: absolute;
	inset: 0;
	background: rgba(10, 24, 48, 0.72);
	backdrop-filter: blur(3px);
}

.bns-pg__dialog {
	position: relative;
	width: 100%;
	max-width: 960px;
	max-height: calc(100vh - 40px);
	overflow: auto;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
	padding: 28px 24px 24px;
	font-family: "Roboto", Sans-serif;
	color: #1a3861;
	animation: bnsPgFadeIn 0.3s ease;
}

@keyframes bnsPgFadeIn {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.bns-pg__close {
	position: absolute;
	top: 12px;
	right: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1px solid #d0d7e2;
	background: #fafbfd;
	font-size: 24px;
	line-height: 1;
	color: #666;
	cursor: pointer;
	border-radius: 4px;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	z-index: 2;
}

.bns-pg__close:hover,
.bns-pg__close:focus-visible {
	background: #f0f5ff;
	border-color: #0840fc;
	color: #0840fc;
	outline: none;
}

.bns-pg__title {
	margin: 0 48px 20px 0;
	font-size: 22px;
	font-weight: 600;
	color: #1a3861;
	line-height: 1.3;
}

.bns-pg__slider {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 12px;
}

.bns-pg__viewport {
	position: relative;
	min-height: 280px;
	max-height: min(70vh, 620px);
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f4f7fc;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid #e0e6ef;
}

.bns-pg__image {
	display: block;
	max-width: 100%;
	max-height: min(70vh, 620px);
	width: auto;
	height: auto;
	object-fit: contain;
	transition: opacity 0.25s ease;
}

.bns-pg__image.is-changing {
	opacity: 0.35;
}

.bns-pg__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	min-width: 44px;
	max-width: 44px;
	min-height: 44px;
	max-height: 44px;
	padding: 0;
	margin: 0;
	border: 1px solid #d0d7e2;
	background: #ffffff;
	color: #1a3861;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	aspect-ratio: 1 / 1;
	align-self: center;
	justify-self: center;
	flex-shrink: 0;
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.bns-pg__nav span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	line-height: 1;
}

.bns-pg__nav:hover:not(:disabled),
.bns-pg__nav:focus-visible:not(:disabled) {
	background: #f0f5ff;
	border-color: #0840fc;
	color: #0840fc;
	outline: none;
}

.bns-pg__nav:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.bns-pg__counter {
	margin: 14px 0 0;
	text-align: center;
	font-size: 14px;
	color: #6b7280;
}

/* Clickable portfolio cards */
.bns-pg-card {
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bns-pg-card:hover,
.bns-pg-card:focus-visible {
	transform: translateY(-4px);
	outline: none;
}

.bns-pg-card .elementor-widget-container {
	position: relative;
}

.bns-pg-card .elementor-widget-container::after {
	content: "View screenshots";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(15, 23, 42, 0.55);
	color: #ffffff;
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0.3px;
	opacity: 0;
	transition: opacity 0.2s ease;
	border-radius: inherit;
	pointer-events: none;
}

.bns-pg-card:hover .elementor-widget-container::after,
.bns-pg-card:focus-visible .elementor-widget-container::after {
	opacity: 1;
}

body.bns-pg-open {
	overflow: hidden;
}

@media (max-width: 767px) {
	.bns-pg__dialog {
		padding: 22px 16px 18px;
	}

	.bns-pg__title {
		font-size: 18px;
		margin-right: 40px;
	}

	.bns-pg__slider {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.bns-pg__nav {
		width: 40px;
		height: 40px;
		min-width: 40px;
		max-width: 40px;
		min-height: 40px;
		max-height: 40px;
		font-size: 24px;
	}

	.bns-pg__nav--prev,
	.bns-pg__nav--next {
		justify-self: center;
	}

	.bns-pg__viewport {
		order: -1;
		grid-column: 1 / -1;
		min-height: 220px;
	}
}
