/* «اسلایدر اصلی» (Integrations\Home\Slider, home/slider.js). */

.fhm-slider {
	position: relative;
	block-size: var(--fhm-h, 460px);
	border-radius: calc(var(--fhm-radius, 16px) + 6px);
	overflow: hidden;
	background: #16121f;
	isolation: isolate;
	touch-action: pan-y;
}

.fhm-slider__track {
	position: absolute;
	inset: 0;
}

/* Dragged with the mouse or a finger (slider.js): no text or picture gets picked up. */
.fhm-slider :is(img, a) {
	-webkit-user-drag: none;
	user-select: none;
}

.fhm-slider.is-dragging {
	cursor: grabbing;
	user-select: none;
}

.fhm-slider.is-dragging .fhm-slide__cover {
	pointer-events: none;
}

/* Slides lie on top of each other and cross-fade. */
.fhm-slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 40px clamp(24px, 6%, 72px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.7s var(--fhm-ease), visibility 0s linear 0.7s;
}

.fhm-slide.is-on {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.7s var(--fhm-ease), visibility 0s;
}

.fhm-slide__bg,
.fhm-slide__bg img {
	position: absolute;
	inset: 0;
	z-index: -1;
	inline-size: 100%;
	block-size: 100%;
}

.fhm-slide__bg img {
	max-inline-size: none;
	object-fit: cover;
	transform: scale(1.04);
	transition: transform 6s linear;
}

.fhm-slide.is-on .fhm-slide__bg img {
	transform: scale(1);
}

/* Readable text over any photo: a soft shade from the text's side. */
.fhm-slide.is-light::before,
.fhm-slide.is-dark::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
}

.fhm-slide.is-light {
	color: #fff;
}

.fhm-slide.is-light::before {
	background: linear-gradient(to left, rgb(14 10 24 / 0.72), rgb(14 10 24 / 0.2) 55%, transparent 75%);
}

.fhm-slide.is-dark {
	color: #1d1730;
}

.fhm-slide.is-dark::before {
	background: linear-gradient(to left, rgb(255 255 255 / 0.75), rgb(255 255 255 / 0.15) 55%, transparent 75%);
}

.fhm-slide__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	max-inline-size: 440px;
}

.fhm-slide__eyebrow {
	padding: 4px 12px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--fhm-accent) 85%, transparent);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
}

.fhm-slide__title {
	font-size: clamp(24px, 3.2vw, 40px);
	font-weight: 900;
	line-height: 1.3;
	text-wrap: balance;
}

.fhm-slide__text {
	font-size: clamp(14px, 1.4vw, 18px);
	opacity: 0.9;
}

/* A pill button with its arrow in a circle of its own. */
.fhm-slide__btn {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-block-size: 48px;
	margin-block-start: 8px;
	padding: 6px 22px 6px 6px;
	border-radius: 999px;
	background: #fff;
	color: #1d1730 !important;
	font-weight: 800;
	box-shadow: 0 10px 30px rgb(0 0 0 / 0.18);
	transition: transform 0.2s var(--fhm-ease), box-shadow 0.2s;
}

.fhm-slide.is-dark .fhm-slide__btn {
	background: var(--fhm-accent);
	color: #fff !important;
}

.fhm-slide__btn:hover {
	transform: translateY(-2px);
}

.fhm-slide__btn:active {
	transform: scale(0.98);
}

.fhm-slide__btn-icon {
	display: grid;
	place-items: center;
	inline-size: 36px;
	block-size: 36px;
	border-radius: 50%;
	background: var(--fhm-accent);
	color: #fff;
	transition: transform 0.2s var(--fhm-ease);
}

.fhm-slide.is-dark .fhm-slide__btn-icon {
	background: rgb(255 255 255 / 0.2);
}

.fhm-slide__btn:hover .fhm-slide__btn-icon {
	transform: translateX(-3px);
}

/* The points: a small column at the slide's far end. */
.fhm-slide__points {
	display: flex;
	flex-direction: column;
	gap: 18px;
	max-inline-size: 240px;
}

.fhm-slide__points li {
	display: flex;
	align-items: center;
	gap: 12px;
	line-height: 1.5;
}

.fhm-slide__points svg {
	flex: none;
	padding: 8px;
	inline-size: 40px;
	block-size: 40px;
	border: 1px solid rgb(255 255 255 / 0.25);
	border-radius: 12px;
	background: rgb(255 255 255 / 0.08);
	backdrop-filter: blur(8px);
}

.fhm-slide.is-dark .fhm-slide__points svg {
	border-color: rgb(29 23 48 / 0.12);
	background: rgb(255 255 255 / 0.6);
}

.fhm-slide__points span {
	display: flex;
	flex-direction: column;
}

.fhm-slide__points b {
	font-size: 13px;
}

.fhm-slide__points small {
	font-size: 12px;
	opacity: 0.8;
}

/* A ready picture with its own text: no shade, no padding; the whole slide is the link. */
.fhm-slide.is-art {
	padding: 0;
}

.fhm-slide__cover {
	position: absolute;
	inset: 0;
	z-index: 1;
}

.fhm-slide__cover:focus-visible {
	outline-offset: -4px;
}

/* Arrows and dots. */
.fhm-slider__arrow {
	position: absolute;
	inset-block-start: 50%;
	z-index: 2;
	display: grid;
	place-items: center;
	inline-size: 44px;
	block-size: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgb(255 255 255 / 0.92);
	color: #1d1730;
	box-shadow: 0 6px 18px rgb(0 0 0 / 0.15);
	cursor: pointer;
	transform: translateY(-50%);
	transition: transform 0.2s var(--fhm-ease), background-color 0.2s;
}

.fhm-slider__arrow:hover {
	background: #fff;
}

/* «پنهان»: the arrows come in only while the pointer is over the slider (or a key is on them). */
.fhm-slider.is-arrows-hover .fhm-slider__arrow {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s var(--fhm-ease), transform 0.2s var(--fhm-ease), background-color 0.2s;
}

.fhm-slider.is-arrows-hover:hover .fhm-slider__arrow,
.fhm-slider.is-arrows-hover .fhm-slider__arrow:focus-visible {
	opacity: 1;
	pointer-events: auto;
}

.fhm-slider__arrow:active {
	transform: translateY(-50%) scale(0.92);
}

.fhm-slider__arrow.is-prev {
	inset-inline-start: 16px;
}

.fhm-slider__arrow.is-next {
	inset-inline-end: 16px;
}

/* The chevron points down; in a right-to-left page «قبلی» points right, «بعدی» left. */
.fhm-slider__arrow.is-prev svg {
	transform: rotate(-90deg);
}

.fhm-slider__arrow.is-next svg {
	transform: rotate(90deg);
}

.fhm-slider__dots {
	position: absolute;
	inset-block-end: 16px;
	inset-inline: 0;
	z-index: 2;
	display: flex;
	justify-content: center;
}

/* The button is a 24px touch target; the dot is drawn inside it. */
.fhm-slider__dot {
	display: grid;
	place-items: center;
	inline-size: 24px;
	block-size: 24px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	transition: inline-size 0.3s var(--fhm-ease);
}

.fhm-slider__dot::before {
	content: "";
	inline-size: 8px;
	block-size: 8px;
	border-radius: 999px;
	background: rgb(255 255 255 / 0.5);
	transition: inline-size 0.3s var(--fhm-ease), background-color 0.3s;
}

.fhm-slider__dot.is-on {
	inline-size: 34px;
}

.fhm-slider__dot.is-on::before {
	inline-size: 26px;
	background: #fff;
}

@media (max-width: 1100px) {
	.fhm-slide__points {
		display: none;
	}
}

@media (max-width: 767px) {
	.fhm-slider {
		block-size: var(--fhm-h-m, 300px);
		border-radius: var(--fhm-radius, 16px);
	}

	.fhm-slide {
		align-items: flex-end;
		padding: 20px 20px 40px;
	}

	.fhm-slide.is-light::before {
		background: linear-gradient(to top, rgb(14 10 24 / 0.78), rgb(14 10 24 / 0.1) 60%, transparent);
	}

	.fhm-slide.is-dark::before {
		background: linear-gradient(to top, rgb(255 255 255 / 0.85), transparent 65%);
	}

	.fhm-slide__bg img {
		object-position: 20% center;
	}

	.fhm-slide__body {
		gap: 6px;
	}

	.fhm-slide__btn {
		min-block-size: 44px;
		margin-block-start: 4px;
		padding-inline-start: 16px;
		font-size: 13px;
	}

	.fhm-slide__btn-icon {
		inline-size: 32px;
		block-size: 32px;
	}

	.fhm-slider__arrow {
		display: none;
	}

	.fhm-slider__dots {
		inset-block-end: 12px;
	}

	/* Pictures with their own text are shown whole on phones (3:2), never cropped. */
	/*
	 * Pictures with their own text are shown whole (3:2). Elementor's flex
	 * column measures its widgets before it knows their width, so a height
	 * from the width counts as zero there: the slider's column is a plain
	 * block on phones.
	 */
	.e-con:has(> .elementor-widget > .fhm-slider.is-art) {
		display: block;
	}

	.fhm-slider.is-art {
		block-size: auto;
		aspect-ratio: 3 / 2;
	}

	.fhm-slider.is-art .fhm-slide__bg img {
		object-position: center;
	}

	.fhm-slider.is-art .fhm-slider__dots {
		inset-block-end: 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fhm-slide,
	.fhm-slide.is-on,
	.fhm-slide__bg img {
		transition: none;
		transform: none;
	}
}
