/**
 * Engineering Trust – Team Members widget styles.
 * All class names are prefixed "etw-" (Elementor Team Widget) to avoid
 * clashing with any existing theme or HTML-widget CSS.
 *
 * Brand colours are CSS custom properties set inline by the widget's
 * Style controls (see class-team-members-widget.php), so this file only
 * needs sensible fallbacks.
 */

.etw-team {
	--etw-blue: #009fe3;
	--etw-green: #76bd1e;
	--etw-purple: #b217ac;
	--etw-grey: #6c6d6e;

	box-sizing: border-box;
	font-family: inherit;
	background: #f3f4f5;
	padding: 80px 30px;

	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.etw-team *,
.etw-team *::before,
.etw-team *::after {
	box-sizing: border-box;
}

.etw-team__inner {
	width: 100%;
	max-width: 1240px;
	margin-left: auto;
	margin-right: auto;
}

/* ---------- Section background (Style > Section > Background Colour) ---------- */

.etw-team--bg-white .etw-team {
	background: #ffffff;
}

.etw-team--bg-grey .etw-team {
	background: #f3f4f5;
}

/* ---------- Header ---------- */

.etw-team__header {
	max-width: 760px;
	margin: 0 auto 48px;
	text-align: center;
}

.etw-team .etw-team__eyebrow {
	display: block;
	margin-bottom: 10px;
	color: var(--etw-green);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1.6px;
	text-transform: uppercase;
}

.etw-team .etw-team__heading {
	margin: 0 0 15px;
	color: #222222;
	font-size: clamp(32px, 5vw, 52px);
	font-weight: 800;
	line-height: 1.05;
}

.etw-team .etw-team__description {
	margin: 0;
	color: var(--etw-grey);
	font-size: 17px;
	line-height: 1.65;
}

/* ---------- Grid ---------- */

.etw-team__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px;
	align-items: start;
}

/* ---------- Card ---------- */

.etw-card {
	--etw-card-colour: var(--etw-blue);

	overflow: hidden;
	background: #ffffff;
	border: 1px solid #dfe2e4;
	border-top: 5px solid var(--etw-card-colour);
	border-radius: 9px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.etw-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 20px 42px rgba(0, 0, 0, 0.14);
}

.etw-card--blue {
	--etw-card-colour: var(--etw-blue);
}

.etw-card--green {
	--etw-card-colour: var(--etw-green);
}

.etw-card--purple {
	--etw-card-colour: var(--etw-purple);
}

.etw-card--grey {
	--etw-card-colour: var(--etw-grey);
}

.etw-card summary {
	cursor: pointer;
	list-style: none;
}

.etw-card summary::-webkit-details-marker {
	display: none;
}

.etw-card summary::marker {
	content: '';
}

.etw-card__image-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #e8eaeb;
}

.etw-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transition: transform 0.4s ease, filter 0.4s ease;
}

/* Greyscale-until-hover/open is opt-out via the "Greyscale Photos" switcher,
   which toggles the etw-team--grayscale-yes / etw-team--grayscale-no class. */
.etw-team--grayscale-yes .etw-card__image {
	filter: grayscale(100%);
}

.etw-team--grayscale-yes .etw-card:hover .etw-card__image,
.etw-team--grayscale-yes .etw-card[open] .etw-card__image {
	filter: grayscale(0%);
}

.etw-card:hover .etw-card__image,
.etw-card[open] .etw-card__image {
	transform: scale(1.035);
}

.etw-card__summary {
	padding: 27px 26px 25px;
	text-align: center;
}

.etw-card .etw-card__label {
	display: block;
	margin-bottom: 8px;
	color: var(--etw-card-colour);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1.3px;
	text-transform: uppercase;
}

.etw-card .etw-card__name {
	margin: 0 0 8px;
	color: #222222;
	font-size: 26px;
	font-weight: 800;
	line-height: 1.1;
	text-transform: uppercase;
}

.etw-card .etw-card__role {
	min-height: 38px;
	margin: 0 0 22px;
	color: #333333;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.45;
	text-transform: uppercase;
}

.etw-card__button {
	min-width: 155px;
	padding: 11px 15px;
	color: var(--etw-card-colour);
	border: 2px solid var(--etw-card-colour);

	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;

	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;

	transition: color 0.25s ease, background-color 0.25s ease;
}

.etw-card summary:hover .etw-card__button,
.etw-card[open] .etw-card__button {
	color: #ffffff;
	background: var(--etw-card-colour);
}

.etw-card__toggle {
	position: relative;
	width: 15px;
	height: 15px;
	flex: 0 0 15px;
}

.etw-card__toggle::before,
.etw-card__toggle::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	background: currentColor;
	transform: translate(-50%, -50%);
	transition: transform 0.25s ease;
}

.etw-card__toggle::before {
	width: 11px;
	height: 2px;
}

.etw-card__toggle::after {
	width: 2px;
	height: 11px;
}

.etw-card[open] .etw-card__toggle::after {
	transform: translate(-50%, -50%) rotate(90deg);
}

/* Button label swaps to the "Close bio" text (set via the widget's
   Content > Layout & Labels controls) using the data attribute the
   widget renders — no JavaScript required. */
.etw-card[open] .etw-card__button-text {
	font-size: 0;
}

.etw-card[open] .etw-card__button-text::after {
	content: attr(data-close-text);
	font-size: 12px;
}

/* ---------- Bio ---------- */

.etw-card__bio {
	padding: 0 26px 27px;
	animation: etwBioReveal 0.3s ease;
}

.etw-card__bio::before {
	content: '';
	display: block;
	width: 42px;
	height: 3px;
	margin: 0 auto 19px;
	background: var(--etw-card-colour);
}

.etw-card__bio p {
	margin: 0 0 1em;
	color: var(--etw-grey);
	font-size: 14px;
	line-height: 1.7;
	text-align: left;
}

.etw-card__bio p:last-child {
	margin-bottom: 0;
}

@keyframes etwBioReveal {
	from {
		opacity: 0;
		transform: translateY(-7px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.etw-team__header {
		margin-bottom: 34px;
	}
}

@media (max-width: 767px) {
	.etw-team {
		padding: 56px 18px;
	}

	.etw-card__name {
		font-size: 23px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.etw-card,
	.etw-card__image,
	.etw-card__toggle::after {
		transition: none;
	}

	.etw-card__bio {
		animation: none;
	}
}
