/* bw/team-modal — staff photo grid + profile pop-up.
 * Mirrors brentwood.ca/academics/faculty: 2 columns on mobile, N on desktop,
 * portrait photos with a translucent name/role overlay; click opens a modal.
 * Fonts match the live site: Open Sans (body) + Oswald (the light condensed
 * staff-name heading). */

.bw-tm,
.bw-tm__modal {
	font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ── grid ─────────────────────────────────────────────────────────────────── */
.bw-tm__grid {
	display: grid;
	grid-template-columns: repeat( 2, 1fr );
	gap: 0.5rem;
}
@media ( min-width: 768px ) {
	.bw-tm__grid {
		grid-template-columns: repeat( var( --bw-tm-cols, 3 ), 1fr );
	}
}

.bw-tm__cell {
	position: relative;
}

.bw-tm__card {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	text-align: left;
	cursor: pointer;
	border-radius: 6px;
	overflow: hidden;
	color: inherit;
	font: inherit;
}
.bw-tm__card--static {
	cursor: default;
}

/* ── photo ────────────────────────────────────────────────────────────────── */
.bw-tm__photo {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 4; /* portrait, like the live pb-[133%] tiles */
	background: #d8d8d8;
	overflow: hidden;
}
.bw-tm__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}
.bw-tm__card:not( .bw-tm__card--static ):hover .bw-tm__img {
	transform: scale( 1.05 );
}
.bw-tm__placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #c7c7c7; /* grey tile, like the live photo-less faculty cards */
}
.bw-tm__placeholder-icon {
	width: auto;
	height: 38%;
	opacity: 0.95;
}

/* ── caption overlay ──────────────────────────────────────────────────────── */
.bw-tm__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 3;
	padding: 0.45rem 0.55rem 0.3rem;
	color: #fff;
	line-height: 1.15;
	background: rgba( 0, 0, 0, 0.32 );
}
.bw-tm__name {
	display: block;
	font-weight: 600;
	text-shadow: 0 1px 2px rgba( 0, 0, 0, 0.5 );
}
.bw-tm__role {
	display: block;
	margin-top: 0.1rem;
	font-size: 0.78rem;
	text-shadow: 0 1px 2px rgba( 0, 0, 0, 0.5 );
}

/* ── list layout: photo-left rows (name / role / credentials) ───────────────
 * Matches the live staff-profile-list "list" 1:1: a small portrait photo, a
 * WHITE row box (live `bg-highlight` = bg-white), and stacked text — the name
 * in the Oswald heading font (live <h3 class="link">: font-header, font-light,
 * text-xl, .link = text-primary rgb(200,39,44)), the role in body text, and
 * italic credentials led by a grey mortarboard (fa text-gray-400).
 * Single column on mobile; --bw-tm-cols on desktop (Columns = 1 for one-per-row).
 * The subtle bar effect on the live page comes from the WHITE rows sitting on a
 * light-grey section background — set the Kadence section/row background to a
 * light grey to reproduce it exactly. */
.bw-tm--list .bw-tm__grid {
	grid-template-columns: 1fr;
	gap: 1rem;
}
@media ( min-width: 768px ) {
	.bw-tm--list .bw-tm__grid {
		grid-template-columns: repeat( var( --bw-tm-cols, 1 ), 1fr );
		gap: 1rem;
	}
}
.bw-tm--list .bw-tm__card {
	display: flex;
	align-items: center;
	gap: 1rem;
	border-radius: 0 4px 4px 0; /* live "rounded-r": right corners only */
	background: #fff;           /* live bg-highlight = bg-white */
	overflow: hidden;
}
.bw-tm--list .bw-tm__photo {
	flex: 0 0 auto;
	width: 5rem; /* live w-20 portrait thumbnail */
}
.bw-tm--list .bw-tm__placeholder {
	background: #e5e7eb; /* live .staff-profile-list-photo = bg-gray-200 */
}
.bw-tm--list .bw-tm__rowtext {
	display: block;
	min-width: 0;
	padding: 0.4rem 0.6rem 0.4rem 0;
	line-height: 1.3;
}
.bw-tm--list .bw-tm__name {
	position: static;
	display: block;
	margin: 0;
	font-family: var( --global-heading-font-family, "Oswald", "Open Sans", sans-serif );
	font-weight: 300;   /* live font-light */
	font-size: 1.25rem; /* live text-xl */
	line-height: 1.3;
	color: inherit;
	text-shadow: none;
}
.bw-tm--list .bw-tm__card:not( .bw-tm__card--static ) .bw-tm__name {
	color: rgb( 200, 39, 44 ); /* live .link = text-primary */
}
.bw-tm--list .bw-tm__card:not( .bw-tm__card--static ):hover .bw-tm__name {
	text-decoration: underline;
}
.bw-tm--list .bw-tm__role {
	position: static;
	display: block;
	margin-top: 0.2rem;
	font-size: 1rem; /* live body text */
	color: #333;
	text-shadow: none;
}
.bw-tm--list .bw-tm__cred {
	display: flex;
	gap: 0.35rem;
	align-items: flex-start;
	margin-top: 0.3rem;
	font-size: 0.9rem;
	font-style: italic;
	line-height: 1.35;
	color: #6b7280;
}
.bw-tm--list .bw-tm__cred .bw-tm__cap {
	flex: 0 0 auto;
	width: 1em;
	height: 1em;
	margin-top: 0.2em;
	color: #9ca3af; /* live grad-cap = text-gray-400 */
	fill: currentColor;
}

/* ── grid layout: names only (no photos) ────────────────────────────────────
 * Live "grid": 2 cols on mobile, --bw-tm-cols on desktop, each name in a
 * bottom-bordered, top-rounded box; clickable names use the link red. */
.bw-tm--grid .bw-tm__grid {
	grid-template-columns: repeat( 2, 1fr );
	gap: 0.4rem 1rem;
}
@media ( min-width: 768px ) {
	.bw-tm--grid .bw-tm__grid {
		grid-template-columns: repeat( var( --bw-tm-cols, 3 ), 1fr );
	}
}
.bw-tm--grid .bw-tm__card {
	padding: 0.4rem 0.35rem;
	border-bottom: 1px solid #d9d9d9;
	border-radius: 4px 4px 0 0;
	overflow: visible;
}
.bw-tm--grid .bw-tm__gridname {
	display: block;
}
.bw-tm--grid .bw-tm__card:not( .bw-tm__card--static ) .bw-tm__gridname {
	color: rgb( 200, 39, 44 ); /* live .link = text-primary */
}
.bw-tm--grid .bw-tm__card:not( .bw-tm__card--static ):hover .bw-tm__gridname {
	text-decoration: underline;
}

/* ── modal ────────────────────────────────────────────────────────────────── */
.bw-tm__modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center; /* vertically centred in the viewport */
	justify-content: center;
}
/* When closed (view.js sets [hidden]) the modal MUST be display:none, otherwise
 * this rule's `display:flex` overrides the browser's [hidden] default and the
 * invisible full-viewport overlay keeps swallowing every click until a reload. */
.bw-tm__modal[hidden] {
	display: none;
}
.bw-tm__overlay {
	position: absolute;
	inset: 0;
	background: rgba( 120, 120, 120, 0.55 );
	opacity: 0;
	transition: opacity 0.25s ease;
}
.bw-tm__modal.is-open .bw-tm__overlay {
	opacity: 1;
}
/* Positioning context for the card + the floating × above its corner. */
.bw-tm__shell {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 640px;
	margin: 1rem;
}
.bw-tm__dialog {
	max-height: 88vh;
	overflow: auto;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.3 );
	opacity: 0;
	transform: translateY( -12px );
	transition: transform 0.25s ease, opacity 0.25s ease;
}
.bw-tm__modal.is-open .bw-tm__dialog {
	opacity: 1;
	transform: none;
}
.bw-tm__dialog:focus {
	outline: none;
}
/* Round × button at the card's top-right corner, nudged half outside — matches
 * the live .modal-close-icon (2rem circle, #f3f4f6 bg, #374151 icon, shadow).
 * The hard resets (!important) override the theme's global <button> styling. */
.bw-tm__close {
	position: absolute;
	top: -0.5rem;
	right: -0.5rem;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 9999px !important;
	background: #f3f4f6 !important;
	color: #374151;
	box-shadow: 0 1px 3px 0 rgba( 0, 0, 0, 0.12 ), 0 1px 2px -1px rgba( 0, 0, 0, 0.12 );
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.bw-tm__close svg {
	display: block;
	width: 1.05rem;
	height: 1.05rem;
	fill: currentColor;
}
.bw-tm__close:hover,
.bw-tm__close:focus {
	background: #e5e7eb !important;
	color: #1f2937;
	outline: none;
}
.bw-tm__modal-body {
	padding: 1.75rem;
}
html.bw-tm-modal-open {
	overflow: hidden;
}

/* ── profile content ──────────────────────────────────────────────────────── */
.bw-tm__p-name {
	margin: 0 0 0.15rem;
	font-family: "Oswald", "Open Sans", sans-serif;
	font-size: 1.6rem;
	font-weight: 300;
	border-bottom: 1px solid #e2e2e2;
	padding-bottom: 0.5rem;
}
.bw-tm__p-role {
	margin: 0.6rem 0 0.35rem;
	font-weight: 700;
}
.bw-tm__p-cred {
	display: flex;
	gap: 0.4rem;
	align-items: flex-start;
	margin: 0 0 1rem;
	font-style: italic;
	color: #555;
}
.bw-tm__cap {
	flex: 0 0 auto;
	width: 1.05em;
	height: 1.05em;
	margin-top: 0.15em;
	fill: currentColor;
}
.bw-tm__p-content::after {
	content: "";
	display: block;
	clear: both;
}
.bw-tm__p-photo {
	float: right;
	width: 190px;
	max-width: 44%;
	margin: 0 0 0.75rem 1.25rem;
}
.bw-tm__p-img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 2px;
}
.bw-tm__p-bio {
	font-size: 0.95rem;
	line-height: 1.55;
}
.bw-tm__p-bio p {
	margin: 0 0 1em;
}
.bw-tm__p-bio p:last-child {
	margin-bottom: 0;
}

/* footer rule + Brentwood shield (closes the profile, like the live modal) */
.bw-tm__footer {
	position: relative;
	display: flex;
	align-items: center;
	margin: 1.25rem 0 0.25rem;
	padding-right: 1.5rem;
}
.bw-tm__rule {
	flex: 1 1 auto;
	border-top: 1px solid #e2e2e2;
}
.bw-tm__shield {
	position: absolute;
	right: 0;
	height: 1.25rem;
	width: auto;
	opacity: 0.75;
}

@media ( max-width: 480px ) {
	.bw-tm__p-photo {
		float: none;
		width: 60%;
		max-width: 220px;
		margin: 0 0 1rem;
	}
	.bw-tm__modal-body {
		padding: 1.5rem 1.25rem;
	}
}

/* ── feature modal (instructor inline / variant 3) ─────────────────────────────
 * Mirrors the live summer-camps director pop-up (max-w-6xl, 3-col grid): name +
 * vertically-centred bio on the LEFT (2/3) and a full-height photo on the RIGHT
 * (1/3). A white convex CURVE divider (from .bw-tm__feature-curve) bulges into
 * the photo, with the Brentwood red accent line straight on top at the seam.
 * Applied only when opened from a data-tm-variant="feature" trigger. */
.bw-tm__modal--feature .bw-tm__shell { max-width: 1100px; }
.bw-tm__modal--feature .bw-tm__modal-body { padding: 0; }

.bw-tm__profile--feature {
	display: grid;
	grid-template-columns: 2fr 1fr; /* text 2/3 (left), photo 1/3 (right) */
	align-items: stretch;
	min-height: 460px;              /* keep the photo tall even for short bios */
}
.bw-tm__profile--feature .bw-tm__feature-text {
	position: relative;
	z-index: 2;                     /* sits above the photo so the curve overlaps it */
	display: flex;
	flex-direction: column;
	justify-content: center;        /* vertically centred, like live flex justify-center */
	min-width: 0;
	padding: 2.5rem 3rem;
}
/* Keep the actual copy above the white curve so line-ends are never covered. */
.bw-tm__profile--feature .bw-tm__feature-text > :not( .bw-tm__feature-curve ) {
	position: relative;
	z-index: 2;
}
.bw-tm__profile--feature .bw-tm__p-name {
	margin: 0 0 1rem;
	padding-bottom: 0;
	border-bottom: 0;
	font-size: 1.9rem;
}
.bw-tm__profile--feature .bw-tm__p-role  { margin: 0 0 0.5rem; }
.bw-tm__profile--feature .bw-tm__p-cred  { margin: 0 0 0.85rem; }
.bw-tm__profile--feature .bw-tm__p-bio {
	font-size: 0.95rem;
	line-height: 1.6;
}
.bw-tm__profile--feature .bw-tm__feature-photo {
	position: relative;
	z-index: 1;
	background: #d8d8d8;
	overflow: hidden;
}
.bw-tm__profile--feature .bw-tm__feature-photo img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 50%;
}
/* Brentwood red accent on the RIGHT edge of the photo (live border-primary md:right-0). */
.bw-tm__profile--feature .bw-tm__feature-photo::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	right: 0;
	width: 4px;
	background: var( --bw-primary, #cc0000 );
	z-index: 2;
	pointer-events: none;
}

/* Desktop: the white curve divider + the straight red accent line at the seam. */
.bw-tm__feature-curve { display: none; }
@media ( min-width: 601px ) {
	/* Clipping wrapper: spans the text column and 1rem into the photo (right:-1rem),
	   overflow:hidden trims the tall ellipse's top/bottom so only the gentle middle
	   arc shows — exactly the live `overflow-hidden right-[-1rem]` wrapper. */
	.bw-tm__feature-curve {
		display: block;
		position: absolute;
		top: 0;
		bottom: 0;
		left: 0;
		right: -1rem;
		z-index: 1;
		overflow: hidden;
		pointer-events: none;
	}
	/* The white ellipse (live: w-32 h-[150%] top-[-25%] rounded-[100%]). */
	.bw-tm__feature-curve::after {
		content: "";
		position: absolute;
		top: -25%;
		right: 0;
		width: 8rem;
		height: 150%;
		background: #fff;
		border-radius: 50%;
	}
}

/* Mobile: stack — bio on top, photo below; no curve, red accent on top edge. */
@media ( max-width: 600px ) {
	.bw-tm__profile--feature {
		grid-template-columns: 1fr;
		min-height: 0;
	}
	.bw-tm__profile--feature .bw-tm__feature-text {
		padding: 1.75rem 1.5rem;
	}
	.bw-tm__profile--feature .bw-tm__feature-photo {
		border-top: 4px solid var( --bw-primary, #cc0000 );
		aspect-ratio: 3 / 4;
		max-height: 60vh;
	}
}
