/*
 * Блок «Команда» по макету Figma.
 *
 * Разметка своя (uc-team__*), исходные правила .specialists__* в style.css
 * не применяются — как и в шапке, откат делается одним файлом.
 */

.uc-team {
	overflow: visible;
}

.uc-team__inner {
	display: grid;
	grid-template-columns: 375px minmax(0, 1fr);
	column-gap: 164px;
	align-items: start;
	padding: 48px 0 60px;
}

/* -------------------------------------------------------------- фильтр -- */

.uc-team__title {
	font-size: 40px;
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.8px;
	color: #030815;
}

.uc-team__search {
	display: flex;
	align-items: center;
	gap: 16px;
	height: 41px;
	margin-top: 24px;
	padding: 0 16px;
	border-radius: 8px;
	background: #F8F7F8;
}

.uc-team__search-icon {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}

.uc-team__search-input {
	width: 100%;
	border: none;
	background: none;
	font-family: inherit;
	font-size: 15px;
	line-height: 22px;
	color: #030815;
}

.uc-team__search-input::placeholder {
	color: #9DA2AA;
}

.uc-team__tabs {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	margin-top: 42px;
}

.uc-team__tab {
	padding: 8px 16px;
	border-radius: 999px;
	background: #F8F7F8;
	font-size: 16px;
	line-height: 22px;
	color: #030815;
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}

.uc-team__tab:hover {
	background: #ECECEE;
}

.uc-team__tab--active,
.uc-team__tab--active:hover {
	background: #363C4A;
	color: #fff;
}

/* ------------------------------------------------------------ карточки -- */

.uc-team__panel {
	display: none;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 17px;
}

.uc-team__panel--active {
	display: grid;
}

.uc-team__card {
	position: relative;
	display: flex;
	flex-direction: column;
	border-radius: 20px;
	background: #F4F4F5;
	overflow: hidden;
}

.uc-team__card[hidden] {
	display: none;
}

.uc-team__photo {
	position: relative;
	/*
	 * Именно высота, а не пропорция: с aspect-ratio снимок тянулся вслед за
	 * шириной карточки, и на широком экране врач вставал почти во весь рост,
	 * а карточки в ряду выглядели разными. 265 px — столько отведено в макете.
	 */
	height: 265px;
	overflow: hidden;
	background: #E4E4E7;
}

.uc-team__photo-link {
	display: block;
	width: 100%;
	height: 100%;
}

/*
 * Снимок рисуется постоянной высотой, а не по ширине карточки. При
 * object-fit: cover масштаб зависел от ширины: на широком экране врач
 * оказывался крупнее и обрезался выше, на узком — мельче и почти в полный
 * рост. Теперь высота кадра фиксирована, а рамка обрезает лишнее по бокам,
 * поэтому врач везде одного размера и всегда срезан примерно по пояс.
 *
 * 520 px выбраны по снимкам: все они 3:4, значит ширина кадра выходит
 * 390 px — чуть больше самой широкой карточки (386), и пустых полей по
 * краям не появляется.
 */
.uc-team__photo-img {
	position: absolute;
	top: -40px;
	left: 50%;
	width: auto;
	height: 520px;
	max-width: none;
	transform: translateX(-50%);
	object-fit: cover;
}

.uc-team__rating {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 5px 10px;
	border-radius: 999px;
	background: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 18px;
	color: #16181D;
}

.uc-team__rating-star {
	color: #F5A623;
}

.uc-team__rating-count {
	font-weight: 400;
	color: #666B73;
}

.uc-team__play {
	position: absolute;
	right: 12px;
	bottom: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #16181D;
	cursor: pointer;
	transition: transform .2s ease;
}

.uc-team__play:hover {
	transform: scale(1.06);
}

.uc-team__play-icon {
	width: 0;
	height: 0;
	margin-left: 3px;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
	border-left: 10px solid #fff;
}

.uc-team__video-time {
	position: absolute;
	left: 12px;
	bottom: 12px;
	padding: 3px 9px;
	border-radius: 999px;
	background: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 15px;
	color: #16181D;
}

.uc-team__body {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	padding: 16px 17px 17px;
}

.uc-team__name {
	font-size: 17px;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: -0.17px;
	color: #16181D;
}

.uc-team__name-link {
	transition: color .2s ease;
}

.uc-team__name-link:hover {
	color: #5C616B;
}

.uc-team__position {
	margin-top: 4px;
	font-size: 14px;
	line-height: 1.4;
	color: #5C616B;
}

.uc-team__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 12px;
}

.uc-team__tag {
	padding: 5px 9px;
	border-radius: 999px;
	background: #fff;
	font-size: 13px;
	line-height: 18px;
	color: #3D424B;
}

.uc-team__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.uc-team__price,
.uc-team__duration {
	padding: 7px 12px;
	border-radius: 999px;
	font-size: 14px;
	line-height: 20px;
}

.uc-team__price {
	background: #E1F0FB;
	font-weight: 600;
	color: #16181D;
}

.uc-team__duration {
	background: #fff;
	color: #3D424B;
}

/* --------------------------------------------------------------- отзыв -- */

.uc-team__review {
	/* Свободное место карточки уходит сюда, поэтому отзывы в ряду
	   встают на один уровень независимо от числа плашек. */
	margin-top: auto;
	padding-top: 14px;
	padding: 12px 14px;
	border-radius: 14px;
	background: #fff;
}

.uc-team__review-head {
	display: flex;
	align-items: center;
	gap: 10px;
}

.uc-team__stars {
	font-size: 13px;
	line-height: 18px;
	color: #F5A623;
	letter-spacing: 1px;
}

.uc-team__review-source {
	font-size: 13px;
	line-height: 18px;
	color: #666B73;
}

.uc-team__review-text {
	margin-top: 10px;
	/* Три строки клампа — минимальная высота, иначе короткий отзыв
	   поднимает соседей по ряду. */
	min-height: 4.5em;
	font-size: 15px;
	line-height: 1.5;
	color: #3D424B;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.uc-team__review--open .uc-team__review-text {
	display: block;
	overflow: visible;
}

.uc-team__review-more {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
	padding: 0;
	border: none;
	background: none;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 19px;
	color: #16181D;
	cursor: pointer;
}

.uc-team__review-caret {
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid #9DA2AA;
	transition: transform .2s ease;
}

.uc-team__review-more[aria-expanded="true"] .uc-team__review-caret {
	transform: rotate(180deg);
}

/* ------------------------------------------------------------- кнопки -- */

.uc-team__actions {
	display: flex;
	gap: 12px;
	padding-top: 16px;
}

/* Без отзыва прижимать к низу нечего — эту роль берут кнопки. */
.uc-team__card--no-review .uc-team__actions {
	margin-top: auto;
}

.uc-team__book,
.uc-team__link {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 0;
	min-height: 44px;
	padding: 0 12px;
	border: none;
	border-radius: 14px;
	font-family: inherit;
	font-size: 15px;
	line-height: 21px;
	text-align: center;
	cursor: pointer;
	transition: background .2s ease;
}

.uc-team__book {
	background: #2B303C;
	font-weight: 500;
	color: #fff;
}

.uc-team__book:hover {
	background: #16181D;
}

.uc-team__link {
	background: #fff;
	color: #16181D;
}

.uc-team__link:hover {
	background: #ECECEE;
}

.uc-team__empty {
	grid-column: 1 / -1;
	padding: 24px 0;
	font-size: 15px;
	line-height: 1.5;
	color: #5C616B;
}

.uc-team__more {
	display: none;
}

/* ------------------------------------------------------- видео-модалка -- */

.uc-team-video[hidden] {
	display: none;
}

.uc-team-video {
	position: fixed;
	inset: 0;
	z-index: 120;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(22, 24, 29, .72);
}

.uc-team-video__frame {
	position: relative;
	width: min(96vw, 1040px);
	max-height: 88vh;
	border-radius: 20px;
	overflow: hidden;
	background: #000;
}

/* Пропорцию не навязываем: ролик может быть и горизонтальным, и вертикальным. */
.uc-team-video__frame video {
	display: block;
	width: 100%;
	height: auto;
	max-height: 88vh;
	margin: 0 auto;
}

.uc-team-video__frame iframe {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	max-height: 88vh;
	border: none;
}

.uc-team-video__close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, .9);
	font-size: 18px;
	color: #16181D;
	cursor: pointer;
}

/* ------------------------------------------------------------- экраны -- */

@media (max-width: 1440px) {
	.uc-team__inner {
		column-gap: 60px;
	}
}

@media (max-width: 1240px) {
	.uc-team__panel {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.uc-team__title {
		font-size: 32px;
	}
}

@media (max-width: 1024px) {
	.uc-team__inner {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 32px;
		padding: 32px 0 40px;
	}

	.uc-team__tabs {
		flex-direction: row;
		flex-wrap: wrap;
		margin-top: 20px;
	}

	.uc-team__search {
		margin-top: 20px;
	}
}

@media (max-width: 768px) {
	.uc-team__inner {
		padding: 24px 0 32px;
		row-gap: 20px;
	}

	.uc-team__title {
		font-size: 26px;
		letter-spacing: -0.5px;
	}

	/* Вкладки уезжают в горизонтальную прокрутку, как в макете. */
	.uc-team__tabs {
		flex-wrap: nowrap;
		gap: 8px;
		margin: 16px -16px 0;
		padding: 0 16px;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.uc-team__tabs::-webkit-scrollbar {
		display: none;
	}

	.uc-team__tab {
		flex: 0 0 auto;
		padding: 10px 16px;
		font-size: 15px;
	}

	.uc-team__panel {
		grid-template-columns: minmax(0, 1fr);
		gap: 22px;
	}

	/* Композиция горизонтальная: фото слева, данные справа. */
	.uc-team__card {
		display: grid;
		grid-template-columns: 118px minmax(0, 1fr);
		column-gap: 14px;
		padding: 14px;
		border-radius: 20px;
	}

	/* Тело карточки раскрываем в сетку самой карточки: тогда цена, отзыв
	   и кнопки встают во всю ширину под фото, как в макете. */
	.uc-team__body {
		display: contents;
	}

	.uc-team__rating {
		position: static;
		grid-column: 2;
		justify-self: start;
		margin-bottom: 8px;
	}

	/* На узком экране карточка горизонтальная, у снимка своя пропорция —
	   возвращаем обычное поведение. */
	.uc-team__photo-img {
		position: static;
		top: auto;
		left: auto;
		width: 100%;
		height: 100%;
		transform: none;
	}

	.uc-team__photo {
		grid-row: 1 / span 3;
		align-self: start;
		height: auto;
		aspect-ratio: 118 / 163;
		border-radius: 16px;
		overflow: hidden;
	}

	.uc-team__name,
	.uc-team__position {
		grid-column: 2;
	}

	/* Плашки уходят под фото во всю ширину: в колонке справа они вставали
	   по одной в строку и оставляли пустое место сбоку от снимка. */
	.uc-team__tags {
		grid-column: 1 / -1;
	}

	.uc-team__name {
		align-self: start;
	}

	.uc-team__meta,
	.uc-team__review,
	.uc-team__actions,
	.uc-team__empty,
	.uc-team__more {
		grid-column: 1 / -1;
	}

	.uc-team__play {
		right: auto;
		right: 10%;
		bottom: 5px;
		width: 24px;
		height: 24px;
		transform: translateX(6px);
	}

	.uc-team__play-icon {
		margin-left: 2px;
		border-top-width: 4px;
		border-bottom-width: 4px;
		border-left-width: 7px;
	}

	.uc-team__video-time {
		left: 8px;
		bottom: 8px;
		padding: 2px 8px;
	}

	.uc-team__tags {
		margin-top: 10px;
	}

	.uc-team__meta {
		margin-top: 14px;
	}

	.uc-team__price,
	.uc-team__duration {
		padding: 9px 13px;
		font-size: 15px;
	}

	.uc-team__review {
		margin-top: 12px;
		padding: 14px;
	}

	.uc-team__actions {
		gap: 14px;
		padding-top: 14px;
	}

	.uc-team__book,
	.uc-team__link {
		min-height: 52px;
		border-radius: 15px;
	}

	.uc-team-video {
		padding: 12px;
	}

	/* Показываем первые карточки, остальные — по кнопке. */
	.uc-team__more {
		display: block;
		width: 100%;
		min-height: 52px;
		margin-top: 4px;
		border: none;
		border-radius: 15px;
		background: #F4F4F5;
		font-family: inherit;
		font-size: 15px;
		font-weight: 500;
		color: #16181D;
		cursor: pointer;
	}

	.uc-team__more[hidden] {
		display: none;
	}
}
