/**
 * NT Projektai – "NT DUK – Titulinis" widget.
 * Base section styles: nt-home-section.css.
 */

.nt-home-faq {
	--ntf-item-bg: #fff;
	--ntf-item-open-bg: #f7f4ee;
	--ntf-item-border: #e9e3d8;
	--ntf-item-radius: 16px;
	--ntf-item-gap: 12px;
	--ntf-icon: #1f5d48;
	--ntf-icon-bg: #e7ede4;
	--ntf-sticky-top: 120px;
}

.nt-home-faq__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--nth-columns-gap);
	align-items: start;
}

.nt-home-faq--has-image .nt-home-faq__layout {
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

.nt-home-faq--image-right .nt-home-faq__layout {
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.nt-home-faq--image-right .nt-home-faq__media-col {
	order: 2;
}

/* Fill mode stretches the photo to the content height. */
.nt-home-faq__media-col {
	align-self: stretch;
	min-width: 0;
}

/* Photo + help card; in whole-photo mode they stay in view while the questions scroll. */
.nt-home-faq__aside {
	display: flex;
	flex-direction: column;
	gap: 20px;
	height: 100%;
}

.nt-home-faq__aside:not(:has(.nt-home-section__media--fill)) {
	position: sticky;
	top: var(--ntf-sticky-top);
	height: auto;
}

.nt-home-faq__aside > .nt-home-section__media--fill {
	flex: 1 1 auto;
}

.nt-home-faq .nt-home-section__header {
	margin-bottom: 36px;
}

/* ------------------------------------------------------------------ */
/* Accordion                                                           */
/* ------------------------------------------------------------------ */

.nt-home-faq__list {
	display: flex;
	flex-direction: column;
	gap: var(--ntf-item-gap);
}

.nt-home-faq__item {
	border: 1px solid var(--ntf-item-border);
	border-radius: var(--ntf-item-radius);
	background-color: var(--ntf-item-bg);
	transition:
		background-color var(--nth-duration) var(--nth-ease),
		border-color var(--nth-duration) var(--nth-ease);
	/* A question opened from a link (#anchor) stops below the sticky header. */
	scroll-margin-top: 130px;
}

.nt-home-faq__item.is-open {
	background-color: var(--ntf-item-open-bg);
}

.nt-home-faq .nt-home-faq__heading {
	margin: 0;
	padding: 0;
	font: inherit;
}

/* Full reset – the theme styles plain buttons globally. */
.nt-home-faq .nt-home-faq__question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	width: 100%;
	min-height: 64px;
	margin: 0;
	padding: 18px 20px 18px 24px;
	border: 0;
	border-radius: var(--ntf-item-radius);
	background: transparent;
	box-shadow: none;
	color: #26292a;
	font-family: var(--nth-font-heading);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: -0.005em;
	text-align: left;
	text-transform: none;
	white-space: normal;
	cursor: pointer;
}

.nt-home-faq .nt-home-faq__question:hover,
.nt-home-faq .nt-home-faq__question:focus {
	background: transparent;
	color: #26292a;
	outline: none;
}

.nt-home-faq .nt-home-faq__question:focus-visible {
	outline: 2px solid var(--nth-accent);
	outline-offset: 2px;
}

.nt-home-faq__question-text {
	min-width: 0;
	overflow-wrap: break-word;
}

/* Plus that turns into a minus. */
.nt-home-faq__icon {
	position: relative;
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background-color: var(--ntf-icon-bg);
	color: var(--ntf-icon);
	transition:
		background-color var(--nth-duration) var(--nth-ease),
		color var(--nth-duration) var(--nth-ease);
}

.nt-home-faq__icon::before,
.nt-home-faq__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 1.8px;
	margin: -0.9px 0 0 -7px;
	border-radius: 2px;
	background: currentColor;
	transition: transform var(--nth-duration) var(--nth-ease);
}

.nt-home-faq__icon::after {
	transform: rotate(90deg);
}

.nt-home-faq__item.is-open .nt-home-faq__icon {
	background-color: var(--ntf-icon);
	color: #fff;
}

.nt-home-faq__item.is-open .nt-home-faq__icon::after {
	transform: rotate(0deg);
}

.nt-home-faq__question:hover .nt-home-faq__icon {
	background-color: var(--ntf-icon);
	color: #fff;
}

/* Height animation without measuring: 0fr → 1fr. */
.nt-home-faq__answer {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows var(--nth-duration) var(--nth-ease);
}

.nt-home-faq__item.is-open .nt-home-faq__answer {
	grid-template-rows: 1fr;
}

.nt-home-faq__answer-inner {
	min-height: 0;
	overflow: hidden;
	visibility: hidden;
	transition: visibility 0s linear var(--nth-duration);
}

.nt-home-faq__item.is-open .nt-home-faq__answer-inner {
	visibility: visible;
	transition-delay: 0s;
}

/* Opened from a link (nt-home-faq.js): no animation, so the page does not shift after scrolling. */
.nt-home-faq__list.is-instant .nt-home-faq__item,
.nt-home-faq__list.is-instant .nt-home-faq__answer,
.nt-home-faq__list.is-instant .nt-home-faq__answer-inner {
	transition: none;
}

.nt-home-faq .nt-home-faq__answer-content {
	padding: 0 76px 22px 24px;
	color: #595c5d;
	font-family: var(--nth-font-body);
	font-size: 16px;
	line-height: 1.7;
}

.nt-home-faq .nt-home-faq__answer-content > :first-child {
	margin-top: 0;
}

.nt-home-faq .nt-home-faq__answer-content > :last-child {
	margin-bottom: 0;
}

.nt-home-faq .nt-home-faq__answer-content p {
	margin: 0 0 12px;
}

.nt-home-faq .nt-home-faq__answer-content a {
	color: var(--nth-accent);
}

/* ------------------------------------------------------------------ */
/* Help line                                                           */
/* ------------------------------------------------------------------ */

.nt-home-faq .nt-home-faq__help {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	margin: 28px 0 0;
	color: #595c5d;
	font-size: 16px;
	line-height: 1.5;
}

.nt-home-faq .nt-home-faq__help-link,
.nt-home-faq .nt-home-faq__help-link:visited {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--nth-accent);
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid currentColor;
}

.nt-home-faq .nt-home-faq__help-link:hover,
.nt-home-faq .nt-home-faq__help-link:focus-visible {
	color: var(--nth-accent-hover);
}

/* Card variant under the photo. */
.nt-home-faq .nt-home-faq__help--card {
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	padding: 26px 28px;
	border: 1px solid var(--ntf-item-border);
	border-radius: var(--nth-img-radius);
	background-color: var(--ntf-item-open-bg);
}

.nt-home-faq .nt-home-faq__help--card .nt-home-faq__help-text {
	color: #26292a;
	font-family: var(--nth-font-heading);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.35;
}

.nt-home-faq__help-link svg {
	transition: transform var(--nth-duration) var(--nth-ease);
}

.nt-home-faq__help-link:hover svg {
	transform: translateX(3px);
}

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

@media (max-width: 1024px) {
	.nt-home-faq--has-image .nt-home-faq__layout,
	.nt-home-faq--image-right .nt-home-faq__layout {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Stacked: heading and questions first, photo after them. */
	.nt-home-faq--has-image .nt-home-faq__media-col {
		order: 2;
	}

	.nt-home-faq__aside:not(:has(.nt-home-section__media--fill)) {
		position: static;
	}
}

@media (max-width: 767px) {
	.nt-home-faq .nt-home-section__header {
		margin-bottom: 28px;
	}

	.nt-home-faq .nt-home-faq__question {
		min-height: 56px;
		gap: 14px;
		padding: 14px 14px 14px 18px;
		font-size: 16px;
	}

	.nt-home-faq__icon {
		width: 32px;
		height: 32px;
	}

	.nt-home-faq .nt-home-faq__answer-content {
		padding: 0 18px 18px;
		font-size: 15px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nt-home-faq__item,
	.nt-home-faq__icon,
	.nt-home-faq__icon::before,
	.nt-home-faq__icon::after,
	.nt-home-faq__answer,
	.nt-home-faq__answer-inner,
	.nt-home-faq__help-link svg {
		transition: none;
	}
}
