/*
 * ASAE Staff Roster — public shortcode styles.
 *
 * Layout: 5-up grid above 1200px, gracefully reflowing down through
 * 4/3/2/1 columns as the viewport narrows. Photos are auto-cropped to
 * squares via aspect-ratio + object-fit:cover so any rectangular source
 * image lands evenly on every card.
 *
 * Colors meet WCAG 2.2 AA contrast against a white page background. Themes
 * with non-white backgrounds should override the wrapper rules here.
 */

.asae-staff-roster {
	color: var(--nv-text-color, #2b2b2b);
	font-size: 16px;
	line-height: 1.5;
}

/* Focus rings on real interactive elements only — never on the wrapper or
 * the search form (which some themes' [tabindex="-1"]:focus rules outline).
 * !important + a [tabindex] selector is the cross-theme winner. */
.asae-staff-roster a:focus-visible,
.asae-staff-roster button:focus-visible,
.asae-staff-roster input:focus-visible,
.asae-staff-roster select:focus-visible {
	outline: 3px solid var(--nv-primary-accent, #bd491e);
	outline-offset: 2px;
}
.asae-staff-roster:focus,
.asae-staff-roster:focus-visible,
.asae-staff-roster:focus-within,
.asae-staff-roster[tabindex]:focus,
.asae-staff-roster[tabindex]:focus-visible,
.asae-staff-search:focus,
.asae-staff-search:focus-visible,
.asae-staff-search:focus-within,
.asae-staff-search[tabindex]:focus,
.asae-staff-search[tabindex]:focus-visible {
	outline: none !important;
	box-shadow: none !important;
}

/* Search form — single input + Clear button. */
.asae-staff-search {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.75em 1em;
	margin-bottom: 1em;
}
.asae-staff-search-field {
	display: flex;
	flex-direction: column;
	gap: 0.25em;
	flex: 1 1 240px;
	min-width: 160px;
}
.asae-staff-search-field label {
	font-weight: 600;
	font-size: 0.95em;
}
.asae-staff-search input[type="search"] {
	min-height: 2.4em;
	padding: 0.3em 0.6em;
	border: 1px solid var(--asae-border-control, #767676);
	border-radius: var(--asae-radius-sm, 2px);
	font: inherit;
	background: var(--nv-site-bg, #fff);
}
.asae-staff-search-actions {
	display: flex;
	align-items: center;
	gap: 0.6em;
}
.asae-staff-search-clear {
	color: var(--nv-primary-accent, #bd491e);
	background: transparent;
	border: 0;
	padding: 0.4em 0.4em;
	cursor: pointer;
	font: inherit;
	text-decoration: underline;
}

/* Letter nav — A-Z buttons (client-side filter). */
.asae-staff-letters ul {
	list-style: none;
	margin: 0 0 1em;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.25em;
	border-bottom: 1px solid var(--asae-border-subtle, #dddddd);
	padding-bottom: 0.5em;
}
.asae-staff-letters li {
	margin: 0;
}
.asae-staff-letters .asae-staff-letter,
.asae-staff-letters span {
	display: inline-block;
	min-width: 2em;
	padding: 0.4em 0.6em;
	text-align: center;
	border-radius: var(--asae-radius-sm, 2px);
	font-weight: 600;
	background: transparent;
	border: 0;
	cursor: pointer;
	color: var(--nv-primary-accent, #bd491e);
	font: inherit;
}
/* Accent text on the grey hover tint takes the darker accent-text: the primary
 * accent is only 4.74:1 on #f7f7f7 and drops below 4.5:1 on darker greys. */
.asae-staff-letters .asae-staff-letter[aria-pressed="false"]:hover {
	background: var(--asae-surface, #f7f7f7);
	color: var(--asae-accent-text, #a03e08);
	text-decoration: underline;
}
.asae-staff-letters .is-current .asae-staff-letter {
	background: var(--nv-primary-accent, #bd491e);
	color: #fff;
}
.asae-staff-letters .is-disabled span {
	color: var(--asae-text-muted, #595959); /* AA on white — 7:1 */
	cursor: not-allowed;
}

/* Results summary line — centred above the listing. */
.asae-staff-results-summary {
	margin: 1em 0;
	text-align: center;
	color: var(--asae-text-muted, #595959); /* 7:1 on white */
	font-style: italic;
}

.asae-staff-empty,
.asae-staff-no-matches {
	margin: 1.5em 0;
	font-style: italic;
}

/* Section headings. */
.asae-staff-section {
	margin-bottom: 2em;
}
.asae-staff-section-heading {
	margin: 1em 0 0.5em;
	font-size: 1.4em;
	font-weight: 700;
	/* Dark grey rule line matching the heading text color rather than
	 * a brand accent — orange (#bd491e on Neve) would be too loud
	 * here, and admin blue is wrong on themed sites. Inherits Neve's
	 * --nv-text-color (which headings use) when present, falls back
	 * to WP-admin dark grey elsewhere. */
	border-bottom: 2px solid var(--nv-text-color, #2b2b2b);
	padding-bottom: 0.25em;
}

/* Card grid. 5-up at desktop, then 4 / 3 / 2 / 1 as we narrow. */
.asae-staff-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 1.25em;
}
@media (max-width: 1499px) {
	.asae-staff-list { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1199px) {
	.asae-staff-list { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 899px) {
	.asae-staff-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 599px) {
	.asae-staff-list { grid-template-columns: 1fr; }
}

/* Card. Photo on top of body — closer to asae-group-rosters than
 * asae-cae-roster's side-by-side layout, per _start.md. */
.asae-staff-card {
	display: flex;
	flex-direction: column;
	gap: 0.5em;
	padding: 0.75em;
	border: 1px solid var(--asae-border-subtle, #dddddd);
	border-radius: var(--asae-radius, 3px);
	background: var(--nv-site-bg, #fff);
	text-align: center;
}
.asae-staff-card[data-visible="false"] {
	display: none;
}

/* Square-cropped photo. aspect-ratio + object-fit:cover handles all the
 * aspect-ratio variation in the source images uniformly. */
.asae-staff-card-photo {
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: var(--asae-radius-media, 3px);
	overflow: hidden;
	background: var(--asae-surface, #f7f7f7);
}
.asae-staff-card-photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.asae-staff-card-photo.is-empty {
	background: repeating-linear-gradient(
		45deg,
		#f0f0f1,
		#f0f0f1 8px,
		#e8e8ea 8px,
		#e8e8ea 16px
	);
}

/* Card body. */
.asae-staff-card-body {
	display: flex;
	flex-direction: column;
	gap: 0.15em;
	min-width: 0;
}
.asae-staff-card-name {
	margin: 0.25em 0 0;
	font-size: 1em;
	line-height: 1.3;
}
.asae-staff-card-suffix {
	color: var(--asae-text-muted, #595959);
	font-weight: 400;
}
.asae-staff-card-title {
	margin: 0.25em 0;
	font-size: 0.95em;
	color: var(--nv-text-color, #2b2b2b);
}
.asae-staff-card-phone,
.asae-staff-card-email {
	margin: 0.1em 0;
	font-size: 0.9em;
}
.asae-staff-card-phone a,
.asae-staff-card-email a {
	color: var(--nv-primary-accent, #bd491e);
	text-decoration: none;
	word-break: break-word;
}
.asae-staff-card-phone a:hover,
.asae-staff-card-email a:hover {
	text-decoration: underline;
}

/* Obfuscation mode — contacts render as a small icon row instead of
 * the full text. Both icons sit on one line via flex; aria-label
 * still names the action for screen-reader users. The rendered HTML
 * never contains the real email/phone, so naive scrapers come up
 * empty even before the JS reveal kicks in. */
.asae-staff-card-contacts {
	display: flex;
	gap: 0.6em;
	justify-content: center;
	margin: 0.4em 0 0;
}
.asae-staff-contact-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	/* Accent glyph on the grey tint: accent-text, not the primary accent. */
	color: var(--asae-accent-text, #a03e08);
	background: var(--asae-surface, #f7f7f7);
	border: 1px solid var(--asae-border-subtle, #dddddd);
	text-decoration: none;
	transition: background 120ms ease, color 120ms ease;
}
.asae-staff-contact-link:hover,
.asae-staff-contact-link:focus-visible {
	background: var(--nv-primary-accent, #bd491e);
	color: #fff;
	text-decoration: none;
}
.asae-staff-contact-link svg {
	display: block;
}

/* ── Tag-filtered output (compact, no nav / no search / no headings) ───── */

.asae-staff-roster-tag-filtered {
	/* Inherits .asae-staff-roster's color/font defaults. Margin tightens
	 * up because there's no search-bar block above the grid. */
	margin-top: 0;
}
.asae-staff-roster-tag-filtered .asae-staff-list {
	margin-top: 0;
}

/* "Contact ASAE" fallback when a tag filter matches zero people. The
 * empty wrapper still carries .asae-staff-roster so the page chrome
 * (margins, region label) stays consistent with the normal roster. */
.asae-staff-roster-tag-empty {
	text-align: center;
	padding: 1em 0;
}
.asae-staff-roster-tag-empty .asae-staff-empty-link {
	display: inline-block;
	padding: 0.5em 1.25em;
	font-weight: 600;
	color: var(--nv-primary-accent, #bd491e);
	text-decoration: underline;
}
.asae-staff-roster-tag-empty a.asae-staff-empty-link:hover,
.asae-staff-roster-tag-empty a.asae-staff-empty-link:focus-visible {
	color: var(--nv-secondary-accent, #333333);
}
