/**
 * Team page ("צוות האתר") — page-team-members.php
 * Loaded only on pages using the "עמוד צוות האתר" template.
 */

.team-members-page .entry-content {
	direction: rtl;
}

.team-section {
	margin: 1.5em 0 2.5em;
}

.team-section:first-child {
	margin-top: .5em;
}

.team-section__title {
	margin: 0 0 1em;
	padding-bottom: .3em;
	border-bottom: 2px solid #e8850c;
	font-size: 1.4em;
}

.team-section--former .team-section__title {
	border-bottom-color: #bbb;
}

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

.team-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 10px;
}

.team-card {
	position: relative;
	overflow: hidden;
	background: #f8f8f8;
	border: 1px solid #ececec;
	border-radius: 10px;
	padding: 20px 16px 18px;
	text-align: center;
	list-style: none;
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* Everything under the avatar; anchor for the bio overlay so the
   avatar link stays clickable while the bio is showing. */
.team-card__body {
	position: relative;
	flex: 1 1 auto;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
}

.team-section--former .team-card {
	background: #f3f3f3;
	filter: grayscale(35%);
	opacity: .85;
}

/* Avatar -------------------------------------------------------------- */

.team-card__avatar {
	display: block;
	width: 120px;
	height: 120px;
	margin: 0 auto 12px;
	border-radius: 3px;
	overflow: hidden;
	border: 3px solid #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}

.team-members-page .entry-content .team-card__avatar img {
	width: 100%;
	max-width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Text -------------------------------------------------------------- */

.team-card__name {
	margin: 0 0 .35em;
	font-size: 1.1em;
	line-height: 1.2;
}

.team-card__name a {
	color: #333;
	text-decoration: none;
}

.team-card__name a:hover {
	color: #e8850c;
}

.team-card__firstname,
.team-card__stat {
	margin: .15em 0;
	padding: 0;
	font-size: .9em;
	color: #555;
}

.team-card__stats {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: baseline;
	gap: 2px 14px;
	margin-top: .5em;
	padding-top: .5em;
	width: 100%;
	border-top: 1px solid #ececec;
}

.team-card__stats .team-card__stat {
	margin: 0;
}

.team-card__label {
	color: #999;
}

/* Role chips -------------------------------------------------------- */

.team-card__roles {
	list-style: none;
	margin: .6em 0 .7em;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
}

.team-card__role {
	background: #e8850c;
	color: #fff;
	font-size: .8em;
	line-height: 1;
	padding: 5px 10px;
	border-radius: 999px;
	white-space: nowrap;
}

.team-section--former .team-card__role {
	background: #9a9a9a;
}

.team-empty {
	color: #777;
	font-style: italic;
}

/* Biography (hover / focus reveal) --------------------------------- */

.team-card--has-bio {
	cursor: help;
}

.team-card__bio {
	position: absolute;
	inset: 0;
	z-index: 2;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	background: #f8f8f8;
	color: #313131;
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, visibility .2s ease;
	pointer-events: none;
}

.team-card__bio:focus {
	outline: none;
}

.team-card__bio-text {
	box-sizing: border-box;
	width: 100%;
	max-height: 100%;
	overflow-y: auto;
	padding: 18px 16px;
	font-size: .85em;
	line-height: 1.6;
	text-align: right;
	overflow-wrap: break-word;
	word-break: break-word;
}

.team-card__bio-text p {
	margin: 0 0 .7em;
}

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

.team-card:hover .team-card__bio,
.team-card:focus-within .team-card__bio {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.team-section--former .team-card__bio {
	background: #f3f3f3;
}

/* Touch devices have no hover: show the bio inline instead of as an overlay */
@media (hover: none) {
	.team-card__bio {
		position: static;
		display: block;
		z-index: auto;
		order: 2;
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		margin: 10px 0;
		border-radius: 6px;
		background: #eee;
		color: #555;
	}

	/* keep the stats block last, after the inline bio */
	.team-card__stats {
		order: 3;
	}

	.team-card__bio-text {
		max-height: none;
		overflow: visible;
		padding: 10px 12px;
		text-align: center;
	}

	.team-card--has-bio {
		cursor: default;
	}

	.team-section--former .team-card__bio {
		background: #e4e4e4;
	}
}

@media (max-width: 480px) {
	.team-grid {
		grid-template-columns: 1fr 1fr;
		gap: 12px;
	}

	.team-card {
		padding: 16px 10px 14px;
	}

	.team-card__avatar {
		width: 92px;
		height: 92px;
	}
}
