/**
 * SigmaGraft About — Applications.
 *
 * Defaults only: every value here is overridable by the widget's controls.
 *
 * ── The horizontal card ───────────────────────────────────────────────────
 *
 * Each card is a row: a text side that takes the remaining width, and a
 * photograph that takes a declared share of it and stretches to the card's
 * full height. The direction is set by a custom property rather than a class
 * so it can change per breakpoint and per card — beside the text on desktop
 * and tablet, stacked underneath on a phone, where a 38% image column would
 * be too narrow to read.
 *
 * Width is set with `width`, never `flex-basis`. Flex-basis addresses the
 * MAIN axis, so the moment the card stacks into a column a basis of 38% would
 * silently become a height. Keeping the share on `width` means the same value
 * behaves correctly in both directions.
 */

.sgxa-apps {
	position: relative;
	overflow-x: clip;
	isolation: isolate;
	padding: 34px 0 44px;
	background-color: #FFFFFF;
}

.sgxa-apps__overlay {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
}

.sgxa-apps__inner {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: 24px;
}

.sgxa-apps--container-full .sgxa-apps__inner {
	max-width: none;
}

/* ═════════ Cell + card ═════════ */

.sgxa-apps__cell {
	display: flex;
}

.sgxa-apps__card {
	--sgxa-a-t: 280ms;
	--sgxa-a-lift: 0px;
	--sgxa-a-scale: 1;
	--sgxa-a-nudge: 4px;
	--sgxa-a-icon-scale: 1;
	--sgxa-a-img-scale: 1.06;
	--sgxa-a-img-rotate: 0deg;
	--sgxa-a-media-w: 38%;

	display: flex;
	flex: 1 1 auto;
	flex-direction: row;
	align-items: stretch;
	width: 100%;
	min-width: 0;
	min-height: 132px;
	overflow: hidden;
	isolation: isolate;
	border: 1px solid #E6ECF3;
	border-radius: 4px;
	background-color: #FFFFFF;
	color: inherit;
	text-decoration: none;
	transition:
		background-color var(--sgxa-a-t) ease,
		border-color var(--sgxa-a-t) ease,
		box-shadow var(--sgxa-a-t) ease,
		transform var(--sgxa-a-t) ease;
}

.sgxa-apps__card:hover {
	transform: translateY(var(--sgxa-a-lift)) scale(var(--sgxa-a-scale));
}

a.sgxa-apps__card:focus-visible {
	outline: 2px solid #1A4C9B;
	outline-offset: 3px;
}

/* ═════════ Body ═════════ */

/*
 * stretch, not flex-start: the text column has to fill the card's height or
 * the link's `margin-block-start: auto` has no slack to push against and the
 * three "Learn More" rows stop lining up. The icon opts out individually so
 * it still sits at the top.
 */
.sgxa-apps__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: row;
	align-items: stretch;
	gap: 12px;
	min-width: 0;
	padding: 15px 16px 15px 15px;
}

.sgxa-apps__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border: 1px solid #1A62C4;
	border-radius: 50%;
	background-color: transparent;
	color: #1A62C4;
	font-size: 15px;
	line-height: 0;
	transition:
		color var(--sgxa-a-t) ease,
		background-color var(--sgxa-a-t) ease,
		border-color var(--sgxa-a-t) ease,
		transform var(--sgxa-a-t) ease;
}

.sgxa-apps__card:hover .sgxa-apps__icon {
	transform: scale(var(--sgxa-a-icon-scale));
}

/*
 * A column so the link can be pushed to the bottom with margin-block-start:
 * auto — that is what lines the three "Learn More" rows up with each other
 * however long the descriptions run.
 */
.sgxa-apps__content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	text-align: start;
}

.sgxa-apps__title {
	margin: 0 0 5px;
	color: #0E2E5C;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	transition: color var(--sgxa-a-t) ease;
}

.sgxa-apps__text {
	margin: 0 0 10px;
	color: #5A6B7D;
	font-size: 12px;
	line-height: 1.5;
	text-wrap: pretty;
	transition: color var(--sgxa-a-t) ease;
}

/* ═════════ Link ═════════ */

.sgxa-apps__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-block-start: auto;
	color: #1A4C9B;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	transition: color var(--sgxa-a-t) ease;
}

span.sgxa-apps__link {
	cursor: inherit;
}

.sgxa-apps__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.sgxa-apps__link .sgxa-icon {
	flex: 0 0 auto;
	font-size: 11px;
	width: 11px;
	height: 11px;
	transition: transform var(--sgxa-a-t) ease;
}

/* The arrow slides along the reading direction, so it flips under RTL. */
.sgxa-apps__card:hover .sgxa-apps__link--icon-after .sgxa-icon,
.sgxa-apps__link--icon-after:hover .sgxa-icon {
	transform: translateX(var(--sgxa-a-nudge));
}

.sgxa-apps__card:hover .sgxa-apps__link--icon-before .sgxa-icon,
.sgxa-apps__link--icon-before:hover .sgxa-icon {
	transform: translateX(calc(-1 * var(--sgxa-a-nudge)));
}

[dir="rtl"] .sgxa-apps__card:hover .sgxa-apps__link--icon-after .sgxa-icon {
	transform: translateX(calc(-1 * var(--sgxa-a-nudge)));
}

[dir="rtl"] .sgxa-apps__card:hover .sgxa-apps__link--icon-before .sgxa-icon {
	transform: translateX(var(--sgxa-a-nudge));
}

/* Underline grows under the label only, never under the arrow. */
.sgxa-apps__link-label {
	position: relative;
}

.sgxa-apps__link-label::after {
	content: "";
	position: absolute;
	inset-inline: 0;
	bottom: -2px;
	height: 1px;
	background-color: #1A4C9B;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform var(--sgxa-a-t) ease;
}

[dir="rtl"] .sgxa-apps__link-label::after {
	transform-origin: right center;
}

.sgxa-apps__card:hover .sgxa-apps__link-label::after,
.sgxa-apps__link:hover .sgxa-apps__link-label::after {
	transform: scaleX(1);
}

/* ═════════ Media ═════════ */

/*
 * `width` carries the share and `flex` stays auto — see the file header for
 * why basis is the wrong property here. align-self: stretch is what makes the
 * photograph run the full height of the card beside the text; the height
 * variable only comes into play once the card stacks.
 */
.sgxa-apps__media {
	position: relative;
	flex: 0 0 auto;
	align-self: stretch;
	width: var(--sgxa-a-media-w, 38%);
	height: var(--sgxa-a-media-h, auto);
	overflow: hidden;
	background-color: #F4F7FA;
}

/*
 * Absolutely positioned rather than height:100%. The frame's height comes
 * from align-self:stretch, not from a declared value, so a percentage height
 * would resolve against `auto` and collapse to the image's intrinsic ratio —
 * leaving the frame's background visible and skipping the crop entirely.
 */
.sgxa-apps__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	transition:
		transform 520ms ease,
		opacity 520ms ease,
		filter 520ms ease;
}

.sgxa-apps__card:hover .sgxa-apps__img {
	transform: scale(var(--sgxa-a-img-scale)) rotate(var(--sgxa-a-img-rotate));
}

.sgxa-apps__media-overlay {
	position: absolute;
	inset: 0;
	display: block;
	opacity: 0;
	pointer-events: none;
	transition: opacity 520ms ease;
}

/* ═════════ Responsive fallbacks ═════════ */

/*
 * Columns, gaps, padding, image width and height, card height, alignment and
 * every type size have responsive controls, so only behaviour without a
 * control repeats here: once a card stacks, the image needs a declared height
 * because there is no longer a text column beside it to borrow one from.
 */
@media (max-width: 767px) {

	.sgxa-apps__card {
		--sgxa-a-media-w: 100%;
	}

	.sgxa-apps__media {
		height: var(--sgxa-a-media-h, 190px);
	}
}

@media (prefers-reduced-motion: reduce) {

	.sgxa-apps__card,
	.sgxa-apps__icon,
	.sgxa-apps__title,
	.sgxa-apps__text,
	.sgxa-apps__link,
	.sgxa-apps__link .sgxa-icon,
	.sgxa-apps__link-label::after,
	.sgxa-apps__img,
	.sgxa-apps__media-overlay {
		transition: none !important;
	}

	.sgxa-apps__card:hover,
	.sgxa-apps__card:hover .sgxa-apps__img,
	.sgxa-apps__card:hover .sgxa-apps__icon {
		transform: none;
	}
}
