/* ==========================================================================
   AFP Board Members element  (salient-child)
   Photo grid + bio popup, matching the AFP Board section on
   https://www.theafp.co.uk/about-us/ (circular photo, name, role,
   "More" button -> modal with the member's bio).
   ========================================================================== */

.afp-board {
	--afp-board-name-color: #57b197;
	--afp-board-role-color: #221f20;
	--afp-board-btn-color: #8e68a6;
	--afp-board-btn-hover-color: #57b197;
}

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

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

/* ---------------------------------------------------------------- grid */
.afp-board__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 40px 30px;
}

@media (max-width: 991px) {
	.afp-board__grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 767px) {
	.afp-board__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 30px 20px;
	}
}

@media (max-width: 575px) {
	.afp-board__grid {
		grid-template-columns: 1fr;
	}
}

/* -------------------------------------------------------------- member */
.afp-board__member {
	width: 100%;
	text-align: center;
}

.afp-board__photo-btn {
	display: block;
	width: 100%;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

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

.afp-board__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.8s ease, filter 0.8s ease;
	transition-delay: 0.15s;
}

.afp-board__member:hover .afp-board__photo img {
	transform: rotateY(180deg);
	filter: sepia(1);
}

.afp-board__no-photo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background-color: var(--afp-board-name-color);
	color: #fff;
	font-family: "Poppins", sans-serif;
	font-size: clamp(20px, 4vw, 32px);
	font-weight: 600;
	letter-spacing: 0.5px;
}

.afp-board__info {
	padding: 18px 0 0;
}

.afp-board__name {
	margin: 0 0 4px;
	color: var(--afp-board-name-color);
	font-family: "Poppins", sans-serif;
	font-size: 22px;
	font-weight: 500;
	line-height: 1.3;
}

.afp-board__role {
	display: block;
	color: var(--afp-board-role-color);
	font-size: 16px;
	font-weight: 500;
}

.afp-board__more-btn {
	display: inline-block;
	margin-top: 12px;
	padding: 6px 20px;
	border: 0;
	border-radius: 100px;
	background-color: var(--afp-board-btn-color);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.4s ease;
}

.afp-board__more-btn:hover,
.afp-board__more-btn:focus-visible {
	background-color: var(--afp-board-btn-hover-color);
}

@media (max-width: 575px) {
	.afp-board__name {
		font-size: 19px;
	}
	.afp-board__role {
		font-size: 15px;
	}
}

/* --------------------------------------------------------------- modal */
.afp-board__modal {
	position: fixed;
	inset: 0;
	/* Above Salient's fixed header (9999) and the WP admin bar (99999). The
	   JS also moves the popup to <body> on open, out of Salient's stacking
	   contexts, so this value actually takes effect. */
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

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

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

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

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

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

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

.afp-board__modal-title {
	margin: 0;
	color: var(--afp-board-name-color);
	font-family: "Poppins", sans-serif;
	font-size: 22px;
	font-weight: 600;
}

.afp-board__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: var(--afp-board-role-color);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

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

.afp-board__modal-body {
	padding: 24px 26px 28px;
	color: #333;
	font-size: 15px;
	line-height: 1.75;
}

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

.afp-board__modal-body p:last-child {
	margin-bottom: 0;
}

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

/* Skip pointless work in the WPBakery back-end editor. */
body.vc_editable .afp-board__photo img {
	transition: none;
}
