/*
 * Головна: «Про об'єднання» та «Керівництво і структура».
 * Секції зібрані зі стандартних блоків — класи задані в редакторі.
 */

/* Та сама сітка, що хіроу й показники: відступ від краю --tmo-gutter, ширина до --tmo-shell. */
.has-global-padding > .alignfull.tmo-home-section,
.alignfull.tmo-home-section {
	margin-left: max(calc(var(--tmo-gutter) - var(--wp--style--root--padding-left, 0px)), calc((100% - var(--tmo-shell) + 2 * var(--tmo-gutter)) / 2)) !important;
	margin-right: max(calc(var(--tmo-gutter) - var(--wp--style--root--padding-right, 0px)), calc((100% - var(--tmo-shell) + 2 * var(--tmo-gutter)) / 2)) !important;
	width: auto;
	max-width: none;
	margin-top: 90px;
	padding: 0;
	font-family: var(--tmo-font);
	box-sizing: border-box;
}

.tmo-home-section * {
	box-sizing: border-box;
}

.tmo-home-section p,
.tmo-home-section h2,
.tmo-home-section h3,
.tmo-home-section h4,
.tmo-home-section ul,
.tmo-home-section figure {
	margin-top: 0;
	margin-bottom: 0;
}

/*
 * Групи з блоків мають «потоковий» макет: тема дає кожному наступному
 * блоку відступ зверху. У сітках це зсуває картки — скидаємо.
 */
.tmo-home-people > *,
.tmo-home-structure > *,
.tmo-home-director > *,
.tmo-home-leadership__grid,
.tmo-home-about__grid {
	margin-block-start: 0 !important;
}

/* ----------------------------------------------------------- Спільне */

.tmo-home-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 7px 14px 7px 12px;
	border-radius: 999px;
	background: rgba(245, 122, 117, 0.12);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	color: #c9534e;
}

.tmo-home-eyebrow::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--tmo-coral);
}

.tmo-home-section .tmo-home-title {
	margin-top: 16px;
	font-size: clamp(30px, 2.6vw, 44px);
	font-weight: 600;
	line-height: 1;
	color: var(--tmo-navy);
	text-wrap: balance;
	margin-bottom: 16px;
}

.tmo-home-section .tmo-home-lead-text {
	margin-top: 0px;
	font-size: 19px;
	line-height: 1.2;
	color: #3b4a5c;
}

.tmo-home-actions {
	gap: 12px;
	margin-top: 32px !important;
}

.tmo-home-actions--center {
	justify-content: center;
}

.tmo-home-section .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 54px;
	padding: 0 26px;
	border: 1.5px solid transparent;
	border-radius: 999px;
	font-size: 16.5px;
	font-weight: 500;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tmo-home-section .wp-block-button__link::after {
	content: "";
	width: 18px;
	height: 18px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") no-repeat center / contain;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") no-repeat center / contain;
	transition: transform 0.2s ease;
}

.tmo-home-section .wp-block-button__link:hover::after {
	transform: translateX(3px);
}

.tmo-home-btn-primary .wp-block-button__link {
	background: linear-gradient(135deg, #f78a85 0%, var(--tmo-coral) 45%, #ec625d 100%);
	box-shadow: 0 10px 24px rgba(245, 122, 117, 0.32);
	color: #fff;
}

.tmo-home-btn-primary .wp-block-button__link:hover {
	box-shadow: 0 14px 30px rgba(245, 122, 117, 0.42);
	color: #fff;
}

.tmo-home-btn-secondary .wp-block-button__link {
	border-color: rgba(115, 156, 210, 0.55);
	background: #fff;
	color: var(--tmo-navy);
}

.tmo-home-btn-secondary .wp-block-button__link:hover {
	border-color: var(--tmo-blue);
	background: var(--tmo-blue);
	color: #fff;
}

/* ---------------------------------------------------- Про об'єднання */

.tmo-home-about__grid.wp-block-columns {
	gap: 64px;
	align-items: center !important;
	margin: 0;
}

.tmo-home-about__media.wp-block-column {
	position: relative;
	flex: 0 0 46% !important;
	isolation: isolate;
}

/* Декоративна підкладка за фото — як у хіроу центру. */
.tmo-home-about__media::before {
    content: "";
    position: absolute;
    inset: 28px 28px -28px -28px;
    z-index: -1;
    border-radius: 44px;
    background: rgb(255 255 255 / 18%);
    border: 12px solid #739cd21a;
}

.tmo-home-about__photo img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 28px;
	box-shadow: 0 18px 44px rgba(30, 53, 86, 0.12);
}

/* Карусель фото: слайди лежать один на одному й перемикаються плавним проявом. */
.tmo-home-about__slider {
	position: relative;
}

.tmo-home-about__slides {
	position: relative;
	aspect-ratio: 4 / 3;
}

.tmo-home-about__slide.wp-block-image {
	position: absolute;
	inset: 0;
	z-index: 1;
	margin: 0;
	opacity: 0;
	transition: opacity 0.9s ease;
}

/* Перший слайд активний уже в розмітці, тож без JS видно саме його. */
.tmo-home-about__slide.is-active {
	z-index: 2;
	opacity: 1;
}

.tmo-home-about__slide img {
	height: 100%;
	aspect-ratio: auto;
}

.tmo-home-about__dots {
	position: absolute;
	left: 20px;
	bottom: 20px;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 999px;
	background: rgb(255 255 255 / 62%);
	box-shadow: 0 6px 18px rgba(30, 53, 86, 0.12);
	backdrop-filter: blur(6px);
}

.tmo-home-about__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(58, 81, 110, 0.32);
	cursor: pointer;
	transition: width 0.3s ease, background-color 0.3s ease;
}

.tmo-home-about__dot:hover {
	background: rgba(58, 81, 110, 0.55);
}

.tmo-home-about__dot.is-active {
	width: 24px;
	background: var(--tmo-coral);
}

@media (prefers-reduced-motion: reduce) {
	.tmo-home-about__slide.wp-block-image {
		transition: none;
	}
}

.tmo-home-section .tmo-home-about__badge {
	position: absolute;
	right: -20px;
	bottom: 28px;
	display: flex;
	align-items: center;
	gap: 14px;
	max-width: 290px;
	padding: 16px 20px;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 16px 36px rgba(30, 53, 86, 0.14);
	font-size: 14.5px;
	line-height: 1.35;
	color: #3b4a5c;
}

.tmo-home-about__badge strong {
	flex: none;
	font-size: 34px;
	font-weight: 700;
	line-height: 1;
	color: var(--tmo-coral);
}

.tmo-home-about__content .tmo-home-lead-text + p {
	margin-top: 12px;
	font-size: 17px;
	line-height: 1.65;
	color: rgba(44, 63, 87, 0.72);
}

.tmo-home-section .tmo-home-points {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 26px;
	padding: 0;
	list-style: none;
}

.tmo-home-points li {
	position: relative;
	padding-left: 40px;
	font-size: 16px;
	line-height: 1.5;
	color: rgba(44, 63, 87, 0.78);
}

.tmo-home-points li::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--tmo-coral) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") no-repeat center / 14px;
}

.tmo-home-points strong {
	color: var(--tmo-navy);
}

/* ------------------------------------------- Керівництво і структура */

.tmo-home-leadership {
	padding: 64px 56px !important;
	border-radius: 32px;
	background: linear-gradient(180deg, #eef4fb 0%, #f7faff 100%);
}

.tmo-home-head {
	max-width: 90%;
	margin-bottom: 40px;
}

.tmo-home-leadership__grid.wp-block-columns {
	gap: 24px;
	align-items: stretch !important;
	margin: 0;
}

.tmo-home-leadership__main.wp-block-column {
	flex: 0 0 46% !important;
}

.tmo-home-director {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 28px;
	align-items: start;
	height: 100%;
	padding: 28px;
	border-radius: 24px;
	background: #fff;
	box-shadow: 0 14px 34px rgba(30, 53, 86, 0.08);
}

.tmo-home-director__photo img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	object-position: top center;
	border-radius: 18px;
}

.tmo-home-director__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.tmo-home-section .tmo-home-director__name {
	margin-top: 14px;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--tmo-navy);
}

.tmo-home-section .tmo-home-director__bio {
	margin-top: 12px;
	font-size: 15.5px;
	line-height: 1.3;
	color: rgba(44, 63, 87, 0.75);
}

.tmo-home-section .tmo-home-director__contacts {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid rgba(115, 156, 210, 0.2);
	font-size: 15px;
	color: rgba(44, 63, 87, 0.55);
}

.tmo-home-director__contacts a {
	font-weight: 500;
	color: var(--tmo-navy);
	text-decoration: none;
}

.tmo-home-director__contacts a:hover {
	color: var(--tmo-coral);
}

.tmo-home-people {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	height: 100%;
}

.tmo-home-person {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr);
	grid-template-rows: auto auto;
	column-gap: 16px;
	align-content: center;
	align-items: start;
	padding: 18px;
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 10px 26px rgba(30, 53, 86, 0.06);
}

.tmo-home-person__photo {
	grid-row: 1 / span 2;
}

.tmo-home-person__photo img {
	display: block;
	width: 88px;
	height: 104px;
	object-fit: cover;
	object-position: top center;
	border-radius: 14px;
}

.tmo-home-section .tmo-home-person__name {
	align-self: end;
	margin-top: 8px;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--tmo-navy);
}

.tmo-home-section .tmo-home-person__role {
	margin-top: 6px;
	font-size: 14px;
	line-height: 1.4;
	color: #2f5d97;
}

.tmo-home-structure {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	margin-top: 24px;
}

.tmo-home-struct-card {
	padding: 22px;
	border: 1px solid rgba(115, 156, 210, 0.18);
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.72);
}

.tmo-home-section .tmo-home-struct-card__role {
	font-size: 12.5px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--tmo-coral);
}

.tmo-home-section .tmo-home-struct-card__title {
	margin-top: 6px;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--tmo-navy);
}

.tmo-home-section .tmo-home-struct-card__list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 14px;
	padding: 0;
	list-style: none;
}

.tmo-home-struct-card__list li {
	position: relative;
	padding-left: 16px;
	font-size: 14.5px;
	line-height: 1.4;
	color: rgba(44, 63, 87, 0.78);
}

.tmo-home-struct-card__list li::before {
	content: "";
	position: absolute;
	top: 0.55em;
	left: 0;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--tmo-blue);
}

.tmo-home-leadership .tmo-home-actions {
	margin-top: 36px !important;
}

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

@media (max-width: 1300px) {
	.tmo-home-leadership__grid.wp-block-columns {
		flex-wrap: wrap !important;
	}

	.tmo-home-leadership__main.wp-block-column,
	.tmo-home-leadership__team.wp-block-column {
		flex: 1 1 100% !important;
	}

	.tmo-home-structure {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 1100px) {
	.alignfull.tmo-home-section {
		margin-top: 64px;
	}

	.tmo-home-about__grid.wp-block-columns {
		flex-wrap: wrap !important;
		gap: 56px;
	}

	.tmo-home-about__media.wp-block-column,
	.tmo-home-about__content.wp-block-column {
		flex: 1 1 100% !important;
	}

	.tmo-home-about__media.wp-block-column {
		margin-right: 28px;
	}

	.tmo-home-leadership {
		padding: 44px 32px !important;
	}
}

@media (max-width: 700px) {
	.tmo-home-about__media::before {
		inset: 16px 16px -16px -16px;
		border-radius: 20px;
	}

	.tmo-home-about__media.wp-block-column {
		margin: 0 0 0 16px;
	}

	.tmo-home-about__photo img {
		border-radius: 20px;
	}

	.tmo-home-about__dots {
		left: 12px;
		bottom: 12px;
		padding: 7px 10px;
		gap: 7px;
	}

	.tmo-home-section .tmo-home-about__badge {
		right: 12px;
		bottom: 12px;
		max-width: 240px;
		padding: 12px 14px;
	}

	.tmo-home-about__badge strong {
		font-size: 26px;
	}

	.tmo-home-section .tmo-home-lead-text {
		font-size: 17px;
	}

	.tmo-home-leadership {
		padding: 32px 18px !important;
		border-radius: 24px;
	}

	.tmo-home-director {
		grid-template-columns: minmax(0, 1fr);
		padding: 20px;
	}

	.tmo-home-director__photo img {
		aspect-ratio: 1 / 1;
	}

	.tmo-home-people,
	.tmo-home-structure {
		grid-template-columns: minmax(0, 1fr);
	}

	.tmo-home-actions .wp-block-button {
		width: 100%;
	}

	.tmo-home-section .wp-block-button__link {
		justify-content: space-between;
		width: 100%;
	}
}

/* ------------------------------------------------ Напрями лікування */

/* Остання секція головної — відступ до підвалу. */
.alignfull.tmo-home-dirs {
	margin-bottom: 90px;
}

.tmo-home-dirs__head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.tmo-home-section .tmo-home-dirs__head .tmo-home-title {
	margin-top: 0;
}

.tmo-home-section .tmo-home-dirs__grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tmo-home-dirs__grid > li {
	display: flex;
	margin: 0;
}

.tmo-home-dir {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	width: 100%;
	min-height: 196px;
	padding: 22px 20px 20px;
	border: 1px solid rgba(115, 156, 210, 0.18);
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 8px 22px rgba(30, 53, 86, 0.05);
	color: var(--tmo-navy);
	text-decoration: none;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

a.tmo-home-dir:hover,
a.tmo-home-dir:focus-visible {
	border-color: transparent;
	box-shadow: 0 18px 38px rgba(30, 53, 86, 0.12);
	transform: translateY(-4px);
	color: var(--tmo-navy);
}

.tmo-home-dir__icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 68px;
	height: 68px;
	border-radius: 18px;
	background: rgba(115, 156, 210, 0.14);
	color: #3f6fae;
	transition: background-color 0.25s ease, color 0.25s ease;
}

.tmo-home-dir__icon svg {
	width: 46px;
	height: 46px;
}

a.tmo-home-dir:hover .tmo-home-dir__icon,
a.tmo-home-dir:focus-visible .tmo-home-dir__icon {
	background: var(--tmo-coral);
	color: #fff;
}

.tmo-home-dir__title {
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
}

.tmo-home-dir__more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: auto;
	font-size: 14px;
	font-weight: 500;
	color: var(--tmo-coral);
}

.tmo-home-dir__more .tmo-icon {
	width: 16px;
	height: 16px;
	transition: transform 0.2s ease;
}

a.tmo-home-dir:hover .tmo-home-dir__more .tmo-icon {
	transform: translateX(4px);
}

/* 6 → 3 → 2 колонки: 18 плиток лягають рівними рядами на будь-якій ширині. */
@media (max-width: 1200px) {
	.tmo-home-section .tmo-home-dirs__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 700px) {
	.tmo-home-section .tmo-home-dirs__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.tmo-home-dir {
		gap: 10px;
		min-height: 0;
		padding: 16px 14px;
		border-radius: 16px;
	}

	.tmo-home-dir__icon {
		width: 52px;
		height: 52px;
		border-radius: 14px;
	}

	.tmo-home-dir__icon svg {
		width: 38px;
		height: 38px;
	}

	.tmo-home-dir__title {
		font-size: 15.5px;
	}

	.tmo-home-dir__more {
		font-size: 13px;
	}
}

/* ---------------------------------------------------- Останні новини */

/* Новини — остання секція головної: нижній відступ переходить до неї. */
.alignfull.tmo-home-news {
	margin-bottom: 90px;
}

.alignfull.tmo-home-reviews:has(+ .tmo-home-news),
.alignfull.tmo-home-dirs:has(+ .tmo-home-news) {
	margin-bottom: 0;
}

.tmo-home-news.is-static .tmo-slider-btn {
	display: none;
}

/* Чотири картки в ряд, решта — прокруткою. Відступи треку дають місце тіні й підйому картки. */
.tmo-home-news__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 3 * 24px) / 4);
	gap: 24px;
	align-items: stretch;
	margin: -14px -14px 0;
	padding: 14px 14px 24px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 14px;
	scroll-behavior: smooth;
	scrollbar-width: none;
}

.tmo-home-news__track::-webkit-scrollbar {
	display: none;
}

.tmo-home-news__track > .tmo-post-card {
	scroll-snap-align: start;
}

.tmo-home-section .tmo-home-news__track .tmo-post-card__title {
	margin: 0;
}

@media (max-width: 1300px) {
	.tmo-home-news__track {
		grid-auto-columns: calc((100% - 2 * 24px) / 3);
	}
}

@media (max-width: 900px) {
	.tmo-home-news__track {
		grid-auto-columns: calc((100% - 24px) / 2);
	}
}

@media (max-width: 600px) {
	.tmo-home-news__track {
		grid-auto-columns: 86%;
		gap: 14px;
	}
}

/* ---------------------------------------------- Поява блоків при скролі */

/*
 * Ховаємо лише тоді, коли на <html> є tmo-reveal-on (JS увімкнено й анімації
 * не вимкнені в системі). Без JS усе видно одразу.
 */
.tmo-reveal-on .tmo-stats > li,
.tmo-reveal-on .tmo-home-about__media,
.tmo-reveal-on .tmo-home-about__content,
.tmo-reveal-on .tmo-home-leadership .tmo-home-head,
.tmo-reveal-on .tmo-home-director,
.tmo-reveal-on .tmo-home-person,
.tmo-reveal-on .tmo-home-leadership > .tmo-home-actions,
.tmo-reveal-on .tmo-home-dirs__head,
.tmo-reveal-on .tmo-home-dirs__grid > li,
.tmo-reveal-on .tmo-home-reviews > .tmo-home-reviews__head,
.tmo-reveal-on .tmo-home-reviews__track,
.tmo-reveal-on .tmo-home-news > .tmo-home-reviews__head,
.tmo-reveal-on .tmo-home-news__track {
	opacity: 0;
	transform: translate3d(0, 40px, 0);
	transition:
		opacity 0.7s cubic-bezier(0.22, 0.7, 0.2, 1) var(--reveal-delay, 0ms),
		transform 0.8s cubic-bezier(0.22, 0.7, 0.2, 1) var(--reveal-delay, 0ms);
}

.tmo-reveal-on .tmo-reveal.is-visible {
	opacity: 1;
	transform: none;
}

/* Після появи — без затримок і трансформацій, щоб не заважати слайдерам і наведенню. */
.tmo-reveal-on .tmo-reveal.is-done {
	transition: none;
}

@media (prefers-reduced-motion: reduce) {
	.tmo-reveal-on .tmo-reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}
}
