/* Kehayova theme: layout, components and motion. Tokens come from theme.json. */

:root {
	--kh-teal: var(--wp--preset--color--teal);
	--kh-teal-dark: var(--wp--preset--color--teal-dark);
	--kh-coral: var(--wp--preset--color--coral);
	--kh-coral-deep: var(--wp--preset--color--coral-deep);
	--kh-ink: var(--wp--preset--color--ink);
	--kh-slate: var(--wp--preset--color--slate);
	--kh-tint: var(--wp--preset--color--tint);
	--kh-tint-warm: var(--wp--preset--color--tint-warm);
	--kh-header-h: 84px;
	--kh-radius: 24px;
	--kh-radius-sm: 16px;
	--kh-shadow: 0 30px 60px -32px rgba(18, 64, 63, 0.38);
	--kh-shadow-sm: 0 12px 32px -18px rgba(18, 64, 63, 0.35);
	--kh-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	--kh-section: clamp(4rem, 3rem + 5vw, 8rem);
}

@media (max-width: 781px) {
	:root { --kh-header-h: 68px; }
}

html { scroll-padding-top: calc(var(--kh-header-h) + 1rem); }
/* Standard Cyrillic letterforms: Manrope would otherwise switch to Bulgarian-style forms for lang="bg". */
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; font-feature-settings: "locl" 0; }
::selection { background: var(--kh-coral); color: #fff; }
:where(a, button, summary, input, textarea, select):focus-visible { outline: 2px solid var(--kh-coral); outline-offset: 3px; border-radius: 4px; }
img { height: auto; }
/* Opening hours ("15:00 - 19:00 ч."): a hyphen is a line-break point, so keep the range on one line. */
.kh-nowrap { white-space: nowrap; }
.wp-site-blocks { padding-top: 0; }
.kh-main { margin-top: 0; }
.kh-main > .wp-block-post-content { margin-top: 0; }

/* ---------- Header ---------- */

.kh-site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	margin-bottom: calc(-1 * var(--kh-header-h));
	color: #fff;
	transition: background-color 0.35s ease, box-shadow 0.35s ease, color 0.35s ease;
}
.admin-bar .kh-site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .kh-site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .kh-site-header { top: 0; } }

.kh-site-header.is-scrolled {
	color: var(--kh-ink);
	background: rgba(255, 255, 255, 0.94);
	-webkit-backdrop-filter: saturate(1.4) blur(14px);
	backdrop-filter: saturate(1.4) blur(14px);
	box-shadow: 0 1px 0 rgba(19, 37, 43, 0.08), 0 10px 30px -20px rgba(19, 37, 43, 0.3);
}
.kh-header { padding-top: 0; padding-bottom: 0; }
.kh-header__bar { min-height: var(--kh-header-h); gap: 1.5rem; }
.kh-header__right { gap: clamp(1rem, 2vw, 2rem); }

/* Logo: mark + name + "Клиничен психолог" */
.kh-brand { margin: 0; line-height: 1; white-space: nowrap; }
.kh-logo {
	--kh-logo-bg: #fff;
	--kh-logo-wave: var(--kh-teal);
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	color: inherit;
	text-decoration: none;
}
.kh-logo__mark { width: 2.75rem; height: 2.75rem; flex: none; }
.kh-logo__bg { fill: var(--kh-logo-bg); transition: fill 0.35s ease; }
.kh-logo__wave { stroke: var(--kh-logo-wave); transition: stroke 0.35s ease; }
.kh-logo__dot { fill: var(--kh-coral); transform-box: fill-box; transform-origin: center; transition: transform 0.35s var(--kh-ease); }
.kh-logo:hover .kh-logo__dot { transform: scale(1.25); }
.kh-logo__text { display: flex; flex-direction: column; gap: 0.2rem; }
.kh-logo__name { font-weight: 800; font-size: 1.1875rem; letter-spacing: -0.02em; line-height: 1.1; }
.kh-logo__role { font-weight: 600; font-size: 0.8125rem; letter-spacing: 0.01em; line-height: 1.1; opacity: 0.8; }
.kh-site-header.is-scrolled .kh-logo { --kh-logo-bg: var(--kh-teal); --kh-logo-wave: #fff; }
.kh-site-header.is-scrolled .kh-logo__role { color: var(--kh-slate); opacity: 1; }
.kh-footer .kh-logo { --kh-logo-wave: var(--kh-teal-dark); }
@media (max-width: 599px) {
	.kh-logo { gap: 0.6rem; }
	.kh-logo__mark { width: 2.4rem; height: 2.4rem; }
	.kh-logo__name { font-size: 1.0625rem; }
	.kh-logo__role { font-size: 0.75rem; }
}

/* Navigation */
.kh-nav { color: inherit; }
.kh-nav .wp-block-navigation__container { gap: clamp(1rem, 1.8vw, 1.9rem); }
.kh-nav .wp-block-navigation-item__content { position: relative; padding-block: 0.4rem; }
.kh-nav .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: var(--kh-coral);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.35s var(--kh-ease);
}
.kh-nav .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover::after,
.kh-nav .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content[aria-current]::after { transform: scaleX(1); }

.kh-nav .wp-block-navigation__submenu-container {
	color: var(--kh-ink) !important;
	background: #fff !important;
	border: 0 !important;
	border-radius: var(--kh-radius-sm);
	box-shadow: var(--kh-shadow);
	padding: 0.6rem !important;
	min-width: 20rem !important;
	top: calc(100% + 0.6rem) !important;
}
.kh-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0.55rem 0.85rem !important;
	border-radius: 10px;
	font-weight: 500;
	transition: background-color 0.2s ease, color 0.2s ease;
}
.kh-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
.kh-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content[aria-current] { background: var(--kh-tint); color: var(--kh-teal); }
.kh-nav .wp-block-navigation-submenu__toggle { color: inherit; }

/* Desktop dropdown: an invisible bridge over the gap under "Услуги" and a short close delay,
   so the menu stays open while the mouse travels down to it. */
@media (min-width: 782px) {
	.kh-nav .wp-block-navigation__submenu-container::before {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		bottom: 100%;
		height: 1rem;
	}
	.kh-nav .has-child:not(.open-on-click) > .wp-block-navigation__submenu-container {
		width: auto !important;
		height: auto !important;
		overflow: visible !important;
		transform: translateY(6px);
		transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.35s;
	}
	.kh-nav .has-child:not(.open-on-click):hover > .wp-block-navigation__submenu-container,
	.kh-nav .has-child:not(.open-on-click):focus-within > .wp-block-navigation__submenu-container {
		transform: none;
		transition-delay: 0s;
	}
	/* Long service names stay on one line; the dropdown grows to fit them. */
	.kh-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content { white-space: nowrap; }
}

/* 600-781 px: the full menu does not fit on one row (it wrapped and its first row was cut off),
   so the menu button is used up to 781 px instead of core's 599 px. */
@media (min-width: 600px) and (max-width: 781px) {
	.kh-nav .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.kh-nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}

/* Mobile overlay */
.kh-nav .wp-block-navigation__responsive-container-open,
.kh-nav .wp-block-navigation__responsive-container-close { color: inherit; }
.kh-nav .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--kh-teal-dark) !important;
	color: #fff !important;
	padding: 1.5rem clamp(1rem, 6vw, 2.5rem) 2.5rem;
}
.kh-nav .is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 3.5rem; }
.kh-nav .is-menu-open .wp-block-navigation__container { gap: 0.9rem !important; }
.kh-nav .is-menu-open .wp-block-navigation-item__content { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.kh-nav .is-menu-open .wp-block-navigation__submenu-container {
	background: transparent !important;
	color: rgba(255, 255, 255, 0.85) !important;
	box-shadow: none;
	padding: 0.4rem 0 0.2rem 0.2rem !important;
	min-width: 0 !important;
}
.kh-nav .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content { font-size: 1.0625rem; font-weight: 500; padding: 0.3rem 0 !important; }
.kh-nav .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover { background: transparent; color: var(--kh-coral); }

/* Phone button in the header */
.kh-header__cta { flex: none; }
.kh-header .wp-block-button.kh-btn-phone > .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.7rem 1.2rem;
	font-size: 0.9375rem;
	color: inherit;
	background: transparent;
	border: 1.5px solid currentColor;
	white-space: nowrap;
}
.kh-btn-phone > .wp-block-button__link::before,
.kh-btn-call > .wp-block-button__link::before,
.kh-icon-phone::before {
	content: "";
	width: 1em;
	height: 1em;
	flex: none;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.57 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.57 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.kh-header .wp-block-button.kh-btn-phone > .wp-block-button__link:hover { background: #fff; color: var(--kh-teal); border-color: #fff; }
.kh-site-header.is-scrolled .kh-header .wp-block-button.kh-btn-phone > .wp-block-button__link { color: var(--kh-teal); }
.kh-site-header.is-scrolled .kh-header .wp-block-button.kh-btn-phone > .wp-block-button__link:hover { background: var(--kh-teal); color: #fff; border-color: var(--kh-teal); }

/* Mid-size screens: the header phone button shows only its icon (the number stays in the link for screen readers). */
@media (min-width: 600px) and (max-width: 1180px) {
	.kh-header .wp-block-button.kh-btn-phone > .wp-block-button__link { font-size: 0; gap: 0; padding: 0.8rem; }
	.kh-header .wp-block-button.kh-btn-phone > .wp-block-button__link::before { width: 1.05rem; height: 1.05rem; }
}
@media (max-width: 599px) {
	.kh-header .wp-block-buttons.kh-header__cta { display: none; }
	.kh-header__right { margin-left: auto; }
}

/* ---------- Buttons ---------- */

.wp-block-button__link { transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s var(--kh-ease); }
.wp-block-button__link:hover { transform: translateY(-2px); }
.wp-block-button.is-style-outline > .wp-block-button__link { border: 1.5px solid currentColor; background: transparent; color: var(--kh-teal); padding: calc(1rem - 1.5px) calc(1.75rem - 1.5px); }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--kh-teal); border-color: var(--kh-teal); color: #fff; }
.kh-btn-light > .wp-block-button__link { background: #fff; color: var(--kh-teal); }
.kh-btn-light > .wp-block-button__link:hover { background: var(--kh-coral); color: var(--kh-ink); }
.kh-btn-call > .wp-block-button__link { display: inline-flex; align-items: center; gap: 0.6rem; }

/* ---------- Dark top areas (hero + page head) ---------- */

.kh-hero,
.kh-pagehead {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	color: #fff;
	background: var(--kh-teal);
	padding-top: calc(var(--kh-header-h) + clamp(2.5rem, 6vw, 5.5rem));
}
.kh-hero :where(h1, h2, h3, p),
.kh-pagehead :where(h1, h2, h3, p) { color: inherit; }
.kh-swirl {
	position: absolute;
	inset: 0;
	max-width: none !important;
	margin: 0 !important;
	z-index: -1;
	width: 100%;
	height: 100%;
	pointer-events: none;
}
.kh-swirl path { fill: none; stroke: rgba(255, 255, 255, 0.13); stroke-width: 34; stroke-linecap: round; }
.kh-swirl path.kh-swirl__thin { stroke: rgba(255, 255, 255, 0.22); stroke-width: 2; }
.kh-swirl__dot-group { opacity: 0; }
.kh-swirl__dot { fill: var(--kh-coral); }
.kh-swirl__halo { fill: rgba(255, 119, 89, 0.28); }

/* Hero */
.kh-hero { padding-bottom: clamp(3.5rem, 8vw, 7rem); }
.kh-hero__cols { gap: clamp(2rem, 5vw, 5rem); }
.kh-hero__title { font-size: clamp(2.4rem, 1.3rem + 3.4vw, 4.1rem) !important; margin: 0; }
.kh-hero__lead { font-size: var(--wp--preset--font-size--medium); line-height: 1.6; max-width: 34rem; opacity: 0.9; margin-top: 1.5rem; }
.kh-hero .wp-block-buttons { margin-top: 2.25rem; gap: 0.9rem; }
.kh-hero .wp-block-button.is-style-outline > .wp-block-button__link { color: #fff; }
.kh-hero .wp-block-button.is-style-outline > .wp-block-button__link:hover { background: #fff; color: var(--kh-teal); border-color: #fff; }
.kh-hero__name { display: inline-flex; align-items: center; gap: 0.6rem; margin: 0 0 1.25rem; font-weight: 700; font-size: 1.0625rem; opacity: 0.92; }
.kh-hero__name::before { content: ""; width: 2.25rem; height: 2px; background: var(--kh-coral); }
.kh-hero__facts { margin-top: 2.5rem; font-size: var(--wp--preset--font-size--small); opacity: 0.85; max-width: 32rem; padding-left: 1rem; border-left: 2px solid var(--kh-coral); }

.kh-hero__media { position: relative; margin: 0; }
.kh-hero__media .wp-block-image { margin: 0; }
.kh-hero__media .wp-block-image img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	object-position: 50% 30%;
	border-radius: var(--kh-radius) var(--kh-radius) var(--kh-radius) 120px;
	box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.55);
}
/* Sits under the photo, never on top of it. */
.kh-hero__card {
	margin: 1rem 0 0 !important;
	padding: 1.1rem 1.3rem;
	color: var(--kh-ink);
	background: #fff;
	border-radius: var(--kh-radius-sm);
	box-shadow: var(--kh-shadow);
}
.kh-hero__card p { margin: 0; color: var(--kh-ink); font-size: 0.9375rem; line-height: 1.45; }
.kh-hero__card p + p { margin-top: 0.25rem; }
.kh-hero__card strong { color: var(--kh-teal); }

@media (max-width: 781px) {
	.kh-hero__media { max-width: 26rem; margin-inline: auto; }
}

/* Page head (inner pages) */
.kh-pagehead { padding-bottom: clamp(3rem, 6vw, 5rem); }
.kh-pagehead__inner { max-width: 52rem; }
.kh-pagehead__title { font-size: var(--wp--preset--font-size--x-large) !important; margin: 0; }
@media (min-width: 782px) { .kh-pagehead__title { font-size: clamp(2.5rem, 1.6rem + 2.4vw, 3.75rem) !important; } }
.kh-pagehead__lead,
.kh-pagehead .wp-block-post-excerpt { margin-top: 1.25rem; font-size: var(--wp--preset--font-size--medium); line-height: 1.55; opacity: 0.9; max-width: 40rem; }
.kh-pagehead .wp-block-post-excerpt__excerpt { margin: 0; }
.kh-pagehead .wp-block-post-excerpt__more-text { display: none; }
.kh-pagehead__meta { opacity: 0.8; margin-bottom: 0.75rem; }
.kh-crumbs { margin: 0 0 1.1rem; font-size: 0.875rem; }
.kh-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.kh-crumbs li { display: inline-flex; align-items: center; gap: 0.45rem; opacity: 0.85; }
.kh-crumbs li + li::before { content: "/"; opacity: 0.6; }
.kh-crumbs a { color: inherit; text-decoration: none; }
.kh-crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.kh-crumbs [aria-current] { font-weight: 600; }

/* ---------- Sections (home) ---------- */

.kh-section { padding-block: var(--kh-section); margin-block: 0 !important; }
.kh-section--tint { background: var(--kh-tint); }
.kh-section--warm { background: var(--kh-tint-warm); }
.kh-section--dark { background: var(--kh-teal-dark); color: #fff; }
.kh-section--dark :where(h2, h3, h4, p, li) { color: inherit; }
.kh-content--home > .kh-section + .kh-section { margin-top: 0; }
.kh-section__head { max-width: 50rem; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.kh-section__title { margin: 0; }
.kh-section__intro { color: var(--kh-slate); font-size: var(--wp--preset--font-size--medium); line-height: 1.6; margin-top: 1rem; }
.kh-section--dark .kh-section__intro { color: rgba(255, 255, 255, 0.78); }
.kh-split { gap: clamp(2rem, 6vw, 6rem); }

/* Cards */
.is-style-card {
	background: #fff;
	border-radius: var(--kh-radius);
	padding: clamp(1.5rem, 3vw, 2.75rem);
	box-shadow: var(--kh-shadow-sm);
}

/* Accordion */
.wp-block-details.is-style-accordion {
	background: #fff;
	border-radius: var(--kh-radius-sm);
	box-shadow: var(--kh-shadow-sm);
	padding: 0;
	margin-top: 0.85rem;
	transition: box-shadow 0.3s ease;
}
.wp-block-details.is-style-accordion:hover { box-shadow: var(--kh-shadow); }
.wp-block-details.is-style-accordion > summary {
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.15rem 1.4rem;
	cursor: pointer;
	font-weight: 800;
	font-size: 1.1875rem;
	letter-spacing: -0.01em;
	color: var(--kh-teal);
}
.wp-block-details.is-style-accordion > summary::-webkit-details-marker { display: none; }
.wp-block-details.is-style-accordion > summary::after {
	content: "";
	flex: none;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--kh-tint-warm) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B83F25' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / 1.1rem no-repeat;
	transition: transform 0.35s var(--kh-ease), background-color 0.3s ease;
}
.wp-block-details.is-style-accordion[open] > summary::after { transform: rotate(180deg); }
.wp-block-details.is-style-accordion > :not(summary) { margin: 0; padding: 0 1.4rem; color: var(--kh-slate); }
.wp-block-details.is-style-accordion > :not(summary):last-child { padding-bottom: 1.3rem; }
.wp-block-details.is-style-accordion > :not(summary) + :not(summary) { padding-top: 0.75rem; }
.wp-block-details.is-style-accordion a { font-weight: 700; }
@supports (interpolate-size: allow-keywords) {
	.wp-block-details.is-style-accordion { interpolate-size: allow-keywords; }
	.wp-block-details.is-style-accordion::details-content { height: 0; overflow: clip; transition: height 0.4s var(--kh-ease), content-visibility 0.4s allow-discrete; }
	.wp-block-details.is-style-accordion[open]::details-content { height: auto; }
}

/* Big typographic list of methods */
.kh-biglist { list-style: none; padding: 0 !important; margin: 0; }
.kh-biglist li { margin: 0; }
.kh-biglist li + li { border-top: 1px solid #E3ECE8; }
.kh-biglist a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 0;
	color: var(--kh-ink);
	text-decoration: none;
	font-weight: 800;
	font-size: clamp(1.35rem, 1rem + 1.3vw, 2rem);
	letter-spacing: -0.02em;
	line-height: 1.2;
	transition: color 0.25s ease, padding 0.35s var(--kh-ease);
}
.kh-biglist a::after {
	content: "";
	flex: none;
	width: 0.75rem;
	height: 0.75rem;
	border-radius: 50%;
	background: var(--kh-coral);
	transform: scale(0);
	transition: transform 0.35s var(--kh-ease);
}
.kh-biglist a:hover { color: var(--kh-teal); padding-left: 0.5rem; }
.kh-biglist a:hover::after { transform: scale(1); }

/* Methods: big typographic links with a one-line purpose */
.kh-methods { padding-block: 0.75rem !important; }
.kh-method { position: relative; margin: 0 !important; padding: 1.05rem 2.5rem 1.05rem 0; }
.kh-method + .kh-method { border-top: 1px solid #F1E4DE; }
.kh-method__name { margin: 0 !important; font-size: clamp(1.3rem, 1rem + 1.1vw, 1.85rem) !important; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.kh-method__name a { color: var(--kh-ink); text-decoration: none; transition: color 0.25s ease; }
.kh-method__name a::after { content: ""; position: absolute; inset: 0; }
.kh-method__text { margin: 0.25rem 0 0 !important; color: var(--kh-slate); font-size: 0.9875rem; }
.kh-method::after {
	content: "";
	position: absolute;
	right: 0.25rem;
	top: 50%;
	width: 2.1rem;
	height: 2.1rem;
	margin-top: -1.05rem;
	border-radius: 50%;
	background: var(--kh-tint-warm) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B83F25' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / 1rem no-repeat;
	transition: transform 0.35s var(--kh-ease), background-color 0.25s ease;
}
.kh-method:hover .kh-method__name a { color: var(--kh-teal); }
.kh-method:hover::after { transform: translateX(4px); background-color: #FFE3D9; }

/* Image with an overlapping quote card */
.kh-overlap { position: relative; }
.kh-overlap .wp-block-image { margin: 0; }
.kh-overlap .wp-block-image img { display: block; width: 100%; border-radius: var(--kh-radius); box-shadow: var(--kh-shadow-sm); background: #fff; }
/* Quote card sits under the image, never on top of it. */
.kh-overlap__card {
	position: relative;
	margin: 1.25rem 0 0 !important;
	background: #fff;
	border-radius: var(--kh-radius-sm);
	padding: 1.5rem 1.6rem;
	box-shadow: var(--kh-shadow);
}
.kh-overlap__card p { margin: 0; }
.kh-overlap__quote { color: var(--kh-coral-deep); font-weight: 800; font-size: 1.3125rem; line-height: 1.35; letter-spacing: -0.01em; }
.kh-overlap__by { color: var(--kh-slate); font-size: var(--wp--preset--font-size--small); margin-top: 0.6rem !important; }

/* Numbered steps (a real sequence: the ТЕЛК procedure) */
.wp-block-list.is-style-steps {
	list-style: none;
	counter-reset: kh-step;
	padding: 0 !important;
	margin: 0;
	position: relative;
}
.wp-block-list.is-style-steps > li {
	counter-increment: kh-step;
	position: relative;
	padding: 0 0 2rem 4.75rem;
	margin: 0;
	min-height: 3rem;
}
.wp-block-list.is-style-steps > li:last-child { padding-bottom: 0; }
.wp-block-list.is-style-steps > li::before {
	content: counter(kh-step);
	position: absolute;
	left: 0;
	top: -0.2rem;
	width: 3rem;
	height: 3rem;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--kh-coral);
	color: var(--kh-ink);
	font-weight: 800;
	font-size: 1.25rem;
	box-shadow: 0 0 0 6px var(--kh-step-ring, var(--kh-tint));
	z-index: 1;
}
/* Connector runs from each circle to the next one and stops at the last circle. */
.wp-block-list.is-style-steps > li:not(:last-child)::after {
	content: "";
	position: absolute;
	left: calc(1.5rem - 1px);
	top: 1.3rem;
	bottom: -1.3rem;
	width: 2px;
	background: currentColor;
	opacity: 0.18;
	transform-origin: top;
}
.kh-section--dark .wp-block-list.is-style-steps > li::before { --kh-step-ring: var(--kh-teal-dark); }
.kh-content .wp-block-list.is-style-steps > li::before { --kh-step-ring: #fff; }
.wp-block-list.is-style-steps > li > strong:first-child { display: block; font-size: 1.1875rem; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 0.2rem; }
.kh-section--dark .wp-block-list.is-style-steps > li { color: rgba(255, 255, 255, 0.82); }
.kh-section--dark .wp-block-list.is-style-steps > li > strong:first-child { color: #fff; }

/* Check list */
.wp-block-list.is-style-checks { list-style: none; padding-left: 0 !important; }
.wp-block-list.is-style-checks > li { position: relative; padding-left: 2rem; margin-bottom: 0.55rem; }
.wp-block-list.is-style-checks > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.3em;
	width: 1.25rem;
	height: 1.25rem;
	border-radius: 50%;
	background: var(--kh-tint-warm) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B83F25' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 0.8rem no-repeat;
}

/* ---------- Content pages ---------- */

.kh-content { padding-top: clamp(3rem, 6vw, 5rem); padding-bottom: clamp(3rem, 6vw, 5rem); }
.kh-content--home { padding-top: 0; padding-bottom: 0; }
.kh-content > :first-child { margin-top: 0; }
.kh-content:not(.kh-content--home) :where(h2) { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem); margin-top: 3rem; margin-bottom: 1rem; }
.kh-content:not(.kh-content--home) :where(h3) { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); margin-top: 2.25rem; margin-bottom: 0.75rem; }
.kh-content:not(.kh-content--home) :where(h2 + h3) { margin-top: 1.25rem; }
.kh-content:not(.kh-content--home) :where(p, li) { color: #2A3B41; }
.kh-content :where(.kh-aside__card--phone, .kh-section--dark) :where(p, li) { color: inherit; }
.kh-content :where(ul.wp-block-list:not([class*="is-style-"]) li)::marker { color: var(--kh-coral); }
.kh-content :where(ol.wp-block-list:not([class*="is-style-"]) li)::marker { color: var(--kh-coral-deep); font-weight: 800; }
.kh-content :where(li) { margin-bottom: 0.45rem; }
.kh-content .kh-lead { font-size: var(--wp--preset--font-size--medium); line-height: 1.6; color: var(--kh-ink); }

.wp-block-quote.kh-quote,
.kh-content .wp-block-quote {
	position: relative;
	margin: 2.5rem 0;
	padding: 3.25rem 2rem 2rem 2.25rem;
	background: var(--kh-tint);
	border-radius: var(--kh-radius);
	font-size: 1.3125rem;
}
.kh-content .wp-block-quote p { color: var(--kh-ink); }
/* The mark sits in the top padding, above the first line, so it never covers text. */
.kh-content .wp-block-quote::before {
	content: "„";
	position: absolute;
	top: -2.4rem;
	left: 2.1rem;
	font-size: 5rem;
	line-height: 1;
	font-weight: 800;
	color: var(--kh-coral);
	pointer-events: none;
}
.kh-content .wp-block-quote cite { display: block; margin-top: 0.75rem; font-size: 0.9375rem; font-style: normal; font-weight: 600; color: var(--kh-slate); }

/* Service template: content + sticky aside */
.kh-service {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 20rem;
	gap: clamp(2.5rem, 6vw, 6rem);
	align-items: stretch;
}
.kh-service__body { max-width: 46rem; }
/* The aside column is as tall as the text; only the short phone card sticks, so nothing gets cut off. */
.kh-service__aside { display: flex; flex-direction: column; padding-top: clamp(3rem, 6vw, 5rem); padding-bottom: clamp(3rem, 6vw, 5rem); }
.kh-service__aside > .kh-aside { flex: 1; display: flex; flex-direction: column; }
.kh-service__aside .kh-aside__card--phone { position: sticky; top: calc(var(--kh-header-h) + 1.5rem); }
.admin-bar .kh-service__aside .kh-aside__card--phone { top: calc(var(--kh-header-h) + 32px + 1.5rem); }
@media (max-width: 959px) {
	.kh-service { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.kh-service__aside { padding-top: 0; }
	.kh-service__aside .kh-aside__card--phone { position: static; }
}
.kh-aside { display: grid; gap: 1.25rem; }
.kh-aside__card { background: var(--kh-tint); border-radius: var(--kh-radius-sm); padding: 1.5rem; margin: 0 !important; }
.kh-aside__card--phone { background: var(--kh-teal); color: #fff; }
.kh-aside__card p { margin: 0; }
.kh-aside__lead { font-weight: 700; opacity: 0.9; }
.kh-aside__phone a { white-space: nowrap; color: #fff; font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; }
.kh-aside__phone a:hover { color: var(--kh-coral); }
.kh-aside__hours { margin-top: 0.5rem !important; font-size: var(--wp--preset--font-size--small); opacity: 0.85; }
.kh-aside__title { font-size: 1.0625rem !important; margin: 0 0 0.75rem !important; }
.kh-aside__list { list-style: none; padding: 0 !important; margin: 0; }
.kh-aside__list li { margin: 0; }
.kh-aside__list a { display: block; padding: 0.4rem 0; color: var(--kh-ink); text-decoration: none; font-weight: 600; font-size: 0.9875rem; transition: color 0.2s ease, transform 0.3s var(--kh-ease); }
.kh-aside__list a:hover { color: var(--kh-teal); transform: translateX(4px); }
.kh-aside__list a[aria-current] { color: var(--kh-coral-deep); }

/* Certificates */
.kh-certs.wp-block-gallery { --wp--style--unstable-gallery-gap: clamp(1rem, 2vw, 1.5rem); gap: var(--wp--style--unstable-gallery-gap) !important; margin-top: 2.5rem; }
@media (max-width: 599px) { .kh-certs.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) { width: 100%; } }
.kh-certs.wp-block-gallery .wp-block-image {
	background: #fff;
	border-radius: var(--kh-radius-sm);
	padding: 0.9rem;
	box-shadow: var(--kh-shadow-sm);
	display: flex !important;
	flex-direction: column !important;
	justify-content: flex-start !important;
	transition: transform 0.35s var(--kh-ease), box-shadow 0.35s ease;
}
/* Cards in one row share the same height (core gives uncropped gallery images margin-bottom: auto). */
.kh-certs.wp-block-gallery.has-nested-images:not(.is-cropped) figure.wp-block-image:not(#individual-image) { margin-bottom: 0; align-self: stretch; }
/* Core gives the caption flex-basis: 100%, which squeezed the image in a stretched card. The caption takes
   the spare height instead: core's lightbox script places the enlarge button from (card - caption - image),
   so spare height anywhere else pushed the button down onto the caption. */
.kh-certs.wp-block-gallery .wp-block-image figcaption { flex: 1 0 auto !important; }
.kh-certs.wp-block-gallery .wp-block-image img { flex: none; }
/* 600-781 px: two per row (core keeps four, which left the documents about 95 px wide). */
@media (min-width: 600px) and (max-width: 781px) {
	.kh-certs.wp-block-gallery.has-nested-images.columns-4 figure.wp-block-image:not(#individual-image) { width: calc(50% - var(--wp--style--unstable-gallery-gap, 16px) / 2); }
}
/* Core's blur layer is meant for captions laid over the image; ours sit under it, so it only blurred the caption. */
.kh-certs.wp-block-gallery.has-nested-images figure.wp-block-image::before { content: none; }
.kh-certs.wp-block-gallery .wp-block-image:hover { transform: translateY(-4px); box-shadow: var(--kh-shadow); }
.kh-certs.wp-block-gallery .wp-block-image img { aspect-ratio: 4 / 3; object-fit: contain !important; width: 100%; background: #F6F8F7; border-radius: 10px; }
.kh-certs.wp-block-gallery .wp-block-image figcaption {
	position: static !important;
	background: none !important;
	color: var(--kh-ink) !important;
	padding: 0.85rem 0.2rem 0.2rem !important;
	font-size: 0.875rem !important;
	line-height: 1.4;
	text-align: left !important;
	max-height: none !important;
	overflow: visible !important;
	margin: 0 !important;
}
.kh-certs-preview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 781px) { .kh-certs-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Lightbox: an opaque backdrop (core's is 90 %), so the page and the header menu button
   do not show through behind the document and the close button. */
.wp-lightbox-overlay .scrim { opacity: 1; }

/* Contact page */
.kh-contact { gap: clamp(2rem, 5vw, 4rem); }
.kh-contact h2 { margin-top: 0; }
.kh-contact-card h3 { font-size: 1.0625rem !important; margin: 1.5rem 0 0.4rem !important; }
.kh-contact-card h3:first-child { margin-top: 0 !important; }
.kh-contact-card p { margin: 0; }
.kh-contact-card .wp-block-buttons { margin-top: 1rem; }
/* 782-899 px: the card column is narrow; keep "Отворете в Google Maps" on one line. */
@media (min-width: 782px) and (max-width: 899px) {
	.kh-contact-card .wp-block-button__link { padding-inline: 1rem; font-size: 0.875rem; white-space: nowrap; }
}
.kh-contact-phone a { white-space: nowrap; font-size: clamp(1.6rem, 1.2rem + 1.1vw, 2.1rem); font-weight: 800; letter-spacing: -0.03em; color: var(--kh-teal); text-decoration: none; }
.kh-contact-phone a:hover { color: var(--kh-coral-deep); }
.kh-map { margin: 0; }
.kh-map img { display: block; width: 100%; border-radius: var(--kh-radius); box-shadow: var(--kh-shadow-sm); }
.kh-map figcaption { margin-top: 0.6rem; }

/* Contact form */
.kh-form-wrap { scroll-margin-top: calc(var(--kh-header-h) + 1.5rem); }
.kh-form { display: grid; gap: 1.1rem; margin-top: 1.5rem; }
.kh-form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
@media (max-width: 599px) { .kh-form__row { grid-template-columns: minmax(0, 1fr); } }
.kh-form__field { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; }
.kh-form label { font-weight: 700; font-size: 0.9375rem; color: var(--kh-ink); }
.kh-form__opt { font-weight: 500; color: var(--kh-slate); }
.kh-form input[type="text"],
.kh-form input[type="tel"],
.kh-form input[type="email"],
.kh-form textarea {
	width: 100%;
	box-sizing: border-box;
	font: inherit;
	font-size: 1rem;
	color: var(--kh-ink);
	background: #fff;
	border: 1.5px solid #CFDDD8;
	border-radius: 14px;
	padding: 0.85rem 1rem;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.kh-form textarea { resize: vertical; min-height: 8rem; }
.kh-form input:focus,
.kh-form textarea:focus { outline: none; border-color: var(--kh-teal); box-shadow: 0 0 0 4px rgba(28, 107, 103, 0.15); }
.kh-form [aria-invalid="true"] { border-color: var(--kh-coral-deep); }
.kh-form__hint { font-size: 0.875rem; color: var(--kh-slate); line-height: 1.5; }
.kh-form__error { font-size: 0.875rem; font-weight: 600; color: var(--kh-coral-deep); }
.kh-form__field--check { display: grid; grid-template-columns: auto 1fr; align-items: start; column-gap: 0.75rem; }
.kh-form__field--check input { width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; accent-color: var(--kh-teal); }
.kh-form__field--check label { font-weight: 500; line-height: 1.5; }
.kh-form__field--check .kh-form__error { grid-column: 2; }
.kh-form__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.kh-form__actions { margin: 0.25rem 0 0; }
.kh-form__submit { border: 0; cursor: pointer; border-radius: 999px; padding: 1rem 1.9rem; font: inherit; font-weight: 700; background: var(--kh-teal); color: #fff; transition: background-color 0.25s ease, transform 0.25s var(--kh-ease); }
.kh-form__submit:hover { background: var(--kh-teal-dark); transform: translateY(-2px); }
.kh-form__submit[disabled] { opacity: 0.7; cursor: progress; transform: none; }
.kh-form__notice { border-radius: var(--kh-radius-sm); padding: 1rem 1.25rem; margin-top: 1rem; line-height: 1.5; }
.kh-form__notice--ok { background: var(--kh-tint); color: var(--kh-teal-dark); border-left: 4px solid var(--kh-teal); }
.kh-form__notice--err { background: var(--kh-tint-warm); color: var(--kh-coral-deep); border-left: 4px solid var(--kh-coral-deep); }

/* ---------- Call to action band ---------- */

.kh-cta { padding-block: 0 var(--kh-section); margin-top: 0 !important; }
.kh-cta__box {
	position: relative;
	overflow: hidden;
	background: var(--kh-teal);
	color: #fff;
	border-radius: calc(var(--kh-radius) + 8px);
	padding: clamp(2rem, 5vw, 4rem);
}
.kh-cta__box::after {
	content: "";
	position: absolute;
	right: -6rem;
	top: -6rem;
	width: 20rem;
	height: 20rem;
	border-radius: 50%;
	border: 34px solid rgba(255, 255, 255, 0.08);
	pointer-events: none;
}
.kh-cta__title { color: #fff; margin: 0; font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.6rem); }
.kh-cta__text { color: rgba(255, 255, 255, 0.85); margin-top: 1rem; max-width: 34rem; }
.kh-cta__phone { margin: 0; }
.kh-cta__phone a { white-space: nowrap; color: #fff; font-size: clamp(1.55rem, 1.1rem + 1.7vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; text-decoration: none; background: linear-gradient(var(--kh-coral), var(--kh-coral)) 0 100% / 100% 4px no-repeat; padding-bottom: 0.15rem; transition: background-size 0.35s var(--kh-ease); }
.kh-cta__phone a:hover { background-size: 100% 100%; color: var(--kh-ink); }
.kh-cta__hours { color: rgba(255, 255, 255, 0.85); margin-top: 1rem; font-size: var(--wp--preset--font-size--small); }
.kh-content--home .kh-cta { padding-top: var(--kh-section); }
.kh-cta__alt { margin-top: 0.75rem; font-weight: 700; }
.kh-cta__alt a { color: #fff; text-underline-offset: 4px; }
.kh-cta__alt a:hover { color: var(--kh-coral); }

/* ---------- Footer ---------- */

.kh-site-footer { margin-top: 0; }
.kh-footer { background: var(--kh-teal-dark); color: rgba(255, 255, 255, 0.78); padding-top: clamp(3.5rem, 6vw, 5.5rem); padding-bottom: 2rem; font-size: 0.9875rem; }
.kh-footer a { color: #fff; text-decoration: none; }
.kh-footer a:hover { color: var(--kh-coral); }
.kh-footer .kh-brand { color: #fff; margin-bottom: 1.25rem; }
.kh-footer__about { max-width: 22rem; }
.kh-footer__title { color: #fff !important; font-size: 1rem !important; font-weight: 800; letter-spacing: 0; margin: 0 0 0.9rem !important; }
.kh-footer p { margin: 0 0 0.75rem; }
.kh-footer__note { font-size: 0.875rem; opacity: 0.8; }
.kh-footer__links { list-style: none; padding: 0 !important; margin: 0; }
.kh-footer__links li { margin-bottom: 0.45rem; }
.kh-footer__cols { gap: clamp(1.5rem, 4vw, 3.5rem); }
.kh-footer__bottom { margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.875rem; }
.kh-footer__bottom p { margin: 0; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
	/* One orchestrated entrance on the home hero. */
	.kh-js .kh-hero__title { animation: kh-mask-up 1s var(--kh-ease) 0.1s both; }
	.kh-js .kh-hero__lead { animation: kh-fade-up 0.9s var(--kh-ease) 0.35s both; }
	.kh-js .kh-hero .wp-block-buttons { animation: kh-fade-up 0.9s var(--kh-ease) 0.5s both; }
	.kh-js .kh-hero__facts { animation: kh-fade-up 0.9s var(--kh-ease) 0.65s both; }
	.kh-js .kh-hero__media .wp-block-image { animation: kh-rise-in 1.2s var(--kh-ease) 0.25s both; }
	.kh-js .kh-hero__card { animation: kh-fade-up 0.9s var(--kh-ease) 0.9s both; }
	.kh-js .kh-swirl path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: kh-draw 2.4s var(--kh-ease) 0.1s forwards; }
	.kh-js .kh-swirl__dot-group { animation: kh-fade 0.6s ease 1.85s forwards; }

	.kh-js .kh-pagehead__inner > * { animation: kh-fade-up 0.8s var(--kh-ease) both; }
	.kh-js .kh-pagehead__inner > :nth-child(2) { animation-delay: 0.12s; }
	.kh-js .kh-pagehead__inner > :nth-child(3) { animation-delay: 0.24s; }

	/* The ТЕЛК steps light up in order when they scroll into view. */
	.kh-js .wp-block-list.is-style-steps > li::after { transform: scaleY(0); transition: transform 0.5s var(--kh-ease); }
	.kh-js .wp-block-list.is-style-steps.is-inview > li::after { transform: scaleY(1); }
	.kh-js .wp-block-list.is-style-steps.is-inview > li:nth-child(1)::after { transition-delay: 0.15s; }
	.kh-js .wp-block-list.is-style-steps.is-inview > li:nth-child(2)::after { transition-delay: 0.33s; }
	.kh-js .wp-block-list.is-style-steps.is-inview > li:nth-child(3)::after { transition-delay: 0.51s; }
	.kh-js .wp-block-list.is-style-steps.is-inview > li:nth-child(4)::after { transition-delay: 0.69s; }
	.kh-js .wp-block-list.is-style-steps.is-inview > li:nth-child(n+5)::after { transition-delay: 0.87s; }
	.kh-js .wp-block-list.is-style-steps > li { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s var(--kh-ease); }
	.kh-js .wp-block-list.is-style-steps.is-inview > li { opacity: 1; transform: none; }
	.kh-js .wp-block-list.is-style-steps.is-inview > li:nth-child(2) { transition-delay: 0.18s; }
	.kh-js .wp-block-list.is-style-steps.is-inview > li:nth-child(3) { transition-delay: 0.36s; }
	.kh-js .wp-block-list.is-style-steps.is-inview > li:nth-child(4) { transition-delay: 0.54s; }
	.kh-js .wp-block-list.is-style-steps.is-inview > li:nth-child(5) { transition-delay: 0.72s; }
	.kh-js .wp-block-list.is-style-steps.is-inview > li:nth-child(n+6) { transition-delay: 0.9s; }

	/* The quote card slides over its image once. */
	.kh-js .kh-overlap__card { opacity: 0; transform: translateY(24px); transition: opacity 0.8s ease, transform 0.9s var(--kh-ease); }
	.kh-js .kh-overlap.is-inview .kh-overlap__card { opacity: 1; transform: none; }
}

@keyframes kh-mask-up {
	from { clip-path: inset(0 0 100% 0); transform: translateY(0.35em); }
	to { clip-path: inset(0 0 -0.2em 0); transform: none; }
}
@keyframes kh-fade-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes kh-rise-in { from { opacity: 0; transform: translateY(30px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes kh-draw { to { stroke-dashoffset: 0; } }
@keyframes kh-fade { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Editor ---------- */

.editor-styles-wrapper .kh-hero,
.editor-styles-wrapper .kh-pagehead { padding-top: 4rem; }
