/* com_webstepgallery - frontend masonry grid + lightbox */

.webstepgallery {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 16px;
}

.webstepgallery__head {
	text-align: center;
	margin-bottom: 32px;
}

.webstepgallery__title {
	margin: 0 0 8px;
}

.webstepgallery__intro {
	color: var(--text-muted, #666);
	max-width: 640px;
	margin: 0 auto;
}

.webstepgallery__grid {
	column-count: var(--wsg-cols-mobile, 1);
	column-gap: 16px;
}

@media (min-width: 640px) {
	.webstepgallery__grid {
		column-count: var(--wsg-cols-tablet, 2);
		column-gap: 20px;
	}
}

@media (min-width: 1024px) {
	.webstepgallery__grid {
		column-count: var(--wsg-cols-desktop, 3);
		column-gap: 24px;
	}
}

.webstepgallery__item {
	break-inside: avoid;
	margin: 0 0 20px;
	display: block;
}

.webstepgallery__link {
	display: block;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	transition: transform .2s ease, box-shadow .2s ease;
}

.webstepgallery__link:hover,
.webstepgallery__link:focus-visible {
	transform: scale(1.015);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.webstepgallery__link img {
	display: block;
	width: 100%;
	height: auto;
}

.webstepgallery__caption {
	margin: 8px 4px 0;
	font-size: 0.875rem;
	color: var(--text-muted, #666);
}

/* --- Lightbox --- */
.webstepgallery-lightbox {
	border: none;
	padding: 0;
	max-width: 92vw;
	max-height: 92vh;
	width: min(1100px, 92vw);
	background: transparent;
	overflow: visible;
}

.webstepgallery-lightbox::backdrop {
	background: rgba(0, 0, 0, 0.85);
}

.webstepgallery-lightbox__stage {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.webstepgallery-lightbox__stage picture {
	display: flex;
	max-height: 82vh;
}

.webstepgallery-lightbox__stage img {
	max-width: 100%;
	max-height: 82vh;
	object-fit: contain;
	border-radius: 6px;
	margin: 0 auto;
}

.webstepgallery-lightbox__caption {
	color: #fff;
	text-align: center;
	margin: 0;
	min-height: 1.2em;
}

.webstepgallery-lightbox__close,
.webstepgallery-lightbox__prev,
.webstepgallery-lightbox__next {
	position: fixed;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	border: none;
	border-radius: 999px;
	cursor: pointer;
	font-size: 1.5rem;
	line-height: 1;
	width: 44px;
	height: 44px;
}

.webstepgallery-lightbox__close {
	top: 16px;
	right: 16px;
}

.webstepgallery-lightbox__prev {
	top: 50%;
	left: 16px;
	transform: translateY(-50%);
}

.webstepgallery-lightbox__next {
	top: 50%;
	right: 16px;
	transform: translateY(-50%);
}

.webstepgallery-lightbox__close:hover,
.webstepgallery-lightbox__prev:hover,
.webstepgallery-lightbox__next:hover {
	background: rgba(0, 0, 0, 0.7);
}
