/* ==========================================================================
   AFP Fleet Intelligence  [afp_fleet_intelligence]  (salient-child)

   Consultant grid matching https://www.theafp.co.uk/fleet-intelligence/:
   circular photo, teal name, left-aligned excerpt, "more" button opening
   a bio popup with a "Register Interest" button.
   Values from the old theme (style.css .afp-users-board / .my-board-review
   and custom-designer.css .afp-fleet-intellingence).
   ========================================================================== */

.afp-fi {
	--afp-fi-cols: 4;
	--afp-fi-green: #57b197;
	--afp-fi-purple: #8e68a6;
	--afp-fi-text: #3c4547;
	--afp-fi-dark: #221f20;

	width: 100%;
	font-family: "Poppins", sans-serif;
}

.afp-fi,
.afp-fi *,
.afp-fi__modal,
.afp-fi__modal * {
	box-sizing: border-box;
}

.afp-fi .afp-fi__heading {
	width: 100%;
	margin: 0 0 4rem;
	text-align: center;
}

/* ---------------------------------------------------------------- grid */
.afp-fi__grid {
	display: grid;
	grid-template-columns: repeat(var(--afp-fi-cols), minmax(0, 1fr));
	gap: 40px 30px;
}

/* ---------------------------------------------------------------- item */
.afp-fi__item {
	display: flex;
	flex-direction: column;
	width: 100%;
	text-align: center;
}

.afp-fi .afp-fi__photo-btn {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
}

.afp-fi div.afp-fi__photo-btn {
	cursor: default;
}

.afp-fi__photo {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	overflow: hidden;
	background-color: #e9e9e9;
}

.afp-fi .afp-fi__photo img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	border-radius: 50%;
	object-fit: cover;
	object-position: center top;
	transition: transform 0.8s ease, filter 0.8s ease;
}

/* Same flip + sepia hover as the live site. */
.afp-fi__item:hover .afp-fi__photo img {
	transform: rotateY(180deg);
	filter: sepia(1);
	transition-delay: 0.4s;
}

.afp-fi__no-photo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background-color: var(--afp-fi-green);
	color: #fff;
	font-size: clamp(22px, 4vw, 40px);
	font-weight: 600;
}

/* Name, excerpt, "more" — flex column so the buttons line up across a row
   whatever the excerpt length (replaces the old fixed min-heights). */
.afp-fi__info {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: center;
	padding: 18px 0 0;
}

.afp-fi .afp-fi__name {
	width: 100%;
	margin: 0;
	padding: 0 0 5px;
	color: var(--afp-fi-green);
	font-family: "Poppins", sans-serif;
	font-size: 25px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0;
	text-align: center;
	text-transform: none;
}

.afp-fi .afp-fi__excerpt {
	width: 100%;
	margin: 0 0 18px;
	padding: 0;
	color: var(--afp-fi-text);
	font-size: 18px;
	font-weight: 400;
	line-height: 1.65;
	text-align: left;
}

.afp-fi .afp-fi__more-btn {
	display: inline-block;
	margin: auto 0 0; /* pushes it to the bottom of the card */
	padding: 5px 16px;
	border: 0;
	border-radius: 100px;
	background-color: var(--afp-fi-purple);
	color: #fff;
	font-family: "Poppins", sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: 0;
	text-transform: lowercase;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.5s ease;
}

.afp-fi .afp-fi__more-btn:hover,
.afp-fi .afp-fi__more-btn:focus-visible {
	background-color: var(--afp-fi-green);
	color: #fff;
}

/* ----------------------------------------------------------- responsive */
@media (max-width: 1680px) {
	.afp-fi .afp-fi__excerpt {
		font-size: 16px;
	}
}

@media (max-width: 1200px) {
	.afp-fi .afp-fi__name {
		font-size: 21px;
	}
	.afp-fi .afp-fi__excerpt {
		font-size: 15px;
	}
	.afp-fi .afp-fi__more-btn {
		padding: 3px 18px;
	}
}

@media (max-width: 991px) {
	.afp-fi--cols-4 .afp-fi__grid,
	.afp-fi--cols-5 .afp-fi__grid,
	.afp-fi--cols-6 .afp-fi__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.afp-fi .afp-fi__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 30px 20px;
	}
	.afp-fi .afp-fi__heading {
		margin-bottom: 2.5rem;
	}
}

@media (max-width: 575px) {
	.afp-fi .afp-fi__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 40px;
	}
	.afp-fi__photo {
		max-width: 320px;
		margin: 0 auto;
	}
	.afp-fi .afp-fi__name {
		font-size: 24px;
	}
}

/* --------------------------------------------------------------- modal */
.afp-fi__modal {
	position: fixed;
	inset: 0;
	z-index: 100000; /* above Salient's header + admin bar; JS moves it to <body> */
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	font-family: "Poppins", sans-serif;
}

.afp-fi__modal.is-open {
	display: flex;
}

.afp-fi__modal-overlay {
	position: absolute;
	inset: 0;
	background-color: rgba(34, 31, 32, 0.75);
}

.afp-fi__modal-dialog {
	position: relative;
	width: 100%;
	max-width: 800px;
	max-height: 88vh;
	overflow-y: auto;
	background-color: #fff;
	border-radius: 8px;
	box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
	animation: afp-fi-modal-in 0.25s ease;
}

@keyframes afp-fi-modal-in {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.afp-fi__modal-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 26px;
	border-bottom: 1px solid #eee;
}

.afp-fi__modal .afp-fi__modal-title {
	margin: 0;
	color: var(--afp-fi-green, #57b197);
	font-family: "Poppins", sans-serif;
	font-size: 22px;
	font-weight: 600;
	line-height: 1.4;
}

.afp-fi__modal .afp-fi__modal-close {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #221f20;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

.afp-fi__modal .afp-fi__modal-close:hover,
.afp-fi__modal .afp-fi__modal-close:focus-visible {
	background-color: #f2f2f2;
}

.afp-fi__modal-body {
	padding: 24px 26px 30px;
	color: #3c4547;
	font-size: 15px;
	line-height: 1.75;
	text-align: left;
}

.afp-fi__modal-body p {
	margin: 0 0 1em;
}

.afp-fi__modal-body ul,
.afp-fi__modal-body ol {
	margin: 0 0 1em 1.3em;
}

.afp-fi__modal .afp-fi__register-btn {
	display: inline-block;
	margin-top: 10px;
	padding: 10px 28px;
	border: 0;
	border-radius: 100px;
	background-color: #57b197;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.5;
	text-decoration: none;
	transition: background-color 0.4s ease;
}

.afp-fi__modal .afp-fi__register-btn:hover,
.afp-fi__modal .afp-fi__register-btn:focus-visible {
	background-color: #8e68a6;
	color: #fff;
}

body.afp-fi-modal-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.afp-fi__modal-dialog {
		animation: none;
	}
	.afp-fi .afp-fi__photo img {
		transition: none;
	}
}
