/* ==========================================================================
   «Спасибо, Доктор!» — внутренние страницы
   Та же система, что на главной (токены — в main.css): шапка страницы на «бумаге»
   с фрагментом спасательного круга или фото в кольце, текст с карточкой записи сбоку,
   карточки разделов, прейскурант, призыв на тёмно-синем.
   ========================================================================== */

:root {
	--section-sm: clamp(3rem, 2.25rem + 2.6vw, 4.5rem); /* ритм внутри страниц — плотнее главной */
	--measure: 46rem;                                    /* ширина колонки текста */
}

/* ---------- Шапка страницы ---------- */
.phead {
	position: relative; overflow: hidden; isolation: isolate;
	padding-block: var(--sp-5) var(--sp-9);
	background: var(--paper);
}
.phead--tight { padding-bottom: var(--sp-8); }
/* Фрагмент спасательного круга уходит за правый край — тот же знак, что в логотипе */
.phead__ring {
	position: absolute; z-index: -1; right: -9rem; top: 50%;
	width: clamp(20rem, 12rem + 22vw, 34rem);
	transform: translateY(-46%) rotate(-14deg);
	--mark-line: var(--navy);
	opacity: .16; /* водяной знак: не спорит с заголовком */
	animation: phead-ring 1.4s var(--ease) both;
}
@keyframes phead-ring { from { opacity: 0; transform: translateY(-46%) rotate(-60deg) scale(.92); } }

.crumbs { margin-bottom: var(--sp-7); font-size: var(--fs-xs); color: var(--muted); }
.crumbs__list { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); }
.crumbs__item { display: inline-flex; align-items: center; gap: var(--sp-2); }
.crumbs__item + .crumbs__item::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }
.crumbs a { text-decoration: none; transition: color var(--t-fast); }
.crumbs a:hover { color: var(--navy); }
.crumbs [aria-current] { color: var(--ink); }

.phead__grid { display: grid; gap: var(--sp-7); align-items: center; }
.phead__text { max-width: 48rem; }
.phead__title {
	font-size: clamp(2rem, 1.35rem + 2.5vw, 3.5rem); font-weight: 800; line-height: 1.04; letter-spacing: -.035em;
	max-width: 22ch;
}
.phead--article .phead__title { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.75rem); max-width: 30ch; }
.phead__role { margin-top: var(--sp-3); font-size: var(--fs-l); font-weight: 500; color: var(--navy); }
.phead__date { margin-top: var(--sp-4); font-size: var(--fs-s); color: var(--muted); }
.phead__lead { margin-top: var(--sp-5); max-width: 40rem; font-size: var(--fs-l); line-height: 1.5; color: var(--muted); }
.phead__lead > * + * { margin-top: var(--sp-3); }
.phead__lead a { color: var(--navy); font-weight: 600; text-decoration: none; white-space: nowrap; }
.phead__lead a:hover { color: var(--red-ink); }
.phead__facts {
	display: flex; flex-wrap: wrap; gap: var(--sp-5) var(--sp-8);
	margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--line-strong);
}
.phead__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-6); }
.phead__media { justify-self: center; }

.kfact { display: grid; gap: var(--sp-1); align-content: start; }
.kfact__label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kfact__value { font-size: var(--fs-l); font-weight: 800; line-height: 1.25; color: var(--navy); font-variant-numeric: tabular-nums; }
.kfact__value small { font-size: var(--fs-s); font-weight: 500; color: var(--muted); }
.kfact__value a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: .2em; }
.kfact__value--faces { display: flex; align-items: center; gap: var(--sp-3); }
.kfact__names { font-size: var(--fs-s); font-weight: 600; line-height: 1.35; }
.kfact .face { width: 2.25rem; height: 2.25rem; box-shadow: 0 0 0 2px var(--paper); }
.faces .face__img { transform: scale(calc(var(--zoom, 1) * 1.35)); }

/* Подразделы — ряд «чипов» под шапкой */
.subnav { margin-top: var(--sp-7); }
.subnav__list {
	display: flex; gap: var(--sp-2);
	margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter);
	overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.subnav__list::-webkit-scrollbar { display: none; }
.subnav__link {
	display: inline-flex; align-items: center; gap: var(--sp-2);
	min-height: var(--control-s); padding: 0 var(--sp-4);
	border-radius: var(--r-pill); background: var(--white); box-shadow: inset 0 0 0 1px var(--line);
	font-size: var(--fs-s); font-weight: 500; color: var(--navy); text-decoration: none; white-space: nowrap;
	transition: box-shadow var(--t-fast), background-color var(--t-fast), color var(--t-fast);
}
.subnav__link:hover { box-shadow: inset 0 0 0 1.5px var(--navy); }
.subnav__link.is-current { background: var(--navy); color: #fff; box-shadow: none; }
.subnav__count { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.subnav__link.is-current .subnav__count { color: rgb(255 255 255 / .65); }
.subnav--inline { margin: 0 0 var(--sp-6); }

@media (min-width: 64rem) {
	.phead { padding-block: var(--sp-6) var(--sp-10); }
	.phead--tight { padding-bottom: var(--sp-9); }
	.phead--media .phead__grid { grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-9); }
	.phead--media .phead__media { margin-block: calc(var(--sp-6) * -1) calc(var(--sp-7) * -1); }
}
@media (max-width: 63.99rem) {
	.phead--media .phead__media { order: -1; justify-self: start; }
}
@media (max-width: 47.99rem) {
	.phead { padding-bottom: var(--sp-8); }
	.phead__ring { width: 13rem; right: -5.5rem; top: -3.5rem; transform: rotate(-14deg); animation: none; }
	.crumbs { margin-bottom: var(--sp-5); padding-right: 6rem; }
	.phead__actions .btn { flex: 1 1 auto; }
	.phead__facts { gap: var(--sp-4) var(--sp-6); }
}

/* ---------- Фото в спасательном круге (как на первом экране главной) ---------- */
.buoy { position: relative; display: block; aspect-ratio: 1; }
.buoy__photo { position: absolute; inset: 18.1%; border-radius: 50%; overflow: hidden; background: var(--mist); }
.buoy__img {
	position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
	transform: scale(var(--zoom, 1)); transition: transform var(--t-slow) var(--ease);
}
.buoy__ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 18px 30px rgb(21 23 63 / .18)); }
.buoy__spin { transform-origin: 200px 200px; animation: buoy-spin 80s linear infinite; }
.buoy__line { fill: none; stroke: var(--navy); stroke-opacity: .16; stroke-width: 1.5; }
.buoy__cap { font-family: var(--font); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; fill: var(--muted); }
.phead__buoy { width: clamp(15rem, 9rem + 15vw, 25rem); animation: buoy-in 1.1s var(--ease) both; }
.phead__buoy--doctor { width: clamp(16rem, 9rem + 17vw, 27rem); }
@keyframes buoy-in { from { opacity: 0; transform: scale(.9) rotate(-30deg); } }
@media (max-width: 63.99rem) { .phead__buoy, .phead__buoy--doctor { width: min(15rem, 62vw); } }

/* Фото товара (БАДы) */
.product-shot {
	position: relative; display: grid; place-items: center;
	width: clamp(15rem, 10rem + 14vw, 24rem); aspect-ratio: 1;
	border-radius: var(--r-l); background: #fff; box-shadow: var(--shadow-2);
	animation: buoy-in .9s var(--ease) both; cursor: zoom-in;
}
.product-shot__img { width: 80%; height: 80%; object-fit: contain; transition: transform var(--t-slow) var(--ease); }
.product-shot:hover .product-shot__img { transform: scale(1.04); }
@media (max-width: 63.99rem) { .product-shot { width: min(14rem, 60vw); } }

/* ---------- Раскладка «текст + карточка сбоку» ---------- */
.page-body { padding-block: var(--section-sm); }
.layout { display: grid; gap: var(--sp-8); padding-block: var(--section-sm); }
.layout__main { min-width: 0; max-width: var(--measure); }
.layout__title { margin-bottom: var(--sp-5); font-size: var(--fs-xl); }
.layout__aside { min-width: 0; }
.aside-sticky { display: grid; gap: var(--sp-5); }
@media (min-width: 64rem) {
	.layout { grid-template-columns: minmax(0, 1fr) 20rem; gap: var(--sp-9); }
	.layout--aside-only { grid-template-columns: minmax(0, 26rem); }
	.aside-sticky { position: sticky; top: calc(var(--header-h) + var(--sp-5)); }
}
@media (min-width: 80rem) { .layout { grid-template-columns: minmax(0, 1fr) 22rem; gap: var(--sp-10); } }

/* Карточка записи */
.bcard {
	display: grid; gap: var(--sp-4);
	padding: var(--sp-6); border-radius: var(--r-l);
	background: var(--navy); color: rgb(255 255 255 / .78);
}
.bcard__kicker { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #ff9ea2; }
.bcard__text { font-size: var(--fs-s); }
.bcard__prices { display: grid; }
.bcard__prices li { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); padding-block: var(--sp-3); border-bottom: 1px solid rgb(255 255 255 / .12); font-size: var(--fs-s); line-height: 1.4; }
.bcard__prices li:first-child { padding-top: 0; }
.bcard__prices strong { color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bcard .more { color: #fff; }
.bcard .btn--primary { box-shadow: none; }
.bcard__phone { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); font-size: var(--fs-l); font-weight: 700; color: #fff; text-decoration: none; transition: color var(--t-fast); }
.bcard__phone .icon { color: #ff9ea2; }
.bcard__phone:hover { color: #ffd6d8; }
.bcard__status { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 1.5em; font-size: var(--fs-xs); color: rgb(255 255 255 / .6); text-align: center; }

/* Оглавление */
.toc { padding: var(--sp-5); border-radius: var(--r-l); background: var(--paper); }
.toc__title { margin-bottom: var(--sp-2); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.toc__list { display: grid; gap: 2px; }
.toc__list a {
	position: relative; display: block; padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-5);
	border-radius: var(--r-s); font-size: var(--fs-s); line-height: 1.35; color: var(--ink); text-decoration: none;
	transition: background-color var(--t-fast), color var(--t-fast);
}
.toc__list a::before {
	content: ""; position: absolute; left: var(--sp-2); top: .95em; width: 6px; height: 6px; border-radius: 50%;
	background: var(--line-strong); transition: background-color var(--t-fast), transform var(--t) var(--ease);
}
.toc__list a:hover { background: #fff; color: var(--navy); }
.toc__list a.is-active { background: #fff; color: var(--navy); font-weight: 600; }
.toc__list a.is-active::before { background: var(--red); transform: scale(1.35); }
@media (max-width: 63.99rem) { .toc { display: none; } }

/* Услуги врача */
.svc-list { padding: var(--sp-5) var(--sp-5) var(--sp-3); border-radius: var(--r-l); background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.svc-list__title { margin-bottom: var(--sp-2); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.svc-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--sp-3); padding-block: var(--sp-3); border-top: 1px solid var(--line); text-decoration: none; }
.svc-list li:first-child a { border-top: 0; }
.svc-list__name { font-weight: 600; color: var(--navy); line-height: 1.35; transition: color var(--t-fast); }
.svc-list__price { font-size: var(--fs-s); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.svc-list__go { width: 1rem; height: 1rem; color: var(--steel); transition: transform var(--t) var(--ease), color var(--t-fast); }
.svc-list a:hover .svc-list__name { color: var(--red-ink); }
.svc-list a:hover .svc-list__go { color: var(--red); transform: translateX(3px); }

/* Инструкция к БАДу */
.instr { padding: var(--sp-5); border-radius: var(--r-l); background: var(--paper); }
.instr__title { margin-bottom: var(--sp-2); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.instr__row { padding-block: var(--sp-3); border-top: 1px solid var(--line); }
.instr__row:first-child { border-top: 0; }
.instr dt { display: flex; align-items: center; gap: var(--sp-2); font-weight: 700; color: var(--navy); }
.instr dt .icon { width: 1.125rem; height: 1.125rem; color: var(--red); }
.instr dd { margin-top: var(--sp-1); font-size: var(--fs-s); line-height: 1.5; }
.aside-warn { font-size: var(--fs-xs); line-height: 1.5; color: var(--muted); }

/* ---------- Текст из редактора на внутренних страницах ---------- */
.prose--page > *, .prose--article > * { max-width: var(--measure); }
/* Широкие блоки занимают всю ширину контейнера */
.prose--page > :is(.not-prose, .wp-block-gallery, .wp-block-table, .wp-block-columns, .wp-block-media-text, .embed-frame, .wp-block-embed, .wp-block-video, .wp-block-query) { max-width: none; }
.prose--page > .wp-block-heading:not(:first-child) { margin-top: var(--sp-9); }
.prose--page > .not-prose { margin-top: var(--sp-6); }
.prose--page > .not-prose + * { margin-top: var(--sp-8); }
.layout__main.prose > h2:not(:first-child), .prose--article > h2:not(:first-child) { margin-top: var(--sp-8); }
.layout__main.prose h2, .prose--page h2, .prose--article h2 { font-size: clamp(1.5rem, 1.25rem + .9vw, 2rem); }
.prose > :first-child { margin-top: 0; }
.prose strong { font-weight: 700; color: var(--navy); }
.prose h4:not(:where(.not-prose *)) { color: var(--navy); }
.prose h2[id] { scroll-margin-top: calc(var(--header-h) + var(--sp-5)); }

/* Абзацы с ролью */
.prose .is-lead { font-size: var(--fs-l); color: var(--muted); }
.prose .is-note { padding-left: var(--sp-4); border-left: 2px solid var(--line-strong); font-size: var(--fs-s); color: var(--muted); }
.prose .is-note strong { color: var(--ink); }
.prose .is-callout { padding: var(--sp-5) var(--sp-6); border-radius: var(--r-l); background: var(--red-50); color: var(--navy); font-weight: 500; }

/* Нумерованные списки — номера как в «Почему мы» на главной */
.prose--page ol:not(:where(.not-prose, .not-prose *)) { gap: var(--sp-4); }
.prose--page ol:not(:where(.not-prose, .not-prose *)) > li { padding-left: 3rem; }
.prose--page ol:not(:where(.not-prose, .not-prose *)) > li::before { content: counter(li, decimal-leading-zero); top: .1em; font-size: var(--fs-s); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Картинки */
.prose .wp-block-image { margin-block: var(--sp-6); }
.prose .wp-block-image img { width: 100%; border-radius: var(--r-l); background: var(--mist); }
.prose .wp-block-image figcaption, .prose figcaption { margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--muted); }
.prose--page > .wp-block-image { max-width: 40rem; }

/* «Медиа и текст»: фото и текст рядом, сторона чередуется */
.prose .wp-block-media-text { display: grid; gap: var(--sp-5); align-items: center; margin-block: var(--sp-7); }
.prose .wp-block-media-text__media { margin: 0; }
.prose .wp-block-media-text__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-l); background: var(--mist); }
.prose .wp-block-media-text__content > * + * { margin-top: var(--sp-3); }
@media (min-width: 48rem) {
	.prose .wp-block-media-text { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--sp-6); }
	.prose .wp-block-media-text.has-media-on-the-right { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
	.prose--page > .wp-block-media-text { gap: var(--sp-8); }
}

/* Видео: место под ролик зарезервировано (16:9), ничего не прыгает */
.prose .wp-block-video { margin-block: var(--sp-6); }
.prose .wp-block-video video { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; border-radius: var(--r-l); background: var(--navy-900); }
.prose--page > .wp-block-video, .prose--page > .embed-frame, .prose--page > .wp-block-embed { max-width: 52rem; }
.embed-frame, .prose .wp-block-embed { position: relative; margin-block: var(--sp-6); }
.embed-frame iframe, .prose .wp-block-embed iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: var(--r-l); background: var(--navy-900); }
.prose .wp-block-embed__wrapper { position: relative; }

/* Цитата — «миссия» на тёмно-синем со знаком круга */
.prose .wp-block-quote:not(:where(.not-prose *)) {
	position: relative; margin-block: var(--sp-7); padding: var(--sp-6) var(--sp-6) var(--sp-6) calc(var(--sp-6) + 3.25rem);
	border: 0; border-radius: var(--r-l); background: var(--navy); color: rgb(255 255 255 / .85);
	font-size: var(--fs-l); line-height: 1.5;
}
.prose .wp-block-quote::before {
	content: ""; position: absolute; left: var(--sp-6); top: calc(var(--sp-6) + .2em); width: 2.25rem; height: 2.25rem; border-radius: 50%;
	background: repeating-conic-gradient(from -22.5deg, var(--red) 0 45deg, #fff 0 90deg);
	-webkit-mask: radial-gradient(circle, transparent 36%, #000 38%);
	        mask: radial-gradient(circle, transparent 36%, #000 38%);
}
.prose .wp-block-quote strong { color: #fff; }
@media (max-width: 39.99rem) { .prose .wp-block-quote:not(:where(.not-prose *)) { padding: calc(var(--sp-6) + 2.75rem) var(--sp-5) var(--sp-5); } }

/* Галереи (фотогалерея, документы) — открываются в просмотрщике */
.prose .wp-block-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); gap: var(--sp-3); margin-block: var(--sp-6); }
/* Стили ядра задают ширину кадров через :not(#individual-image) — перебиваем той же специфичностью */
.prose .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) { width: auto; margin: 0; flex: none; }
.prose .wp-block-gallery .wp-block-image { position: relative; margin: 0; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r-m); background: var(--mist); }
.prose .wp-block-gallery .wp-block-image a { display: block; height: 100%; cursor: zoom-in; }
.prose .wp-block-gallery .wp-block-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; transition: transform var(--t-slow) var(--ease); }
.prose .wp-block-gallery .wp-block-image:hover img { transform: scale(1.04); }
.prose .wp-block-gallery figcaption {
	position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: var(--sp-6) var(--sp-3) var(--sp-3);
	background: linear-gradient(transparent, rgb(21 23 63 / .78)); font-size: var(--fs-xs); line-height: 1.35; color: #fff;
	pointer-events: none;
}
.page-body--galereya .wp-block-gallery { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: var(--sp-4); }
/* Документы — страницы А4 */
.page-body--dokumenty .wp-block-gallery { grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); }
.page-body--dokumenty .wp-block-gallery .wp-block-image { aspect-ratio: 1 / 1.414; background: #fff; box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); }
.page-body--dokumenty .wp-block-gallery .wp-block-image img { object-position: top; }
.page-body--dokumenty .prose > .wp-block-image img { border: 1px solid var(--line); }

/* Таблицы: на телефоне прокручиваются внутри рамки */
.prose .wp-block-table {
	margin-block: var(--sp-6); overflow-x: auto; overscroll-behavior-x: contain;
	border-radius: var(--r-l); box-shadow: inset 0 0 0 1px var(--line); background: #fff;
}
.prose .wp-block-table table { min-width: 30rem; font-size: var(--fs-s); border-collapse: collapse; }
.prose .wp-block-table :is(thead, tfoot, tr, th, td) { border: 0; }
.prose .wp-block-table td { border-bottom: 1px solid var(--line); }
.prose .wp-block-table em { font-style: normal; }
.prose .wp-block-table :is(th, td) { padding: var(--sp-3) var(--sp-5); }
.prose .wp-block-table thead th { background: var(--paper); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.prose .wp-block-table tbody tr:last-child td { border-bottom: 0; }
.prose .wp-block-table tbody tr { transition: background-color var(--t-fast); }
.prose .wp-block-table tbody tr:hover { background: var(--paper); }
/* Цены: последний столбец — сумма */
.page-body--ceny .wp-block-table :is(th, td):last-child { width: 1%; text-align: right; white-space: nowrap; }
.page-body--ceny .wp-block-table td:last-child { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.page-body--ceny .wp-block-table tr:has(td:last-child:empty) td { padding-top: var(--sp-5); background: var(--navy-50); color: var(--navy); }
.page-body--ceny .wp-block-table tr:has(td:last-child:empty):hover { background: transparent; }

/* Раскрывающийся блок (реквизиты) */
.prose .wp-block-details { border-radius: var(--r-l); background: #fff; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.prose .wp-block-details summary {
	display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
	min-height: var(--control-l); padding: var(--sp-3) var(--sp-5); list-style: none; cursor: pointer;
	font-weight: 700; color: var(--navy);
}
.prose .wp-block-details summary::-webkit-details-marker { display: none; }
.prose .wp-block-details summary::after {
	content: ""; flex: none; width: 2rem; height: 2rem; border-radius: 50%;
	box-shadow: inset 0 0 0 1.5px var(--line-strong);
	background: linear-gradient(var(--navy), var(--navy)) center / .75rem 1.5px no-repeat, linear-gradient(var(--navy), var(--navy)) center / 1.5px .75rem no-repeat;
	transition: transform var(--t) var(--ease), background-color var(--t);
}
.prose .wp-block-details[open] summary::after { transform: rotate(45deg); }
.prose .wp-block-details > :not(summary) { margin: 0 var(--sp-5) var(--sp-5); }
.prose .wp-block-details .wp-block-table { margin-top: 0; box-shadow: none; border-radius: 0; }
.prose .wp-block-details .wp-block-table td:first-child { width: 14rem; color: var(--muted); }
/* Плавное раскрытие там, где браузер умеет анимировать details */
@supports selector(::details-content) {
	.prose .wp-block-details { interpolate-size: allow-keywords; }
	.prose .wp-block-details::details-content { height: 0; overflow: clip; transition: height var(--t) var(--ease), content-visibility var(--t) allow-discrete; }
	.prose .wp-block-details[open]::details-content { height: auto; }
}

/* Кнопки из редактора */
.prose .wp-block-buttons { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-5); }
.prose .wp-block-button__link, .cta-card .wp-block-button__link {
	display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
	min-height: var(--control); padding: 0 calc(var(--control) * .5);
	border-radius: var(--r-pill); background: var(--red); color: #fff;
	font-size: var(--fs-s); font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap;
	box-shadow: 0 8px 20px -8px rgb(215 38 45 / .6);
	transition: background-color var(--t-fast);
}
.prose .wp-block-button__link:hover, .cta-card .wp-block-button__link:hover { background: var(--red-ink); }
/* Площадки отзывов — ярлыки со стрелкой наружу */
.prose .wp-block-buttons.is-sites { gap: var(--sp-2); }
.prose .is-sites .wp-block-button__link {
	min-height: var(--control-s); padding: 0 var(--sp-4); background: #fff; color: var(--navy); box-shadow: inset 0 0 0 1px var(--line);
	font-weight: 500;
}
.prose .is-sites .wp-block-button__link::after { content: "↗"; color: var(--muted); }
.prose .is-sites .wp-block-button__link:hover { background: #fff; box-shadow: inset 0 0 0 1.5px var(--navy); }

.prose hr, .prose .wp-block-separator { height: 1px; margin-block: var(--sp-7); border: 0; background: var(--line); }

/* ---------- Карточки разделов (услуги, заболевания) ---------- */
.tcards { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.tcard {
	position: relative; display: flex; flex-direction: column;
	border-radius: var(--r-l); background: #fff; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden;
	transition: box-shadow var(--t) var(--ease), translate var(--t) var(--ease);
}
.tcard:hover { box-shadow: inset 0 0 0 1px transparent, var(--shadow-2); translate: 0 -3px; }
.tcard__img { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--navy-50); }
.tcard__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); }
.tcard:hover .tcard__img img { transform: scale(1.04); }
.tcard__mark { position: absolute; width: 46%; right: -10%; bottom: -24%; transition: transform var(--t-slow) var(--ease); }
.tcard:hover .tcard__mark { transform: rotate(45deg); }
.tcard__body { display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; padding: var(--sp-5); }
.tcard__title { font-size: var(--fs-l); line-height: 1.25; }
.tcard__link { color: var(--navy); text-decoration: none; transition: color var(--t-fast); }
.tcard__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tcard:hover .tcard__link { color: var(--red-ink); }
.tcard__desc { font-size: var(--fs-s); line-height: 1.45; color: var(--muted); }
.tcard__helps { font-size: var(--fs-xs); line-height: 1.5; color: var(--ink); }
.tcard__helps span { font-weight: 600; color: var(--muted); }
.tcard__kids { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-1); }
.tcard__kids a {
	display: inline-flex; align-items: center; min-height: 2rem; padding: 0 var(--sp-3); border-radius: var(--r-pill);
	box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-xs); font-weight: 500; color: var(--navy); text-decoration: none;
	transition: box-shadow var(--t-fast), background-color var(--t-fast);
}
.tcard__kids a:hover { box-shadow: inset 0 0 0 1.5px var(--navy); background: #fff; }
.tcard__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: auto; padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.tcard__body > .tcard__foot { margin-top: auto; }
.tcard__body > :nth-last-child(2) { margin-bottom: var(--sp-3); }
.tcard__price { font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.tcard__price small { font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
.tcard__price--none, .tcard__more { font-size: var(--fs-s); font-weight: 600; color: var(--muted); }
.tcard__go { display: grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--paper); color: var(--navy); transition: background-color var(--t-fast), color var(--t-fast); }
.tcard__go .icon { width: 1.125rem; height: 1.125rem; transition: transform var(--t) var(--ease); }
.tcard:hover .tcard__go { background: var(--red); color: #fff; }
.tcard:hover .tcard__go .icon { transform: translateX(2px); }
.section--paper .tcard { box-shadow: var(--shadow-1); }
.section--paper .tcard:hover { box-shadow: var(--shadow-2); }

/* ---------- Карточки БАДов ---------- */
.pcards { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.pcard {
	position: relative; display: flex; flex-direction: column; gap: var(--sp-2);
	padding: var(--sp-3) var(--sp-3) var(--sp-5); border-radius: var(--r-l); background: #fff; box-shadow: inset 0 0 0 1px var(--line);
	transition: box-shadow var(--t) var(--ease), translate var(--t) var(--ease);
}
.pcard:hover { box-shadow: var(--shadow-2); translate: 0 -3px; }
.section--paper .pcard { box-shadow: var(--shadow-1); }
.pcard__img { position: relative; display: grid; place-items: center; aspect-ratio: 1; margin-bottom: var(--sp-2); border-radius: var(--r-m); background: var(--paper); overflow: hidden; }
.section--paper .pcard__img { background: #fff; }
.pcard__img img { width: 76%; height: 76%; object-fit: contain; mix-blend-mode: multiply; transition: transform var(--t-slow) var(--ease); }
.pcard:hover .pcard__img img { transform: scale(1.05); }
.pcard__img .tcard__mark { width: 40%; position: static; }
.pcard__title { padding-inline: var(--sp-2); font-size: var(--fs-m); line-height: 1.3; }
.pcard__link { color: var(--navy); text-decoration: none; transition: color var(--t-fast); }
.pcard__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.pcard:hover .pcard__link { color: var(--red-ink); }
.pcard__meta { padding-inline: var(--sp-2); font-size: var(--fs-xs); color: var(--muted); }
.pcard__text { padding-inline: var(--sp-2); font-size: var(--fs-s); line-height: 1.45; color: var(--muted); }

/* ---------- Прейскурант услуги ---------- */
.plist { display: grid; gap: var(--sp-5); }
.plist:not(.plist--groups) { max-width: 52rem; }
@media (min-width: 64rem) { .plist--groups { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: var(--sp-6); } }
.plist__group { padding: var(--sp-5) var(--sp-6) var(--sp-3); border-radius: var(--r-l); background: #fff; box-shadow: var(--shadow-1); }
.plist__title { padding-bottom: var(--sp-3); border-bottom: 2px solid var(--navy); font-size: var(--fs-l); }
.plist__row { display: flex; align-items: baseline; gap: var(--sp-4); padding-block: var(--sp-3); border-bottom: 1px solid var(--line); }
.plist__row:last-child { border-bottom: 0; }
.plist__name { flex: 1; line-height: 1.4; }
.plist__price { font-weight: 800; color: var(--navy); white-space: nowrap; font-variant-numeric: tabular-nums; }
.plist__note { max-width: 52rem; margin-top: var(--sp-5); font-size: var(--fs-s); color: var(--muted); }
@media (max-width: 39.99rem) { .plist__group { padding-inline: var(--sp-4); } .plist__row { flex-direction: column; gap: 2px; } }

/* ---------- Разделы внутри страниц ---------- */
.section__aside { font-size: var(--fs-s); color: var(--muted); }
.related .doctors__grid, .related .tcards { margin-top: 0; }

/* ---------- Призыв в конце страницы ---------- */
.cta-band { padding-block: var(--section-sm); }
.section--paper + .cta-band, .phead + .cta-band { padding-top: var(--section-sm); }
.cta-card {
	position: relative; overflow: hidden; isolation: isolate;
	padding: clamp(2rem, 1.25rem + 3vw, 4rem); border-radius: var(--r-l);
	background: var(--navy); color: rgb(255 255 255 / .78);
}
.cta-card__mark {
	position: absolute; z-index: -1; right: -5rem; bottom: -7rem; width: clamp(15rem, 10rem + 16vw, 24rem);
	--mark-line: #fff; transition: transform 1.2s var(--ease);
}
.cta-card:hover .cta-card__mark { transform: rotate(45deg); }
.cta-card__body { max-width: 40rem; }
.cta-card__body .wp-block-group > * + * { margin-top: var(--sp-4); }
.cta-card h2 { font-size: var(--fs-2xl); color: #fff; }
.cta-card p { font-size: var(--fs-l); }
.cta-card p a { color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.cta-card p a:hover { text-decoration: underline; }
.cta-card .wp-block-buttons { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-6); }
.cta-card .wp-block-button__link { min-height: var(--control-l); font-size: var(--fs-m); box-shadow: none; }
@media (max-width: 47.99rem) { .cta-card__mark { width: 12rem; right: -4rem; bottom: -4rem; opacity: .5; } }

/* ---------- Отзывы: стена карточек ---------- */
.review-wall { columns: 3 19rem; column-gap: var(--sp-5); }
.review-wall .review { break-inside: avoid; margin-bottom: var(--sp-5); }
.review--full .review__text p { display: block; -webkit-line-clamp: unset; overflow: visible; }
.review__text p + p { margin-top: var(--sp-3); }
.review__answer { padding: var(--sp-4); border-radius: var(--r-m); background: var(--paper); font-size: var(--fs-s); line-height: 1.55; }
.review__answer > * + * { margin-top: var(--sp-2); }
.review__answer-by { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); }
.review__answer-mark { width: 1.25rem; height: 1.25rem; }
.review__meta a { color: inherit; }
.review__meta a:hover { color: var(--navy); }

/* ---------- Пагинация ---------- */
.pager { margin-top: var(--sp-8); }
.pager .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pager .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2); }
.page-numbers {
	display: inline-grid; place-items: center; min-width: var(--control-s); height: var(--control-s); padding: 0 var(--sp-3);
	border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--line); background: #fff;
	font-size: var(--fs-s); font-weight: 600; color: var(--navy); text-decoration: none; font-variant-numeric: tabular-nums;
	transition: box-shadow var(--t-fast), background-color var(--t-fast), color var(--t-fast);
}
.page-numbers .icon { width: 1.125rem; height: 1.125rem; }
a.page-numbers:hover { box-shadow: inset 0 0 0 1.5px var(--navy); }
.page-numbers.current { background: var(--navy); color: #fff; box-shadow: none; }
.page-numbers.dots { background: none; box-shadow: none; }

/* ---------- Акции ---------- */
.promo-grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.promo-grid .promo__text > * + * { margin-top: var(--sp-2); }
.promo__mark { position: absolute; width: 46%; right: -10%; bottom: -24%; }

/* ---------- Вакансии ---------- */
.vacancies { display: grid; gap: var(--sp-3); }
.vacancy { border-radius: var(--r-l); background: #fff; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow var(--t) var(--ease); }
.vacancy:has([aria-expanded="true"]) { box-shadow: var(--shadow-2); }
.vacancy__head {
	display: grid; grid-template-columns: minmax(0, 1fr) auto 2rem; align-items: center; gap: var(--sp-2) var(--sp-5);
	width: 100%; padding: var(--sp-5) var(--sp-6); border: 0; background: none; text-align: left;
}
.vacancy__title { font-size: var(--fs-l); font-weight: 700; line-height: 1.3; color: var(--navy); }
.vacancy__salary { padding: var(--sp-1) var(--sp-3); border-radius: var(--r-pill); background: var(--navy-50); font-size: var(--fs-s); font-weight: 600; color: var(--navy); white-space: nowrap; }
.vacancy__head[aria-expanded="true"] .acc__icon { background: var(--navy); box-shadow: none; }
.vacancy__head[aria-expanded="true"] .acc__icon::before, .vacancy__head[aria-expanded="true"] .acc__icon::after { background: #fff; }
.vacancy__head[aria-expanded="true"] .acc__icon::after { transform: rotate(0deg); }
.vacancy__body { display: grid; gap: var(--sp-5); padding: 0 var(--sp-6) var(--sp-6); }
.vacancy__col h4 { margin-bottom: var(--sp-2); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.vacancy__col ul { display: grid; gap: var(--sp-2); font-size: var(--fs-s); line-height: 1.45; }
.vacancy__col li { position: relative; padding-left: var(--sp-4); }
.vacancy__col li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.vacancy__place { display: flex; align-items: flex-start; gap: var(--sp-2); font-size: var(--fs-s); }
.vacancy__place .icon { color: var(--red); margin-top: 1px; }
@media (min-width: 48rem) {
	.vacancy__body { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.vacancy__place { grid-column: 1 / -1; }
}
@media (max-width: 47.99rem) {
	.vacancy__head { grid-template-columns: minmax(0, 1fr) 2rem; padding-inline: var(--sp-5); }
	.vacancy__salary { grid-row: 2; justify-self: start; }
	.vacancy__body { padding-inline: var(--sp-5); }
}

/* ---------- Дипломы и сертификаты ---------- */
.certs { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(min(46%, 13rem), 1fr)); }
.cert { --cert-pad: var(--sp-2); position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r-m); background: #fff; box-shadow: var(--shadow-1); cursor: zoom-in; transition: box-shadow var(--t) var(--ease), translate var(--t) var(--ease); }
.cert:hover { box-shadow: var(--shadow-2); translate: 0 -2px; }
/* Документ целиком: горизонтальные дипломы заполняют карточку, вертикальные стоят по центру с полями. */
.cert__img { position: absolute; inset: var(--cert-pad); width: calc(100% - 2 * var(--cert-pad)); height: calc(100% - 2 * var(--cert-pad)); object-fit: contain; object-position: center; }
.cert[hidden] { display: none; }
.cert.is-shown { animation: fade-up var(--t-slow) var(--ease) both; }
.no-js [data-certs-more] { display: none; }
.certs__more { margin-top: var(--sp-6); }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Блог ---------- */
.article { padding-block: var(--section-sm); }
.article__cover { position: relative; max-width: 60rem; aspect-ratio: 16 / 9; margin-bottom: var(--sp-8); border-radius: var(--r-l); overflow: hidden; background: var(--mist); }
.article__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.postnav { display: grid; gap: var(--sp-3); max-width: var(--measure); margin-top: var(--sp-9); padding-top: var(--sp-6); border-top: 1px solid var(--line); }
.postnav__link { display: grid; gap: var(--sp-1); padding: var(--sp-4) var(--sp-5); border-radius: var(--r-l); background: var(--paper); text-decoration: none; transition: background-color var(--t-fast); }
.postnav__link:hover { background: var(--mist); }
.postnav__link--next { text-align: right; }
.postnav__dir { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); font-weight: 600; color: var(--red-ink); }
.postnav__link--next .postnav__dir { justify-content: flex-end; }
.postnav__dir .icon { width: 1rem; height: 1rem; }
.postnav__title { font-weight: 600; line-height: 1.35; color: var(--navy); }
@media (min-width: 48rem) { .postnav { grid-template-columns: 1fr 1fr; } .postnav__link--next:only-child { grid-column: 2; } }
.empty { color: var(--muted); }

/* ---------- 404 ---------- */
.quicklinks { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.quicklink {
	position: relative; display: grid; gap: var(--sp-1); padding: var(--sp-5) var(--sp-8) var(--sp-5) var(--sp-5);
	border-radius: var(--r-l); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none;
	transition: box-shadow var(--t) var(--ease);
}
.quicklink strong { font-size: var(--fs-l); color: var(--navy); }
.quicklink span { font-size: var(--fs-s); color: var(--muted); }
.quicklink .icon { position: absolute; right: var(--sp-5); top: 50%; margin-top: -.625em; color: var(--red); transition: transform var(--t) var(--ease); }
.quicklink:hover { box-shadow: var(--shadow-2); }
.quicklink:hover .icon { transform: translateX(4px); }

/* ---------- Контакты и запись (блок с главной) ---------- */
.contacts--page { padding-block: var(--section-sm); }
.requisites .prose--page > * { max-width: 52rem; }

/* ---------- Просмотрщик фото ---------- */
.lb {
	width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
	background: transparent; color: #fff; overflow: hidden;
}
.lb::backdrop { background: rgb(13 14 38 / .92); opacity: 0; transition: opacity var(--t) var(--ease); }
.lb.is-open::backdrop { opacity: 1; }
.lb__stage { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--sp-9) var(--sp-4) var(--sp-10); }
.lb__img {
	/* Проценты от ячейки грида не ограничивают картинку по высоте — считаем от вьюпорта минус поля сцены. */
	--lb-pad-y: calc(var(--sp-9) + var(--sp-10));
	max-width: calc(100vw - var(--sp-4) * 2); max-height: calc(100vh - var(--lb-pad-y)); max-height: calc(100dvh - var(--lb-pad-y));
	width: auto; height: auto; object-fit: contain; border-radius: var(--r-s); background: #fff;
	box-shadow: 0 30px 80px -20px rgb(0 0 0 / .6);
	opacity: 0; transform: scale(.96); transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.lb.is-open .lb__img.is-ready { opacity: 1; transform: none; }
.lb__bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: var(--sp-4); padding: var(--sp-4) var(--gutter) calc(var(--sp-4) + env(safe-area-inset-bottom)); }
.lb__cap { flex: 1; max-width: 40rem; font-size: var(--fs-s); text-align: center; color: rgb(255 255 255 / .85); }
.lb__count { font-size: var(--fs-xs); color: rgb(255 255 255 / .6); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb .icon-btn { background: rgb(255 255 255 / .12); color: #fff; }
.lb .icon-btn:hover { background: rgb(255 255 255 / .24); }
.lb__close { position: absolute; top: var(--sp-4); right: var(--sp-4); }
.lb__prev, .lb__next { position: absolute; top: 50%; margin-top: calc(var(--control) * -.5); width: var(--control) !important; height: var(--control) !important; }
.lb__prev { left: var(--sp-4); }
.lb__next { right: var(--sp-4); }
.lb--single .lb__prev, .lb--single .lb__next, .lb--single .lb__count { display: none; }
@media (max-width: 47.99rem) { .lb__prev, .lb__next { top: auto; bottom: var(--sp-3); margin: 0; } .lb__stage { padding-bottom: calc(var(--sp-10) + var(--sp-4)); } .lb__img { --lb-pad-y: calc(var(--sp-9) + var(--sp-10) + var(--sp-4)); } }

/* ---------- Версия для слабовидящих ---------- */
html.is-a11y .phead__ring, html.is-a11y .cta-card__mark { display: none; }
html.is-a11y .crumbs a, html.is-a11y .tcard__kids a { text-decoration: underline; }

/* ---------- YouTube по клику ---------- */
.embed-frame--yt { aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-l); background: var(--navy-900); }
.embed-frame__play { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.embed-frame__play img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; transition: transform var(--t-slow) var(--ease); }
.embed-frame__play .video__btn { position: relative; transition: box-shadow var(--t) var(--ease); }
.embed-frame__play:hover img { transform: scale(1.03); }
.embed-frame__play:hover .video__btn { box-shadow: 0 0 0 12px rgb(215 38 45 / .3); }
.embed-frame--yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.embed-frame--yt.is-playing .embed-frame__play { opacity: 0; pointer-events: none; transition: opacity var(--t); }

/* Цены на телефоне: сумма — под названием услуги, без горизонтальной прокрутки */
@media (max-width: 47.99rem) {
	.page-body--ceny .wp-block-table table { min-width: 0; }
	.page-body--ceny .wp-block-table thead { display: none; }
	.page-body--ceny .wp-block-table tr { display: grid; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
	.page-body--ceny .wp-block-table td { padding: 0; border: 0; }
	.page-body--ceny .wp-block-table td:last-child { width: auto; margin-top: var(--sp-1); text-align: left; white-space: normal; }
	.page-body--ceny .wp-block-table td:last-child:empty { display: none; }
	.page-body--ceny .wp-block-table tbody tr:last-child { border-bottom: 0; }
}
