/**
 * Staff directory - Anstey Horne Connect.
 * Purple #672e6b (dark #452048), grey pills #898a8d, opened-photo grey #aeb2b1.
 */

.ah-directory {
	padding: 60px 5% 90px;
	background: #fff; /* the page's body background is the coloured hero band */
	color: #000;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 15px;
	line-height: 1.4;
}

/* ---- Filters ------------------------------------------------------------- */

.ah-directory__filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	min-height: 58px; /* stops the page jumping while FacetWP fills the dropdowns */
}

.ah-directory__label {
	flex: 0 0 100%;
	color: #672e6b;
	font-size: 12px;
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

.ah-filter .facetwp-facet {
	margin: 0;
}

.ah-directory .ah-filter select.facetwp-dropdown {
	appearance: none;
	-webkit-appearance: none;
	width: auto;
	max-width: 100%;
	margin: 0;
	padding: 8px 36px 8px 18px;
	border: 0;
	border-radius: 50px;
	background-color: #898a8d;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='white' stroke-linecap='round' stroke-width='1.5'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 12px 8px;
	color: #fff;
	font: 600 12px/1.2 Arial, Helvetica, sans-serif;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
}

.ah-directory .ah-filter--department select.facetwp-dropdown {
	background-color: #672e6b;
}

.ah-directory .ah-filter select.facetwp-dropdown:hover,
.ah-directory .ah-filter select.facetwp-dropdown:focus {
	box-shadow: none;
}

.ah-directory .ah-filter select.facetwp-dropdown:focus-visible {
	outline: 2px solid #672e6b;
	outline-offset: 3px;
}

.ah-filter select option {
	background: #fff;
	color: #000;
	letter-spacing: 0;
	text-transform: none;
}

.ah-filter select option:disabled {
	color: #9a9a9a; /* no team members for the current selection */
}

/* ---- Custom dropdowns (FacetWP fSelect) ------------------------------------
   The pill is the design's; the open list follows the site's own menus (white,
   rounded, soft shadow). The native <select> above is the pre-JS fallback. */

.ah-directory .ah-filter .fs-wrap {
	width: auto;
	max-width: 100%;
	font-family: Arial, Helvetica, sans-serif;
	line-height: 1.2;
}

.ah-directory .ah-filter .fs-wrap:focus {
	outline: none;
}

.ah-directory .ah-filter .fs-wrap:focus-visible .fs-label-wrap {
	outline: 2px solid #672e6b;
	outline-offset: 3px;
}

.ah-directory .ah-filter .fs-label-wrap {
	border: 0;
	border-radius: 50px;
	background: #898a8d;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.ah-directory .ah-filter--department .fs-label-wrap {
	background: #672e6b;
}

.ah-directory .ah-filter .fs-wrap:hover .fs-label-wrap,
.ah-directory .ah-filter .fs-open .fs-label-wrap {
	background: #672e6b;
}

.ah-directory .ah-filter .fs-label-wrap .fs-label {
	padding: 9px 40px 9px 18px;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* Replace fSelect's CSS triangle with the design's chevron. */
.ah-directory .ah-filter .fs-arrow {
	right: 16px;
	width: 12px;
	height: 8px;
	border: 0;
	background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='white' stroke-linecap='round' stroke-width='1.5'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat center / contain;
}

.ah-directory .ah-filter .fs-dropdown {
	top: 100%;
	left: 0;
	width: max-content;
	min-width: 100%;
	max-width: min(340px, 90vw);
	margin-top: 8px;
	overflow: hidden;
	border: 0;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 3px 12px rgba(0, 0, 0, 0.12);
}

.ah-directory .ah-filter .fs-dropdown .fs-options {
	max-height: 340px;
	padding: 8px 0;
}

.ah-directory .ah-filter .fs-search {
	padding: 6px 14px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	background: #fff;
}

.ah-directory .ah-filter .fs-search input {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 6px 0;
	border: 0;
	background: transparent;
	font-size: 14px;
}

.ah-directory .ah-filter .fs-option {
	padding: 10px 20px;
	color: #353535;
	font-size: 15px;
	line-height: 1.3;
	white-space: nowrap;
	word-break: normal;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.ah-directory .ah-filter .fs-option:hover,
.ah-directory .ah-filter .fs-option.hl {
	background: #f3eef4;
	color: #672e6b;
}

.ah-directory .ah-filter .fs-wrap.single .fs-option.selected {
	background: #672e6b;
	color: #fff;
}

.ah-directory .ah-filter .fs-option.disabled,
.ah-directory .ah-filter .fs-option.disabled:hover {
	background: transparent;
	color: #353535;
	opacity: 0.35;
}

.ah-directory .ah-filter .fs-no-results {
	padding: 10px 20px;
	color: #898a8d;
	font-size: 14px;
}

.ah-directory .ah-filter .fs-checkbox {
	display: none; /* single-select: no checkbox column */
}

/* ---- Results ------------------------------------------------------------- */

.ah-directory .facetwp-template {
	min-height: 200px;
	transition: opacity 0.2s ease;
}

.ah-directory .facetwp-template.is-loading {
	opacity: 0.45;
}

.ah-directory__heading {
	margin: 52px 0 34px;
	color: #672e6b;
	font-family: inherit;
	font-size: 30px;
	font-weight: 500;
	letter-spacing: 0.12em;
	line-height: 1.2;
	text-transform: uppercase;
}

.ah-directory__empty,
.ah-directory__notice {
	color: #672e6b;
	font-size: 18px;
}

.ah-people {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	grid-auto-flow: dense; /* later cards fill the gap left when a bio opens full-width */
	gap: 36px 24px;
	align-items: start;
}

/* ---- Card ---------------------------------------------------------------- */

.ah-person {
	min-width: 0;
}

/* Reset Themify's global <button> styling on our controls. */
.ah-directory .ah-person__toggle,
.ah-directory .ah-person__close {
	margin: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	transform: none;
}

.ah-directory .ah-person__toggle {
	display: block;
	width: 100%;
	padding: 0;
	font-weight: 400;
	text-align: left;
	cursor: pointer;
}

.ah-directory .ah-person__toggle:hover,
.ah-directory .ah-person__close:hover {
	background: none;
	box-shadow: none;
	color: inherit;
	transform: none;
}

.ah-person__toggle:focus-visible {
	outline: 2px solid #672e6b;
	outline-offset: 4px;
	border-radius: 20px;
}

/* Purple backdrop with a darker corner triangle - behind the transparent PNG. */
.ah-person__photo {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 20px;
	background:
		linear-gradient(to bottom left, #452048 0, #452048 44%, transparent 44%),
		#672e6b;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ah-person__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center bottom;
}

.ah-person__initials {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: rgba(255, 255, 255, 0.85);
	font-size: 34px;
	font-weight: 700;
	letter-spacing: 0.08em;
}

@media (prefers-reduced-motion: no-preference) {
	.ah-person__toggle:hover .ah-person__photo {
		transform: translateY(-3px);
		box-shadow: 0 10px 20px rgba(69, 32, 72, 0.3);
	}
}

.ah-person__name {
	display: block;
	margin-top: 12px;
	color: #672e6b;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.25;
}

.ah-person__meta {
	display: block;
	margin-top: 2px;
	font-size: 14px;
}

.ah-person__meta > span {
	display: block;
}

/* ---- Contact rows (card, bio and office) ---------------------------------- */

.ah-contact {
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.ah-contact li {
	margin: 0 0 6px;
	padding: 0;
}

.ah-contact a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: #672e6b;
	font-size: 14px;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.ah-contact a:hover span {
	text-decoration: underline;
}

.ah-contact .ah-icon {
	width: 20px;
	height: 20px;
	flex: none;
}

/* ---- Opened bio ------------------------------------------------------------ */

.ah-person.is-open {
	grid-column: span 2;
}

.ah-person.is-open .ah-person__summary {
	display: none;
}

.ah-person__panel {
	position: relative;
	padding: 28px;
	border-radius: 26px;
	background: #672e6b;
	color: #fff;
}

.ah-person__panel[hidden] {
	display: none;
}

.ah-person__panel:focus {
	outline: none;
}

.ah-person__panel:focus-visible {
	outline: 3px solid #fff;
	outline-offset: -8px;
}

.ah-directory .ah-person__close {
	position: absolute;
	top: 14px;
	right: 16px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 34px;
	height: 34px;
	padding: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: #672e6b;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.ah-directory .ah-person__close:hover {
	background: #fff;
}

.ah-person__photo--open {
	aspect-ratio: 6 / 5;
	border-radius: 16px;
	background: #aeb2b1; /* grey when opened */
	transition: none;
}

.ah-person__body {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px 28px;
	margin-top: 22px;
}

.ah-person__info {
	flex: 1 1 200px;
	min-width: 0;
}

.ah-person__title {
	margin: 0 0 2px;
	color: #fff;
	font-family: inherit;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.2;
}

.ah-person__quals,
.ah-person__line {
	margin: 0;
	color: #fff;
	font-size: 15px;
}

.ah-person__quals {
	margin-bottom: 10px;
}

.ah-person__about {
	margin: 14px 0 0;
	color: #fff;
	font-size: 15px;
}

.ah-person__panel .ah-contact {
	flex: 0 1 auto;
	margin: 0;
}

.ah-person__panel .ah-contact a {
	color: #fff;
}

/* ---- Office ------------------------------------------------------------------ */

.ah-office {
	display: grid;
	grid-template-columns: minmax(240px, 1fr) 2.4fr;
	gap: 40px;
	align-items: center;
	margin-top: 80px;
}

.ah-office__title {
	margin: 0 0 18px;
	color: #672e6b;
	font-family: inherit;
	font-size: 30px;
	font-weight: 500;
	letter-spacing: 0.12em;
	line-height: 1.2;
	text-transform: uppercase;
}

.ah-office__address {
	margin: 0 0 22px;
	color: #672e6b;
	font-size: 20px;
	font-style: normal;
	line-height: 1.4;
}

.ah-contact--office {
	margin: 0;
}

.ah-contact--office li {
	margin-bottom: 14px;
}

.ah-contact--office a {
	gap: 12px;
	font-size: 20px;
}

.ah-contact--office .ah-icon {
	width: 32px;
	height: 32px;
}

.ah-office__image img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 440px;
	object-fit: cover;
}

/* ---- Pagination (FacetWP) ----------------------------------------------------- */

.ah-directory .facetwp-pager {
	margin-top: 50px;
}

.ah-directory .facetwp-pager .facetwp-page {
	display: inline-block;
	margin: 0 6px 8px 0;
	padding: 6px 14px;
	border-radius: 50px;
	background: #898a8d;
	color: #fff;
	font: 600 13px/1.2 Arial, Helvetica, sans-serif;
	letter-spacing: 1px;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.ah-directory .facetwp-pager .facetwp-page:hover,
.ah-directory .facetwp-pager .facetwp-page.active {
	background: #672e6b;
	color: #fff;
}

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

@media (max-width: 1200px) {
	.ah-people {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 960px) {
	.ah-people {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 760px) {
	.ah-directory__heading,
	.ah-office__title {
		font-size: 22px;
	}

	.ah-office {
		grid-template-columns: 1fr;
		gap: 26px;
		margin-top: 56px;
	}
}

@media (max-width: 680px) {
	.ah-people {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 30px 16px;
	}

	.ah-person.is-open {
		grid-column: 1 / -1;
	}

	.ah-person__panel {
		padding: 22px;
	}
}

/* A contact row with no icon (CV link, office contact): line up with the text of the rows above. */
.ah-contact__plain {
	padding-left: 28px;
	font-size: 14px;
}

.ah-contact--office .ah-contact__plain {
	padding-left: 44px;
	font-size: 20px;
}

.ah-person__panel .ah-contact__plain {
	color: #fff;
}

.ah-contact__plain a span {
	text-decoration: underline;
}
