/**
 * NT Projektai – flexible payment banner ("Įsirenkite dabar – atsiskaitykite
 * gavę banko finansavimą"), used on project pages and the homepage.
 *
 * The whole card is one link: the CTA's ::after covers the card.
 */

.nt-flexpay {
	--ntfp-bg: #edf3ef;
	--ntfp-border: #dce7df;
	--ntfp-heading: #173c30;
	--ntfp-text: #3f5a50;
	--ntfp-accent: #1f5d48;
	--ntfp-accent-hover: #164535;
	--ntfp-icon-bg: #fff;
	--ntfp-radius: 20px;
	--ntfp-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
	--ntfp-duration: 0.3s;
	--ntfp-font-heading: var(--e-global-typography-secondary-font-family, "Libre Franklin"), sans-serif;
	--ntfp-font-body: var(--e-global-typography-text-font-family, "Roboto"), sans-serif;
	width: 100%;
	margin: 0;
	font-family: var(--ntfp-font-body);
}

.nt-flexpay *,
.nt-flexpay *::before,
.nt-flexpay *::after {
	box-sizing: border-box;
}

.nt-flexpay__card {
	position: relative;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	grid-template-areas: "icon body button";
	align-items: center;
	gap: 0 32px;
	overflow: hidden;
	padding: 36px 190px 36px 40px;
	border: 1px solid var(--ntfp-border);
	border-radius: var(--ntfp-radius);
	background-color: var(--ntfp-bg);
	transition:
		box-shadow var(--ntfp-duration) var(--ntfp-ease),
		border-color var(--ntfp-duration) var(--ntfp-ease);
}

.nt-flexpay__card:hover {
	border-color: #c9dacd;
	box-shadow: 0 14px 36px rgba(15, 42, 33, 0.08);
}

.nt-flexpay__card:focus-within {
	outline: 2px solid var(--ntfp-accent);
	outline-offset: 3px;
}

.nt-flexpay__icon {
	grid-area: icon;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 84px;
	height: 84px;
	border-radius: 50%;
	background-color: var(--ntfp-icon-bg);
	box-shadow: 0 6px 18px rgba(15, 42, 33, 0.06);
	color: var(--ntfp-accent);
}

.nt-flexpay__icon svg {
	display: block;
	width: 46px;
	height: 46px;
}

.nt-flexpay__body {
	grid-area: body;
	min-width: 0;
}

.nt-flexpay .nt-flexpay__title {
	margin: 0;
	padding: 0;
	color: var(--ntfp-heading);
	font-family: var(--ntfp-font-heading);
	font-size: clamp(21px, 1.2rem + 0.6vw, 27px);
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
	text-transform: none;
}

.nt-flexpay .nt-flexpay__text {
	margin: 10px 0 0;
	padding: 0;
	max-width: 62ch;
	color: var(--ntfp-text);
	font-family: var(--ntfp-font-body);
	font-size: 16px;
	line-height: 1.6;
}

/* Full reset – the theme styles plain links globally. */
.nt-flexpay .nt-flexpay__button,
.nt-flexpay .nt-flexpay__button:visited {
	grid-area: button;
	position: static;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	padding: 14px 28px;
	border: 0;
	border-radius: 999px;
	background-color: var(--ntfp-accent);
	color: #fff;
	font-family: var(--ntfp-font-body);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color var(--ntfp-duration) var(--ntfp-ease);
}

/* Stretches the link over the whole card. */
.nt-flexpay .nt-flexpay__button::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: inherit;
}

.nt-flexpay .nt-flexpay__button:hover,
.nt-flexpay .nt-flexpay__button:focus,
.nt-flexpay__card:hover .nt-flexpay__button {
	background-color: var(--ntfp-accent-hover);
	color: #fff;
	text-decoration: none;
}

.nt-flexpay .nt-flexpay__button:focus-visible {
	outline: none;
}

.nt-flexpay__button svg {
	display: block;
	flex: 0 0 auto;
	transition: transform var(--ntfp-duration) var(--ntfp-ease);
}

.nt-flexpay__card:hover .nt-flexpay__button svg {
	transform: translateX(3px);
}

.nt-flexpay__decor {
	position: absolute;
	right: 22px;
	bottom: -10px;
	width: 150px;
	height: auto;
	color: var(--ntfp-accent);
	opacity: 0.16;
	pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Placements                                                          */
/* ------------------------------------------------------------------ */

/* Project page: closer to the facts above than a regular section. */
.nt-project-page .ntp-flexpay {
	padding-top: 56px;
}

/*
 * Homepage: same width, side gutters and bottom spacing as the homepage
 * sections (nt-home-section.css); the section above provides the top spacing.
 */
.nt-flexpay-home {
	box-sizing: border-box;
	width: 100%;
	padding: 0 20px 100px;
}

.nt-flexpay-home__inner {
	width: 100%;
	max-width: 1300px;
	margin: 0 auto;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
	.nt-flexpay__card {
		grid-template-columns: auto minmax(0, 1fr);
		grid-template-areas:
			"icon body"
			"icon button";
		align-items: start;
		gap: 0 24px;
		padding: 32px 150px 32px 32px;
	}

	.nt-flexpay .nt-flexpay__button {
		justify-self: start;
		margin-top: 20px;
	}

	.nt-flexpay__icon {
		width: 72px;
		height: 72px;
	}

	.nt-flexpay__icon svg {
		width: 40px;
		height: 40px;
	}

	.nt-flexpay__decor {
		right: 16px;
		width: 120px;
	}

	.nt-project-page .ntp-flexpay {
		padding-top: 48px;
	}

	.nt-flexpay-home {
		padding-bottom: 72px;
	}
}

@media (max-width: 767px) {
	.nt-flexpay__card {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"icon"
			"body"
			"button";
		padding: 28px 22px 24px;
	}

	.nt-flexpay__icon {
		width: 60px;
		height: 60px;
		margin-bottom: 18px;
	}

	.nt-flexpay__icon svg {
		width: 34px;
		height: 34px;
	}

	.nt-flexpay .nt-flexpay__text {
		font-size: 15px;
	}

	.nt-flexpay .nt-flexpay__button {
		justify-self: stretch;
		width: 100%;
		white-space: normal;
	}

	.nt-flexpay__decor {
		top: 18px;
		right: 14px;
		bottom: auto;
		width: 92px;
		opacity: 0.12;
	}

	.nt-project-page .ntp-flexpay {
		padding-top: 40px;
	}

	.nt-flexpay-home {
		padding-bottom: 56px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nt-flexpay__card,
	.nt-flexpay__button,
	.nt-flexpay__button svg {
		transition: none;
	}
}
