/**
 * Staff Directory — Frontend Styles
 *
 * Two-column layout with filter sidebar and card grid.
 * Designed to match the Figma prototype with no hover effects.
 *
 * @package Staff_Directory
 */

/* =========================================
   CSS Custom Properties
   ========================================= */
:root {
	--color-primary: #2b3c73;
	--color-secondary: #f9ac1b;
	--color-accent-green: #d0dd28;
	--color-accent-green-strong: #50b447;
	--color-accent-maroon: #8b1b50;
	--color-accent-sky: #009ad0;
	--color-accent-red: #cc4a38;
	--color-white: #ffffff;
	--color-black: #000000;
	--color-gray-100: #e2e2e2;

	--sd-primary: var(--color-primary);
	--sd-accent-green: var(--color-accent-green);
	--sd-primary-dark: #1e40af;
	--sd-text: #3c3c3c;
	--sd-text-muted: #64748b;
	--sd-bg: #e2e4f0;
	--sd-sidebar-bg: var(--color-white);
	--sd-card-bg: #fdffe0;
	--sd-card-highlight: #f6a828;
	--sd-border: #bfbfbf;
	--sd-border-light: var(--color-gray-100);
	--sd-radius: 20px;
	--sd-font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	--sd-shadow: 0 69px 69px 0 rgba(0, 0, 0, 0.09), 0 17px 38px 0 rgba(0, 0, 0, 0.10);

	/* Card internal */
	--sd-card-radius: 20px;
	--sd-img-radius: 18px;
}

/* =========================================
   Container — Two-Column Layout
   ========================================= */
.staff-directory {
	font-family: var(--sd-font);
	color: var(--sd-text);
	display: flex;
	gap: 58px;
}

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

/* =========================================
   Sidebar
   ========================================= */
.staff-directory__sidebar {
	max-width: 260px;
	background: var(--sd-sidebar-bg);
	border-radius: var(--sd-radius);
	padding-block: 20px 25px;
	padding-inline: 30px;
	align-self: flex-start;
	position: sticky;
	top: 9rem;
}

/* ── Sidebar Header ── */
.staff-directory__sidebar-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 30px;
}

.staff-directory__sidebar-icon {
	display: inline-flex;
	color: var(--sd-primary);
}

.staff-directory__sidebar-title {
	flex: 1;
	color: var(--sd-primary);
	font-family: var(--sd-font);
	font-size: clamp(14px, 1.04vw, 20px);
	font-style: normal;
	font-weight: 600;
	line-height: normal;
}

.staff-directory__clear-all {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	color: var(--color-black);
	text-align: right;
	font-family: var(--sd-font);
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	line-height: normal;
	text-decoration: none;
	transition: opacity 0.2s;
}

.staff-directory__clear-all:disabled,
.staff-directory__clear-all[disabled],
.staff-directory__clear-all[aria-disabled="true"] {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

/* ── Filter Sections ── */
.staff-directory__filter-section:not(:last-child) {
	margin-bottom: 24px;
	padding-bottom: 24px;
	border-bottom: solid 1px var(--sd-border-light);
}

.staff-directory__filter-label {
	display: block;
	margin-bottom: 6px;
	color: var(--sd-text);
	font-family: var(--sd-font);
	font-size: 16px;
	font-style: normal;
	font-weight: 700;
	line-height: 22px;
}

/* ── Search Inputs ── */
.staff-directory__search-inner {
	position: relative;
	display: flex;
	align-items: center;
	margin-bottom: 20px;
}

.staff-directory__search {
	width: 100%;
	background: var(--sd-sidebar-bg);
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	padding: 8px 50px 8px 15px !important;
	border-radius: 10px !important;
	border: 1px solid var(--sd-border) !important;
	color: var(--sd-text) !important;
	font-family: var(--sd-font);
	font-size: 16px;
	font-style: normal;
	line-height: normal;
}

/* Hide native search clear button (browser default) */
.staff-directory__search::-webkit-search-cancel-button,
.staff-directory__search::-webkit-search-decoration {
	-webkit-appearance: none;
	appearance: none;
	display: none;
}

.staff-directory__search::-ms-clear {
	display: none;
	width: 0;
	height: 0;
}

.staff-directory__search:focus {
	border-color: var(--sd-primary);
	box-shadow: 0 0 0 2px rgba(43, 60, 115, 0.15);
	/* Adjust based on primary */
}

.staff-directory__search::placeholder {
	color: var(--sd-text);
	opacity: 0.8;
}

.staff-directory__search-icon {
	position: absolute;
	right: 12px;
	pointer-events: none;
}

.staff-directory__search-clear {
	position: absolute;
	right: 32px;
	background: var(--sd-sidebar-bg);
	border: none;
	cursor: pointer;
	padding: 4px;
	color: var(--sd-text);
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	z-index: 10;
}

.staff-directory__search-clear:focus-visible {
	outline: 2px solid var(--sd-primary);
	outline-offset: 1px;
}

.staff-directory__search-clear[hidden] {
	display: none;
}

/* ── A-Z Alphabet Grid ── */
.staff-directory__alpha-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	row-gap: 18px;
}

.staff-directory__alpha-btn {
	width: fit-content;
	padding: 4px 8px;
	border: none;
	background: none;
	color: var(--color-black);
	cursor: pointer;
	border-radius: 4px;
	text-align: center;
	font-family: var(--sd-font);
	font-size: 16px;
	font-style: normal;
	font-weight: 400;
	line-height: normal;
	border-radius: 50%;
}

.staff-directory__alpha-btn[aria-pressed="true"],
.staff-directory__alpha-btn--active {
	background: var(--sd-primary);
	color: var(--color-white);
}

.staff-directory__alpha-btn:focus-visible {
	outline: 2px solid var(--sd-primary);
	outline-offset: 1px;
}

/* ── Department Checkbox List ── */
.staff-directory__dept-list {
	max-height: 240px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.staff-directory__dept-item {
	display: flex;
	padding-bottom: 4px;
	/* align-items: center; */
	gap: 10px;
	cursor: pointer;
	color: var(--sd-text);
	font-family: var(--sd-font);
	font-size: 16px;
	font-style: normal;
	line-height: 22px;
}

.staff-directory__dept-item.sd-hidden {
	display: none;
}

/* Custom checkbox */
.staff-directory__dept-checkbox {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.staff-directory__dept-checkmark {
	flex-shrink: 0;
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 1.5px solid var(--sd-border);
	border-radius: 2px;
	background: var(--sd-sidebar-bg);
	position: relative;
	margin-top: 1px;
}

.staff-directory__dept-checkbox:checked+.staff-directory__dept-checkmark {
	background: var(--sd-primary);
	border-color: var(--sd-primary);
}

.staff-directory__dept-checkbox:checked+.staff-directory__dept-checkmark::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 4px;
	width: 10.5px;
	height: 5.6px;
	border: solid var(--color-white);
	border-width: 0 1.5px 1.5px 0;
	transform: translateX(-50%) rotate(-45deg) scaleX(-1);
}

.staff-directory__dept-checkbox:focus-visible+.staff-directory__dept-checkmark {
	outline: 2px solid var(--sd-primary);
	outline-offset: 1px;
}

.staff-directory__dept-name {
	flex: 1;
}

/* =========================================
   Content Area
   ========================================= */
.staff-directory__content {
	flex: 1;
	min-width: 0;
}

/* ── Department Section Headings ── */
.staff-directory__dept-section:not(:last-of-type) {
	margin-bottom: 92px;
}

.staff-directory__dept-heading {
	margin: 0 0 20px;
	color: var(--color-black);
	font-family: var(--sd-font);
	font-size: clamp(18px, 1.56vw, 30px);
	font-style: normal;
	font-weight: 700;
	line-height: normal;
}

/* =========================================
   Card Grid
   ========================================= */
.staff-directory__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 40px;
}

/* =========================================
   Staff Card
   ========================================= */
.staff-card {
	border-radius: var(--sd-card-radius);
	background: var(--sd-card-bg);
	box-shadow: var(--sd-shadow);
	backdrop-filter: blur(15px);
	transition: all 0.5s ease-in-out;
}

.staff-card:hover {
	background: var(--color-secondary);
}

.leadership-team .staff-card:hover {
	background: var(--sd-accent-green);
}

/* Highlighted variant (for future use) */
.staff-card--highlight {
	background: var(--sd-card-highlight);
}

.staff-card--highlight .staff-card__name,
.staff-card--highlight .staff-card__title,
.staff-card--highlight .staff-card__detail,
.staff-card--highlight .staff-card__detail a,
.staff-card--highlight .staff-card__detail span {
	color: var(--color-white);
}

/* .staff-card--highlight .staff-card__detail svg {
	color: var(--color-white);
} */

/* -- Image -- */
.staff-card__image-wrap {
	margin: 6px 6px 0 6px;
	overflow: hidden;
	border-radius: var(--sd-img-radius);
	height: 368px;
}

.staff-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: var(--sd-img-radius);
	transition: transform 0.3s ease-in-out;
}

.staff-card:hover .staff-card__image {
	transform: scale(1.1);
}

/* -- Body -- */
.staff-card__body {
	padding: 24px 24px 26px 24px;
}

.staff-card__name {
	color: #050505;
	font-family: var(--sd-font);
	font-size: clamp(14px, 1.04vw, 20px);
	font-style: normal;
	font-weight: 700;
	line-height: 30px;
	margin: 0;
}

.staff-card__title {
	margin: 4px 0 15.5px;
	line-height: normal;
}

/* -- Detail rows -- */
.staff-card__details {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 16px;
	padding-top: 15.5px;
	border-top: 1px solid var(--sd-border-light);
}

.staff-card__detail {
	display: flex;
	align-items: center;
	gap: 8px;
}

.staff-card__detail svg {
	flex-shrink: 0;
	/* color: var(--sd-text-muted); */
}

.staff-card__detail a {
	font-size: 14px;
	color: var(--color-black);
	line-height: normal;
}

.staff-card__detail span {
	color: var(--color-black);
	font-family: var(--sd-font);
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	line-height: normal;
}

/* =========================================
   Placeholder Avatar
   ========================================= */
.staff-card__image--placeholder {
	object-fit: contain !important;
	padding: 25%;
	background: #d5d0c4;
}

/* =========================================
   No Results & Screen reader live region
   ========================================= */
.staff-directory__no-results {
	text-align: center;
	padding: 3rem 1rem;
	color: var(--sd-text-muted);
}

.staff-directory__no-results svg {
	margin-bottom: 0.75rem;
	color: var(--sd-border);
}

.staff-directory__no-results p {
	font-size: 1rem;
	margin: 0;
}

/* A visually hidden region for ARIA live announcements */
.staff-directory__sr-announce {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* =========================================
   Hidden utility (JS filtering)
   ========================================= */
.sd-hidden {
	display: none !important;
}

/* =========================================
   Screen reader only
   ========================================= */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* =========================================
   Mobile Filter UI (Slide-up panels)
   ========================================= */

body.sd-modal-open {
	overflow: hidden;
}

.sd-mobile-bar {
	display: none;
	/* Shown on mobile via media query */
}

.sd-mobile-panel {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
}

.sd-mobile-panel[hidden] {
	display: none;
}

.sd-mobile-panel__overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.sd-mobile-panel.sd-panel--open .sd-mobile-panel__overlay {
	opacity: 1;
}

.sd-mobile-panel__sheet {
	position: relative;
	background: var(--color-white);
	width: 100%;
	height: 85vh;
	border-radius: 10px 10px 0 0;
	display: flex;
	flex-direction: column;
	transform: translateY(100%);
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.1);
}

.sd-mobile-panel.sd-panel--open .sd-mobile-panel__sheet {
	transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {

	.sd-mobile-panel__overlay,
	.sd-mobile-panel__sheet {
		transition: none;
	}
}

.sd-mobile-panel__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 16px;
	border-bottom: 1px solid var(--sd-border-light);
}

.sd-mobile-panel__title {
	margin: 0;
	font-size: 20px;
	font-weight: 600;
	color: var(--color-black);
}

.sd-mobile-panel__clear-all {
	background: none;
	border: none;
	color: var(--color-primary);
	font-size: 14px;
	cursor: pointer;
	padding: 0;
	font-family: var(--sd-font);
}

.sd-mobile-panel__clear-all:disabled,
.sd-mobile-panel__clear-all[disabled] {
	opacity: 0.5;
	text-decoration: none;
	cursor: not-allowed;
}

.sd-mobile-panel__body {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: row;
	background: var(--color-white);
	padding: 20px 16px 0 16px;
}

/* Two-column layout */
.sd-mobile-tabs {
	width: 37%;
	display: flex;
	flex-direction: column;
	row-gap: 8px;
	overflow-y: auto;
	border-right: solid 1px var(--color-gray-100);
}

.sd-mobile-tab {
	border: none;
	text-align: left;
	font-family: var(--sd-font);
	cursor: pointer;
	transition: background 0.2s;
	background: transparent;
	color: #4E4E4E;
	font-size: 14px;
	line-height: 21px;
	padding-block: 11px;
	padding-inline: 12px 8px;
	border-radius: 4px 0 0 4px;
}

.sd-mobile-tab.active {
	background: #FFF3DE;
	font-weight: 600;
	color: var(--color-black);
}

.sd-mobile-tab-content {
	/* flex: 1; */
	width: 63%;
	overflow-y: auto;
	padding-inline: 20px 9px;
	/* min-width: 0; */
	/* Prevent overflow */
}

.sd-mobile-tab-pane {
	display: none;
}

.sd-mobile-tab-pane.active {
	display: block;
}

.sd-mobile-tab-pane .staff-directory__filter-label {
	display: none;
}

/* Fix up the filter sections when inside the tab pane */
.sd-mobile-tab-pane .staff-directory__filter-section {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.sd-mobile-panel__footer {
	padding: 9px 16px 16px 16px;
	display: flex;
	gap: 10px;
	background: var(--color-white);
}

.sd-mobile-panel__btn {
	flex: 1;
	padding: 14px;
	border-radius: 30px;
	font-family: var(--sd-font);
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	text-align: center;
	transition: opacity 0.2s;

	color: var(--color-primary);
	font-weight: 600;
	line-height: 20px;
	padding: 10px 18px;
	border: none;
}

.sd-mobile-panel__btn:hover {
	opacity: 0.9;
}

.sd-mobile-panel__btn--outline {
	background: var(--color-gray-100);
	max-width: 37%;
}

.sd-mobile-panel__btn--fill {
	background: var(--color-accent-green);
	max-width: 63%;
}

.staff-directory__no-results h2 {
	margin-block: 16px 10px;
	color: var(--color-black);
	font-size: clamp(20px, 1.6vw, 26px);
	font-weight: 900;
	text-transform: uppercase;
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 1200px) {
	.staff-directory__sidebar {
		top: 7rem;
	}
}

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

@media (max-width: 768px) {
	.staff-directory {
		flex-direction: column;
		padding-bottom: 80px;
		/* Space for sticky bar */
	}

	.staff-directory__sidebar {
		display: none;
		/* Hide sidebar on mobile in favor of sticky bar */
	}

	.sd-mobile-bar {
		display: flex;
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		z-index: 9998;
		background: var(--color-primary);
		border-radius: 16px 16px 0 0;
		box-shadow: 0 -4px 4px 0 rgba(0, 0, 0, 0.06);
	}

	.sd-mobile-bar__btn {
		flex: 1;
		background: transparent;
		border: none;
		color: var(--color-white);
		padding: 17.5px 16px;
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 10px;
		font-family: var(--sd-font);
		font-size: 16px;
		font-weight: 500;
		cursor: pointer;
	}

	.sd-mobile-bar__text-wrap {
		position: relative;
		display: flex;
	}

	.sd-mobile-bar__icon-wrap svg {
		width: 18px;
		height: 18px;
	}

	.sd-mobile-bar__badge {
		position: absolute;
		top: 0;
		right: -15px;
		width: 5px;
		height: 5px;
		background: var(--color-secondary);
		border-radius: 50%;
		/* border: 2px solid var(--color-primary); */
	}

	.sd-mobile-bar__badge[hidden] {
		display: none;
	}

	.staff-directory__grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.staff-directory__dept-list {
		max-height: 100%;
	}

	.sd-mobile-tab-pane :is(.staff-directory__dept-name, .staff-directory__search, .staff-directory__alpha-btn) {
		font-size: 14px;
	}

	.sd-mobile-tab-pane .staff-directory__alpha-grid {
		row-gap: 14px;
	}
}

@media (max-width: 480px) {
	.staff-directory__grid {
		grid-template-columns: 1fr;
	}

	/* ── A-Z Alphabet Grid ── */
	.staff-directory__alpha-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}