/*
 * [ram_staff_directory] frontend styles. Everything is scoped under
 * .ram-staff-directory so this works wherever the shortcode is placed —
 * no page ID, no Elementor element ID, no dependency on the Elementor
 * Loop Grid. Loaded only when the shortcode renders (see
 * class-frontend-directory.php), never enqueued site-wide.
 */

.ram-staff-directory {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

/*
 * directory.js toggles visibility by setting the `hidden` DOM property on
 * cards, the grid, and the empty state. Without this rule, the component's
 * own display:flex/display:grid declarations below have equal-or-greater
 * specificity than the browser's default [hidden]{display:none} rule and
 * load after it, so `hidden` is silently ignored. !important is necessary
 * here specifically to guarantee hidden always wins over this component's
 * own display rules, regardless of selector order below.
 */
.ram-staff-directory [hidden] {
	display: none !important;
}

.ram-staff-directory__controls {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ram-staff-directory__search {
	width: 100%;
	max-width: 420px;
	padding: 11px 16px;
	border: 1px solid #CBD5E1;
	border-radius: 100px;
	font-size: 14px;
	color: #1E293B;
}

.ram-staff-directory__filters {
	display: flex;
	flex-flow: row wrap;
	gap: 8px;
}

.ram-staff-directory__filter {
	flex: 0 0 auto;
	appearance: none;
	border: 1px solid #E2E8F0;
	border-radius: 100px;
	background: #fff;
	color: #64748B;
	padding: 10px 15px;
	font-family: inherit;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	transition: .2s;
}

.ram-staff-directory__filter:hover,
.ram-staff-directory__filter:focus-visible,
.ram-staff-directory__filter.is-active {
	border-color: #223C86;
	background: #223C86;
	color: #fff;
}

.ram-staff-directory__filter:focus-visible {
	outline: 3px solid rgba(34, 60, 134, .25);
	outline-offset: 2px;
}

.ram-staff-directory__count {
	margin: 0;
	color: #64748B;
	font-size: 13px;
}

.ram-staff-directory__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
}

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

@media (max-width: 600px) {
	.ram-staff-directory__grid {
		gap: 16px;
	}
}

.ram-staff-directory__card {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
}

.ram-staff-directory__portrait {
	position: relative;
	overflow: hidden;
	aspect-ratio: 1 / 0.9;
	background: linear-gradient(145deg, #F7F9FC, #E2E8F0);
}

.ram-staff-directory__portrait img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ram-staff-directory__badge {
	position: absolute;
	left: 12px;
	bottom: 12px;
	padding: 7px 9px;
	border-radius: 2px;
	background: rgba(255, 255, 255, .92);
	color: #223C86;
	font-size: 10px;
	font-weight: 800;
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: .06em;
}

.ram-staff-directory__copy {
	padding: 17px 2px;
	border-bottom: 1px solid #E2E8F0;
}

.ram-staff-directory__heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
}

.ram-staff-directory__copy h3 {
	margin: 0 0 5px;
	font-size: 21px;
	font-weight: 650;
	line-height: 1.25;
	color: #1E293B;
}

.ram-staff-directory__copy p {
	margin: 0;
	font-size: 13px;
	line-height: 1.45;
	color: #64748B;
}

.ram-staff-directory__email {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	margin-top: -4px;
	border: 1px solid #CBD5E1;
	border-radius: 50%;
	color: #223C86;
	line-height: 1;
	text-decoration: none;
	transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.ram-staff-directory__email svg {
	display: block;
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ram-staff-directory__email:hover {
	background: #223C86;
	border-color: #223C86;
	color: #fff;
	transform: translateY(-1px);
}

.ram-staff-directory__email:focus-visible {
	outline: 3px solid #F5B700;
	outline-offset: 3px;
}

.ram-staff-directory__empty {
	background: #F7F9FC;
	padding: 90px 20px;
	text-align: center;
}

.ram-staff-directory__empty h3 {
	margin: 0 0 10px;
	color: #1E293B;
	font-size: 28px;
}

.ram-staff-directory__empty p {
	margin: 0 0 20px;
	color: #64748B;
}

.ram-staff-directory__clear {
	border: 0;
	border-radius: 100px;
	background: #223C86;
	color: #fff;
	padding: 11px 18px;
	font-weight: 700;
	cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
	.ram-staff-directory__email {
		transition: none;
	}

	.ram-staff-directory__email:hover {
		transform: none;
	}
}
