/*
 * ARN Hero — Editorial: magazine layout slider (builds on hero-base.css).
 *
 * data-view  cover   magazine cover over the full media
 *            column  text column on a light page beside the media
 *            inset   framed media band on a dark page
 * data-fx    fade | wipe (the media is revealed in the reading direction)
 *
 * Slide grid: labels (top corners) / media row / content (short text, giant
 * title, author line, link). The cover and the desktop column place the media
 * out of the grid; the inset view and the phone column keep it in the middle
 * row, so the title never covers it.
 *
 * Tokens: --vdx-editorial-title-width, --vdx-editorial-surface (page colour of
 * the column and inset views), --vdx-editorial-rule (thin lines),
 * --vdx-editorial-nav (counter and arrows). The progress line carries
 * --vdx-progress (0…1), set by hero-deck.js.
 *
 * Phone first; the 768 px and 1025 px steps follow Elementor's breakpoints.
 */

.vdx-editorial {
	--vdx-editorial-top: calc(var(--vdx-safe-top, 0px) + 20px);
	--vdx-editorial-bottom: 92px;
	--vdx-editorial-title-size: clamp(2.8rem, 1.1rem + 7.4vw, 9.5rem);
	--vdx-editorial-surface: var(--vendix-color-bg-light, #f7f8fa);
	--vdx-editorial-rule: color-mix(in srgb, #ffffff 42%, transparent);
	--vdx-editorial-nav: #ffffff;
	--vdx-progress-color: var(--vdx-accent);
	--vdx-links-bottom: 72px;

	background: var(--vdx-ink);
}

/* Corner links at the top push the labels below them. */
.vdx-editorial.vdx-hero--links-top {
	--vdx-editorial-top: calc(var(--vdx-safe-top, 0px) + 64px);
}

/* ------------------------------------------------------------------ */
/* Slides                                                              */
/* ------------------------------------------------------------------ */

.vdx-editorial .vdx-editorial__stage {
	position: absolute;
	inset: 0;
	touch-action: pan-y;
}

.vdx-editorial .vdx-editorial__slide {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-areas:
		"labels"
		"media"
		"content";
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: auto minmax(0, 1fr) auto;
	padding-block: var(--vdx-editorial-top) var(--vdx-editorial-bottom);
	padding-inline: var(--vdx-gutter);
	visibility: hidden;
}

.vdx-editorial .vdx-editorial__slide.is-active,
.vdx-editorial .vdx-editorial__slide.is-leaving {
	visibility: visible;
}

.vdx-editorial .vdx-editorial__slide.is-active {
	z-index: 2;
}

.vdx-editorial .vdx-editorial__slide.is-leaving {
	z-index: 1;
}

.vdx-editorial .vdx-editorial__media {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: var(--vdx-ink);
}

.vdx-editorial .vdx-editorial__visual {
	position: absolute;
	inset: 0;
}

/* Strong at the bottom (title), light at the top (labels). */
.vdx-editorial .vdx-editorial__shade {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(to top, color-mix(in srgb, var(--vdx-shade) 88%, transparent), color-mix(in srgb, var(--vdx-shade) 30%, transparent) 58%, transparent 80%),
		linear-gradient(color-mix(in srgb, var(--vdx-shade) 50%, transparent), transparent 22%);
	opacity: var(--vdx-shade-opacity);
}

/* ------------------------------------------------------------------ */
/* Labels                                                              */
/* ------------------------------------------------------------------ */

.vdx-editorial .vdx-editorial__labels {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	grid-area: labels;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px 16px;
	padding-block-end: 12px;
	border-block-end: 1px solid var(--vdx-editorial-rule);
}

.vdx-editorial .vdx-editorial__label {
	color: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: var(--vdx-tracking-wide);
	line-height: 1.4;
	text-transform: uppercase;
}

.vdx-editorial .vdx-editorial__label--end {
	margin-inline-start: auto;
	text-align: end;
}

/* ------------------------------------------------------------------ */
/* Content                                                             */
/* ------------------------------------------------------------------ */

.vdx-editorial .vdx-editorial__content {
	position: relative;
	display: grid;
	grid-area: content;
	justify-items: start;
	gap: 14px;
	min-inline-size: 0;
}

.vdx-editorial .vdx-editorial__text {
	max-inline-size: 26em;
	margin: 0;
	color: var(--vdx-on-media-soft);
	font-size: 15px;
	line-height: 1.55;
	text-wrap: pretty;
}

.vdx-editorial .vdx-editorial__title {
	max-inline-size: var(--vdx-editorial-title-width, 100%);
	margin: 0;
	color: inherit;
	font-size: var(--vdx-editorial-title-size);
	font-weight: 800;
	letter-spacing: -0.04em;
	line-height: calc(var(--vdx-title-leading) - 0.12);
	overflow-wrap: anywhere;
}

.vdx-editorial:lang(ar) .vdx-editorial__title {
	letter-spacing: normal;
}

.vdx-editorial .vdx-editorial__byline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 14px;
	inline-size: 100%;
	margin: 0;
	padding-block-start: 12px;
	border-block-start: 1px solid var(--vdx-editorial-rule);
	color: inherit;
	font-size: 13px;
	line-height: 1.5;
}

.vdx-editorial .vdx-editorial__author {
	font-weight: 700;
}

.vdx-editorial .vdx-editorial__date {
	opacity: 0.78;
}

.vdx-editorial .vdx-editorial__author + .vdx-editorial__date::before {
	content: "";
	display: inline-block;
	inline-size: 18px;
	margin-inline-end: 14px;
	border-block-start: 1px solid currentColor;
	vertical-align: middle;
}

.vdx-editorial .vdx-editorial__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
}

/* The link of a story reads as an underlined text link. */
.vdx-editorial .vdx-editorial__actions .vdx-btn {
	min-block-size: 44px;
	padding: 10px 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 6px;
}

.vdx-editorial .vdx-editorial__actions .vdx-btn:hover {
	background: transparent;
	color: var(--vdx-accent);
	text-decoration: underline;
}

/* ------------------------------------------------------------------ */
/* Transitions                                                         */
/* ------------------------------------------------------------------ */

.vdx-editorial .vdx-editorial__slide.is-active .vdx-editorial__media {
	animation: vdx-editorial-fade var(--vdx-speed) var(--vdx-ease) both;
}

.vdx-editorial[data-fx="wipe"] .vdx-editorial__slide.is-active .vdx-editorial__media {
	animation-name: vdx-editorial-wipe;
}

.vdx-editorial.vdx-hero--rtl[data-fx="wipe"] .vdx-editorial__slide.is-active .vdx-editorial__media {
	animation-name: vdx-editorial-wipe-rtl;
}

.vdx-editorial .vdx-editorial__slide.is-active :is(.vdx-editorial__labels, .vdx-editorial__content > *) {
	animation: vdx-editorial-rise calc(var(--vdx-speed) * 0.9) var(--vdx-ease) both;
	animation-delay: calc(var(--vdx-speed) * 0.25);
}

.vdx-editorial .vdx-editorial__slide.is-active .vdx-editorial__content > :nth-child(2) {
	animation-delay: calc(var(--vdx-speed) * 0.35);
}

.vdx-editorial .vdx-editorial__slide.is-active .vdx-editorial__content > :nth-child(3) {
	animation-delay: calc(var(--vdx-speed) * 0.45);
}

.vdx-editorial .vdx-editorial__slide.is-active .vdx-editorial__content > :nth-child(4) {
	animation-delay: calc(var(--vdx-speed) * 0.55);
}

.vdx-editorial .vdx-editorial__slide.is-leaving :is(.vdx-editorial__labels, .vdx-editorial__content) {
	animation: vdx-editorial-fade-out calc(var(--vdx-speed) * 0.4) ease both;
}

@keyframes vdx-editorial-fade {
	from {
		opacity: 0;
	}
}

@keyframes vdx-editorial-fade-out {
	to {
		opacity: 0;
	}
}

@keyframes vdx-editorial-wipe {
	from {
		clip-path: inset(0 100% 0 0);
	}

	to {
		clip-path: inset(0);
	}
}

@keyframes vdx-editorial-wipe-rtl {
	from {
		clip-path: inset(0 0 0 100%);
	}

	to {
		clip-path: inset(0);
	}
}

@keyframes vdx-editorial-rise {
	from {
		opacity: 0;
		transform: translateY(18px);
	}
}

/* ------------------------------------------------------------------ */
/* Counter, progress line and arrows                                   */
/* ------------------------------------------------------------------ */

.vdx-editorial .vdx-editorial__nav {
	position: absolute;
	z-index: 5;
	inset-block-end: 20px;
	inset-inline-end: var(--vdx-gutter);
	display: flex;
	align-items: center;
	gap: 4px;
	color: var(--vdx-editorial-nav);
}

.vdx-editorial .vdx-editorial__nav .vdx-hero-toggle {
	margin-inline-end: 6px;
}

.vdx-editorial .vdx-editorial__count {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 8px;
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	line-height: 1;
}

.vdx-editorial .vdx-editorial__count-current.is-changing {
	animation: vdx-editorial-rise 0.45s var(--vdx-ease) both;
}

.vdx-editorial .vdx-editorial__bar {
	position: relative;
	inline-size: 44px;
	block-size: 2px;
	overflow: hidden;
	background: color-mix(in srgb, currentColor 30%, transparent);
}

.vdx-editorial .vdx-editorial__bar::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--vdx-progress-color);
	transform: scaleX(var(--vdx-progress, 0));
	transform-origin: left;
}

.vdx-editorial.vdx-hero--rtl .vdx-editorial__bar::after {
	transform-origin: right;
}

.vdx-editorial .vdx-editorial__arrow {
	display: grid;
	flex: none;
	place-items: center;
	inline-size: 40px;
	block-size: 40px;
	border: 1px solid color-mix(in srgb, var(--vdx-editorial-nav) 40%, transparent);
	border-radius: 50%;
	color: var(--vdx-editorial-nav);
	transition: border-color 0.2s ease;
}

.vdx-editorial .vdx-editorial__arrow:is(:hover, :focus) {
	border-color: var(--vdx-editorial-nav);
	color: var(--vdx-editorial-nav);
}

.vdx-editorial .vdx-editorial__arrow svg {
	inline-size: 18px;
	block-size: 18px;
}

/* ------------------------------------------------------------------ */
/* View: text column on a light page beside the media                  */
/* ------------------------------------------------------------------ */

.vdx-editorial[data-view="column"] {
	--vdx-editorial-rule: color-mix(in srgb, var(--vendix-color-heading, #111827) 22%, transparent);
	--vdx-editorial-nav: var(--vendix-color-heading, #111827);

	background: var(--vdx-editorial-surface);
	color: var(--vendix-color-heading, #111827);
}

/* Phone: the media fills the middle row from edge to edge. */
.vdx-editorial[data-view="column"] .vdx-editorial__media,
.vdx-editorial[data-view="inset"] .vdx-editorial__media {
	position: relative;
	inset: auto;
	grid-area: media;
	margin-block: 16px 22px;
}

.vdx-editorial[data-view="column"] .vdx-editorial__media {
	margin-inline: calc(var(--vdx-gutter) * -1);
}

.vdx-editorial[data-view="column"] .vdx-editorial__shade,
.vdx-editorial[data-view="inset"] .vdx-editorial__shade {
	background: color-mix(in srgb, var(--vdx-shade) 10%, transparent);
}

.vdx-editorial[data-view="column"] .vdx-editorial__text {
	color: var(--vendix-color-text, #374151);
}

/* ------------------------------------------------------------------ */
/* View: framed media band on a dark page                              */
/* ------------------------------------------------------------------ */

.vdx-editorial[data-view="inset"] {
	--vdx-editorial-surface: var(--vdx-ink);

	background: var(--vdx-editorial-surface);
}

.vdx-editorial[data-view="inset"] .vdx-editorial__media {
	outline: 1px solid var(--vdx-editorial-rule);
	outline-offset: 6px;
}

/* ------------------------------------------------------------------ */
/* Tablet                                                              */
/* ------------------------------------------------------------------ */

@media (min-width: 768px) {
	.vdx-editorial {
		--vdx-editorial-top: calc(var(--vdx-safe-top, 0px) + 28px);
		--vdx-editorial-bottom: 104px;
	}

	.vdx-editorial.vdx-hero--links-top {
		--vdx-editorial-top: calc(var(--vdx-safe-top, 0px) + 72px);
	}

	.vdx-editorial .vdx-editorial__label {
		font-size: 12px;
	}

	.vdx-editorial .vdx-editorial__content {
		gap: 18px;
	}

	.vdx-editorial .vdx-editorial__text {
		font-size: 17px;
	}

	.vdx-editorial .vdx-editorial__byline {
		font-size: 14px;
	}

	.vdx-editorial .vdx-editorial__nav {
		inset-block-end: 28px;
	}

	.vdx-editorial .vdx-editorial__bar {
		inline-size: 72px;
	}
}

/* ------------------------------------------------------------------ */
/* Desktop                                                             */
/* ------------------------------------------------------------------ */

@media (min-width: 1025px) {
	/* The author line and the link share one row. */
	.vdx-editorial .vdx-editorial__content {
		grid-template-columns: minmax(0, 1fr) auto;
		column-gap: 32px;
	}

	.vdx-editorial .vdx-editorial__content > :not(.vdx-editorial__actions) {
		grid-column: 1 / -1;
	}

	.vdx-editorial .vdx-editorial__content > .vdx-editorial__byline {
		grid-column: 1;
	}

	/* The short text sits at the end side above the title. */
	.vdx-editorial[data-view="inset"] .vdx-editorial__text {
		justify-self: end;
	}

	/* Column: the media fills the end half; the text column takes the start half. */
	.vdx-editorial[data-view="column"] .vdx-editorial__slide {
		grid-template-areas:
			"labels labels"
			"content .";
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		grid-template-rows: auto minmax(0, 1fr);
		column-gap: calc(var(--vdx-gutter) * 2);
	}

	.vdx-editorial[data-view="column"] .vdx-editorial__media {
		position: absolute;
		inset-block: 0;
		inset-inline: 50% 0;
		margin: 0;
	}

	.vdx-editorial[data-view="column"] .vdx-editorial__labels {
		border-block-end: 0;
	}

	.vdx-editorial[data-view="column"] .vdx-editorial__label--end {
		color: #ffffff;
	}

	.vdx-editorial[data-view="column"] .vdx-editorial__content {
		align-self: end;
	}

	/* Over the media half: light counter, light links on the end side. */
	.vdx-editorial[data-view="column"] {
		--vdx-editorial-nav: #ffffff;
	}

	.vdx-editorial[data-view="column"] :is(.vdx-hero-links--top-start, .vdx-hero-links--bottom-start) {
		--vdx-link-color: var(--vendix-color-heading, #111827);
	}

	.vdx-editorial[data-view="inset"] .vdx-editorial__media {
		margin-block: 22px 30px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vdx-editorial[data-fx] .vdx-editorial__slide.is-active .vdx-editorial__media,
	.vdx-editorial.vdx-hero--rtl[data-fx] .vdx-editorial__slide.is-active .vdx-editorial__media {
		animation-name: vdx-editorial-fade;
	}

	.vdx-editorial .vdx-editorial__slide.is-active :is(.vdx-editorial__labels, .vdx-editorial__content > *),
	.vdx-editorial .vdx-editorial__count-current.is-changing {
		animation-name: vdx-editorial-fade;
		animation-delay: 0s;
	}
}
