/* ==========================================================================
   ИАПП · psy-page.css
   Анкета психолога (макет html/com_content/article/teacher.php).
   Токены — из user.css шаблона, в var() — запасные значения.
   ========================================================================== */

.psy-page {
	--p-navy:     var(--iapp-navy-900, #14294a);
	--p-navy-700: var(--iapp-navy-700, #1e3e67);
	--p-blue:     var(--iapp-blue-500, #36609c);
	--p-blue-300: var(--iapp-blue-300, #90bae4);
	--p-blue-100: var(--iapp-blue-100, #e4edf7);
	--p-panel:    #eef4fb;
	--p-slate:    var(--iapp-slate-500, #6b7a8c);
	--p-line:     var(--iapp-line, #d9e2ec);

	max-width: 1180px;
	margin: 0 0 64px;
	color: var(--p-navy);
}

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

.psy-ico { width: 18px; height: 18px; flex: none; }

/* MAX — запасной вариант, если нет «Max colored.svg»: белый images/max.svg на фиолетовом кружке */
.psy-ico--max {
	display: inline-grid;
	place-items: center;
	border-radius: 50%;
	background: #9500ff;
}

/* ВК и MAX: логотипы сайта (images/vk.svg, «images/Max colored.svg») уже со своим
   фоном — без подложки, во весь размер значка */
.psy-ico--vk,
.psy-ico--logo { display: inline-grid; place-items: center; }

.psy-ico--vk img,
.psy-ico--vk svg,
.psy-ico--logo svg { display: block; width: 100%; height: 100%; }

.psy-ico--max img,
.psy-ico--max svg {
	display: block;
	width: 58%;          /* размер логотипа внутри кружка */
	height: 58%;
	overflow: visible;
}

/* --- шапка ---------------------------------------------------------------- */

.psy-hero {
	display: grid;
	grid-template-columns: 340px minmax(0, 1fr);
	gap: 44px;
	align-items: start;
	padding: 8px 0 36px;
}

.psy-hero__photo {
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 5;
	border-radius: 28px;
	background: var(--p-blue-100);
}

.psy-hero__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 25%;
}

.psy-hero__initials {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: var(--p-blue-300);
	font-size: 96px;
	font-weight: 800;
}

.psy-hero__main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.psy-hero__kicker {
	margin: 0;
	color: var(--p-blue);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.psy-page .psy-hero__name {
	margin: 0;
	color: var(--p-navy);
	font-size: clamp(30px, 3.6vw, 46px);
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -.02em;
}

.psy-hero__specialty {
	max-width: 62ch;
	margin: 0;
	color: var(--p-navy-700);
	font-size: 18px;
	line-height: 1.5;
}

.psy-facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 10px;
	margin: 4px 0 0;
}

.psy-facts > div {
	padding: 12px 16px;
	border-radius: 14px;
	background: var(--p-panel);
}

.psy-facts dt {
	margin: 0 0 2px;
	color: var(--p-slate);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.psy-facts dd { margin: 0; color: var(--p-navy); font-size: 15px; font-weight: 600; line-height: 1.4; }

.psy-hero__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 24px;
	margin-top: 6px;
	padding-top: 18px;
	border-top: 1px solid var(--p-line);
}

.psy-price { display: flex; flex-direction: column; margin: 0; }
.psy-price__label { color: var(--p-slate); font-size: 13px; }
.psy-price__value { font-size: 28px; font-weight: 800; line-height: 1.2; }
.psy-price__note { color: var(--p-navy-700); font-size: 14px; }

.psy-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 0 auto; }

.psy-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 50px;
	padding: 10px 22px;
	border: 1.5px solid transparent;
	border-radius: 12px;
	font-size: 16px;
	font-weight: 700;
	text-decoration: none;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.psy-page .psy-btn.is-primary { background: var(--p-blue); color: #fff; }
.psy-page .psy-btn.is-primary:hover { background: var(--p-navy-700); color: #fff; }
.psy-page .psy-btn.is-ghost { border-color: var(--p-line); background: #fff; color: var(--p-navy); }
.psy-page .psy-btn.is-ghost:hover { border-color: var(--p-blue-300); background: var(--p-blue-100); }
.psy-btn:focus-visible { outline: 3px solid var(--p-blue-300); outline-offset: 2px; }

/* --- навигация по разделам ------------------------------------------------ */

.psy-nav {
	position: sticky;
	z-index: 5;
	top: 0;
	margin: 0 0 8px;
	padding: 10px 0;
	border-bottom: 1px solid var(--p-line);
	background: rgba(255, 255, 255, .94);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.psy-nav ul {
	display: flex;
	gap: 6px;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	list-style: none;
	scrollbar-width: none;
}

.psy-nav ul::-webkit-scrollbar { display: none; }

.psy-page .psy-nav a {
	display: block;
	padding: 8px 14px;
	border-radius: 999px;
	color: var(--p-navy-700);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.psy-page .psy-nav a:hover { background: var(--p-blue-100); }
.psy-page .psy-nav a.is-active { background: var(--p-navy); color: #fff; }
.psy-page .psy-link,
.psy-page .psy-chip,
.psy-page .psy-btn,
.psy-page .psy-cert { text-decoration: none; }

/* --- разделы ---------------------------------------------------------------- */

.psy-body { display: flex; flex-direction: column; }

.psy-sec {
	padding: 36px 0;
	border-bottom: 1px solid var(--p-line);
	scroll-margin-top: 80px;
}

.psy-sec:last-child { border-bottom: 0; }

.psy-page .psy-sec__title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 18px;
	color: var(--p-navy);
	font-size: 26px;
	font-weight: 800;
	line-height: 1.2;
}

.psy-sec__count {
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--p-blue-100);
	color: var(--p-navy-700);
	font-size: 15px;
}

.psy-text {
	max-width: 80ch;
	color: var(--p-navy);
	font-size: 17px;
	line-height: 1.65;
}

.psy-text > :first-child { margin-top: 0; }
.psy-text > :last-child { margin-bottom: 0; }
.psy-text p { margin: 0 0 14px; }
.psy-text ul { margin: 0 0 16px; padding-left: 22px; }
.psy-text li { margin-bottom: 6px; }

.psy-page .psy-text h2 {
	margin: 32px 0 14px;
	color: var(--p-navy);
	font-size: 22px;
	font-weight: 800;
}

.psy-page .psy-text h3 {
	margin: 22px 0 10px;
	color: var(--p-navy);
	font-size: 18px;
	font-weight: 700;
}

/* О себе — крупнее, с акцентной линией */
.psy-about .psy-text {
	padding-left: 22px;
	border-left: 3px solid var(--p-blue-300);
	font-size: 18px;
}

/* запросы: список-галочки в две колонки */
.psy-page .psy-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 10px 24px;
	max-width: none;
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

.psy-requests .psy-text { max-width: none; }

.psy-list li {
	position: relative;
	margin: 0;
	padding: 2px 0 2px 32px;
	font-size: 16px;
	line-height: 1.5;
}

.psy-list li::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 0;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--p-blue-100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%2336609c' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.psy-list__note { display: block; color: var(--p-slate); font-size: 14px; }

/* группы запросов — карточки */
.psy-groups {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 16px;
	margin: 0 0 16px;
}

.psy-group {
	padding: 20px 22px;
	border: 1px solid var(--p-line);
	border-radius: 18px;
	background: #fff;
}

.psy-page .psy-group h3 { margin: 0 0 12px; font-size: 17px; line-height: 1.35; }
.psy-group .psy-list { grid-template-columns: 1fr; gap: 8px; margin: 0; }
.psy-group .psy-list li { font-size: 15px; }

.psy-page .psy-quotes { margin: 0; padding: 0; list-style: none; }

.psy-quotes li {
	margin: 0 0 6px;
	padding: 8px 12px;
	border-radius: 10px;
	background: var(--p-panel);
	color: var(--p-navy-700);
	font-size: 15px;
	font-style: italic;
	line-height: 1.45;
}

/* терапия — светлая подложка */
.psy-therapy__main {
	max-width: 86ch;
	padding: 24px 28px;
	border-radius: 20px;
	background: var(--p-panel);
}

.psy-extra { margin-top: 8px; }

/* образование — лента с годами */
.psy-education .psy-text { max-width: 96ch; }

.psy-page .psy-edu { margin: 0 0 18px; padding: 0; list-style: none; }

.psy-edu li {
	display: grid;
	grid-template-columns: 112px minmax(0, 1fr);
	gap: 16px;
	margin: 0;
	padding: 12px 0;
	border-bottom: 1px dashed var(--p-line);
	font-size: 16px;
	line-height: 1.5;
}

.psy-edu li:last-child { border-bottom: 0; }

.psy-edu__year {
	align-self: start;
	justify-self: start;
	padding: 2px 10px;
	border-radius: 8px;
	background: var(--p-blue-100);
	color: var(--p-navy);
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
}

.psy-edu__text { grid-column: 2; }

.psy-page li.is-more,
.psy-page .psy-text > .is-more { display: none; }
.psy-page .is-open .psy-text > .is-more { display: block; }
.psy-page .is-open li.is-more { display: grid; }
.psy-page .psy-certs.is-open li.is-more { display: block; }

.psy-more {
	margin-top: 8px;
	padding: 10px 18px;
	border: 1.5px solid var(--p-blue-300);
	border-radius: 10px;
	background: #fff;
	color: var(--p-navy);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

.psy-more:hover { background: var(--p-blue-100); }

/* дипломы */
.psy-certs__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.psy-certs__grid li { margin: 0; }

.psy-cert {
	display: block;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	border: 1px solid var(--p-line);
	border-radius: 14px;
	background: var(--p-panel);
	transition: transform .15s ease, box-shadow .15s ease;
}

.psy-cert img { display: block; width: 100%; height: 100%; object-fit: cover; }
.psy-cert:hover { box-shadow: 0 10px 24px rgba(20, 41, 74, .14); transform: translateY(-2px); }
.psy-cert:focus-visible { outline: 3px solid var(--p-blue-300); outline-offset: 2px; }
.psy-cert__title { display: block; margin-top: 6px; color: var(--p-navy-700); font-size: 13px; line-height: 1.35; }

/* программы */
.psy-programs__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.psy-prog {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 18px 20px;
	border: 1px solid var(--p-line);
	border-radius: 16px;
	background: #fff;
}

.psy-prog:hover { border-color: var(--p-blue-300); box-shadow: 0 8px 20px rgba(20, 41, 74, .08); }
.psy-prog__kind { color: var(--p-blue); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

.psy-page .psy-prog__title { color: var(--p-navy); font-size: 17px; font-weight: 700; line-height: 1.35; text-decoration: none; }
.psy-prog__title::after { content: ""; position: absolute; inset: 0; }

.psy-prog__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--p-navy-700); font-size: 14px; }
.psy-prog__status { font-weight: 600; }
.psy-prog.is-open .psy-prog__status,
.psy-prog.is-join .psy-prog__status { color: #1d7a45; }
.psy-prog.is-going .psy-prog__status { color: #9a5b12; }
.psy-prog.is-done .psy-prog__status,
.psy-prog.is-record .psy-prog__status { color: var(--p-slate); }

/* форма записи */
.psy-form { padding: 32px; border: 0; border-radius: 20px; background: var(--p-blue-100); }

/* контакты */
.psy-contacts__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 14px;
	margin-bottom: 16px;
}

.psy-contact {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 18px 20px;
	border-radius: 18px;
	background: var(--p-panel);
}

.psy-contact__label { display: inline-flex; align-items: center; gap: 8px; color: var(--p-slate); font-size: 14px; }

.psy-page .psy-contact__value {
	color: var(--p-navy);
	font-size: 22px;
	font-weight: 800;
	letter-spacing: .01em;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.psy-page .psy-contact__value:hover { color: var(--p-blue); }

.psy-contact__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.psy-contact__hint { color: var(--p-slate); font-size: 13px; }

.psy-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 6px 12px;
	border: 1px solid var(--p-line);
	border-radius: 999px;
	background: #fff;
	color: var(--p-navy);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.psy-page a.psy-chip { color: var(--p-navy); }
.psy-chip .psy-ico { width: 16px; height: 16px; }
.psy-chip:hover { border-color: var(--p-blue-300); background: var(--p-blue-100); }
.psy-chip.is-tg .psy-ico { color: #229ed9; }
.psy-chip.is-wa .psy-ico { color: #25d366; }

.psy-chip.is-done { border-color: #1d7a45; background: #e6f4ec; color: #1d7a45; }

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

.psy-links li { margin: 0; }

.psy-page .psy-link {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 100%;
	padding: 12px 16px;
	border: 1px solid var(--p-line);
	border-radius: 14px;
	background: #fff;
	color: var(--p-navy);
	text-decoration: none;
}

.psy-page .psy-link:hover { border-color: var(--p-blue-300); background: var(--p-panel); }
.psy-link .psy-ico { width: 22px; height: 22px; color: var(--p-blue); }
.psy-link.is-vk .psy-ico { color: #0077ff; }
.psy-link.is-telegram .psy-ico { color: #229ed9; }

.psy-link span:not(.psy-ico) { display: flex; flex-direction: column; min-width: 0; }
.psy-link b { font-size: 15px; line-height: 1.3; }
.psy-link small { overflow: hidden; color: var(--p-slate); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.psy-page .psy-link.is-card { border-color: #0077ff33; background: #f2f7ff; }

.psy-contacts__note {
	margin: 0;
	padding: 12px 16px;
	border-left: 3px solid var(--p-blue-300);
	color: var(--p-navy-700);
	font-size: 15px;
}

/* всплывающее «Номер скопирован» */
.psy-toast {
	position: fixed;
	z-index: 2000;
	left: 50%;
	bottom: 24px;
	max-width: calc(100vw - 32px);
	padding: 12px 18px;
	border-radius: 12px;
	background: var(--p-navy);
	box-shadow: 0 10px 30px rgba(20, 41, 74, .3);
	color: #fff;
	font-size: 15px;
	opacity: 0;
	transform: translate(-50%, 10px);
	transition: opacity .2s ease, transform .2s ease;
}

.psy-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* --- просмотр дипломов (окно создаётся скриптом вне .psy-page) ------------ */

.psy-lightbox {
	width: 100vw;
	max-width: none;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(12, 22, 40, .94);
	color: #fff;
}

.psy-lightbox[open] { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center; }
.psy-lightbox::backdrop { background: rgba(12, 22, 40, .6); }

.psy-lightbox__fig {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	height: 100dvh;
	margin: 0;
	padding: 56px 0 48px;
}

.psy-lightbox__fig img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 6px;
	background: #fff;
	transition: opacity .15s ease;
}

.psy-lightbox__fig img.is-loading { opacity: .4; }
.psy-lightbox__fig figcaption { font-size: 15px; text-align: center; }

.psy-lightbox__nav,
.psy-lightbox__close {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	font-size: 34px;
	line-height: 1;
	cursor: pointer;
	justify-self: center;
}

.psy-lightbox__nav:hover,
.psy-lightbox__close:hover { background: rgba(255, 255, 255, .25); }
.psy-lightbox__close { position: absolute; top: 12px; right: 12px; font-size: 30px; }
.psy-lightbox__count { position: absolute; top: 22px; left: 50%; font-size: 14px; opacity: .8; transform: translateX(-50%); }
.psy-lightbox.is-single .psy-lightbox__nav { visibility: hidden; }

/* --- адаптив -------------------------------------------------------------- */

@media (max-width: 991.98px) {
	.psy-hero { grid-template-columns: 240px minmax(0, 1fr); gap: 28px; }
	.psy-hero__actions { margin-left: 0; }
}

@media (max-width: 767.98px) {
	.psy-hero { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.psy-hero__photo { width: min(320px, 100%); margin: 0 auto; }
	.psy-hero__name,
	.psy-hero__kicker { text-align: center; }
	.psy-hero__specialty { text-align: center; font-size: 16px; }
	.psy-hero__bottom { flex-direction: column; align-items: stretch; }
	.psy-hero__actions { flex-direction: column; }
	.psy-sec { padding: 28px 0; }
	.psy-page .psy-sec__title { font-size: 22px; }
	.psy-text,
	.psy-about .psy-text { font-size: 16px; }
	.psy-therapy__main { padding: 18px; }
	.psy-edu li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
	.psy-edu__text { grid-column: 1; }
	.psy-certs__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.psy-lightbox[open] { grid-template-columns: 0 minmax(0, 1fr) 0; }
	.psy-lightbox__nav { position: absolute; bottom: 12px; }
	.psy-lightbox__nav.is-prev { left: 25%; }
	.psy-lightbox__nav.is-next { right: 25%; }
	.psy-lightbox__fig { padding: 56px 8px 76px; }
}

@media (prefers-reduced-motion: reduce) {
	.psy-page *,
	.psy-toast { transition: none !important; }
}

html.a11y-on .psy-nav { position: static; }
