/* Article Slider — front end
 *
 * The height is a CSS variable on .artsl and nothing else touches it: no
 * inline height written by JS, no transform: scale(), no fixed canvas. The
 * viewport is a plain block with overflow hidden and every slide is absolutely
 * positioned inside it, so the layout is identical in LTR and RTL and cannot
 * drift while the theme is still laying out the column.
 */

.artsl {
	position: relative;
	width: 100%;
	/* Isolate from theme direction: the slide transforms are computed in JS
	   with an explicit RTL sign, so the box itself must not flip too. */
	direction: ltr;
}

.artsl__viewport {
	position: relative;
	width: 100%;
	height: var(--artsl-h, 420px);
	overflow: hidden;
	border-radius: var(--artsl-radius, 0);
	background: #101418;
}

@media (max-width: 782px) {
	.artsl__viewport {
		height: var(--artsl-h-m, 260px);
	}
}

.artsl__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	z-index: 1;
	transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.65, 0, 0.35, 1);
	will-change: opacity, transform;
}

.artsl__slide.is-active {
	opacity: 1;
	z-index: 2;
}

/* Image fills the slide. object-fit does the cropping, so a portrait photo in
   a wide slot never letterboxes and never stretches. */
.artsl__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 50%;
	display: block;
	margin: 0;
	padding: 0;
	max-width: none;
	border-radius: 0;
}

.artsl__img--empty {
	background: linear-gradient(135deg, #1b2026, #0c0f13);
}

.artsl__scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(8, 10, 12, var(--artsl-overlay, 0.55)) 0%,
		rgba(8, 10, 12, calc(var(--artsl-overlay, 0.55) * 0.75)) 38%,
		rgba(8, 10, 12, 0) 78%
	);
	z-index: 2;
}

.artsl__body {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	z-index: 3;
	padding: clamp(14px, 3.4%, 30px);
	/* Text follows the site, independent of the slider box direction. */
	direction: rtl;
	text-align: right;
	color: #fff;
	pointer-events: none;
}

.artsl:not(.artsl--rtl) .artsl__body {
	direction: ltr;
	text-align: left;
}

.artsl__cat {
	display: inline-block;
	margin-bottom: 8px;
	padding: 3px 10px;
	border-radius: 3px;
	background: var(--artsl-accent, #c1272d);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.6;
}

.artsl__title {
	margin: 0;
	padding: 0;
	color: #fff;
	font-size: var(--artsl-title, 26px);
	font-weight: 800;
	line-height: 1.4;
	text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
	/* Never let a long Arabic headline grow past the slide and clip. */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.artsl__date {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	opacity: 0.8;
}

@media (max-width: 782px) {
	.artsl__title {
		font-size: var(--artsl-title-m, 18px);
	}

	.artsl__date {
		font-size: 11px;
	}
}

/* Whole slide is the link. */
.artsl__hit {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: block;
	text-decoration: none;
}

.artsl__hit:focus-visible {
	outline: 3px solid var(--artsl-accent, #c1272d);
	outline-offset: -3px;
}

/* Chrome
   ------------------------------------------------------------------ */

.artsl__arrow {
	position: absolute;
	top: 50%;
	z-index: 6;
	width: 42px;
	height: 42px;
	margin-top: -21px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.4);
	cursor: pointer;
	transition: background 0.2s ease;
}

.artsl__arrow:hover,
.artsl__arrow:focus-visible {
	background: var(--artsl-accent, #c1272d);
}

.artsl__arrow::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 10px;
	height: 10px;
	border-top: 2px solid #fff;
	border-left: 2px solid #fff;
}

.artsl__arrow--prev {
	left: 14px;
}

.artsl__arrow--prev::before {
	transform: translate(-30%, -50%) rotate(-45deg);
}

.artsl__arrow--next {
	right: 14px;
}

.artsl__arrow--next::before {
	transform: translate(-70%, -50%) rotate(135deg);
}

.artsl__dots {
	position: absolute;
	z-index: 6;
	inset-inline: 0;
	bottom: 12px;
	display: flex;
	justify-content: center;
	gap: 8px;
}

.artsl__dot {
	width: 22px;
	height: 4px;
	padding: 0;
	border: 0;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.45);
	cursor: pointer;
	transition: background 0.2s ease, width 0.2s ease;
}

.artsl__dot.is-active {
	width: 34px;
	background: var(--artsl-accent, #c1272d);
}

.artsl__dot:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

@media (max-width: 600px) {
	.artsl__arrow {
		width: 34px;
		height: 34px;
		margin-top: -17px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.artsl__slide {
		transition: none;
	}
}
