/*
 * EP Member Directory
 * Brand: blue-green #1db9d6, light blue-green #abdfe8, charcoal #222b2d.
 * Override these custom properties in the theme if the palette changes.
 */
.epmd {
	--epmd-accent: #1db9d6;        /* Fills: selected chips, focus rings, current family member */
	--epmd-accent-light: #abdfe8;  /* Soft fills: initials, tags, hovers */
	--epmd-accent-ink: #137c90;    /* Deeper blue-green for links and text on white (meets WCAG AA) */
	--epmd-charcoal: #222b2d;      /* Headings, body text, text on blue-green */
	--epmd-text: #222b2d;
	--epmd-muted: #5b676a;
	--epmd-border: #dde5e7;
	--epmd-card-bg: #ffffff;
	--epmd-soft: #f2f8f9;
	--epmd-radius: 0;        /* Cards and popup use square corners */
	--epmd-card-w: 210px;    /* Member card size */
	--epmd-card-h: 288px;
	--epmd-card-photo: 132px;
	--epmd-hero-photo: 240px; /* Popup photo */
	color: var(--epmd-text);
}

.epmd [hidden],
.epmd[hidden] {
	display: none !important;
}

.epmd__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.epmd__icon {
	width: 1.125rem;
	height: 1.125rem;
	flex: 0 0 auto;
}

.epmd a {
	color: var(--epmd-accent-ink);
}

/* Controls ------------------------------------------------------------------ */

.epmd__controls {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.875rem;
	margin-bottom: 1rem;
}

/* The label draws the pill. The icon and the input sit side by side, so theme
   input padding can't slide the text under the icon. */
.epmd__search {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 0 1.25rem 0 1.125rem;
	border: 1px solid var(--epmd-border);
	border-radius: 999px;
	background: var(--epmd-card-bg);
	cursor: text;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.epmd__search:focus-within {
	border-color: var(--epmd-accent);
	box-shadow: 0 0 0 3px rgba(29, 185, 214, 0.25);
}

.epmd__search svg {
	flex: 0 0 auto;
	color: var(--epmd-muted);
	pointer-events: none;
}

.epmd__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.epmd button {
	font-family: inherit;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
}

.epmd__chip {
	padding: 0.375rem 0.9rem;
	border: 1px solid var(--epmd-border);
	border-radius: 999px;
	background: var(--epmd-card-bg);
	color: var(--epmd-text);
	font-size: 0.875rem;
	line-height: 1.3;
}

.epmd__chip:hover {
	border-color: var(--epmd-accent);
	background: var(--epmd-soft);
}

.epmd__chip[aria-pressed="true"] {
	background: var(--epmd-accent);
	border-color: var(--epmd-accent);
	color: var(--epmd-charcoal);
	font-weight: 600;
}

/* Letters share the full width evenly; on phones the row scrolls sideways. */
.epmd__az {
	display: flex;
	flex-wrap: nowrap;
	justify-content: space-between;
	gap: 0.125rem;
	width: 100%;
	min-width: 0;
	overflow-x: auto;       /* only scrolls if the content area is very narrow */
	scrollbar-width: none;
}

.epmd__az::-webkit-scrollbar {
	display: none;
}

.epmd__az-btn {
	display: inline-flex;
	flex: 1 1 0;
	align-items: center;
	justify-content: center;
	min-width: 1.25rem;
	max-width: 2.75rem;
	height: 2rem;
	padding: 0 0.25rem;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--epmd-charcoal);
	font-size: 0.875rem;
	font-weight: 600;
}

.epmd__az-btn:hover {
	background: var(--epmd-accent-light);
}

.epmd__az-btn[aria-pressed="true"] {
	background: var(--epmd-accent);
	color: var(--epmd-charcoal);
}

.epmd__az-btn.is-empty {
	color: #c3cdcf;
	font-weight: 400;
	cursor: default;
}

.epmd button:focus-visible,
.epmd a:focus-visible {
	outline: 2px solid var(--epmd-accent-ink);
	outline-offset: 2px;
}

.epmd__count {
	margin: 0 0 1rem;
	color: var(--epmd-muted);
	font-size: 0.875rem;
}

/* Avatars ------------------------------------------------------------------- */

/*
 * The circle is a positioned box; the photo is pinned to all four edges and
 * cropped with object-fit. This holds up even when a theme sets global image
 * rules like `img { height: auto; width: auto; max-width: 100% }`.
 */
.epmd .epmd__avatar {
	position: relative;
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	overflow: hidden;
	box-sizing: border-box;
	border-radius: 50%;
	background: var(--epmd-accent-light);
	color: var(--epmd-charcoal);
	font-weight: 700;
	line-height: 1;
	vertical-align: middle;
}

.epmd .epmd__avatar img {
	position: absolute !important;
	inset: 0 !important;
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	box-shadow: none !important;
	object-fit: cover !important;
	object-position: 50% 22% !important; /* favor faces in tall photos */
}

.epmd__avatar--xs   { width: 1.5rem;  height: 1.5rem;  font-size: 0.625rem; border: 2px solid var(--epmd-card-bg); margin-right: -0.375rem; }
.epmd__avatar--sm   { width: 3rem;    height: 3rem;    font-size: 0.95rem; }
.epmd__avatar--card { width: var(--epmd-card-photo); height: var(--epmd-card-photo); font-size: 2.25rem; }
.epmd__avatar--hero { width: var(--epmd-hero-photo); height: var(--epmd-hero-photo); font-size: 4rem; }

/* Grid & cards -------------------------------------------------------------- */

.epmd__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, var(--epmd-card-w));
	justify-content: center;
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.epmd__card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	box-sizing: border-box;
	width: var(--epmd-card-w);
	min-height: var(--epmd-card-h);
	margin: 0;
	padding: 1.25rem 1rem 1rem;
	border: 1px solid var(--epmd-border);
	border-radius: var(--epmd-radius);
	background: var(--epmd-card-bg);
	text-align: center;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.epmd__card > .epmd__avatar {
	margin-bottom: 0.875rem;
	box-shadow: 0 0 0 3px var(--epmd-card-bg), 0 0 0 5px var(--epmd-accent-light);
}

.epmd__card-body {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
}

.epmd__card:hover {
	border-color: var(--epmd-accent);
	box-shadow: 0 6px 18px rgba(34, 43, 45, 0.1);
	transform: translateY(-2px);
}

.epmd .epmd__card-name {
	width: 100%;
	margin: 0 !important;
	padding: 0 !important;
	color: var(--epmd-charcoal);
	font-size: 1.0625rem !important;
	font-weight: 700;
	line-height: 1.3 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	overflow-wrap: anywhere;
}

.epmd .epmd__card-rel,
.epmd .epmd__card-phone {
	margin: 0.125rem 0 0 !important;
	padding: 0 !important;
	color: var(--epmd-muted);
	font-size: 0.875rem;
	line-height: 1.4;
}

.epmd__card-rel {
	color: var(--epmd-accent-ink) !important;
	font-weight: 600;
}

.epmd__strip {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	max-width: 100%;
	margin-top: auto;
	padding-top: 0.75rem;
}

.epmd__strip-faces {
	display: flex;
	flex: 0 0 auto;
	padding-right: 0.375rem;
}

.epmd__strip-label {
	min-width: 0;
	color: var(--epmd-muted);
	font-size: 0.8125rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* The whole card is clickable via this overlay button. */
.epmd__open {
	position: absolute;
	inset: 0;
	z-index: 1;
	border: 0;
	border-radius: var(--epmd-radius);
	background: transparent;
}

.epmd__matches {
	position: relative;
	z-index: 2;
	width: 100%;
	margin: 0.75rem 0 0;
	padding-top: 0.5rem;
	border-top: 1px dashed var(--epmd-border);
	font-size: 0.8125rem;
	color: var(--epmd-muted);
}

.epmd__match {
	padding: 0;
	border: 0;
	background: none;
	color: var(--epmd-accent-ink);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.epmd__empty {
	padding: 2rem 1rem;
	text-align: center;
	color: var(--epmd-muted);
}

.epmd__reset {
	margin-left: 0.5rem;
	padding: 0;
	border: 0;
	background: none;
	color: var(--epmd-accent-ink);
	text-decoration: underline;
}

/* Profile dialog ------------------------------------------------------------ */

html.epmd-lock {
	overflow: hidden;
}

.epmd__dialog {
	width: min(680px, calc(100vw - 2rem));
	max-height: calc(100dvh - 3rem);
	margin: auto;
	padding: 0;
	overflow: auto;
	border: 0;
	border-radius: var(--epmd-radius);
	background: var(--epmd-card-bg);
	color: var(--epmd-text);
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.epmd__dialog::backdrop {
	background: rgba(17, 22, 23, 0.82);
}

.epmd__profile {
	position: relative;
	padding: 1.5rem;
}

.epmd__close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border: 0;
	border-radius: 50%;
	background: var(--epmd-soft);
	color: var(--epmd-charcoal);
}

.epmd__close:hover {
	background: var(--epmd-accent-light);
}

.epmd__profile-head {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	padding-right: 2.5rem;
}

.epmd__profile-head > div {
	flex: 1 1 auto;
	min-width: 0;
}

.epmd__profile-head > .epmd__avatar {
	box-shadow: 0 0 0 3px var(--epmd-card-bg), 0 0 0 5px var(--epmd-accent-light);
}

.epmd .epmd__profile-name {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 1.5rem !important;
	line-height: 1.2 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	overflow-wrap: anywhere;
	color: var(--epmd-charcoal);
}

.epmd__profile-meta {
	margin: 0.25rem 0 0;
	color: var(--epmd-muted);
}

.epmd__details {
	display: grid;
	gap: 0.625rem;
	margin: 1.25rem 0 0;
	padding: 0;
	list-style: none;
}

.epmd__detail {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.epmd__detail .epmd__icon {
	margin-top: 0.1rem;
	color: var(--epmd-accent-ink);
}

.epmd__detail--note {
	color: var(--epmd-muted);
	font-style: italic;
}

.epmd__muted {
	color: var(--epmd-muted);
}

.epmd__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}

.epmd__tags li {
	padding: 0.2rem 0.65rem;
	border-radius: var(--epmd-radius);
	background: var(--epmd-accent-light);
	color: var(--epmd-charcoal);
	font-size: 0.8125rem;
	font-weight: 600;
}

.epmd__teams {
	display: grid;
	gap: 0.375rem;
	margin: 1.125rem 0 0;
	padding: 0.875rem 1rem;
	border-radius: var(--epmd-radius);
	background: var(--epmd-soft);
	list-style: none;
}

.epmd__teams li {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.25rem 1rem;
	font-size: 0.9375rem;
}

.epmd__team-name {
	font-weight: 600;
}

.epmd__team-title {
	color: var(--epmd-accent-ink);
}

.epmd__family {
	margin-top: 1.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--epmd-border);
}

.epmd__family-title {
	margin: 0 0 0.75rem;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--epmd-muted);
}

.epmd__family-photo {
	display: block;
	width: 100%;
	max-height: 260px;
	margin-bottom: 0.875rem;
	border-radius: var(--epmd-radius);
	object-fit: cover;
}

.epmd__family-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.epmd__member {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.3rem;
	width: 5.25rem;
	padding: 0.5rem 0.25rem;
	border: 0;
	border-radius: var(--epmd-radius);
	background: transparent;
	color: var(--epmd-text);
	text-align: center;
}

.epmd__member:hover {
	background: var(--epmd-soft);
}

.epmd__member[aria-current="true"] {
	cursor: default;
}

.epmd__member[aria-current="true"] .epmd__avatar {
	outline: 3px solid var(--epmd-accent);
	outline-offset: 2px;
}

.epmd__member-name {
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
}

.epmd__member-rel {
	font-size: 0.75rem;
	line-height: 1.2;
	color: var(--epmd-muted);
}

.epmd__edit-links {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin: 1.25rem 0 0;
	padding-top: 1rem;
	border-top: 1px solid var(--epmd-border);
	font-size: 0.875rem;
}

.epmd__edit {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	text-decoration: none;
}

/* Logged-out state ---------------------------------------------------------- */

.epmd--locked {
	max-width: 420px;
	margin: 0 auto;
	padding: 1.5rem;
	border: 1px solid var(--epmd-border);
	border-radius: var(--epmd-radius);
	background: var(--epmd-card-bg);
}

.epmd--locked form p {
	margin: 0 0 0.875rem;
}

.epmd--locked label {
	display: block;
	margin-bottom: 0.25rem;
	font-weight: 600;
}

.epmd--locked input[type="text"],
.epmd--locked input[type="password"] {
	width: 100%;
	box-sizing: border-box;
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--epmd-border);
	border-radius: 8px;
	font-size: 1rem;
}

.epmd--locked .login-remember label {
	display: inline;
	font-weight: 400;
}

.epmd--locked input[type="submit"] {
	padding: 0.65rem 1.4rem;
	border: 0;
	border-radius: 999px;
	background: var(--epmd-accent);
	color: var(--epmd-charcoal);
	font-weight: 700;
	cursor: pointer;
}

.epmd__locked-help {
	margin: 0;
	font-size: 0.875rem;
}

/* Mobile -------------------------------------------------------------------- */

@media (max-width: 480px) {
	.epmd {
		--epmd-card-photo: 104px;
	}
	.epmd__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.75rem;
	}
	.epmd__card {
		width: auto;
		min-height: 0;
		padding: 1rem 0.625rem 0.875rem;
	}
	.epmd .epmd__card-name {
		font-size: 1rem !important;
	}
}

@media (max-width: 600px) {

	.epmd__az {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		margin: 0 -0.25rem;
		padding: 0 0.25rem 0.25rem;
	}

	.epmd__az::-webkit-scrollbar {
		display: none;
	}

	.epmd__az-btn,
	.epmd[data-epmd] .epmd__az-btn {
		flex: 0 0 2rem;
		max-width: none;
		min-width: 2rem !important;
	}

	/* Profile becomes a full-height sheet. */
	.epmd__dialog {
		width: 100vw;
		max-width: 100vw;
		height: 100dvh;
		max-height: 100dvh;
		border-radius: 0;
	}

	.epmd__profile {
		padding: 1.25rem 1rem 2rem;
	}

	.epmd__profile-head {
		flex-direction: column;
		align-items: flex-start;
	}
}

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

@media print {
	.epmd__controls,
	.epmd__count,
	.epmd__empty,
	.epmd__dialog {
		display: none !important;
	}
	.epmd__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 0.5rem;
	}
	.epmd__card {
		break-inside: avoid;
		box-shadow: none;
	}
}

/* ---------------------------------------------------------------------------
 * Theme shield
 * Many themes (Salient, Avada, Divi, …) style every ul/li, heading, and button
 * globally, often with ID selectors. These rules keep the directory's own
 * layout intact inside any theme.
 * ------------------------------------------------------------------------ */

.epmd ul,
.epmd ol {
	margin-left: 0 !important;
	padding-left: 0 !important;
	list-style: none !important;
}

.epmd li {
	margin-left: 0 !important;
	padding-left: 0 !important;
	list-style: none !important;
	background-image: none !important;
}

.epmd li::before,
.epmd li::marker {
	content: none !important;
	display: none !important;
}

.epmd button {
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0;
	box-shadow: none;
	text-shadow: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	font-family: inherit !important;
}

.epmd .epmd__open {
	position: absolute !important;
	inset: 0 !important;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

.epmd[data-epmd] .epmd__chip {
	margin: 0 !important;
	padding: 0.375rem 0.9rem !important;
	border-radius: 999px !important;
	font-size: 0.875rem !important;
	line-height: 1.3 !important;
}

.epmd[data-epmd] .epmd__az-btn {
	box-sizing: border-box !important;
	margin: 0 !important;
	min-width: 1.25rem !important;
	padding: 0 !important;
	border-radius: 8px !important;
	line-height: 1 !important;
}

.epmd[data-epmd] .epmd__close {
	width: 2.5rem !important;
	height: 2.5rem !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: var(--epmd-radius) !important;
	line-height: 1 !important;
}

.epmd .epmd__member {
	margin: 0 !important;
	padding: 0.5rem 0.25rem !important;
	border: 0 !important;
	border-radius: var(--epmd-radius) !important;
	line-height: 1.2 !important;
}

.epmd .epmd__match,
.epmd .epmd__reset {
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	line-height: inherit !important;
}

.epmd[data-epmd] .epmd__search input[data-epmd-search] {
	flex: 1 1 auto !important;
	width: auto !important;
	min-width: 0 !important;
	max-width: none !important;
	height: auto !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0.8rem 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	outline: none !important;
	color: var(--epmd-text) !important;
	font-size: 1rem !important;
	line-height: 1.4 !important;
	text-indent: 0 !important;
	-webkit-appearance: none;
	appearance: none;
}

.epmd[data-epmd] .epmd__search {
	margin: 0 !important;
}

.epmd .epmd__search svg {
	position: static !important;
	transform: none !important;
	width: 20px !important;
	height: 20px !important;
}

.epmd svg.epmd__icon {
	width: 1.125rem !important;
	height: 1.125rem !important;
}

/* Re-apply padding on lists that need it (the reset above zeroes list padding). */
.epmd ul.epmd__teams {
	padding: 0.875rem 1rem !important;
}

.epmd .epmd__tags li {
	padding: 0.2rem 0.65rem !important;
}

.epmd .epmd__family-title {
	margin: 0 0 0.75rem !important;
	padding: 0 !important;
	font-size: 0.8125rem !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	letter-spacing: 0.06em !important;
	text-transform: uppercase !important;
}

.epmd .epmd__heading {
	letter-spacing: normal !important;
	text-transform: none !important;
}

/* Card padding must beat the list reset above (it zeroes left padding only,
   which pulled card content off-center). */
.epmd[data-epmd] .epmd__card {
	padding: 1.25rem 1rem 1rem !important;
	border-radius: var(--epmd-radius) !important;
}

.epmd .epmd__teams li,
.epmd .epmd__family-row li,
.epmd .epmd__details li {
	padding-right: 0 !important;
}

/* Popup header: big photo on the left, name beside it. */
.epmd__profile-head {
	align-items: center;
}

@media (max-width: 480px) {
	.epmd[data-epmd] .epmd__card {
		padding: 1rem 0.625rem 0.875rem !important;
	}
}

@media (max-width: 600px) {
	.epmd {
		--epmd-hero-photo: 200px;
	}
	.epmd__profile-head {
		align-items: center;
		text-align: center;
		padding-right: 0;
	}
}
