/* Systical — Blog Slider (posts rail with a hover-expanding card) */

.sys-bl {
	--bl-accent: #9afd0d;
	--bl-max: 1400px;
	--bl-gutter: 40px;
	--bl-gap: 22px;
	--bl-card-w: 380px;
	--bl-card-w-open: 480px;
	--bl-card-w-shut: 340px;
	--bl-media-h: 240px;
	--bl-radius: 16px;
	--bl-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--bl-speed: 520ms;
	position: relative;
	/* Light band, matching the FAQ section directly above it. Every colour here
	   is also an Elementor control, so the section can be flipped dark without
	   touching this file. */
	background-color: #fff;
	padding: 110px 0;
}

/* The rail is the only thing allowed to scroll sideways. Without this the
   overhanging cards would extend the document and give the whole page a
   horizontal scrollbar. */
.sys-bl,
.sys-bl__viewport {
	max-width: 100%;
}

.sys-bl__inner {
	max-width: var(--bl-max);
	margin: 0 auto;
	padding: 0 var(--bl-gutter);
}

/* ---------- heading ---------- */

.sys-bl__head {
	margin-bottom: 56px;
}

.sys-bl__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	margin-bottom: 22px;
	padding: 9px 18px;
	border-radius: 999px;
	background-color: #141414;
	color: #fff;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
}

.sys-bl__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: var(--bl-accent);
}

/* Button rides with the first line of the title, not the last, so a title that
   wraps to two or three lines does not drag it down the page. */
.sys-bl__head-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 32px;
}

.sys-bl__title {
	max-width: 15ch;
	margin: 0;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	font-size: clamp(32px, 4.4vw, 60px);
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.025em;
	color: #070707;
}

.sys-bl__all {
	flex: 0 0 auto;
	padding: 16px 30px;
	border: 1px solid #dddddd;
	border-radius: 999px;
	background-color: transparent;
	color: #070707;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition:
		background-color 220ms ease,
		border-color 220ms ease,
		color 220ms ease;
}

.sys-bl__all:hover,
.sys-bl__all:focus-visible {
	background-color: var(--bl-accent);
	border-color: var(--bl-accent);
	color: #070707;
}

/* ---------- rail ---------- */

.sys-bl__viewport {
	overflow-x: auto;
	overflow-y: hidden;
	/* Chrome/Safari keep momentum scrolling; the bar itself is hidden because
	   the cards already signal that the row continues. */
	scrollbar-width: none;
	-ms-overflow-style: none;
	overscroll-behavior-x: contain;
}

.sys-bl__viewport::-webkit-scrollbar {
	display: none;
}

.sys-bl--draggable .sys-bl__viewport {
	cursor: grab;
}

.sys-bl.is-dragging .sys-bl__viewport {
	cursor: grabbing;
	scroll-behavior: auto;
	/* Text selection during a drag leaves the whole rail highlighted. */
	user-select: none;
}

/* Cards must line up with the heading above them, so the first card's left
   edge is the gutter of the centred container — not the edge of the screen.
   Past the max width that is a plain gutter, which is what the max() gives. */
.sys-bl__track {
	display: flex;
	gap: var(--bl-gap);
	width: max-content;
	padding-right: var(--bl-gutter);
	padding-left: max(
		var(--bl-gutter),
		calc((100% - var(--bl-max)) / 2 + var(--bl-gutter))
	);
}

/* ---------- card ---------- */

.sys-bl__card {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 0 0 var(--bl-card-w);
	width: var(--bl-card-w);
	transition:
		flex-basis var(--bl-speed) var(--bl-ease),
		width var(--bl-speed) var(--bl-ease);
}

/* The whole card is the hit area. Only the title text and the image were
   clickable before, so a click on the excerpt — or in the gap between two
   title lines — did nothing at all. Stretching the title link leaves the
   accessible name and the href exactly where they were. */
.sys-bl__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* A drag would otherwise be read as a hover over whichever card passes under
   the cursor, so the row would ripple while it moves. */
.sys-bl.is-dragging .sys-bl__card {
	pointer-events: none;
}

.sys-bl__media {
	position: relative;
	display: block;
	height: var(--bl-media-h);
	margin-bottom: 20px;
	overflow: hidden;
	border-radius: var(--bl-radius);
	background-color: #f1f1f1;
}

.sys-bl__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 620ms var(--bl-ease);
}

.sys-bl__img--empty {
	background: linear-gradient(135deg, #f4f4f4 0%, #e6e6e6 100%);
}

.sys-bl__card:hover .sys-bl__img {
	transform: scale(1.04);
}

.sys-bl__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.sys-bl__terms {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 14px;
	padding: 0;
	list-style: none;
}

.sys-bl__term {
	padding: 7px 14px;
	border: 1px solid #dddddd;
	border-radius: 999px;
	color: #070707;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	font-size: 13px;
	line-height: 1;
	white-space: nowrap;
}

.sys-bl__card-title {
	margin: 0 0 12px;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.28;
	letter-spacing: -0.015em;
	color: #070707;
}

.sys-bl__link {
	color: inherit;
	text-decoration: none;
}

.sys-bl__link:hover,
.sys-bl__link:focus-visible {
	color: var(--bl-accent);
}

.sys-bl__excerpt {
	margin: 0;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.6;
	color: #5a5a5a;
	/* Two lines on every card, so a long excerpt cannot make one card taller
	   than its neighbours as the row expands and contracts. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---------- the expansion ----------
   Hover only. On a touch screen :hover sticks after a tap, which would leave
   a card stuck open, so the whole effect is behind a hover query and touch
   devices get a plain equal-width rail. */

@media (hover: hover) and (pointer: fine) {
	/* At rest the first card leads, so the interaction is visible before the
	   pointer arrives. */
	.sys-bl--lead .sys-bl__track:not(:hover) .sys-bl__card:first-child {
		flex-basis: var(--bl-card-w-open);
		width: var(--bl-card-w-open);
	}

	/* Pointer anywhere on the rail: everything contracts... */
	.sys-bl__track:hover .sys-bl__card {
		flex-basis: var(--bl-card-w-shut);
		width: var(--bl-card-w-shut);
	}

	/* ...and the one under it expands. Same specificity as the rule above and
	   declared after it, so this is what wins on the hovered card. */
	.sys-bl__track .sys-bl__card:hover {
		flex-basis: var(--bl-card-w-open);
		width: var(--bl-card-w-open);
	}

	/* Keyboard tabbing gets the same treatment as a pointer. */
	.sys-bl__track .sys-bl__card:focus-within {
		flex-basis: var(--bl-card-w-open);
		width: var(--bl-card-w-open);
	}
}

/* ---------- editor empty state ---------- */

.sys-bl--empty {
	padding: 40px;
	color: #929292;
	font-family: Inter, system-ui, sans-serif;
	text-align: center;
}

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
	.sys-bl__head-row {
		align-items: flex-start;
		gap: 24px;
	}

	.sys-bl__title {
		max-width: 20ch;
	}
}

@media (max-width: 767px) {
	.sys-bl {
		padding: 64px 0;
	}

	.sys-bl__inner {
		padding: 0 18px;
	}

	.sys-bl__head {
		margin-bottom: 28px;
	}

	.sys-bl__head-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 20px;
	}

	.sys-bl__title {
		max-width: none;
		font-size: clamp(28px, 8.5vw, 40px);
	}

	.sys-bl__all {
		padding: 14px 24px;
		font-size: 14px;
	}

	/* Cards are a fixed slice of the screen and snap, so a swipe always lands
	   on a card edge rather than halfway across one. */
	.sys-bl__viewport {
		scroll-snap-type: x mandatory;
	}

	.sys-bl__card {
		scroll-snap-align: start;
	}

	.sys-bl__card-title {
		font-size: 19px;
	}

	.sys-bl__excerpt {
		font-size: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sys-bl__card,
	.sys-bl__img {
		transition: none;
	}
}
