/**
 * Study Areas widget — ported 1:1 from the Next.js reference site's
 * "Explore our six study areas" section, including the open-book backdrop.
 */

.fc-study {
	--fc-study-cols: 3;
	--fc-study-gap: 1.5rem;
	--fc-study-teal: #077e86;
	--fc-study-ink: #0b3a3f;
	--fc-study-text: #475569;
	--fc-study-mist: #cadfe2;
	--fc-study-mist-light: #e9f3f4;
	--fc-study-blob: rgba(202, 223, 226, 0.5);
	--fc-study-book: rgba(7, 126, 134, 0.1);

	position: relative;
	overflow: hidden;
	padding: 4rem 0;
	background: #f8fafc;
}

@media (min-width: 1024px) {
	.fc-study {
		padding: 6rem 0;
	}
}

/* --- Open book backdrop --------------------------------------------- */

.fc-study__book {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.fc-study__book-inner {
	position: relative;
	width: 34rem;
	height: 34rem;
	color: var(--fc-study-book);
	perspective: 1200px;
	animation: fc-study-float 9s ease-in-out infinite;
}

@media (min-width: 640px) {
	.fc-study__book-inner {
		width: 42rem;
		height: 42rem;
	}
}

.fc-study__book svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

/* The right-hand leaf turns over and back, forever. */
.fc-study__page {
	position: absolute;
	inset: 0;
	transform-origin: 50% 50%;
	opacity: 0.7;
	animation: fc-study-page 12s ease-in-out infinite;
}

@keyframes fc-study-float {
	0%,
	100% {
		transform: rotate(-6deg) translateY(0);
	}

	50% {
		transform: rotate(-6deg) translateY(-18px);
	}
}

@keyframes fc-study-page {
	0%,
	8% {
		transform: rotateY(0deg);
	}

	45%,
	55% {
		transform: rotateY(-180deg);
	}

	92%,
	100% {
		transform: rotateY(0deg);
	}
}

/* --- Header ---------------------------------------------------------- */

.fc-study__inner {
	position: relative;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1.25rem;
}

.fc-study__head {
	max-width: 48rem;
	margin: 0 auto;
	text-align: center;
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fc-study.is-visible .fc-study__head {
	opacity: 1;
	transform: none;
}

.fc-study__eyebrow {
	margin: 0;
	color: var(--fc-study-teal);
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.2em;
	line-height: 1.25rem;
	text-transform: uppercase;
}

.fc-study__title {
	margin: 0.75rem 0 0;
	color: var(--fc-study-ink);
	font-size: 1.875rem;
	font-weight: 800;
	letter-spacing: -0.025em;
	line-height: 1.2;
}

@media (min-width: 640px) {
	.fc-study__title {
		font-size: 2.25rem;
	}
}

.fc-study__lead {
	margin: 1rem 0 0;
	color: var(--fc-study-text);
	font-size: 1.125rem;
	line-height: 1.625;
}

.fc-study__rule {
	width: 4rem;
	height: 0.25rem;
	margin: 1.25rem auto 0;
	border-radius: 9999px;
	background: var(--fc-study-teal);
}

/* --- Cards ----------------------------------------------------------- */

.fc-study__grid {
	display: grid;
	grid-template-columns: repeat(var(--fc-study-cols), minmax(0, 1fr));
	gap: var(--fc-study-gap);
	margin-top: 3rem;
}

.fc-study__item {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fc-study.is-visible .fc-study__item {
	opacity: 1;
	transform: none;
}

.fc-study__card {
	position: relative;
	display: block;
	height: 100%;
	overflow: hidden;
	padding: 1.75rem;
	border: 1px solid var(--fc-study-mist);
	border-radius: 1rem;
	background: #fff;
	color: inherit;
	text-decoration: none;
	transition: box-shadow 0.3s ease;
}

.fc-study__card:hover,
.fc-study__card:focus-visible {
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.fc-study__card:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px rgba(7, 126, 134, 0.3);
}

.fc-study__blob {
	position: absolute;
	right: 0;
	top: 0;
	width: 6rem;
	height: 6rem;
	border-radius: 9999px;
	background: var(--fc-study-blob);
	transform: translate(2rem, -2rem);
	transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none;
}

.fc-study__card:hover .fc-study__blob,
.fc-study__card:focus-visible .fc-study__blob {
	transform: translate(2rem, -2rem) scale(1.5);
}

/* The card body and its text are spans so they can nest inside the <a>. */
.fc-study__body {
	position: relative;
	display: block;
}

.fc-study__text {
	display: block;
}

.fc-study__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 1rem;
	background: var(--fc-study-mist-light);
	box-shadow: inset 0 0 0 1px var(--fc-study-mist);
	color: var(--fc-study-teal);
	transition: background-color 0.5s ease, color 0.5s ease;
}

.fc-study__card:hover .fc-study__icon,
.fc-study__card:focus-visible .fc-study__icon {
	background: var(--fc-study-teal);
	color: #fff;
}

.fc-study__icon svg {
	width: 2rem;
	height: 2rem;
	fill: none;
	stroke: currentColor;
}

.fc-study__icon i {
	font-size: 1.5rem;
}

.fc-study__card-title {
	margin: 1.25rem 0 0;
	color: var(--fc-study-ink);
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.35;
	transition: color 0.3s ease;
}

.fc-study__card:hover .fc-study__card-title,
.fc-study__card:focus-visible .fc-study__card-title {
	color: var(--fc-study-teal);
}

.fc-study__text {
	margin: 0.5rem 0 0;
	color: var(--fc-study-text);
	font-size: 0.875rem;
	line-height: 1.625;
}

.fc-study__more {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	margin-top: 1rem;
	color: var(--fc-study-teal);
	font-size: 0.875rem;
	font-weight: 600;
}

.fc-study__more svg {
	width: 1rem;
	height: 1rem;
	fill: none;
	stroke: currentColor;
	transition: transform 0.3s ease;
}

.fc-study__card:hover .fc-study__more svg,
.fc-study__card:focus-visible .fc-study__more svg {
	transform: translateX(4px);
}

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

@media (max-width: 639px) {
	.fc-study__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.fc-study__book-inner,
	.fc-study__page {
		animation: none;
	}

	.fc-study__item,
	.fc-study__head,
	.fc-study__blob,
	.fc-study__icon,
	.fc-study__more svg {
		transition: none;
	}
}
