/**
 * Services Stack Widget — front-end styles.
 * Prefix: .ssw-
 */

.ssw-services {
	position: relative;
	--ssw-stack-top: 120px;
	--ssw-stack-peek: 0px;
}

/* ------------------------------------------------------------------ *
 * Header
 * ------------------------------------------------------------------ */
.ssw-header {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-end;
	gap: 32px;
	margin-bottom: 48px;
}

.ssw-header__left {
	flex: 1 1 340px;
	min-width: 0;
}

.ssw-header__right {
	flex: 1 1 340px;
	min-width: 0;
}

.ssw-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	margin-bottom: 18px;
}

.ssw-eyebrow__dot {
	font-size: 8px;
	line-height: 1;
}

.ssw-heading {
	margin: 0;
	font-size: clamp(28px, 4vw, 44px);
	line-height: 1.12;
	font-weight: 500;
}

.ssw-subheading {
	margin: 0 0 18px;
	font-size: 15px;
	line-height: 1.6;
	opacity: 0.85;
}

/* Search */
.ssw-search {
	display: flex;
	align-items: stretch;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 2px;
	overflow: hidden;
	max-width: 460px;
}

.ssw-search__input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	background: transparent;
	padding: 12px 16px;
	font: inherit;
	outline: none;
}

.ssw-search__btn {
	flex: 0 0 auto;
}

/* Search wrapper + live suggestions dropdown. */
.ssw-search-wrap {
	position: relative;
	max-width: 460px;
}

.ssw-search-wrap .ssw-search {
	max-width: none;
}

.ssw-search__suggestions {
	list-style: none;
	margin: 8px 0 0;
	padding: 6px 0;
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 60;
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 4px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
	max-height: 320px;
	overflow-y: auto;
}

.ssw-search__suggestions[hidden] {
	display: none;
}

.ssw-search__suggestions li {
	margin: 0;
	padding: 0;
}

.ssw-search__suggestion {
	display: block;
	padding: 10px 16px;
	color: #1a1a1a;
	text-decoration: none;
	font-size: 14px;
	line-height: 1.3;
}

.ssw-search__suggestion:hover,
.ssw-search__suggestion:focus {
	background: rgba(0, 0, 0, 0.05);
}

/* Card hidden by the live filter. */
.ssw-card.ssw-hidden {
	display: none !important;
}

.ssw-list__empty {
	padding: 28px 8px;
	font-size: 15px;
	opacity: 0.6;
}

.ssw-list__empty[hidden] {
	display: none;
}

/* ------------------------------------------------------------------ *
 * Buttons
 * ------------------------------------------------------------------ */
.ssw-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 22px;
	font-size: 13px;
	line-height: 1;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	color: #ffffff;
	background-color: #14213d;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
	white-space: nowrap;
}

.ssw-btn:hover {
	background-color: #000000;
}

.ssw-card__more {
	color: #1a1a1a;
	background-color: transparent;
	border-color: rgba(0, 0, 0, 0.2);
}

/* ------------------------------------------------------------------ *
 * Diamond hover animation (navy text -> golden fill on hover)
 * Left diamond visible at rest, slides out; right diamond slides in.
 * ------------------------------------------------------------------ */
.ssw-btn__text {
	position: relative;
	display: inline-block;
	white-space: nowrap;
}

.ssw-btn--diamond {
	position: relative;
	overflow: visible;
	/* Breathing room so the diamonds sit inside the button. */
	padding-left: 40px;
	padding-right: 40px;
}

.ssw-btn--diamond .ssw-btn__text::before,
.ssw-btn--diamond .ssw-btn__text::after {
	content: "\25C6"; /* ◆ */
	position: absolute;
	top: 50%;
	font-size: 0.7em;
	line-height: 1;
	transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
	pointer-events: none;
}

.ssw-btn--diamond .ssw-btn__text::before {
	left: -1.5em;
}

.ssw-btn--diamond .ssw-btn__text::after {
	right: -1.5em;
}

/* --- Variant: both diamonds visible at rest (◆ text ◆) --- */
.ssw-btn--diamond-both .ssw-btn__text::before,
.ssw-btn--diamond-both .ssw-btn__text::after {
	transform: translateY(-50%);
	opacity: 1;
}

/* --- Variant: animated swap (left at rest → right on hover) --- */
.ssw-btn--diamond-swap .ssw-btn__text::before {
	transform: translateY(-50%);
	opacity: 1;
}

.ssw-btn--diamond-swap .ssw-btn__text::after {
	transform: translateY(-50%) translateX(-8px);
	opacity: 0;
}

.ssw-btn--diamond-swap:hover .ssw-btn__text::before {
	opacity: 0;
	transform: translateY(-50%) translateX(8px);
}

.ssw-btn--diamond-swap:hover .ssw-btn__text::after {
	opacity: 1;
	transform: translateY(-50%) translateX(0);
}

/* ------------------------------------------------------------------ *
 * List + Cards (sticky stack)
 * ------------------------------------------------------------------ */
.ssw-list {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.ssw-card {
	position: relative;
}

/* Sticky stacking is enabled only when data-ssw-stack="yes". */
.ssw-services[data-ssw-stack="yes"] .ssw-card {
	position: sticky;
	top: calc(var(--ssw-stack-top) + (var(--ssw-i) * var(--ssw-stack-peek)));
}

.ssw-card__inner {
	position: relative;
	display: flex;
	align-items: flex-start;
	column-gap: 28px;
	row-gap: 16px;
	padding: 32px;
	background-color: #f4f1ec;
	border-radius: 4px;
	overflow: hidden;
}

/* A subtle top divider like the reference, using a pseudo element that
   doesn't interfere with the stacking background. */
.ssw-card__inner::before {
	content: "";
	position: absolute;
	left: 32px;
	right: 32px;
	top: 0;
	height: 1px;
	background: rgba(0, 0, 0, 0.08);
	pointer-events: none;
}

.ssw-card__num {
	flex: 0 0 64px;
	font-size: 12px;
	opacity: 0.6;
	align-self: flex-start;
}

.ssw-card__head {
	flex: 0 0 34%;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
}

.ssw-card__title {
	margin: 0;
	font-size: clamp(18px, 2vw, 24px);
	line-height: 1.2;
	font-weight: 500;
}

.ssw-card__title a {
	color: inherit;
	text-decoration: none;
}

.ssw-card__desc {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 13px;
	line-height: 1.6;
	opacity: 0.75;
}

.ssw-card__media {
	flex: 0 0 150px;
	width: 150px;
	display: block;
	overflow: hidden;
	border-radius: 0;
	line-height: 0;
}
.ssw-card__media .ssw-media { width: 100%; height: 100%; }
.ssw-card__media .ssw-media--desktop { display: block; }
.ssw-card__media .ssw-media--mobile { display: none; }

.ssw-card__media img {
	display: block;
	width: 100%;
	height: 90px;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.ssw-card:hover .ssw-card__media img {
	transform: scale(1.05);
}

.ssw-card__media--empty {
	background: rgba(0, 0, 0, 0.06);
	height: 90px;
}

/* Whole-card link overlay (sits under the real links/buttons). */
.ssw-card__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	text-indent: -9999px;
	overflow: hidden;
}

.ssw-card__num,
.ssw-card__head,
.ssw-card__desc,
.ssw-card__media {
	position: relative;
	z-index: 2;
}

/* When the whole card is linked, the button/title links stay clickable. */
.ssw-card__title a,
.ssw-card__more {
	position: relative;
	z-index: 3;
}

/* Empty-state notice (editor only). */
.ssw-empty {
	padding: 24px;
	border: 1px dashed rgba(0, 0, 0, 0.25);
	border-radius: 6px;
	font-size: 14px;
	text-align: center;
	opacity: 0.8;
}

/* ------------------------------------------------------------------ *
 * Mobile "Learn More" link — shown instead of the cursor on touch.
 * ------------------------------------------------------------------ */
.ssw-card__mcta {
	display: none;
	align-items: center;
	gap: 8px;
	width: max-content;
	color: #1a1a1a;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	position: relative;
	z-index: 3;
}

.ssw-card__mcta-icon {
	display: inline-flex;
	align-items: center;
	transition: transform 0.3s ease;
}

.ssw-card__mcta-icon svg {
	width: 1em;
	height: 1em;
	display: block;
}

.ssw-card__mcta:hover .ssw-card__mcta-icon {
	transform: translateX(4px);
}

/* Touch devices: no custom cursor, so show the link. */
@media (hover: none) {
	.ssw-card__mcta {
		display: inline-flex;
	}
}

/* Editor preview toggle so it can be styled on any screen. */
.ssw-mcta-preview-yes .ssw-card__mcta {
	display: inline-flex;
}

/* ------------------------------------------------------------------ *
 * Custom cursor follower
 * ------------------------------------------------------------------ */
.ssw-cursor {
	position: fixed;
	top: 0;
	left: 0;
	width: 88px;
	height: 88px;
	border-radius: 50%;
	background-color: #111111;
	color: #ffffff;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	font-size: 12px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	pointer-events: none;
	z-index: 99999;
	opacity: 0;
	transform: translate(-50%, -50%) scale(0.4);
	transition: opacity 0.25s ease, transform 0.25s ease;
	will-change: transform, opacity;
	box-sizing: border-box;
}

.ssw-cursor.is-visible {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.ssw-cursor__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.ssw-cursor__icon svg {
	width: 1em;
	height: 1em;
	display: block;
}

.ssw-cursor__label {
	display: inline-block;
	line-height: 1.1;
}

/* Icon position relative to the label. */
.ssw-cursor--pos-top {
	flex-direction: column;
}

.ssw-cursor--pos-bottom {
	flex-direction: column-reverse;
}

.ssw-cursor--pos-left {
	flex-direction: row;
}

.ssw-cursor--pos-right {
	flex-direction: row-reverse;
}

.ssw-cursor--pos-both {
	flex-direction: row;
}

/* Hide the follower where a real cursor is expected (touch devices). */
@media (hover: none) {
	.ssw-cursor {
		display: none !important;
	}
}

/* When cursor follower active, hide native pointer over the card on desktop. */
@media (hover: hover) and (pointer: fine) {
	.ssw-services[data-ssw-cursor="yes"] .ssw-card__inner,
	.ssw-services[data-ssw-cursor="yes"] .ssw-card__overlay,
	.ssw-services[data-ssw-cursor="yes"] .ssw-card__title a,
	.ssw-services[data-ssw-cursor="yes"] .ssw-card__media {
		cursor: none;
	}
	/* The Learn More CTA keeps a real pointer; JS hides the follower over it. */
	.ssw-services[data-ssw-cursor="yes"] .ssw-card__inner .ssw-btn,
	.ssw-services[data-ssw-cursor="yes"] .ssw-card__inner .ssw-btn * {
		cursor: pointer !important;
	}
}

/* ------------------------------------------------------------------ *
 * Responsive
 * ------------------------------------------------------------------ */
@media (max-width: 1024px) {
	.ssw-card__head {
		flex: 0 0 40%;
	}
	.ssw-card__desc {
		flex: 1 1 100%;
		order: 5;
	}
}

@media (max-width: 767px) {
	.ssw-header {
		align-items: flex-start;
	}
	.ssw-card__inner {
		flex-wrap: wrap;
		padding: 22px;
	}
	.ssw-card__num {
		flex: 0 0 auto;
	}
	.ssw-card__head {
		flex: 1 1 auto;
	}
	.ssw-card__desc {
		flex: 1 1 100%;
		order: 4;
	}
	.ssw-card__mcta {
		display: inline-flex;
		flex: 0 0 auto;
		order: 5;
	}
	.ssw-card__media {
		flex: 0 0 100%;
		width: 100%;
		order: 6;
	}
	.ssw-card__media img,
	.ssw-card__media--empty {
		height: 180px;
	}
	.ssw-card__inner::before {
		left: 22px;
		right: 22px;
	}
	/* Sticky stack still works on mobile with a smaller offset. */
	.ssw-services[data-ssw-stack="yes"] .ssw-card {
		top: calc(var(--ssw-stack-top) + (var(--ssw-i) * var(--ssw-stack-peek)));
	}
}

@media (prefers-reduced-motion: reduce) {
	.ssw-services[data-ssw-stack="yes"] .ssw-card {
		position: relative;
		top: auto;
	}
	.ssw-cursor {
		display: none !important;
	}
}


/* Separate desktop / mobile featured image */
@media (max-width: 767px) {
	.ssw-card__media.ssw-has-mobile .ssw-media--desktop { display: none; }
	.ssw-card__media.ssw-has-mobile .ssw-media--mobile { display: block; }
}
