/*
 * APPEX Directory — frontend styles
 * Modern, clean card grid. Override in your theme if needed.
 */

.appex-directory {
	--appex-directory-columns: 3;
	--appex-directory-gap: 1.75rem;
	--appex-directory-radius: 14px;
	--appex-directory-card-bg: #ffffff;
	--appex-directory-card-border: rgba(15, 23, 42, 0.06);
	--appex-directory-card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.06);
	--appex-directory-card-shadow-hover: 0 6px 12px rgba(15, 23, 42, 0.08), 0 16px 32px rgba(15, 23, 42, 0.10);
	--appex-directory-text: #0f172a;
	--appex-directory-muted: #64748b;
	--appex-directory-accent: #0f766e;
	--appex-directory-divider: rgba(15, 23, 42, 0.08);

	color: var(--appex-directory-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
	line-height: 1.55;
	max-width: 100%;
}

.appex-directory * {
	box-sizing: border-box;
}

.appex-directory-intro {
	max-width: 65ch;
	margin: 0 0 2.5rem;
	font-size: 1.0625rem;
	color: var(--appex-directory-muted);
}

/* Table of contents — "Jump to" label + a wrap-as-needed row of tag-style
 * chips. Squared-off (3px radius) rather than pill-shaped. */
.appex-directory-toc {
	margin: 0 0 2.25rem;
	padding: 0 0 0.875rem;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem 0.75rem;
	border-bottom: 1px solid var(--appex-directory-divider);
}

.appex-directory-toc-label {
	color: var(--appex-directory-muted);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.appex-directory-toc ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem 0.5rem;
}

/* !important + nested selector defeat theme rules that color anchors on hover. */
.appex-directory .appex-directory-toc a {
	display: inline-block;
	padding: 0.35rem 0.625rem;
	background: rgba(15, 23, 42, 0.06) !important;
	color: var(--appex-directory-accent) !important;
	border-radius: 3px;
	font-size: 0.6875rem !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	letter-spacing: 0.06em !important;
	text-transform: uppercase !important;
	text-decoration: none !important;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.appex-directory .appex-directory-toc a:hover,
.appex-directory .appex-directory-toc a:focus-visible {
	background: var(--appex-directory-accent) !important;
	color: #ffffff !important;
	outline: none;
}

.appex-directory-toc a:hover,
.appex-directory-toc a:focus-visible {
	border-bottom-color: currentColor;
	outline: none;
}

.appex-directory-section {
	margin: 0 0 3.5rem;
	padding-top: 3rem;
	border-top: 1px solid var(--appex-directory-divider);
	/* Give anchor jumps a bit of breathing room from the top of the viewport. */
	scroll-margin-top: 1.5rem;
}

.appex-directory-section:first-of-type {
	padding-top: 0;
	border-top: 0;
}

.appex-directory-section-header {
	margin: 0 0 1.75rem;
}

/* Section title — eyebrow style (uppercase, letter-spaced, weight 700), no
 * background. The section's top border provides the visual break; the heading
 * itself just labels the group.
 *
 * Selector + !important defeat theme / Breakdance rules that target h2. */
.appex-directory .appex-directory-section-title,
.appex-directory h2.appex-directory-section-title {
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
	color: var(--appex-directory-text) !important;
	font-family: inherit !important;
	font-size: 1.125rem !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	letter-spacing: 0.08em !important;
	text-transform: uppercase !important;
	text-align: left !important;
	border: 0 !important;
}

.appex-directory-section-desc {
	margin: 0.5rem 0 0;
	color: var(--appex-directory-muted);
	font-size: 0.95rem;
}

.appex-directory-section-desc p:last-child {
	margin-bottom: 0;
}

.appex-directory-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: var(--appex-directory-gap);
	grid-template-columns: repeat(var(--appex-directory-columns), minmax(0, 1fr));
}

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

@media (max-width: 600px) {
	.appex-directory-grid {
		grid-template-columns: 1fr;
	}
}

.appex-directory-card {
	background: var(--appex-directory-card-bg);
	border: 1px solid var(--appex-directory-card-border);
	border-radius: var(--appex-directory-radius);
	overflow: hidden;
	box-shadow: var(--appex-directory-card-shadow);
	display: flex;
	flex-direction: column;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.appex-directory-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--appex-directory-card-shadow-hover);
}

.appex-directory-card-media {
	position: relative;
	aspect-ratio: 1 / 1;
	background: #f1f5f9;
	overflow: hidden;
}

/* Position absolutely so theme rules like `img { height: auto }` can't
 * override us. Every profile photo fills the square via object-fit: cover. */
.appex-directory-card-media img,
.appex-directory-card-media .appex-directory-photo {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
	display: block;
}

.appex-directory-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	font-weight: 600;
	font-size: clamp(2.5rem, 8vw, 4rem);
	letter-spacing: 0.02em;
	user-select: none;
}

.appex-directory-card-body {
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	text-align: center;
}

/* When the card doesn't end in a links list, give the last element bottom
 * breathing room so the text doesn't sit on the rounded card edge. Links
 * provide their own symmetric padding via the .appex-directory-links rule. */
.appex-directory-card-body > *:last-child:not(.appex-directory-links) {
	padding-bottom: 1.25rem;
}

/* Name strip sits flush against the image, full card width, dark bg / white text.
 * The selector and !important defeat theme rules that target h3 elements. */
.appex-directory .appex-directory-name,
.appex-directory h3.appex-directory-name {
	margin: 0 !important;
	padding: 0.5rem 0.75rem !important;
	background: var(--appex-directory-text) !important;
	color: #ffffff !important;
	font-family: inherit !important;
	font-size: 1.5rem !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	letter-spacing: -0.005em !important;
	text-align: center !important;
	text-transform: none !important;
	text-wrap: balance;
	border: 0 !important;
}

.appex-directory-title,
.appex-directory-association,
.appex-directory-bio {
	padding-left: 1rem;
	padding-right: 1rem;
}

/* Title styled as an "eyebrow": uppercase, letter-spaced, accent color. */
.appex-directory-title {
	margin: 0.125rem 0 0;
	padding: 0.5rem;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--appex-directory-accent);
}

/* Association in muted italic — feels institutional / academic. */
.appex-directory-association {
	margin: 0;
	font-size: 0.75rem;
	line-height: 1.4;
	color: var(--appex-directory-muted);
	font-style: italic;
}

.appex-directory-bio {
	margin: 0.5rem 0 0;
	font-size: 0.9375rem;
	color: var(--appex-directory-text);
}

.appex-directory-bio p {
	margin: 0 0 0.5rem;
}

.appex-directory-bio p:last-child {
	margin-bottom: 0;
}

.appex-directory-links {
	list-style: none;
	margin: 0;
	padding: 0 0 0.5rem 0 !important;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem 0.875rem;
	border-top: 1px solid var(--appex-directory-divider);
}

/* Match the eyebrow style used on .appex-directory-title. */
.appex-directory-links a {
	color: var(--appex-directory-accent);
	text-decoration: none;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	border-bottom: 1px solid transparent;
	transition: border-color 0.15s ease;
}

.appex-directory-links a:hover,
.appex-directory-links a:focus {
	border-bottom-color: currentColor;
}

.appex-directory-empty {
	color: var(--appex-directory-muted);
	font-style: italic;
	margin: 0;
}

.appex-directory-error {
	padding: 0.75rem 1rem;
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
	border-radius: 8px;
	font-size: 0.9375rem;
}
