/* ==========================================================================
   ИАПП · mod_iapp_psychologists — карточки психологов
   Токены палитры берутся из user.css шаблона; в var() стоят запасные
   значения — модуль не поплывёт и на странице без шаблона.
   ========================================================================== */

.iapp-psy {
	--psy-navy: var(--iapp-navy-900, #14294a);
	--psy-text: var(--iapp-navy-700, #1e3e67);
	--psy-blue: var(--iapp-blue-500, #36609c);
	--psy-blue-600: var(--iapp-blue-600, #2a4e82);
	--psy-blue-300: var(--iapp-blue-300, #90bae4);
	--psy-blue-100: var(--iapp-blue-100, #e4edf7);
	--psy-blue-50: var(--iapp-blue-50, #f4f8fd);
	--psy-slate: var(--iapp-slate-500, #6b7a8c);
	--psy-line: var(--iapp-line, #d9e2ec);
	--psy-radius: 16px;
	--psy-gap: 24px;
}

.iapp-psy *,
.iapp-psy *::before,
.iapp-psy *::after { box-sizing: border-box; }

/* --- заголовок блока ------------------------------------------------------ */

.iapp-psy__head {
	max-width: 760px;
	margin: 0 auto 32px;
	text-align: center;
}

.iapp-psy__heading {
	margin: 0;
	color: var(--psy-navy);
	font-size: clamp(24px, 2.8vw, 36px);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -.01em;
	text-wrap: balance;
}

.iapp-psy__lead {
	max-width: 56ch;
	margin: 12px auto 0;
	color: var(--psy-slate);
	font-size: 17px;
	line-height: 1.6;
}

/* --- сетка ---------------------------------------------------------------- */

.iapp-psy__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: var(--psy-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.iapp-psy.cols-3 .iapp-psy__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.iapp-psy.cols-4 .iapp-psy__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 991.98px) {
	.iapp-psy.cols-3 .iapp-psy__grid,
	.iapp-psy.cols-4 .iapp-psy__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
	.iapp-psy.cols-3 .iapp-psy__grid,
	.iapp-psy.cols-4 .iapp-psy__grid,
	.iapp-psy.cols-auto .iapp-psy__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

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

.iapp-psy__card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin: 0;
	overflow: hidden;
	border: 1px solid var(--psy-line);
	border-radius: var(--psy-radius);
	background: #fff;
	box-shadow: 0 2px 12px rgba(20, 41, 74, .06);
	transition: transform .2s ease, box-shadow .2s ease;
}

.iapp-psy__card:hover {
	transform: translateY(-3px);
	box-shadow: 0 16px 32px rgba(20, 41, 74, .12);
}

.iapp-psy__photo {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: var(--psy-blue-100);
	text-decoration: none;
}

.iapp-psy__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;   /* лицо обычно в верхней части кадра */
	transition: transform .4s ease;
}

.iapp-psy__card:hover .iapp-psy__photo img { transform: scale(1.03); }

.iapp-psy__initials {
	color: var(--psy-blue-300);
	font-size: 48px;
	font-weight: 800;
	letter-spacing: .02em;
	user-select: none;
}

.iapp-psy__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 18px 20px 20px;
}

.iapp-psy__name {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

.iapp-psy__name a {
	color: var(--psy-navy);
	text-decoration: none;
}

.iapp-psy__name a:hover { color: var(--psy-blue); }

.iapp-psy__price {
	margin: 6px 0 0;
	color: var(--psy-blue);
	font-size: 17px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.iapp-psy__price-note {
	margin-left: 4px;
	color: var(--psy-slate);
	font-size: 14px;
	font-weight: 500;
}

.iapp-psy__spec {
	margin: 8px 0 0;
	color: var(--psy-slate);
	font-size: 14px;
	line-height: 1.5;
}

.iapp-psy__text {
	margin: 8px 0 0;
	color: var(--psy-text);
	font-size: 14px;
	line-height: 1.5;
}

.iapp-psy__more { margin: auto 0 0; padding-top: 16px; }

.iapp-psy__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 44px;
	padding: 8px 16px;
	border-radius: 8px;
	background: var(--psy-blue);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: background-color .2s ease;
}

.iapp-psy__btn:hover,
.iapp-psy__btn:focus-visible { background: var(--psy-blue-600); color: #fff; }

.iapp-psy__btn.is-ghost {
	width: auto;
	background: transparent;
	color: var(--psy-blue);
	box-shadow: inset 0 0 0 1.5px var(--psy-blue);
}

.iapp-psy__btn.is-ghost:hover { background: var(--psy-blue-100); color: var(--psy-blue-600); }

/* --- подсказка под сеткой ------------------------------------------------- */

.iapp-psy__help {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px 20px;
	margin: 32px 0 0;
	padding: 20px 24px;
	border-radius: var(--psy-radius);
	background: var(--psy-blue-50);
	color: var(--psy-navy);
	font-weight: 600;
	text-align: center;
}

.iapp-psy__empty {
	padding: 24px;
	border-radius: var(--psy-radius);
	background: var(--psy-blue-50);
	color: var(--psy-slate);
	text-align: center;
}

@media (max-width: 575.98px) {
	.iapp-psy__body { padding: 12px 12px 14px; }
	.iapp-psy__name { font-size: 16px; }
	.iapp-psy__price { font-size: 15px; }
	.iapp-psy__spec { font-size: 13px; }
	.iapp-psy__btn { padding-inline: 8px; font-size: 14px; }
	.iapp-psy__initials { font-size: 36px; }
}

@media (prefers-reduced-motion: reduce) {
	.iapp-psy__card,
	.iapp-psy__photo img { transition: none; }
}
