/**
 * Profile Selector block styles.
 * Two layouts: .profile-selector--story (tabs + facts/quote card + pagination)
 *              .profile-selector--people (name list + portrait/bio).
 * Uses theme tokens (var(--cmcf-*)). Auto-enqueued via functions.php glob.
 */

.profile-selector {
	font-family: var(--cmcf-font-body);
	color: var(--cmcf-black);
}

/* ============================ STORY layout ============================== */

/* Horizontal tab row */
.profile-selector--story .profile-selector--nav {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(24px, 3vw, 56px);
	margin-bottom: clamp(28px, 3vw, 44px);
}

.profile-selector--story .profile-selector--tab {
	appearance: none;
	background: none;
	border: 0;
	padding: 0 0 6px;
	cursor: pointer;
	font-family: var(--cmcf-font-body);
	font-weight: 600;
	font-size: 16px;
	line-height: 1.5;
	letter-spacing: var(--cmcf-ls-eyebrow);
	text-transform: uppercase;
	color: #424242;
	border-bottom: 3px solid transparent;
	transition: color .15s ease, border-color .15s ease;
}

.profile-selector--story .profile-selector--tab:hover {
	color: var(--cmcf-primary);
}

.profile-selector--story .profile-selector--tab.is-active {
	color: var(--cmcf-primary);
	border-bottom-color: var(--cmcf-secondary);
	border-radius: 0;
}

/* Detail card: white with a hairline frame INSET ~28px from the card edge (per design) */
.profile-selector--story .profile-selector--panels {
	background: var(--cmcf-white);
	padding: 28px;
	box-shadow: 0 1px 24px rgba(0, 0, 0, 0.04);
}

.profile-selector--story .profile-selector--panel {
	display: grid;
	grid-template-columns: minmax(0, 0.9fr) 1px minmax(0, 1.1fr);
	gap: clamp(32px, 4vw, 64px);
	padding: clamp(32px, 4vw, 56px);
	border: 1px solid rgba(0, 0, 0, 0.15);
}

.profile-selector--story .profile-selector--panel:not(.is-active) { display: none; }

/* Lime vertical divider is the middle grid column */
.profile-selector--story .profile-selector--facts {
	position: relative;
}
.profile-selector--story .profile-selector--panel::before {
	content: "";
	/* A site-wide reset forces `position: absolute` on every ::before/::after;
	   that fights align-self: stretch (the grid area can't resolve a height for
	   an out-of-flow item), so the divider collapses to 0px and never renders.
	   Opt this pseudo back into normal grid-item flow. */
	position: static;
	grid-column: 2;
	grid-row: 1;
	width: 2px;
	background: var(--cmcf-secondary);
	align-self: stretch;
	justify-self: center;
}

/* Left facts column */
.profile-selector--recipient {
	font-family: var(--cmcf-font-body);
	font-weight: 600;
	font-size: 14px;
	line-height: 1.4;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--cmcf-black);
	margin: 0 0 10px;
}

.profile-selector--story .profile-selector--name {
	font-family: var(--cmcf-font-heading);
	font-weight: 400;
	font-size: var(--cmcf-fs-name);
	line-height: 1.2;
	color: var(--cmcf-primary);
	margin: 0 0 24px;
}

.profile-selector--meta {
	margin: 0;
}
.profile-selector--meta-label {
	font-family: var(--cmcf-font-body);
	font-weight: 600;
	font-size: 14px;
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--cmcf-black);
	margin-top: 20px;
}
.profile-selector--meta-label:first-child { margin-top: 0; }
.profile-selector--meta-value {
	font-family: var(--cmcf-font-body);
	font-size: var(--cmcf-fs-body);
	line-height: 1.4;
	color: var(--cmcf-black);
	margin: 2px 0 0;
}

/* Right quote column */
.profile-selector--quote {
	grid-column: 3;
	grid-row: 1;
}
.profile-selector--quote-mark {
	display: block;
	font-family: var(--cmcf-font-heading);
	font-size: clamp(80px, 8vw, 120px);
	line-height: 0.6;
	color: var(--cmcf-secondary);
	height: 0.55em;
	overflow: visible;
	margin-bottom: 28px;
}
.profile-selector--quote-body {
	font-family: var(--cmcf-font-body);
	font-size: var(--cmcf-fs-body);
	line-height: 1.6;
	color: var(--cmcf-black);
}
.profile-selector--quote-body p { margin: 0 0 1em; }
.profile-selector--quote-body p:last-child { margin-bottom: 0; }

/* Pagination */
.profile-selector--pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-top: clamp(28px, 3vw, 44px);
}
.profile-selector--page-num {
	appearance: none;
	background: none;
	border: 0;
	border-radius: 0;    /* parent button default rounds the active underline */
	box-shadow: none;
	cursor: pointer;
	font-family: var(--cmcf-font-body);
	font-size: var(--cmcf-fs-body);
	line-height: 1;
	color: var(--cmcf-black);
	padding: 4px 2px;
	border-bottom: 2px solid transparent;
	min-width: 24px;
	justify-content: center;
}
.profile-selector--page-num:hover { color: var(--cmcf-primary); }
.profile-selector--page-num.is-active {
	color: var(--cmcf-primary);
	border-bottom-color: var(--cmcf-primary);
	font-weight: 600;
}
/* Square lime-outline arrows, same language as the news/resources pagers */
.profile-selector--page-arrow {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	background: transparent;
	border: 1px solid var(--cmcf-secondary);
	border-radius: 4px;
	box-shadow: none;
	cursor: pointer;
	color: var(--cmcf-primary);
	font-size: 14.4px;
	line-height: 1;
	transition: background .15s ease, color .15s ease;
}
.profile-selector--page-arrow:hover {
	background: var(--cmcf-secondary);
	color: var(--cmcf-deep);
}

/* ============================ PEOPLE layout ============================= */

.profile-selector--people {
	display: grid;
	grid-template-columns: minmax(180px, 250px) minmax(0, 1fr);
	/* row 1 = section heading only; the spanning panel column must NOT
	   distribute its height into row 1 (pushes the names list down) */
	grid-template-rows: auto 1fr;
	gap: 0 clamp(40px, 7vw, 110px);
	align-items: start;
}

/* Vertical name list (left) */
.profile-selector--people .profile-selector--nav {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 18px;
}
.profile-selector--people .profile-selector--tab {
	appearance: none;
	background: none;
	border: 0;
	border-radius: 0;
	padding: 0 0 4px;
	cursor: pointer;
	text-align: left;
	font-family: var(--cmcf-font-body);
	font-weight: 600;
	font-size: 16px;
	line-height: 1.5;
	letter-spacing: var(--cmcf-ls-eyebrow);
	text-transform: uppercase;
	color: #424242;
	border-bottom: 2px solid transparent;
	transition: color .15s ease, border-color .15s ease;
}
.profile-selector--people .profile-selector--tab:hover { color: var(--cmcf-primary); }
.profile-selector--people .profile-selector--tab.is-active {
	color: var(--cmcf-primary);
	border-bottom-color: var(--cmcf-secondary);
}

/* Detail (right): portrait + bio */
.profile-selector--people .profile-selector--panels { min-width: 0; }
.profile-selector--people .profile-selector--panel {
	/* Design stacks the portrait ABOVE the bio in one ~746px column
	   (names list is the left grid column of the section) */
	display: block;
	max-width: 746px;
}
.profile-selector--people .profile-selector--panel .profile-selector--portrait-frame {
	margin-bottom: 36px;
}
.profile-selector--people .profile-selector--panel:not(.is-active) { display: none; }

/* Portrait: 346x346 photo inset in a 2px light-green 376x376 frame */
.profile-selector--portrait-frame {
	width: 376px;
	max-width: 100%;
	aspect-ratio: 1 / 1;
	border: 2px solid var(--cmcf-secondary);
	padding: 14px;
	box-sizing: border-box;
	background: var(--cmcf-white);
}
.profile-selector--portrait-frame img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.profile-selector--people .profile-selector--eyebrow {
	margin: 0 0 6px;
}
.profile-selector--people .profile-selector--name {
	font-family: var(--cmcf-font-heading);
	font-weight: 400;
	font-size: var(--cmcf-fs-name);
	line-height: 1.3;
	color: var(--cmcf-primary);
	margin: 0 0 20px;
}
.profile-selector--bio {
	font-family: var(--cmcf-font-body);
	font-size: var(--cmcf-fs-body);
	line-height: 1.6;
	color: var(--cmcf-black);
}
.profile-selector--bio p { margin: 0 0 1.2em; }
.profile-selector--bio p:last-child { margin-bottom: 0; }
.profile-selector--bio p { margin: 0 0 1em; }
.profile-selector--bio p:last-child { margin-bottom: 0; }
.profile-selector--bio a { color: var(--cmcf-primary); text-decoration: underline; }

/* ============================ MOBILE ================================== */

@media (max-width: 860px) {
	/* Story: tabs scroll horizontally; card + quote stack */
	.profile-selector--story .profile-selector--nav {
		flex-wrap: nowrap;
		overflow-x: auto;
		gap: 24px;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 4px;
	}
	.profile-selector--story .profile-selector--tab { white-space: nowrap; }

	.profile-selector--story .profile-selector--panel {
		grid-template-columns: 1fr;
		gap: 28px;
		padding: 28px 22px;
	}
	.profile-selector--story .profile-selector--panel::before {
		display: none;
	}
	.profile-selector--story .profile-selector--quote,
	.profile-selector--story .profile-selector--facts {
		grid-column: 1;
	}
	/* Desktop gives .profile-selector--quote an explicit grid-row:1 (to sit
	   beside facts in the 3-column layout). A fully-positioned item (row+col)
	   is placed before a partially-positioned one in grid auto-placement, so
	   without this reset quote grabs row 1 ahead of facts — even though facts
	   comes first in the DOM — and visually swaps their order on mobile. */
	.profile-selector--story .profile-selector--quote {
		grid-row: auto;
	}
	.profile-selector--story .profile-selector--facts {
		padding-bottom: 28px;
		border-bottom: 2px solid var(--cmcf-secondary);
	}

	/* People: name list above the detail; portrait full width */
	.profile-selector--people {
		grid-template-columns: 1fr;
		gap: 32px;
	}
	.profile-selector--people .profile-selector--nav {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 14px 24px;
	}
	.profile-selector--people .profile-selector--panel {
		grid-template-columns: 1fr;
		gap: 24px;
	}
	.profile-selector--portrait-frame { width: 100%; max-width: 376px; }

	/* People: prev/next-only pager under each bio — quicker than scanning
	   the wrapped name-tab row on a phone. */
	.profile-selector--people .profile-selector--pagination-arrows-only {
		justify-content: center;
		gap: 16px;
		margin-top: 32px;
	}
}
/* Desktop/tablet: the full name-list nav already covers navigation, so the
   people-layout pager is mobile-only. */
@media (min-width: 861px) {
	.profile-selector--people .profile-selector--pagination-arrows-only { display: none; }
}

.profile-selector--section-head { text-align: center; margin-bottom: 32px; }
.profile-selector--section-heading { font-size: var(--cmcf-fs-h1); margin: 0; }

/* ---- Variant: .cmcf-stories-grey (interior pages) — grey band ---- */
.cmcf-stories-grey.profile-selector {
	background: var(--cmcf-grey-panel);
	padding: var(--cmcf-section-pad) var(--cmcf-page-padding);
}
.cmcf-stories-grey .profile-selector--nav,
.cmcf-stories-grey .profile-selector--panels {
	max-width: var(--cmcf-container);
	margin-inline: auto;
}

/* Design rhythm: heading → 40px → full-width green hairline → 75px → tabs → 26px → card,
   card → 76px → pagination */
.cmcf-stories-grey .profile-selector--section-head { margin-bottom: 40px; }
.cmcf-stories-grey .profile-selector--nav {
	border-top: 1px solid var(--cmcf-primary);
	padding-top: 75px;
	margin-top: 0;
	margin-bottom: 26px;
}
.cmcf-stories-grey .profile-selector--pagination { margin-top: 76px; }

/* ---- People layout: content-box container + left-aligned section heading ---- */
.profile-selector--people {
	max-width: calc(var(--cmcf-container) + 2 * var(--cmcf-page-padding));
	margin-inline: auto;
	padding: var(--cmcf-section-pad) var(--cmcf-page-padding);
}
.profile-selector--people .profile-selector--section-head { text-align: left; margin-bottom: 36px; }
@media (min-width: 981px) {
	/* Design: heading tops the NAMES column only; the portrait/bio column runs
	   parallel from the section top (portrait top ~= heading top) */
	.profile-selector--people .profile-selector--section-head { grid-column: 1; grid-row: 1; }
	.profile-selector--people .profile-selector--nav { grid-column: 1; grid-row: 2; }
	/* .profile-selector--panels is nested inside .profile-selector--stage, which
	   is the actual direct grid child — grid-column/grid-row only apply to grid
	   items, so targeting .profile-selector--panels here was a no-op. With no
	   placement, .profile-selector--stage auto-placed into row 1 only (non-
	   spanning) alongside the heading, so row 1's auto height grew to match the
	   full bio content, pushing the name list (row 2) down below it — i.e. to
	   the bottom of the section instead of directly under the heading. */
	.profile-selector--people .profile-selector--stage { grid-column: 2; grid-row: 1 / span 2; }
}
.profile-selector--people .profile-selector--section-heading { color: var(--cmcf-primary); }

/* ==== Variant: .cmcf-stories-lime (home) — TWO static dark-green cards ====
   Design: 613x410 cards side by side, per-card on-green CTA, no tabs/pagination. */
.profile-selector--story.cmcf-stories-lime { background: var(--cmcf-secondary); padding: 76px var(--cmcf-page-padding); }
.profile-selector--story.cmcf-stories-lime .profile-selector--nav,
.profile-selector--story.cmcf-stories-lime .profile-selector--pagination { display: none; }
.profile-selector--story.cmcf-stories-lime .profile-selector--panels {
	padding: 0;           /* the grey-band inset frame does not apply to the lime cards */
	box-shadow: none;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	background: transparent;
	max-width: var(--cmcf-container);
	margin-inline: auto;
}
.profile-selector--cards.cmcf-stories-lime .profile-selector--panel,
.profile-selector--carousel.cmcf-stories-lime .profile-selector--panel {
	border: none;
	display: block;
	background: var(--cmcf-primary);
	color: var(--cmcf-white);
	min-height: 410px;
	padding: 54px 54px 48px;
}
.profile-selector--story.cmcf-stories-lime .profile-selector--panel::before { display: none; }

/* Variant: carousel mode — two cards at a time, using native CSS scroll-snap
   (no transform math, swipe/trackpad scroll work for free); arrows call
   scrollIntoView, dots are hidden, both reuse the story pagination markup. */
.profile-selector--carousel.cmcf-stories-lime .profile-selector--panels {
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	gap: 20px;
	scrollbar-width: none;
}
.profile-selector--carousel.cmcf-stories-lime .profile-selector--panels::-webkit-scrollbar { display: none; }
.profile-selector--carousel.cmcf-stories-lime .profile-selector--panel {
	flex: 0 0 calc(50% - 10px);
	width: calc(50% - 10px);
	scroll-snap-align: start;
}
@media (max-width: 700px) {
	.profile-selector--carousel.cmcf-stories-lime .profile-selector--panel {
		flex: 0 0 100%;
		width: 100%;
	}
}
.profile-selector--carousel.cmcf-stories-lime .profile-selector--stage {
	position: relative;
	max-width: var(--cmcf-container);
	margin-inline: auto;
}
.profile-selector--carousel.cmcf-stories-lime .profile-selector--pagination {
	display: block;
	position: absolute;
	inset: 0;
	margin: 0;
	pointer-events: none;
}
.profile-selector--carousel.cmcf-stories-lime .profile-selector--page-num { display: none; }
.profile-selector--carousel.cmcf-stories-lime .profile-selector--page-arrow {
	pointer-events: auto;
	position: absolute;
	top: 50%;
	background: rgba(255, 255, 255, 0.1);
	color: var(--cmcf-white);
	width: 48px;
	height: 48px;
	border-radius: 4px;
	border: 0.662037px solid #FFFFFF;
}
.profile-selector--carousel.cmcf-stories-lime .profile-selector--page-arrow[data-ps-arrow="prev"] {
	left: 0;
	transform: translate(-50%, -50%);
}
.profile-selector--carousel.cmcf-stories-lime .profile-selector--page-arrow[data-ps-arrow="next"] {
	right: 0;
	transform: translate(50%, -50%);
}
.profile-selector--carousel.cmcf-stories-lime .profile-selector--page-arrow:hover {
	background: var(--cmcf-primary);
	color: var(--cmcf-white);
}
/* Pin each card's "Find Out More" button to the bottom, so it lines up
   across cards regardless of quote length. */
.profile-selector--carousel.cmcf-stories-lime .profile-selector--panel {
	display: flex;
	flex-direction: column;
	gap: 0;
}
.profile-selector--carousel.cmcf-stories-lime .profile-selector--quote {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	flex: 1;
}
.profile-selector--carousel.cmcf-stories-lime .profile-selector--quote-body {
	margin-bottom: 24px;
}
.profile-selector--story.cmcf-stories-lime .profile-selector--facts { display: flex; flex-direction: column; padding: 0; border: none; }
.profile-selector--story.cmcf-stories-lime .profile-selector--name { color: var(--cmcf-accent); order: 1; margin: 0 0 8px; }
.profile-selector--story.cmcf-stories-lime .profile-selector--recipient {
	order: 2;
	color: var(--cmcf-white);
	border-bottom: 1px solid var(--cmcf-accent);
	padding-bottom: 16px;
	margin-bottom: 16px;
}
.profile-selector--story.cmcf-stories-lime .profile-selector--quote-mark { display: none; }
.profile-selector--story.cmcf-stories-lime .profile-selector--quote { padding: 0; border: none; }
.profile-selector--story.cmcf-stories-lime .profile-selector--quote-body,
.profile-selector--story.cmcf-stories-lime .profile-selector--quote-body p { color: var(--cmcf-white); }
.profile-selector--story.cmcf-stories-lime .profile-selector--card-cta { margin-top: 24px; }
.profile-selector--carousel.cmcf-stories-lime .profile-selector--card-cta { margin-top: auto; }
.profile-selector--story.cmcf-stories-lime .profile-selector--section-head .cmcf-eyebrow { color: var(--cmcf-black); }
.profile-selector--story.cmcf-stories-lime .profile-selector--section-heading { color: var(--cmcf-primary); }
@media (max-width: 860px) {
	.profile-selector--story.cmcf-stories-lime .profile-selector--panels { grid-template-columns: 1fr; }
}

/* Divider between Trustees and Staff sections (design: 2px lime rule) */
.profile-selector--people.cmcf-staff { border-top: 2px solid var(--cmcf-secondary); }
