/**
 * Research Faculty Directory — front end.
 *
 * Sized and coloured to sit inside the Superio theme: Jost is inherited from the
 * theme rather than loaded again, 15px base, 8px radii, #34A853 accent. Colours
 * come through CSS custom properties set inline by the shortcode, so changing
 * the accent in settings restyles everything without editing this file.
 */

.rjfd {
	--rjfd-border: #e8ecf1;
	--rjfd-surface: #ffffff;
	--rjfd-muted: #f7f9fb;
	font-size: 15px;
	line-height: 1.6;
	color: var(--rjfd-body, #77838f);
}

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

.rjfd__title {
	color: var(--rjfd-heading, #202124);
	font-weight: 500;
	margin: 0 0 20px;
}

/* ---------- Search ---------- */

.rjfd__search {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.rjfd__field {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--rjfd-surface);
	border: 1px solid var(--rjfd-border);
	border-radius: 60px; /* matches the theme's hero search pill */
	padding: 6px 6px 6px 18px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rjfd__field:focus-within {
	border-color: var(--rjfd-accent, #34a853);
	box-shadow: 0 0 0 4px var(--rjfd-accent-soft, rgba(52, 168, 83, 0.07));
}

.rjfd__icon {
	width: 18px;
	height: 18px;
	flex: none;
	fill: none;
	stroke: var(--rjfd-body, #77838f);
	stroke-width: 2;
	stroke-linecap: round;
}

.rjfd__input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: 0;
	background: transparent;
	font: inherit;
	color: var(--rjfd-heading, #202124);
	padding: 10px 0;
	-webkit-appearance: none;
	appearance: none;
}

.rjfd__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}

.rjfd__submit {
	flex: none;
	border: 0;
	cursor: pointer;
	background: var(--rjfd-accent, #34a853);
	color: #fff;
	font: inherit;
	font-weight: 500;
	padding: 11px 26px;
	border-radius: 60px;
	transition: filter 0.15s ease;
}

.rjfd__submit:hover {
	filter: brightness(0.94);
}

.rjfd__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.rjfd__select {
	flex: 1 1 200px;
	max-width: 280px;
	font: inherit;
	color: var(--rjfd-heading, #202124);
	background: var(--rjfd-surface);
	border: 1px solid var(--rjfd-border);
	border-radius: var(--rjfd-radius, 8px);
	padding: 10px 12px;
	outline: 0;
}

.rjfd__select:focus {
	border-color: var(--rjfd-accent, #34a853);
	box-shadow: 0 0 0 3px var(--rjfd-accent-soft, rgba(52, 168, 83, 0.07));
}

.rjfd__clear {
	border: 1px solid var(--rjfd-border);
	background: transparent;
	color: var(--rjfd-body, #77838f);
	font: inherit;
	border-radius: var(--rjfd-radius, 8px);
	padding: 10px 16px;
	cursor: pointer;
}

.rjfd__clear:hover {
	color: var(--rjfd-heading, #202124);
	border-color: #d7dde5;
}

.rjfd__hint {
	margin: 12px 0 0;
	font-size: 13.5px;
}

.rjfd__hint strong {
	color: var(--rjfd-heading, #202124);
	font-weight: 500;
}

.rjfd__status {
	margin: 18px 0 0;
	font-size: 14px;
	min-height: 21px;
}

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

.rjfd__results {
	display: grid;
	gap: 12px;
	margin-top: 14px;
	grid-template-columns: 1fr;
}

@media (min-width: 700px) {
	.rjfd__results {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1100px) {
	.rjfd__results {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.rjfd__card {
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: 100%;
	text-align: left;
	background: var(--rjfd-surface);
	border: 1px solid var(--rjfd-border);
	border-radius: var(--rjfd-radius, 8px);
	padding: 18px;
	cursor: pointer;
	font: inherit;
	color: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.rjfd__card:hover,
.rjfd__card:focus-visible {
	border-color: var(--rjfd-accent, #34a853);
	box-shadow: 0 6px 20px -12px rgba(32, 33, 36, 0.35);
	transform: translateY(-1px);
	outline: none;
}

.rjfd__name {
	color: var(--rjfd-heading, #202124);
	font-weight: 500;
	font-size: 16px;
	margin: 0;
}

.rjfd__meta {
	font-size: 13.5px;
	margin: 0;
}

.rjfd__institute {
	font-size: 13.5px;
	margin: 0;
	color: var(--rjfd-heading, #202124);
}

.rjfd__research {
	margin: 8px 0 0;
	font-size: 13px;
	color: var(--rjfd-body, #77838f);
}

.rjfd__tag {
	align-self: flex-start;
	margin-top: 10px;
	font-size: 12px;
	background: var(--rjfd-accent-soft, rgba(52, 168, 83, 0.07));
	color: var(--rjfd-accent, #34a853);
	border-radius: 999px;
	padding: 3px 10px;
}

/* ---------- Pager ---------- */

.rjfd__pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 26px;
}

.rjfd__pager button {
	border: 1px solid var(--rjfd-border);
	background: var(--rjfd-surface);
	color: var(--rjfd-heading, #202124);
	font: inherit;
	border-radius: var(--rjfd-radius, 8px);
	padding: 9px 18px;
	cursor: pointer;
}

.rjfd__pager button:disabled {
	opacity: 0.45;
	cursor: default;
}

.rjfd__pager span {
	font-size: 13.5px;
}

/* ---------- Detail ---------- */

.rjfd__modal[hidden] {
	display: none;
}

.rjfd__modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.rjfd__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(32, 33, 36, 0.45);
}

.rjfd__panel {
	position: relative;
	background: var(--rjfd-surface);
	border-radius: 14px;
	width: min(560px, 100%);
	max-height: 85vh;
	overflow-y: auto;
	padding: 28px;
	box-shadow: 0 24px 60px -20px rgba(32, 33, 36, 0.4);
}

.rjfd__close {
	position: absolute;
	top: 12px;
	right: 14px;
	border: 0;
	background: transparent;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: var(--rjfd-body, #77838f);
}

.rjfd__close:hover {
	color: var(--rjfd-heading, #202124);
}

.rjfd__detail-name {
	color: var(--rjfd-heading, #202124);
	font-size: 22px;
	font-weight: 500;
	margin: 0 30px 4px 0;
}

.rjfd__detail-row {
	display: flex;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--rjfd-border);
	font-size: 14px;
}

.rjfd__detail-row:last-of-type {
	border-bottom: 0;
}

.rjfd__detail-label {
	flex: 0 0 128px;
	color: var(--rjfd-body, #77838f);
}

.rjfd__detail-value {
	flex: 1;
	color: var(--rjfd-heading, #202124);
}

.rjfd__profile-link {
	display: inline-block;
	margin-top: 18px;
	background: var(--rjfd-accent, #34a853);
	color: #fff !important;
	text-decoration: none !important;
	font-weight: 500;
	padding: 11px 22px;
	border-radius: var(--rjfd-radius, 8px);
}

.rjfd__profile-link:hover {
	filter: brightness(0.94);
}

/* Screen-reader-only text, in case the theme does not define it. */
.rjfd .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* Makes a casual "select all and copy" of the results grid useless without
   affecting keyboard users or the detail panel. */
.rjfd__results {
	-webkit-user-select: none;
	user-select: none;
}

.rjfd__panel {
	-webkit-user-select: text;
	user-select: text;
}
