/* 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. */

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

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

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

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

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

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

/* Desktop band (>=1025px) */
@media (min-width: 1025px) {
	.vmseo-gallery { grid-template-columns: repeat(var(--vmseo-gal-cols, 3), 1fr); }
	.vmseo-gallery .is-hide-d { display: none; }
	.vmseo-gallery--btn-d .vmseo-gallery__btn { display: flex; }
}

/* Tablet band (768-1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
	.vmseo-gallery { grid-template-columns: repeat(var(--vmseo-gal-cols-t, 2), 1fr); }
	.vmseo-gallery .is-hide-t { display: none; }
	.vmseo-gallery--btn-t .vmseo-gallery__btn { display: flex; }
}

/* Mobile band (<=767px) */
@media (max-width: 767px) {
	.vmseo-gallery { grid-template-columns: repeat(var(--vmseo-gal-cols-m, 2), 1fr); }
	.vmseo-gallery .is-hide-m { display: none; }
	.vmseo-gallery--btn-m .vmseo-gallery__btn { display: flex; }
}

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

/* Lightbox (self-written) */
.vmseo-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;
}

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

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

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

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

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

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

/* "Show all" modal + infinite scroll */
.vmseo-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;
}

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

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

.vmseo-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;
}

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

@media (min-width: 768px) and (max-width: 1024px) {
	.vmseo-gmodal__grid { grid-template-columns: repeat(var(--vmseo-gal-cols-t, 2), 1fr); }
}

@media (max-width: 767px) {
	.vmseo-gmodal__grid { grid-template-columns: repeat(var(--vmseo-gal-cols-m, 2), 1fr); }
}

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

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

.vmseo-gmodal__sentinel { height: 1px; }
