/* VMSEO Gallery — responsive is 100% CSS (no JS layout), CLS-safe via fixed aspect-ratio.
   Breakpoints are mutually exclusive bands so hide/columns/button rules never fight the cascade. */

.slshow-gallery {
	display: grid;
	grid-template-columns: repeat(var(--slshow-gal-cols, 3), 1fr);
	gap: var(--slshow-gal-gap, 16px);
}

.slshow-gallery__item {
	position: relative;
	margin: 0;
	aspect-ratio: var(--slshow-gal-ar, 4 / 3);
	border-radius: var(--slshow-gal-radius, 0);
	overflow: hidden;
	cursor: zoom-in;
	background: #f0f0f1;
}

.slshow-gallery__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.slshow-gallery__btn {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	width: 100%;
	height: 100%;
	aspect-ratio: var(--slshow-gal-ar, 4 / 3);
	border: 0;
	cursor: pointer;
	border-radius: var(--slshow-gal-radius, 0);
	background: var(--slshow-gal-btn-bg, #c1121f);
	color: var(--slshow-gal-btn-color, #fff);
	font: inherit;
	font-weight: 600;
}

.slshow-gallery__btn-arrow {
	transition: transform 0.2s ease;
}

.slshow-gallery__btn:hover .slshow-gallery__btn-arrow {
	transform: translateX(4px);
}

/* Desktop / tablet / mobile bands: generated from Settings → Advanced breakpoints by
   VMSEO\Support\Breakpoints::css_gallery() and attached via wp_add_inline_style('slshow-gallery'). */

/* Editor placeholder */
.slshow-gallery--empty {
	padding: 2rem;
	text-align: center;
	border: 1px dashed #c3c4c7;
	color: #646970;
	border-radius: 4px;
}

/* Lightbox (self-written) */
.slshow-glb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.9);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease;
}

.slshow-glb.is-open {
	opacity: 1;
	visibility: visible;
}

.slshow-glb__img {
	max-width: 92vw;
	max-height: 88vh;
	object-fit: contain;
}

.slshow-glb__nav,
.slshow-glb__close {
	position: absolute;
	border: 0;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	cursor: pointer;
	border-radius: 50%;
	line-height: 1;
}

.slshow-glb__nav {
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	font-size: 2rem;
}

.slshow-glb__prev { left: 16px; }
.slshow-glb__next { right: 16px; }

.slshow-glb__close {
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	font-size: 1.5rem;
}

/* "Show all" modal + infinite scroll */
.slshow-gmodal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, 0.6);
	overflow: auto;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease;
}

.slshow-gmodal.is-open {
	opacity: 1;
	visibility: visible;
}

.slshow-gmodal__panel {
	position: relative;
	background: #fff;
	width: min(1100px, 92vw);
	margin: 5vh auto;
	padding: 24px;
	border-radius: 8px;
}

.slshow-gmodal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 40px;
	height: 40px;
	border: 0;
	background: #f0f0f1;
	cursor: pointer;
	border-radius: 50%;
	font-size: 1.4rem;
	line-height: 1;
}

.slshow-gmodal__grid {
	display: grid;
	grid-template-columns: repeat(var(--slshow-gal-cols, 3), 1fr);
	gap: 16px;
	margin-top: 8px;
}

.slshow-gmodal__item {
	aspect-ratio: var(--slshow-gal-ar, 4 / 3);
	border-radius: var(--slshow-gal-radius, 0);
	overflow: hidden;
	cursor: zoom-in;
	margin: 0;
}

.slshow-gmodal__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.slshow-gmodal__sentinel { height: 1px; }
