/**
 * Faria Focus Areas — "Browse by focus area" tabs.
 * Tokens: Plum #37023C, Paper #F0EBEB, Yellow #F7D35F, Nunito Sans.
 * Sizes follow the Figma frame (1408px content) and scale down fluidly.
 */

.ffa {
	--ffa-plum: #37023c;
	--ffa-paper: #f0ebeb;
	--ffa-tab: #f6f3f3;
	--ffa-white: #ffffff;
	--ffa-ink: #171717;
	--ffa-yellow: #f7d35f;
	--ffa-bg: var(--ffa-paper);
	--ffa-sticky-top: 0px;
	--ffa-font: "Nunito Sans", "NunitoSans", system-ui, sans-serif;
	width: 100%;
	font-family: var(--ffa-font);
	color: var(--ffa-plum);
}

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

/* overflow:hidden on an ancestor disables position:sticky; clip keeps the clipping without that side effect. */
.bde-section:has(.ffa) {
	overflow: clip !important;
}

/* Sticky tab bar */

.ffa__bar {
	position: sticky;
	top: var(--ffa-sticky-top);
	z-index: 5;
	padding-top: 12px;
	background: var(--ffa-bg);
	transition: top 0.3s ease;
}

/* Header boxes can be taller than their visible pill; cover the gap while stuck. */
.ffa__bar.is-stuck::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
	height: calc(var(--ffa-sticky-top, 0px) + 2px);
	background: var(--ffa-bg);
	pointer-events: none;
}

.ffa__bar::after {
	content: "";
	display: block;
	height: 3px;
	margin-top: 1px;
	background: var(--ffa-white);
	box-shadow: 0 4px 4px rgba(0, 0, 0, 0.1);
}

.ffa .ffa__title {
	margin: 0 0 clamp(20px, 1.9vw, 32px);
	color: var(--ffa-ink);
	font-family: var(--ffa-font);
	font-size: clamp(30px, 2.6vw, 44px);
	font-weight: 700;
	line-height: 1.14;
	letter-spacing: 0.5px;
}

.ffa__tabs {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: none;
}

.ffa__tabs::-webkit-scrollbar {
	display: none;
}

.ffa .ffa__tab {
	flex: 0 0 auto;
	margin: 0;
	padding: clamp(16px, 1.75vw, 30px) clamp(20px, 2.45vw, 42px);
	min-height: 0;
	border: 0;
	border-radius: 8px 8px 0 0;
	background: var(--ffa-tab);
	box-shadow: none;
	color: var(--ffa-plum);
	font-family: var(--ffa-font);
	font-size: clamp(18px, 1.65vw, 28px);
	font-weight: 400;
	line-height: 1.15;
	letter-spacing: 0.5px;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.ffa .ffa__tab:hover {
	background: var(--ffa-white);
	color: var(--ffa-plum);
}

.ffa .ffa__tab.is-active {
	background: var(--ffa-white);
	font-weight: 700;
}

.ffa .ffa__tab:focus-visible {
	outline: 2px solid var(--ffa-plum);
	outline-offset: -4px;
}

/* Panel */

.ffa__panel {
	display: flex;
	flex-direction: column;
	gap: clamp(48px, 4.9vw, 84px);
	padding-top: clamp(40px, 4.65vw, 80px);
}

.ffa__panel[hidden] {
	display: none;
}

.ffa__panel:focus {
	outline: none;
}

.ffa__intro {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: clamp(24px, 2.45vw, 42px);
}

.ffa .ffa__logo {
	display: block;
	width: auto;
	max-width: 100%;
	height: clamp(44px, 3.7vw, 64px);
	object-fit: contain;
	object-position: left center;
}

/* Featured guide */

.ffa-guide {
	display: flex;
	align-items: stretch;
	gap: 32px;
	width: 100%;
	overflow: hidden;
	border-radius: 12px;
	background: var(--ffa-white);
}

.ffa-guide__content {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	gap: 26px;
	min-width: 0;
	padding: 32px;
	container-type: inline-size;
}

.ffa-guide__heading {
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.ffa .ffa-guide__label {
	margin: 0;
	font-family: var(--ffa-font);
	font-size: clamp(18px, 1.4vw, 24px);
	font-weight: 500;
	line-height: 1.2;
}

.ffa .ffa-guide__title {
	margin: 0;
	color: var(--ffa-plum);
	font-family: var(--ffa-font);
	font-size: clamp(28px, 2.6vw, 44px);
	font-weight: 700;
	line-height: 1.14;
	letter-spacing: 0.5px;
}

.ffa .ffa-guide__description {
	max-width: 655px;
	margin: 0;
	color: var(--ffa-ink);
	font-family: var(--ffa-font);
	font-size: clamp(17px, 1.2vw, 20px);
	/* Scales with the text column so ~145 characters stay on two lines at every desktop width. */
	font-size: clamp(14px, 2.9cqi, 20px);
	font-weight: 300;
	line-height: 1.5;
}

.ffa a.ffa-guide__button {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	height: 40px;
	padding: 8px 8px 8px 16px;
	border-radius: 100px;
	background: var(--ffa-yellow);
	color: var(--ffa-plum);
	font-family: var(--ffa-font);
	font-size: 16px;
	font-weight: 700;
	line-height: 16px;
	text-decoration: none;
	white-space: nowrap;
	transition: filter 0.2s ease;
}

.ffa a.ffa-guide__button:hover,
.ffa a.ffa-guide__button:focus-visible {
	color: var(--ffa-plum);
	filter: brightness(0.95);
	text-decoration: none;
}

.ffa-guide__button-icon {
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.ffa a.ffa-guide__button:hover .ffa-guide__button-icon {
	transform: translateX(2px);
}

.ffa-guide__media {
	display: flex;
	flex: 0 0 49%;
	align-items: center;
	min-width: 0;
}

.ffa .ffa-guide__image {
	display: block;
	width: 100%;
	height: 100%;
	max-height: 420px;
	object-fit: cover;
	object-position: left center;
}

/* Related resources */

.ffa__related {
	display: flex;
	flex-direction: column;
	gap: clamp(32px, 3.7vw, 64px);
}

.ffa__related-heading {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ffa .ffa__related-title {
	margin: 0;
	color: var(--ffa-plum);
	font-family: var(--ffa-font);
	font-size: clamp(24px, 1.9vw, 32px);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: 0.5px;
}

.ffa .ffa__related-subtitle {
	max-width: 690px;
	margin: 0;
	color: var(--ffa-plum);
	font-family: var(--ffa-font);
	font-size: clamp(18px, 1.4vw, 24px);
	font-weight: 500;
	line-height: 1.17;
}

.ffa__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

/* Card */

.ffa .ffa-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	color: var(--ffa-plum);
	text-decoration: none;
}

.ffa a.ffa-card:hover,
.ffa a.ffa-card:focus-visible {
	color: var(--ffa-plum);
	text-decoration: none;
}

.ffa a.ffa-card:focus-visible {
	outline: 2px solid var(--ffa-plum);
	outline-offset: 4px;
	border-radius: 8px;
}

.ffa-card__media {
	aspect-ratio: 2 / 1;
	overflow: hidden;
	border-radius: 6px 6px 0 0;
	background: var(--ffa-white);
}

.ffa .ffa-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.ffa a.ffa-card:hover .ffa-card__image {
	transform: scale(1.03);
}

.ffa-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 16px;
	padding: 16px;
	border-radius: 0 0 8px 8px;
	background: rgba(255, 255, 255, 0.9);
}

.ffa-card__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 8px 16px;
}

.ffa-card__tag {
	display: inline-flex;
	align-items: center;
	padding: 12px 16px;
	border-radius: 100px;
	background: var(--ffa-paper);
	font-size: 12px;
	font-weight: 700;
	line-height: 12px;
	letter-spacing: 1px;
	text-transform: uppercase;
	white-space: nowrap;
}

.ffa-card__date {
	font-size: 16px;
	line-height: 22px;
	white-space: nowrap;
}

.ffa .ffa-card__title {
	margin: 0;
	color: var(--ffa-plum);
	font-family: var(--ffa-font);
	font-size: clamp(22px, 1.9vw, 32px);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0.5px;
}

.ffa .ffa-card__excerpt {
	margin: -8px 0 0;
	color: var(--ffa-plum);
	font-family: var(--ffa-font);
	font-size: clamp(16px, 1.2vw, 20px);
	font-weight: 400;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
	line-clamp: 4;
	overflow: hidden;
}

.ffa-card__arrow {
	display: inline-flex;
	align-self: flex-end;
	margin-top: auto;
	padding: 8px;
	border: 1px solid var(--ffa-paper);
	border-radius: 100px;
	background: var(--ffa-plum);
	color: var(--ffa-paper);
	line-height: 0;
	transition: transform 0.2s ease;
}

.ffa a.ffa-card:hover .ffa-card__arrow {
	transform: translateX(3px);
}

.ffa-empty {
	padding: 16px;
	border: 1px dashed #b32d2e;
	color: #b32d2e;
}

@media (prefers-reduced-motion: reduce) {
	.ffa *,
	.ffa *::before,
	.ffa *::after {
		transition: none !important;
	}
}

@media (max-width: 1024px) {
	.ffa__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 1100px) {
	.ffa-guide {
		flex-direction: column;
		gap: 0;
	}

	.ffa-guide__content {
		padding: 24px;
		gap: 20px;
	}

	.ffa-guide__media {
		flex-basis: auto;
	}

	.ffa .ffa-guide__image {
		height: auto;
		max-height: none;
	}
}

@media (max-width: 640px) {
	.ffa__grid {
		grid-template-columns: 1fr;
	}
}
