/**
 * Sensible Team Members – grid and lightbox
 * Scoped under .stm-team-wrap to override theme.
 */

.stm-team-wrap {
	--stm-gap: 1.5rem;
	margin: 0 0 2rem;
}

.stm-team-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--stm-gap);
}

@media (min-width: 576px) {
	.stm-team-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 992px) {
	.stm-team-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

.stm-team-col {
	display: flex;
}

.stm-team-card {
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
}

/* Card: image 100% width of card, circle, centered */
.stm-team-wrap .stm-team-image-wrap {
	width: 100% !important;
	aspect-ratio: 1 !important;
	max-width: 100%;
	margin: 0 auto 0;
	border-radius: 50% !important;
	overflow: hidden !important;
	background: #eaeaea;
	border: 3px solid #ddd;
	position: relative;
	flex-shrink: 0;
	box-sizing: border-box;
	align-self: stretch;
}

.stm-team-wrap .stm-team-image-wrap.stm-team-image-placeholder {
	background: #e0e0e0;
}

.stm-team-wrap .stm-team-image-wrap.stm-team-bio-trigger {
	cursor: pointer;
}

.stm-team-wrap .stm-team-image-wrap.stm-team-bio-trigger:hover {
	border-color: #999;
	opacity: 0.95;
}

.stm-team-wrap .stm-team-image {
	width: 100% !important;
	height: 100% !important;
	min-width: 100% !important;
	min-height: 100% !important;
	max-width: 100% !important;
	max-height: 100% !important;
	object-fit: cover !important;
	object-position: center;
	display: block;
	pointer-events: none;
	box-sizing: border-box;
}

.stm-team-info {
	text-align: center !important;
	padding-top: 10px !important;
	width: 100%;
	box-sizing: border-box;
}

.stm-team-name {
	font-weight: 700;
	font-size: 1.1rem;
	margin-bottom: 0.25rem;
	text-align: center !important;
}

.stm-team-position {
	font-size: 0.9rem;
	color: #555;
	margin-bottom: 0.5rem;
	text-align: center !important;
}

.stm-team-links {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.5rem 0;
}

.stm-team-view-bio {
	background: none;
	border: none;
	cursor: pointer;
	color: inherit;
	font-size: 0.9rem;
	text-decoration: underline;
	padding: 0;
}

.stm-team-view-bio:hover {
	opacity: 0.8;
}

/* ========== Lightbox: above everything, black overlay, white box ========== */
.stm-team-lightbox {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100% !important;
	height: 100% !important;
	z-index: 2147483647 !important; /* above page title, header, everything */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	box-sizing: border-box;
}

.stm-team-lightbox[hidden] {
	display: none !important;
}

/* Overlay: black, transparent, NO blur */
.stm-team-lightbox-backdrop {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100% !important;
	height: 100% !important;
	background: rgba(0, 0, 0, 0.75) !important;
	cursor: pointer;
	z-index: 1;
}

/* White container – structure */
.stm-team-lightbox-content {
	position: relative !important;
	z-index: 2 !important;
	background: #ffffff !important;
	width: 100%;
	max-width: 580px;
	max-height: 90vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.stm-team-lightbox-close {
	position: absolute !important;
	top: 12px;
	right: 12px;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.5) !important;
	border: none;
	border-radius: 50%;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: #fff !important;
	padding: 0;
	z-index: 3;
}

.stm-team-lightbox-close:hover {
	background: rgba(0, 0, 0, 0.7) !important;
}

/* Lightbox body: image full width, then padded content */
.stm-team-lightbox-content-inner {
	overflow-y: auto;
	flex: 1;
	min-height: 0;
}

/* Profile image in lightbox: full width, height auto, no crop */
#stm-lightbox-body .stm-lightbox-image-wrap {
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	border-radius: 8px 8px 0 0 !important;
	overflow: hidden;
	background: #eee;
	line-height: 0;
}

#stm-lightbox-body .stm-lightbox-image {
	width: 100% !important;
	height: auto !important;
	display: block;
	vertical-align: top;
}

/* Text block: white background, padding */
#stm-lightbox-body .stm-lightbox-text {
	background: #ffffff !important;
	padding: 1.5rem 2rem 2rem !important;
	text-align: left;
}

#stm-lightbox-body .stm-lightbox-name {
	font-weight: 700;
	font-size: 1.35rem;
	margin: 0 0 0.25rem 0;
	color: #111;
}

/* Job title (left) + LinkedIn (right) on one line */
#stm-lightbox-body .stm-lightbox-title-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin: 0 0 1rem 0;
	padding-bottom: 1rem;
	border-bottom: 1px solid #eee;
}

#stm-lightbox-body .stm-lightbox-title-row .stm-lightbox-position {
	font-size: 0.95rem;
	color: #555;
	margin: 0;
	flex: 1;
}

#stm-lightbox-body .stm-lightbox-linkedin {
	display: inline-flex;
	align-items: center;
	color: #0a66c2;
	text-decoration: none;
	flex-shrink: 0;
}

#stm-lightbox-body .stm-lightbox-linkedin:hover {
	opacity: 0.85;
}

#stm-lightbox-body .stm-lightbox-bio {
	text-align: left;
	font-size: 0.95rem;
	line-height: 1.65;
	color: #333;
	margin: 0;
}

#stm-lightbox-body .stm-lightbox-bio p {
	margin: 0 0 0.85em 0;
}

#stm-lightbox-body .stm-lightbox-bio p:last-child {
	margin-bottom: 0;
}

#stm-lightbox-body .stm-lightbox-bio ul,
#stm-lightbox-body .stm-lightbox-bio ol {
	margin: 0.5em 0 1em 1.25em;
	padding: 0;
}

#stm-lightbox-body .stm-lightbox-bio li {
	margin-bottom: 0.35em;
}
