/**
 * VIO Advance Slider – Frontend Styles
 * Author: Hossein Nazari | VIO Team
 * Version: 1.0.0
 */

/* ============================================================
   BASE WRAPPER
   ============================================================ */

.vio-slider-wrapper {
	position: relative;
	overflow: hidden;
	width: 100%;
	display: block;
	line-height: 0; /* remove inline-block gap */
}

.vio-swiper {
	width: 100%;
	height: 100%;
	overflow: hidden;
}

/* ============================================================
   SLIDE
   ============================================================ */

.vio-swiper-slide {
	position: relative;
	overflow: hidden;
	width: 100%;
	height: 600px; /* default – overridden by Elementor responsive control */
	line-height: normal;
}

/* ============================================================
   RESPONSIVE IMAGE  (<picture>)
   ============================================================ */

.vio-slide-bg-picture {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	z-index: 0;
	overflow: hidden;
}

/*
 * Critical fix:  <img> inside <picture> must be positioned absolute
 * so it fills the slide regardless of browser height-inheritance quirks.
 * object-fit then does the cropping/fitting within that 100×100% box.
 */
.vio-slide-bg-img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: block;
	-o-object-fit: cover;          /* default — overridden per-slide or via global selector */
	   object-fit: cover;
	-o-object-position: center center;
	   object-position: center center;
	transition: transform 0.5s ease;
}

/* ============================================================
   KEN BURNS  (zoom effect)
   ============================================================ */

.vio--ken-burns .vio-swiper-slide.swiper-slide-active .vio-slide-bg-img,
.vio--ken-burns .vio-swiper-slide.swiper-slide-duplicate-active .vio-slide-bg-img {
	animation: vioKenBurns 8s ease-in-out both;
}

@keyframes vioKenBurns {
	0%   { transform: scale(1);    }
	100% { transform: scale(1.12); }
}

/* ============================================================
   OVERLAY
   ============================================================ */

.vio-slide-overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
}

/* ============================================================
   CONTENT LAYER
   ============================================================ */

.vio-slide-content {
	position: absolute;
	inset: 0;
	display: flex;
	z-index: 2;
	padding: 48px;
	box-sizing: border-box;
}

.vio-slide-inner {
	max-width: 680px;
	width: 100%;
}

/* ============================================================
   TITLE
   ============================================================ */

.vio-slide-title {
	color: #fff;
	font-size: 2.6em;
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 15px;
	padding: 0;
}

/* ============================================================
   DESCRIPTION
   ============================================================ */

.vio-slide-desc {
	color: rgba(255, 255, 255, 0.9);
	font-size: 1.1em;
	line-height: 1.7;
	margin: 0 0 25px;
	padding: 0;
}

/* ============================================================
   BUTTON
   ============================================================ */

.vio-slide-btn-wrap {
	display: inline-block;
}

.vio-slide-btn {
	display: inline-block;
	padding: 13px 32px;
	background-color: #4054b2;
	color: #fff;
	font-size: 1em;
	font-weight: 600;
	text-decoration: none;
	border-radius: 6px;
	letter-spacing: .02em;
	cursor: pointer;
	transition:
		background-color .25s ease,
		color            .25s ease,
		transform        .25s ease,
		box-shadow       .25s ease;
}

.vio-slide-btn:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
	text-decoration: none;
	color: #fff;
}

/* ============================================================
   TEXT ANIMATIONS  (enter on active slide)
   ============================================================ */

/* --- fadeInUp (default) --- */
.vio-anim-fadeInUp {
	opacity: 0;
	transform: translateY(32px);
	transition: opacity .55s ease, transform .55s ease;
}

/* --- fadeInDown --- */
.vio-anim-fadeInDown {
	opacity: 0;
	transform: translateY(-32px);
	transition: opacity .55s ease, transform .55s ease;
}

/* --- fadeInLeft --- */
.vio-anim-fadeInLeft {
	opacity: 0;
	transform: translateX(32px);
	transition: opacity .55s ease, transform .55s ease;
}

/* --- fadeIn --- */
.vio-anim-fadeIn {
	opacity: 0;
	transition: opacity .6s ease;
}

/* --- zoomIn --- */
.vio-anim-zoomIn {
	opacity: 0;
	transform: scale(.85);
	transition: opacity .5s ease, transform .5s ease;
}

/* Active slide → reset all animations */
.swiper-slide-active .vio-anim-fadeInUp,
.swiper-slide-active .vio-anim-fadeInDown,
.swiper-slide-active .vio-anim-fadeInLeft,
.swiper-slide-active .vio-anim-fadeIn,
.swiper-slide-active .vio-anim-zoomIn,
/* duplicate slides for loop */
.swiper-slide-duplicate-active .vio-anim-fadeInUp,
.swiper-slide-duplicate-active .vio-anim-fadeInDown,
.swiper-slide-duplicate-active .vio-anim-fadeInLeft,
.swiper-slide-duplicate-active .vio-anim-fadeIn,
.swiper-slide-duplicate-active .vio-anim-zoomIn {
	opacity: 1;
	transform: none;
}

/* ============================================================
   NAVIGATION ARROWS
   ============================================================ */

.vio-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	width: 48px;
	height: 48px;
	background-color: rgba(0, 0, 0, 0.40);
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color .25s ease, transform .25s ease;
}

.vio-arrow:hover {
	background-color: rgba(0, 0, 0, 0.75);
	transform: translateY(-50%) scale(1.08);
}

/* Swiper overrides */
.vio-arrow.swiper-button-prev { left: 18px;  }
.vio-arrow.swiper-button-next { right: 18px; }

.vio-arrow::after {
	font-size: 18px;
	color: #fff;
	font-weight: 700;
}

.vio-arrow.swiper-button-disabled {
	opacity: 0.35;
	pointer-events: none;
}

/* ============================================================
   PAGINATION DOTS
   ============================================================ */

.vio-pagination {
	position: absolute;
	bottom: 20px;
	left: 0;
	width: 100%;
	text-align: center;
	z-index: 10;
	line-height: 1;
}

.vio-pagination .swiper-pagination-bullet {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.5);
	opacity: 1;
	margin: 0 5px;
	cursor: pointer;
	transition: background-color .3s ease, transform .3s ease, width .3s ease;
}

.vio-pagination .swiper-pagination-bullet-active {
	background-color: #fff;
	width: 14px;
	height: 14px;
	transform: scale(1);
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */

.vio-progress-bar-track {
	position: absolute;
	left: 0;
	width: 100%;
	height: 3px;
	background-color: rgba(255, 255, 255, 0.2);
	z-index: 20;
	overflow: hidden;
}

.vio-progress-bar-track[data-pos="top"]    { top: 0; }
.vio-progress-bar-track[data-pos="bottom"] { bottom: 0; }

.vio-progress-bar-fill {
	height: 100%;
	width: 100%;
	background-color: #4054b2;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform linear;
}

/* ============================================================
   SLIDE COUNTER
   ============================================================ */

.vio-slide-counter {
	position: absolute;
	bottom: 22px;
	right: 22px;
	z-index: 15;
	color: #fff;
	font-size: .9em;
	font-weight: 600;
	letter-spacing: .05em;
	line-height: 1;
	text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
	background: rgba(0, 0, 0, .35);
	padding: 6px 12px;
	border-radius: 20px;
	font-family: 'Courier New', monospace;
}

.vio-counter-current {
	font-size: 1.2em;
}

.vio-counter-sep {
	margin: 0 2px;
	opacity: .7;
}

/* ============================================================
   SLIDE FULL LINK  (JS-driven via data-slide-url)
   ============================================================ */

/*
 * The full-slide click is handled by JS (Swiper click event).
 * We only need visual cues here.
 *
 * Key fix: .vio-slide-content covers the whole slide with
 * position:absolute; inset:0 — so it must have pointer-events:none
 * in order for Swiper's click event to fire correctly on the slide.
 * We then restore pointer-events only on interactive children.
 */

.vio-has-link {
	cursor: pointer;
}

/* Make content layer pass-through so Swiper click fires on the slide */
.vio-has-link .vio-slide-content {
	pointer-events: none;
}

/* Re-enable clicks on interactive children */
.vio-has-link .vio-slide-btn,
.vio-has-link .vio-slide-btn-wrap,
.vio-has-link .vio-slide-title a,
.vio-has-link .vio-slide-desc  a {
	pointer-events: auto;
	position: relative;
	z-index: 10;
}

/* ============================================================
   OBJECT-FIT MODE SPECIFIC RULES
   ============================================================ */

/*
 * The base object-fit/position is declared on .vio-slide-bg-img above.
 * The global Elementor selector  {{WRAPPER}} .vio-slide-bg-img  overrides it.
 * Per-slide inline style has the highest priority and overrides everything.
 *
 * Priority chain (lowest → highest):
 *  1. .vio-slide-bg-img { object-fit: cover }       ← base CSS
 *  2. {{WRAPPER}} .vio-slide-bg-img { object-fit: X } ← Elementor global setting
 *  3. style="object-fit: Y" on the <img>            ← per-slide inline override
 */

/*
 * CONTAIN
 * تصویر کامل نمایش داده می‌شود — فضای خالی با رنگ پس‌زمینه اسلاید پر می‌شود
 * When object-fit:contain is set via inline style or global selector,
 * the slide bg-color (black by default) fills the empty space.
 */

/* Slides with contain or none: don't zoom in Ken Burns (it looks bad) */
.vio--ken-burns .vio-swiper-slide.swiper-slide-active .vio-slide-bg-img[style*="object-fit:contain"],
.vio--ken-burns .vio-swiper-slide.swiper-slide-active .vio-slide-bg-img[style*="object-fit: contain"],
.vio--ken-burns .vio-swiper-slide.swiper-slide-active .vio-slide-bg-img[style*="object-fit:none"],
.vio--ken-burns .vio-swiper-slide.swiper-slide-active .vio-slide-bg-img[style*="object-fit: none"],
.vio--ken-burns .vio-swiper-slide.swiper-slide-active .vio-slide-bg-img[style*="object-fit:scale-down"],
.vio--ken-burns .vio-swiper-slide.swiper-slide-active .vio-slide-bg-img[style*="object-fit: scale-down"] {
	animation: none !important;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
	.vio-slide-title   { font-size: 2em;  }
	.vio-slide-desc    { font-size: 1em;  }
	.vio-slide-content { padding: 30px;   }
	.vio-slide-inner   { max-width: 540px;}
}

/* Mobile */
@media (max-width: 767px) {
	.vio-slide-title   { font-size: 1.5em; }
	.vio-slide-desc    { font-size: .9em;  }
	.vio-slide-content { padding: 20px;    }
	.vio-slide-inner   { max-width: 100%;  }

	.vio-arrow { display: none; } /* hide arrows on mobile for better UX */

	.vio-slide-counter { bottom: 14px; right: 14px; font-size: .75em; }

	/* Dots sit above counter gap */
	.vio-pagination { bottom: 14px; }

	.vio-slide-btn { padding: 10px 22px; font-size: .9em; }
}

/* Very small screens */
@media (max-width: 400px) {
	.vio-slide-title { font-size: 1.2em; }
	.vio-slide-desc  { font-size: .82em; }
}