/* Estee — карточки мастеров + модалка. Парная логика в inc/estee-team.php */

:root {
	--estee: #9c3787;
	--estee-dark: #541f5c;
}

/* ---------- карточка ---------- */

/* Соотношение сторон держит КОНТЕЙНЕР, а не <img>.
   iOS Safari при aspect-ratio на самой картинке берёт высоту из HTML-атрибута
   height="960" и рендерит фото гигантским — поэтому фиксируем рамку на holder,
   а картинку растягиваем абсолютом: её intrinsic-размеры больше ни на что не влияют. */
.q_team .q_team_image_holder {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 5;
	overflow: hidden;
}

.q_team .q_team_image_holder img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
	object-position: center top;
}

/* «+» — единственный намёк, что карточка кликабельна */
.estee-card .q_team_image_holder::after {
	content: "+";
	position: absolute;
	right: 8px;
	bottom: 8px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--estee);
	color: #fff;
	font: 400 20px/30px Montserrat, sans-serif;
	text-align: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
	transition: transform .25s, background-color .25s;
}

.estee-card:hover .q_team_image_holder::after {
	transform: scale(1.12);
	background: var(--estee-dark);
}

.q_team .q_team_text_inner .separator {
	background-color: var(--estee);
}

/* страховка, если штатный вывод описания не вырезался */
.q_team .q_team_description_below_image_wrapper {
	display: none;
}

/* клик по всей карточке, но в таб-порядке — одна кнопка */
.estee-card {
	position: relative;
	padding-bottom: 30px;
}

.estee-hit {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.estee-hit__label {
	padding-bottom: 2px;
	border-bottom: 1px solid rgba(156, 55, 135, .35);
	color: var(--estee);
	font-size: 12px;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.estee-hit:focus-visible {
	outline: 2px solid var(--estee);
	outline-offset: 3px;
}

/* ---------- мобильная сетка: 2 карточки в ряд ---------- */

@media (max-width: 767px) {
	/* Колонки WPBakery лежат внутри .full_section_inner (обёртка ряда),
	   а НЕ напрямую в .vc_row-fluid — поэтому flex вешаем на неё. */
	.full_section_inner:has(.q_team) {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-start;
	}

	.full_section_inner:has(.q_team)::before,
	.full_section_inner:has(.q_team)::after {
		display: none;
	}

	.full_section_inner:has(.q_team) > .wpb_column {
		width: 50% !important;
		float: none !important;
		min-width: 0;   /* flex-элемент должен уметь сжиматься ниже intrinsic-ширины картинки */
	}

	/* в последнем ряду обеих страниц висит пустая колонка-заглушка */
	.full_section_inner:has(.q_team) > .wpb_column:not(:has(.q_team)) {
		display: none !important;
	}

	.full_section_inner:has(.q_team) > .wpb_column > .vc_column-inner {
		padding: 0 7px !important;
	}

	.estee-card .q_team_text {
		padding: 10px 2px 0 !important;
	}

	.q_team .q_team_title_holder .q_team_name {
		font-size: 15px !important;
		line-height: 1.3;
	}

	.q_team .q_team_title_holder span {
		display: block;
		font-size: 11px;
		line-height: 1.35;
	}
}

/* ---------- модалка ---------- */

.estee-modal {
	width: 100%;
	max-width: 100%;
	height: 100%;
	max-height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
}

.estee-modal::backdrop {
	background: rgba(28, 10, 30, .7);
}

.estee-modal:not([open]) {
	display: none;
}

.estee-modal[open] {
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.estee-modal__inner {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 660px;
	max-height: 92vh;
	max-height: 92dvh;
	overflow: hidden;
	background: #fff;
	border-radius: 18px 18px 0 0;
}

.estee-modal__close {
	position: absolute;
	top: 6px;
	right: 8px;
	z-index: 3;
	width: 44px;
	height: 44px;
	border: 0;
	background: none;
	color: #666;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
}

.estee-modal__scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 22px 20px;
}

.estee-modal__head {
	display: flex;
	gap: 14px;
	align-items: center;
	margin-bottom: 16px;
	padding-right: 40px;
}

.estee-modal__photo img {
	display: block;
	width: 74px;
	height: 74px;
	border-radius: 50%;
	object-fit: cover;
	object-position: center top;
}

.estee-modal__name {
	margin: 0 0 2px;
	color: var(--estee);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.25;
}

.estee-modal__role {
	margin: 0;
	color: #777;
	font-size: 13px;
}

.estee-modal__bio {
	color: #3c3c3c;
	font-size: 15px;
	line-height: 1.65;
}

.estee-modal__bio p {
	margin: 0 0 12px;
}

.estee-modal__bio ul {
	margin: 0 0 14px;
	padding: 0;
	list-style: none;
}

.estee-modal__bio li {
	position: relative;
	margin-bottom: 7px;
	padding-left: 22px;
}

.estee-modal__bio li::before {
	content: "";
	position: absolute;
	left: 2px;
	top: .62em;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--estee);
}

/* кнопка записи прибита к низу — текст длинный, до неё не доскроллят */
.estee-modal__foot {
	flex: 0 0 auto;
	padding: 13px 20px calc(13px + env(safe-area-inset-bottom, 0px));
	background: #fff;
	border-top: 1px solid #f0eaef;
}

.estee-book {
	display: block;
	padding: 16px;
	border-radius: 40px;
	background: linear-gradient(to right, var(--estee-dark), var(--estee));
	color: #fff !important;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .08em;
	text-align: center;
	text-decoration: none !important;
	text-transform: uppercase;
}

@media (min-width: 768px) {
	.estee-modal[open] {
		align-items: center;
		padding: 24px;
	}

	.estee-modal__inner {
		max-height: 86vh;
		border-radius: 10px;
	}

	.estee-modal__scroll {
		padding: 34px 40px;
	}

	.estee-modal__foot {
		text-align: center;
	}

	.estee-book {
		display: inline-block;
		min-width: 260px;
	}
}

/* iOS: без этого страница под окном уезжает */
html.estee-open,
html.estee-open body {
	overflow: hidden;
}

html.estee-open body {
	position: fixed;
	width: 100%;
}

@media (prefers-reduced-motion: reduce) {
	.estee-card .q_team_image_holder::after {
		transition: none;
	}
}
