/* =============================================================
   Viscato Gallery — viscato.com
   ============================================================= */

/* ---- Wrapper ---- */

.vg-wrap {
	position: relative;
	display: block;
	outline: none;
}

.vg-wrap:focus-visible {
	outline: 2px solid #000;
	outline-offset: 2px;
}

/* ---- Main Stage ---- */

.vg-stage {
	position: relative;
	width: 100%;
	height: 75vh;           /* default overridden by Elementor style */
	overflow: hidden;
	border-radius: 15px;    /* default overridden */
}

.vg-stage-overlay {
	position: absolute;
	top: 0; right: 0; bottom: 0; left: 0;
	pointer-events: none;
	z-index: 2;
}

/* ---- Slides ---- */

.vg-slide {
	position: absolute;
	top: 0; right: 0; bottom: 0; left: 0;
	opacity: 0;
	pointer-events: none;
	transition-property: opacity, transform;
	transition-timing-function: ease;
	/* transition-duration set by JS from data-speed */
}

.vg-slide.vg-active {
	opacity: 1;
	pointer-events: auto;
	z-index: 1;
}

/* Slide effect — incoming / outgoing positions */
.vg-wrap[data-effect="slide"] .vg-slide {
	transform: translateX(100%);
	opacity: 1;
}
.vg-wrap[data-effect="slide"] .vg-slide.vg-active {
	transform: translateX(0);
}
.vg-wrap[data-effect="slide"] .vg-slide.vg-slide-out-left  { transform: translateX(-100%); }
.vg-wrap[data-effect="slide"] .vg-slide.vg-slide-out-right { transform: translateX(100%); }
.vg-wrap[data-effect="slide"] .vg-slide.vg-slide-in-right  { transform: translateX(100%); opacity: 1; }
.vg-wrap[data-effect="slide"] .vg-slide.vg-slide-in-left   { transform: translateX(-100%); opacity: 1; }

/* Main image & video fill the slide */

.vg-stage .vg-slide .vg-main-img,
.vg-stage .vg-slide .vg-main-video {
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	object-fit: cover;
	display: block;
}

/* Slide overlay (per-slide) */

.vg-slide-overlay {
	position: absolute;
	top: 0; right: 0; bottom: 0; left: 0;
	pointer-events: none;
	z-index: 2;
}

/* Caption */

.vg-caption {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 3;
	color: #fff;
	background: rgba(0, 0, 0, 0.45);
	padding: 8px 16px;
	font-size: 0.9rem;
	line-height: 1.4;
}

/* ---- Arrows ---- */

.vg-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 2px solid #333;
	background: transparent;
	color: #333;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.vg-arrow:hover {
	background-color: #333;
	color: #fff;
}

.vg-arrow:focus {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}
.vg-arrow:focus:not(:focus-visible) {
	outline: none;
}

.vg-prev { left: 12px; }
.vg-next { right: 12px; }

/* ---- Dots ---- */

.vg-dots {
	position: absolute;
	bottom: 14px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 8px;
	z-index: 10;
}

.vg-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: rgba(0, 0, 0, 0.3);
	background-clip: content-box;
	box-sizing: content-box;
	border: none;
	cursor: pointer;
	padding: 6px;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.vg-dot.vg-active {
	background-color: #000;
	background-clip: content-box;
	transform: scale(1.4);
}

.vg-dot:focus {
	outline: 2px solid #000;
	outline-offset: 2px;
}
.vg-dot:focus:not(:focus-visible) {
	outline: none;
}

/* ---- Thumbnail Strip ---- */

.vg-thumbs-wrap {
	margin-top: 12px;
	position: relative;
	z-index: 1;             /* sit above stage so scaled thumbs don't clip behind it */
	overflow: visible;      /* allow transform:scale on thumbs to show outside bounds */
}

.vg-thumbs {
	display: flex;
	gap: 8px;
	justify-content: center;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: thin;
	scrollbar-color: rgba(0,0,0,0.2) transparent;
	padding-bottom: 4px;    /* room for scrollbar on some browsers */
}

.vg-thumbs::-webkit-scrollbar        { height: 4px; }
.vg-thumbs::-webkit-scrollbar-track  { background: transparent; }
.vg-thumbs::-webkit-scrollbar-thumb  { background: rgba(0,0,0,0.2); border-radius: 2px; }

/* Each thumb is a flex-shrink-0 button */

.vg-thumb {
	position: relative;
	flex: 0 0 auto;
	height: 100px;          /* default; overridden by Elementor */
	aspect-ratio: 16 / 9;
	border: 2px solid transparent;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	padding: 0;
	background: #eee;
	transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.vg-thumbs-wrap .vg-thumb img {
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	object-fit: cover;
	display: block;
	pointer-events: none;
}

.vg-thumb.vg-active,
.vg-thumb:hover {
	border-color: #333;
}

.vg-thumb:focus {
	outline: 2px solid #333;
	outline-offset: 2px;
}
.vg-thumb:focus:not(:focus-visible) {
	outline: none;
}

/* Thumb overlay (for hover/active colour) */

.vg-thumb-overlay {
	position: absolute;
	top: 0; right: 0; bottom: 0; left: 0;
	pointer-events: none;
	z-index: 1;
	transition: background-color 0.2s ease;
}

/* Video play badge on thumb */

.vg-play-badge {
	position: absolute;
	top: 0; right: 0; bottom: 0; left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	pointer-events: none;
}

.vg-play-badge svg {
	width: 28px;
	height: 28px;
	fill: #fff;
	filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
	opacity: 0.85;
}

/* ---- Screen-reader announcer ---- */

.vg-sr-announce {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ================================================================
   Responsive hide rules
   ================================================================ */

/* Arrows */
@media (max-width: 767px) {
	.vg-wrap[data-hide-arrows="mobile"] .vg-arrow,
	.vg-wrap[data-hide-arrows="tablet"] .vg-arrow {
		display: none;
	}
}

@media (min-width: 768px) and (max-width: 1024px) {
	.vg-wrap[data-hide-arrows="tablet"] .vg-arrow {
		display: none;
	}
}

/* Dots */
@media (max-width: 767px) {
	.vg-wrap[data-hide-dots="mobile"] .vg-dots,
	.vg-wrap[data-hide-dots="tablet"] .vg-dots {
		display: none;
	}
}

@media (min-width: 768px) and (max-width: 1024px) {
	.vg-wrap[data-hide-dots="tablet"] .vg-dots {
		display: none;
	}
}

/* Mobile: slightly smaller stage default */
@media (max-width: 767px) {
	.vg-arrow {
		width: 36px;
		height: 36px;
		font-size: 1.3rem;
	}
	.vg-prev { left: 8px; }
	.vg-next { right: 8px; }
}

/* ================================================================
   Lightbox
   ================================================================ */

.vg-lightbox {
	position: fixed;
	top: 0; right: 0; bottom: 0; left: 0;
	z-index: 999999;
	background: rgba(0, 0, 0, 0.92);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: zoom-out;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.vg-lightbox.vg-lightbox--open {
	opacity: 1;
}

.vg-lightbox img {
	max-width: 95vw;
	max-height: 95vh;
	object-fit: contain;
	cursor: default;
	-webkit-user-select: none;
	user-select: none;
}

/* Loading spinner while full-res image loads */
.vg-lightbox--loading::after {
	content: '';
	width: 40px;
	height: 40px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: vg-spin 0.8s linear infinite;
	position: absolute;
}

.vg-lightbox--loading img {
	opacity: 0;
}

@keyframes vg-spin {
	to { transform: rotate(360deg); }
}

.vg-lightbox-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	background: rgba(255, 255, 255, 0.15);
	border: none;
	border-radius: 50%;
	color: #fff;
	font-size: 28px;
	cursor: pointer;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	transition: background-color 0.2s ease;
}

.vg-lightbox-close:hover {
	background: rgba(255, 255, 255, 0.3);
}

.vg-lightbox-close:focus {
	outline: 2px solid #fff;
	outline-offset: 2px;
}
.vg-lightbox-close:focus:not(:focus-visible) {
	outline: none;
}

/* ---- Cursor hints ---- */

.vg-slide--image.vg-active .vg-main-img {
	cursor: zoom-in;
}

.vg-main-video:not([controls]) {
	cursor: pointer;
}
