/* Team member cards and bio modal for [besitos_team] (team/render.php).
   Colours, sizes and motion come from the "Live Leadership Section" design; fonts are
   inherited from the site. Hello Elementor and the Elementor kit style every button
   (".elementor-kit-N button" beats a single class), so card and close-button rules carry
   a parent class and set every state explicitly. */

.besitos-team,
.besitos-team-modal {
	--bt-ink: #0C2340;
	--bt-muted: #55677E;
	--bt-body: #33465F;
	--bt-gold: #B8860B;
	--bt-gold-badge: #D3A13B;
	--bt-gold-light: #E8B84B;
	--bt-placeholder: #E6ECF3;
	--bt-icon-bg: #F4F7FA;
	--bt-ease: cubic-bezier(0.16, 1, 0.3, 1);
	--bt-gutter: clamp(14px, 4vw, 48px);
	color: var(--bt-ink);
}

/* ---- Cards ---------------------------------------------------------------- */

.besitos-team {
	max-width: 1200px;
	margin: 0 auto;
}

/* Shown to editors when the shortcode has nothing to render (team/render.php). */
.besitos-team__notice {
	margin: 0;
	padding: 12px 16px;
	border: 1px dashed rgba(12, 35, 64, 0.3);
	border-radius: 6px;
	font-size: 14px;
	color: #55677E;
	text-align: center;
}

/* Optional section header ([besitos_team title subtitle intro]). Scoped under .besitos-team
   so it beats the kit's ".elementor-kit-N h2". */
.besitos-team .besitos-team__header {
	max-width: 780px;
	margin: 0 auto clamp(36px, 4.5vw, 56px);
	text-align: center;
}

.besitos-team .besitos-team__heading {
	margin: 0 0 18px;
	font-size: clamp(30px, 3.8vw, 46px);
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: -0.02em;
	color: var(--bt-ink);
	text-wrap: pretty;
}

.besitos-team .besitos-team__subheading {
	margin: 0 0 16px;
	font-size: clamp(17px, 1.7vw, 20px);
	font-weight: 500;
	line-height: 1.45;
	color: var(--bt-body);
	text-wrap: pretty;
}

.besitos-team .besitos-team__intro {
	margin: 0;
	font-size: 15.5px;
	line-height: 1.6;
	color: var(--bt-muted);
	text-wrap: pretty;
}

.besitos-team .besitos-team__header > :last-child {
	margin-bottom: 0;
}

/* The advisory board follows the leadership grid: smaller heading, the design's gap above. */
.besitos-team[data-group="advisory"] .besitos-team__header {
	margin-top: clamp(56px, 7vw, 88px);
	margin-bottom: clamp(30px, 3.5vw, 44px);
}

.besitos-team[data-group="advisory"] .besitos-team__heading {
	font-size: clamp(26px, 3.2vw, 38px);
	line-height: 1.14;
}

/* A wrapping row rather than a grid, so a partial last row (3 advisors, the last 2
   leaders) sits centered instead of hugging the left. Cards start at 248px and grow to
   282px, which fits 4 per row in 1200px. */
.besitos-team__grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 26px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.besitos-team__item {
	flex: 1 1 248px;
	max-width: 282px;
	margin: 0;
	padding: 0;
}

/* One card per row on phones: let it use the full width. */
@media (max-width: 560px) {
	.besitos-team__item {
		max-width: none;
	}
}

.besitos-team .besitos-team__card,
.besitos-team .besitos-team__card:hover,
.besitos-team .besitos-team__card:focus {
	appearance: none;
	position: relative;
	/* A stretched <button> centres its content vertically; a column keeps it at the top
	   when a long name makes one card in the row taller. */
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: stretch;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(12, 35, 64, 0.08);
	border-radius: 10px;
	overflow: hidden;
	background: #FFFFFF;
	color: var(--bt-ink);
	font: inherit;
	letter-spacing: normal;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	white-space: normal;
	cursor: pointer;
}

.besitos-team .besitos-team__card {
	box-shadow: 0 2px 10px rgba(12, 35, 64, 0.07);
	transition: transform 0.28s var(--bt-ease), box-shadow 0.28s ease;
}

.besitos-team .besitos-team__card:focus {
	outline: none;
}

.besitos-team .besitos-team__card:focus-visible {
	outline: 3px solid var(--bt-gold-light);
	outline-offset: 3px;
}

.besitos-team__photo {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: var(--bt-placeholder);
}

.besitos-team__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 22%;
}

.besitos-team__body {
	display: block;
	padding: 20px 22px 26px;
}

.besitos-team__name {
	display: block;
	margin: 0 0 5px;
	font-size: 19px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.besitos-team__title {
	display: block;
	margin-bottom: 16px;
	font-size: 14px;
	color: var(--bt-muted);
}

.besitos-team__cta {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--bt-gold);
}

.besitos-team__overlay {
	position: absolute;
	inset: 0;
	color: #FFFFFF;
	background: linear-gradient(180deg, rgba(12, 35, 64, 0.12) 0%, rgba(12, 35, 64, 0.58) 32%, #0C2340 62%, #0C2340 100%);
	opacity: 0;
	transition: opacity 0.26s ease;
	pointer-events: none;
}

.besitos-team__badge {
	position: absolute;
	top: 16px;
	right: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--bt-gold-badge);
}

.besitos-team__overlay-text {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	display: block;
	padding: 28px 24px 30px;
}

.besitos-team__overlay-name {
	display: block;
	margin-bottom: 6px;
	font-size: 20px;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.besitos-team__overlay-title {
	display: block;
	margin-bottom: 16px;
	font-size: 14px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.86);
}

.besitos-team__overlay-blurb {
	display: block;
	margin-bottom: 20px;
	font-size: 14.5px;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.92);
	text-wrap: pretty;
}

.besitos-team__overlay-cta {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: var(--bt-gold-light);
}

/* Hover and keyboard focus are one state. Touch screens skip it: a tap opens the bio. */
@media (hover: hover) {
	.besitos-team .besitos-team__card:hover,
	.besitos-team .besitos-team__card:focus-visible {
		transform: translateY(-10px);
		box-shadow: 0 24px 48px rgba(12, 35, 64, 0.26);
	}

	.besitos-team__card:hover .besitos-team__overlay,
	.besitos-team__card:focus-visible .besitos-team__overlay {
		opacity: 1;
	}
}

/* ---- Modal ---------------------------------------------------------------- */

body.besitos-team-modal-open {
	overflow: hidden;
}

.besitos-team-modal {
	width: 940px;
	max-width: calc(100vw - 2 * var(--bt-gutter));
	max-height: none;
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 10px;
	overflow: hidden;
	background: #FFFFFF;
	box-shadow: 0 30px 80px rgba(12, 35, 64, 0.38);
}

.besitos-team-modal[open] {
	animation: besitos-team-modal-in 0.26s var(--bt-ease);
}

.besitos-team-modal::backdrop {
	background: rgba(12, 35, 64, 0.55);
	animation: besitos-team-veil-in 0.2s ease;
}

.besitos-team-modal__panel {
	position: relative;
}

.besitos-team-modal__body {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
	grid-auto-rows: minmax(0, 1fr);
	max-height: calc(100vh - 2 * var(--bt-gutter));
	max-height: calc(100dvh - 2 * var(--bt-gutter));
	overflow: hidden auto;
}

.besitos-team-modal__photo {
	min-width: 0;
	min-height: 260px;
	background: var(--bt-placeholder);
}

.besitos-team-modal__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	/* --bt-photo-x: a team member's "Bio photo position", set inline by render.php. */
	object-position: var(--bt-photo-x, center) 20%;
}

.besitos-team-modal__content {
	min-width: 0;
	min-height: 0;
	padding: clamp(26px, 3.2vw, 42px);
	overflow-y: auto;
}

.besitos-team-modal .besitos-team-modal__close,
.besitos-team-modal .besitos-team-modal__close:hover,
.besitos-team-modal .besitos-team-modal__close:focus {
	position: absolute;
	top: 18px;
	right: 18px;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid rgba(12, 35, 64, 0.14);
	border-radius: 50%;
	background: #FFFFFF;
	color: var(--bt-ink);
	cursor: pointer;
}

.besitos-team-modal .besitos-team-modal__close:hover,
.besitos-team-modal .besitos-team-modal__close:focus-visible {
	border-color: var(--bt-ink);
	background: var(--bt-ink);
	color: #FFFFFF;
}

.besitos-team-modal .besitos-team-modal__name {
	margin: 0 0 8px;
	padding-right: 48px;
	font-size: clamp(27px, 3.1vw, 38px);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: -0.022em;
	color: inherit;
}

.besitos-team-modal .besitos-team-modal__title {
	margin: 0 0 24px;
	line-height: 1.4;
	font-size: 15px;
	font-weight: 600;
	color: var(--bt-gold);
}

.besitos-team-modal .besitos-team-modal__bio p {
	margin: 0 0 16px;
	font-size: 15.5px;
	line-height: 1.62;
	color: var(--bt-body);
	text-wrap: pretty;
}

.besitos-team-modal__bio p:last-child {
	margin-bottom: 0;
}

.besitos-team-modal__divider {
	margin: 28px 0 22px;
	border: 0;
	border-top: 1px solid rgba(12, 35, 64, 0.12);
}

.besitos-team-modal .besitos-team-modal__focus-heading {
	margin: 0 0 20px;
	line-height: 1.3;
	letter-spacing: normal;
	font-size: 15px;
	font-weight: 600;
	color: inherit;
}

.besitos-team-modal__focus {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.besitos-team-modal__focus li {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
	text-align: center;
}

.besitos-team-modal__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: var(--bt-icon-bg);
	color: var(--bt-gold);
}

@keyframes besitos-team-veil-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes besitos-team-modal-in {
	from { transform: translateY(18px) scale(0.98); opacity: 0; }
	to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.besitos-team .besitos-team__card,
	.besitos-team__overlay {
		transition: none;
	}

	.besitos-team .besitos-team__card:hover,
	.besitos-team .besitos-team__card:focus-visible {
		transform: none;
	}

	.besitos-team-modal[open],
	.besitos-team-modal::backdrop {
		animation: none;
	}
}
