/**
 * SigmaGraft Elements — By Applications.
 *
 * Defaults only: every value here is overridable by the widget's controls.
 * Card layout comes from the shared .sgx-grid system in base.css, so the row
 * follows the repeater — three cards fill three columns, two widen to a half
 * each, and a fourth wraps without leaving a hole.
 *
 * Structure: .sgx-ap__cell is the layout box the grid sizes, orders and spans;
 * .sgx-ap__card inside it carries the styling and becomes the anchor when the
 * whole card is linked.
 */

.sgx-ap {
	position: relative;
	overflow-x: clip;
	isolation: isolate;
	padding: 40px 0 64px;
	background-color: #FFFFFF;
}

.sgx-ap__overlay {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
}

.sgx-ap__inner {
	--sgx-ap-rule-color: #E6ECF3;
	--sgx-ap-rule-w: 1px;
	--sgx-ap-rule-gap: 28px;

	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: 24px;
}

.sgx-ap--container-full .sgx-ap__inner {
	max-width: none;
}

/* The rule sits inside the container so it lines up with the content rather
   than running the full width of the viewport. */
.sgx-ap-rule-on .sgx-ap__inner {
	border-top: var(--sgx-ap-rule-w) solid var(--sgx-ap-rule-color);
	padding-top: var(--sgx-ap-rule-gap);
}

/* ═════════ Section header ═════════ */

.sgx-ap__head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	margin-bottom: 26px;
	text-align: start;
}

.sgx-ap__label {
	margin: 0 0 12px;
	color: #1A62C4;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
}

.sgx-ap__heading {
	margin: 0 0 10px;
	color: #0E2E5C;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.25;
	text-wrap: balance;
}

.sgx-ap__desc {
	margin: 0;
	max-width: 72ch;
	color: #5A6B7D;
	font-size: 13.5px;
	line-height: 1.65;
	text-wrap: pretty;
}

/* ═════════ Cards ═════════ */

.sgx-ap__cell {
	display: flex;
}

.sgx-ap__card {
	--sgx-c-t: 280ms;
	--sgx-c-lift: 0px;
	--sgx-c-scale: 1;

	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	width: 100%;
	min-width: 0;
	overflow: hidden;
	border: 1px solid #E6ECF3;
	border-radius: 4px;
	background-color: #FFFFFF;
	color: inherit;
	text-decoration: none;
	transition:
		background-color var(--sgx-c-t) ease,
		border-color var(--sgx-c-t) ease,
		box-shadow var(--sgx-c-t) ease,
		transform var(--sgx-c-t) ease;
}

.sgx-ap__card:hover {
	transform: translateY(var(--sgx-c-lift)) scale(var(--sgx-c-scale));
}

a.sgx-ap__card:focus-visible {
	outline: 2px solid #1A4C9B;
	outline-offset: 3px;
}

/* ═════════ Image ═════════ */

.sgx-ap__media {
	--sgx-m-scale: 1.06;
	--sgx-m-rotate: 0deg;
	--sgx-m-t: 520ms;

	position: relative;
	overflow: hidden;
	flex: 0 0 auto;
	height: 150px;
	background-color: #F4F7FA;
}

.sgx-ap__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	transition:
		transform var(--sgx-m-t) ease,
		filter var(--sgx-m-t) ease,
		opacity var(--sgx-m-t) ease;
}

.sgx-ap__card:hover .sgx-ap__img {
	transform: scale(var(--sgx-m-scale)) rotate(var(--sgx-m-rotate));
}

.sgx-ap__media-overlay {
	position: absolute;
	inset: 0;
	display: block;
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--sgx-m-t) ease;
}

/* ═════════ Body ═════════ */

.sgx-ap__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	padding: 18px 20px 20px;
	text-align: start;
}

.sgx-ap__title {
	margin: 0 0 8px;
	color: #0E2E5C;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	transition: color var(--sgx-c-t) ease;
}

.sgx-ap__text {
	margin: 0;
	color: #5A6B7D;
	font-size: 13px;
	line-height: 1.6;
	text-wrap: pretty;
}

/* ═════════ Button ═════════ */

.sgx-ap__btn {
	--sgx-btn-fg: #1A4C9B;
	--sgx-btn-bg: rgba(0, 0, 0, 0);
	--sgx-btn-fg-h: #0E2E5C;
	--sgx-btn-bg-h: rgba(0, 0, 0, 0);
	--sgx-btn-t: 220ms;
	--sgx-btn-lift: 0px;
	--sgx-nudge: 4px;
	--sgx-ul-color: #1A4C9B;

	position: relative;
	/* auto pushes it to the bottom so buttons line up across uneven cards. */
	margin-block-start: auto;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding-top: 14px;
	background-color: var(--sgx-btn-bg);
	color: var(--sgx-btn-fg);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	transition:
		color var(--sgx-btn-t) ease,
		background-color var(--sgx-btn-t) ease,
		border-color var(--sgx-btn-t) ease,
		transform var(--sgx-btn-t) ease;
}

.sgx-ap__card:hover .sgx-ap__btn,
.sgx-ap__btn:hover,
.sgx-ap__btn:focus-visible {
	color: var(--sgx-btn-fg-h);
	background-color: var(--sgx-btn-bg-h);
}

.sgx-ap__btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.sgx-ap__btn .sgx-icon {
	flex: 0 0 auto;
	font-size: 11px;
	width: 11px;
	height: 11px;
	transition: transform var(--sgx-btn-t) ease;
}

/* ── Hover animations ── */

/* Nudge: the icon slides along the reading direction. */
.sgx-ap-btnfx-nudge .sgx-ap__card:hover .sgx-ap__btn--icon-after .sgx-icon,
.sgx-ap-btnfx-nudge .sgx-ap__btn--icon-after:hover .sgx-icon {
	transform: translateX(var(--sgx-nudge));
}

.sgx-ap-btnfx-nudge .sgx-ap__card:hover .sgx-ap__btn--icon-before .sgx-icon,
.sgx-ap-btnfx-nudge .sgx-ap__btn--icon-before:hover .sgx-icon {
	transform: translateX(calc(-1 * var(--sgx-nudge)));
}

[dir="rtl"] .sgx-ap-btnfx-nudge .sgx-ap__card:hover .sgx-ap__btn--icon-after .sgx-icon {
	transform: translateX(calc(-1 * var(--sgx-nudge)));
}

[dir="rtl"] .sgx-ap-btnfx-nudge .sgx-ap__card:hover .sgx-ap__btn--icon-before .sgx-icon {
	transform: translateX(var(--sgx-nudge));
}

/* Underline: grows under the label only, not under the icon. */
.sgx-ap-btnfx-underline .sgx-ap__btn-label {
	position: relative;
}

.sgx-ap-btnfx-underline .sgx-ap__btn-label::after {
	content: "";
	position: absolute;
	inset-inline: 0;
	bottom: -3px;
	height: 1px;
	background-color: var(--sgx-ul-color);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform var(--sgx-btn-t) ease;
}

[dir="rtl"] .sgx-ap-btnfx-underline .sgx-ap__btn-label::after {
	transform-origin: right center;
}

.sgx-ap-btnfx-underline .sgx-ap__card:hover .sgx-ap__btn-label::after,
.sgx-ap-btnfx-underline .sgx-ap__btn:hover .sgx-ap__btn-label::after {
	transform: scaleX(1);
}

/* Lift */
.sgx-ap-btnfx-lift .sgx-ap__card:hover .sgx-ap__btn,
.sgx-ap-btnfx-lift .sgx-ap__btn:hover {
	transform: translateY(var(--sgx-btn-lift));
}

/* ═════════ Icon presentation ═════════ */

/*
 * The icon-led variant. The same repeater image is shown as a small contained
 * mark inside a fixed frame instead of a full-bleed banner, so the card
 * becomes a horizontal media object: mark on one side, title and description
 * on the other.
 *
 * The frame is a flex box rather than a fixed-ratio one, which keeps the mark
 * optically centred whatever its own proportions are.
 */
/* The extra .sgx-ap__card in the selector is deliberate: it lifts these three
   sizing declarations above the cover-mode rules Elementor generates, so the
   frame keeps its dimensions even if a stale cover value is still stored. */
.sgx-ap-media-icon .sgx-ap__card .sgx-ap__media {
	flex: 0 0 var(--sgx-icon-w, 86px);
	width: var(--sgx-icon-w, 86px);
	max-width: var(--sgx-icon-w, 86px);
	height: var(--sgx-icon-h, 86px);
	aspect-ratio: auto;
}

.sgx-ap-media-icon .sgx-ap__media {
	--sgx-icon-w: 86px;
	--sgx-icon-h: 86px;

	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	border: 2px solid #1A62C4;
	border-radius: 999px;
	background-color: transparent;
	transition:
		border-color var(--sgx-m-t) ease,
		background-color var(--sgx-m-t) ease,
		transform var(--sgx-m-t) ease;
}

.sgx-ap-media-icon .sgx-ap__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* A contained mark should not be cropped by a zoom, so the hover scale moves
   to the frame instead of the image. */
.sgx-ap-media-icon .sgx-ap__card:hover .sgx-ap__img {
	transform: none;
}

.sgx-ap-media-icon .sgx-ap__card:hover .sgx-ap__media {
	transform: scale(var(--sgx-m-scale)) rotate(var(--sgx-m-rotate));
}

/* ═════════ Plain card chrome ═════════ */

/*
 * Strips the card back to nothing so the items sit directly on the section,
 * as the icon row does. Specificity is kept low enough that the Card style
 * controls still win if the client sets a value there deliberately.
 */
.sgx-ap-card-plain .sgx-ap__card {
	overflow: visible;
	border: 0;
	border-radius: 0;
	background-color: transparent;
}

.sgx-ap-card-plain .sgx-ap__body {
	padding: 0;
}

/* ═════════ Responsive fallbacks ═════════ */

/*
 * Column counts, gaps, image height and alignment all have responsive
 * controls, so only presentation without a control of its own repeats here.
 */
@media (max-width: 1024px) {

	.sgx-ap__heading {
		font-size: 26px;
	}
}

@media (max-width: 767px) {

	.sgx-ap__heading {
		font-size: 23px;
	}

	.sgx-ap__body {
		padding: 16px 16px 18px;
	}
}

@media (prefers-reduced-motion: reduce) {

	.sgx-ap__card,
	.sgx-ap__img,
	.sgx-ap__btn,
	.sgx-ap__btn .sgx-icon,
	.sgx-ap__btn-label::after {
		transition: none !important;
	}
}

@media (max-width: 767px) {

	/* Keep the mark from crowding the text once the row is narrow. */
	.sgx-ap-media-icon .sgx-ap__media {
		padding: 16px;
	}
}
