/*
 * Новини: стрічка, рубрики, сторінка запису.
 * Сітка й відступи — ті самі, що в шапці й хіроу (--tmo-shell, --tmo-gutter).
 */

/* Змінні карток — на сторінках новин і в каруселі новин на головній. */
.tmo-blog-page,
.tmo-home-news {
	--blog-line: rgba(115, 156, 210, 0.18);
	--blog-muted: rgba(44, 63, 87, 0.66);
	--blog-tint: #eef4fb;
	--blog-radius: 18px;
	--blog-shadow: 0 18px 40px rgba(30, 53, 86, 0.1);
}

.tmo-blog-page {
	margin: 0 !important;
	font-family: var(--tmo-font);
	color: var(--tmo-ink);
}

.tmo-blog-page > * {
	margin-block: 0 !important;
}

.tmo-blog *,
.tmo-blog *::before,
.tmo-blog *::after {
	box-sizing: border-box;
}

.tmo-blog-wrap {
	width: 100%;
	max-width: var(--tmo-shell);
	margin-inline: auto;
	padding-inline: var(--tmo-gutter);
}

/* ---------------------------------------------------------- Заголовок */

/*
 * На широких екранах картка меню звисає з шапки (у шапки фіксована висота) —
 * відступ зверху з урахуванням звису, щоб хлібні крихти не підлазили під картку.
 */
.tmo-blog-head {
	padding-block: 28px 30px;
}

@media (min-width: 1401px) {
	.tmo-blog-head,
	.tmo-blog.tmo-blog--single .tmo-blog-layout {
		padding-top: 84px;
	}
}

.tmo-blog-crumbs {
	margin-bottom: 16px;
}

.tmo-blog-head__title {
	margin: 0;
	font-size: clamp(32px, 3vw, 46px);
	font-weight: 700;
	line-height: 1.1;
	color: var(--tmo-navy);
}

.tmo-blog-head__intro {
	margin: 12px 0 0;
	max-width: 760px;
	font-size: 18px;
	line-height: 1.55;
	color: var(--blog-muted);
}

/* -------------------------------------------------------------- Сітка */

.tmo-blog-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 40px;
	align-items: start;
	padding-bottom: 90px;
}

.tmo-blog--single .tmo-blog-layout {
	padding-top: 28px;
}

.tmo-blog-aside__sticky {
	position: sticky;
	top: 24px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* На сторінці запису колонка вища за екран — «липкою» її низ був би недосяжний. */
.tmo-blog--single .tmo-blog-aside__sticky {
	position: static;
}

.admin-bar .tmo-blog-aside__sticky {
	top: calc(24px + var(--wp-admin--admin-bar--height, 32px));
}

.tmo-blog-empty {
	padding: 40px;
	border-radius: var(--blog-radius);
	background: var(--blog-tint);
	color: var(--blog-muted);
	text-align: center;
}

/* --------------------------------------------------------------- Мета */

.tmo-post-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	font-size: 13.5px;
	color: var(--blog-muted);
}

.tmo-post-meta__item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.tmo-post-meta__item .tmo-icon {
	width: 16px;
	height: 16px;
	color: var(--tmo-blue);
}

.tmo-chip {
	display: inline-flex;
	align-items: center;
	padding: 5px 12px;
	border-radius: 999px;
	background: rgba(115, 156, 210, 0.15);
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.2;
	color: #2f5d97;
	text-decoration: none;
}

a.tmo-chip:hover {
	background: var(--tmo-blue);
	color: #fff;
}

/* ------------------------------------------------------------- Картки */

.tmo-post-card {
	position: relative;
	display: flex;
	flex-direction: column;
	border: 1px solid var(--blog-line);
	border-radius: var(--blog-radius);
	background: #fff;
	overflow: hidden;
	transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.tmo-post-card:hover,
.tmo-post-card:focus-within {
	border-color: transparent;
	box-shadow: var(--blog-shadow);
	transform: translateY(-3px);
}

.tmo-post-card__media {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	background: var(--blog-tint);
	overflow: hidden;
}

.tmo-post-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.tmo-post-card:hover .tmo-post-card__media img {
	transform: scale(1.04);
}

.tmo-post-cover-empty {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	color: rgba(115, 156, 210, 0.55);
}

.tmo-post-cover-empty .tmo-icon {
	width: 48px;
	height: 48px;
}

.tmo-post-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 12px;
	padding: 20px 22px 22px;
}

.tmo-post-card__title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tmo-post-card__title a {
	color: var(--tmo-navy);
	text-decoration: none;
}

/* Уся картка — посилання: розтягуємо заголовок на неї. */
.tmo-post-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.tmo-post-card:hover .tmo-post-card__title a {
	color: #2f5d97;
}

.tmo-post-card__excerpt {
	margin: 0;
	font-size: 15px;
	line-height: 1.55;
	color: var(--blog-muted);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tmo-post-card__more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	padding-top: 4px;
	font-size: 14.5px;
	font-weight: 500;
	color: var(--tmo-coral);
}

.tmo-post-card__more .tmo-icon {
	width: 18px;
	height: 18px;
	transition: transform 0.2s ease;
}

.tmo-post-card:hover .tmo-post-card__more .tmo-icon {
	transform: translateX(4px);
}

/* Перша новина — велика горизонтальна картка. */
.tmo-post-card--featured {
	display: grid;
	grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
	margin-bottom: 24px;
	border-radius: 24px;
	box-shadow: 0 10px 30px rgba(30, 53, 86, 0.06);
}

.tmo-post-card--featured .tmo-post-card__media {
	aspect-ratio: auto;
	min-height: 380px;
}

.tmo-post-card--featured .tmo-post-card__body {
	justify-content: center;
	gap: 16px;
	padding: 40px 42px;
}

.tmo-post-card--featured .tmo-post-card__title {
	font-size: clamp(24px, 2vw, 32px);
	font-weight: 700;
	line-height: 1.2;
	-webkit-line-clamp: 4;
}

.tmo-post-card--featured .tmo-post-card__excerpt {
	font-size: 16.5px;
	-webkit-line-clamp: 4;
}

.tmo-post-card--featured .tmo-post-card__more {
	margin-top: 8px;
	align-self: flex-start;
	padding: 12px 20px;
	border-radius: 999px;
	background: rgba(245, 122, 117, 0.12);
}

.tmo-post-card--featured:hover .tmo-post-card__more {
	background: var(--tmo-coral);
	color: #fff;
}

.tmo-post-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

/* ----------------------------------------------------------- Пагінація */

.tmo-pager {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 44px;
}

.tmo-pager .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 46px;
	height: 46px;
	padding: 0 12px;
	border: 1px solid var(--blog-line);
	border-radius: 12px;
	background: #fff;
	font-size: 16px;
	font-weight: 500;
	color: var(--tmo-navy);
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tmo-pager a.page-numbers:hover {
	border-color: var(--tmo-blue);
	color: #2f5d97;
}

.tmo-pager .page-numbers.current {
	border-color: var(--tmo-blue);
	background: var(--tmo-blue);
	color: #fff;
}

.tmo-pager .page-numbers.dots {
	border-color: transparent;
	background: transparent;
}

.tmo-pager .tmo-icon {
	width: 20px;
	height: 20px;
}

.tmo-pager__prev {
	transform: rotate(180deg);
}

/* ------------------------------------------------------- Бічна колонка */

.tmo-blog-box {
	padding: 22px;
	border: 1px solid var(--blog-line);
	border-radius: var(--blog-radius);
	background: #fff;
}

.tmo-blog-box__title {
	margin: 0 0 14px;
	font-size: 18px;
	font-weight: 700;
	color: var(--tmo-navy);
}

.tmo-blog-filter__list {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tmo-blog-filter__link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 12px;
	font-size: 15.5px;
	font-weight: 500;
	color: var(--tmo-navy);
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.tmo-blog-filter__link:hover {
	background: var(--blog-tint);
	color: #2f5d97;
}

.tmo-blog-filter__count {
	flex: none;
	min-width: 30px;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--blog-tint);
	font-size: 12.5px;
	font-weight: 600;
	text-align: center;
	color: #2f5d97;
}

.tmo-blog-filter__link.is-active {
	background: var(--tmo-blue);
	color: #fff;
}

.tmo-blog-filter__link.is-active .tmo-blog-filter__count {
	background: rgba(255, 255, 255, 0.25);
	color: #fff;
}

.tmo-post-minis {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.tmo-post-mini {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	color: inherit;
	text-decoration: none;
}

.tmo-post-mini__media {
	flex: none;
	width: 74px;
	height: 74px;
	border-radius: 12px;
	background: var(--blog-tint);
	overflow: hidden;
}

.tmo-post-mini__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tmo-post-mini__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.tmo-post-mini__title {
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--tmo-navy);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tmo-post-mini:hover .tmo-post-mini__title {
	color: #2f5d97;
}

.tmo-post-mini time {
	font-size: 12.5px;
	color: var(--blog-muted);
}

.tmo-blog-cta {
	border: 0;
	background: linear-gradient(160deg, #eaf2fc 0%, #f7faff 100%);
}

.tmo-blog-cta p {
	margin: -6px 0 14px;
	font-size: 14.5px;
	line-height: 1.5;
	color: var(--blog-muted);
}

.tmo-blog-cta__phone {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 14px;
	font-size: 22px;
	font-weight: 600;
	color: var(--tmo-navy);
	text-decoration: none;
}

.tmo-blog-cta__phone .tmo-icon {
	color: var(--tmo-blue);
}

.tmo-blog-cta__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	height: 50px;
	border-radius: 999px;
	background: linear-gradient(135deg, #f78a85 0%, var(--tmo-coral) 45%, #ec625d 100%);
	box-shadow: 0 10px 22px rgba(245, 122, 117, 0.3);
	font-size: 16px;
	font-weight: 500;
	color: #fff;
	text-decoration: none;
}

.tmo-blog-cta__btn .tmo-icon {
	width: 18px;
	height: 18px;
}

.tmo-blog-cta__btn:hover {
	color: #fff;
	box-shadow: 0 14px 28px rgba(245, 122, 117, 0.4);
}

/* -------------------------------------------------------------- Запис */

.tmo-article__head {
	max-width: 90%;
}

.tmo-article__head .tmo-post-meta {
	margin-bottom: 16px;
}

.tmo-article__title {
	margin: 0;
	font-size: clamp(30px, 3vw, 40px);
	font-weight: 700;
	line-height: 1.12;
	color: var(--tmo-navy);
	text-wrap: balance;
}

.tmo-article__lead {
	margin: 18px 0 0;
	font-size: 20px;
	line-height: 1.55;
	color: var(--blog-muted);
}

/* Плакати бувають і квадратні, і широкі — показуємо цілком на світлому тлі. */
.tmo-article__cover {
	display: flex;
	justify-content: center;
	margin: 30px 0 34px;
	border-radius: 24px;
	background: var(--blog-tint);
	overflow: hidden;
}

.tmo-article__cover img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 640px;
	object-fit: contain;
}

.tmo-article__content {
	max-width: 780px;
	font-size: 18px;
	line-height: 1.75;
	color: #33404f;
}

.tmo-article__content > :first-child {
	margin-top: 0;
}

.tmo-article__content p {
	margin: 0 0 1em;
}

.tmo-article__content h2,
.tmo-article__content h3,
.tmo-article__content h4 {
	margin: 1.7em 0 0.6em;
	line-height: 1.3;
	color: var(--tmo-navy);
}

.tmo-article__content h2 {
	font-size: 28px;
}

.tmo-article__content h3 {
	font-size: 22px;
}

.tmo-article__content strong {
	color: var(--tmo-navy);
}

.tmo-article__content a {
	color: #2f5d97;
	text-decoration-color: rgba(47, 93, 151, 0.35);
	text-underline-offset: 3px;
}

.tmo-article__content a:hover {
	text-decoration-color: currentColor;
}

.tmo-article__content ul,
.tmo-article__content ol {
	margin: 0 0 1.1em;
	padding-left: 1.3em;
}

.tmo-article__content li::marker {
	color: var(--tmo-coral);
}

.tmo-article__content blockquote {
	margin: 1.6em 0;
	padding: 18px 24px;
	border-left: 4px solid var(--tmo-coral);
	border-radius: 0 14px 14px 0;
	background: var(--blog-tint);
}

.tmo-article__content figure {
	margin: 1.8em 0;
}

.tmo-article__content img {
	max-width: 100%;
	height: auto;
	border-radius: 16px;
}

.tmo-article__content .wp-block-gallery img {
	border-radius: 12px;
}

.tmo-article__content figcaption {
	margin-top: 8px;
	font-size: 14px;
	color: var(--blog-muted);
	text-align: center;
}

.tmo-article__foot {
	max-width: 780px;
	margin-top: 40px;
	padding-top: 28px;
	border-top: 1px solid var(--blog-line);
}

.tmo-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.tmo-share__label {
	margin-right: 6px;
	font-size: 15px;
	font-weight: 500;
	color: var(--tmo-navy);
}

.tmo-share__btn {
	display: inline-flex;
	align-items: center;
	height: 40px;
	padding: 0 16px;
	border: 1px solid var(--blog-line);
	border-radius: 999px;
	background: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	color: var(--tmo-navy);
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tmo-share__btn:hover,
.tmo-share__btn.is-done {
	border-color: var(--tmo-blue);
	background: var(--tmo-blue);
	color: #fff;
}

.tmo-post-nav {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin-top: 28px;
}

.tmo-post-nav__link {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 18px 20px;
	border: 1px solid var(--blog-line);
	border-radius: 16px;
	background: #fff;
	text-decoration: none;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.tmo-post-nav__link:hover {
	border-color: transparent;
	box-shadow: var(--blog-shadow);
}

.tmo-post-nav__link--next {
	grid-column: 2;
	text-align: right;
}

.tmo-post-nav__label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--tmo-coral);
}

.tmo-post-nav__link--next .tmo-post-nav__label {
	justify-content: flex-end;
}

.tmo-post-nav__label .tmo-icon {
	width: 16px;
	height: 16px;
}

.tmo-post-nav__title {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--tmo-navy);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tmo-related {
	margin-top: 64px;
}

.tmo-related__title {
	margin: 0 0 22px;
	font-size: 28px;
	font-weight: 700;
	color: var(--tmo-navy);
}

/* ------------------------------------------------------------ Адаптив */

@media (max-width: 1400px) {
	.tmo-post-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.tmo-post-card--featured {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}

	.tmo-post-card--featured .tmo-post-card__body {
		padding: 32px;
	}
}

@media (max-width: 1100px) {
	.tmo-blog-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}

	.tmo-blog-aside__sticky {
		position: static;
	}

	/* На стрічці фільтр стає рядком «чипів» над новинами. */
	.tmo-blog:not(.tmo-blog--single) .tmo-blog-aside {
		order: -1;
	}

	.tmo-blog:not(.tmo-blog--single) .tmo-blog-filter {
		padding: 0;
		border: 0;
		background: transparent;
	}

	.tmo-blog:not(.tmo-blog--single) .tmo-blog-filter .tmo-blog-box__title {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.tmo-blog:not(.tmo-blog--single) .tmo-blog-filter__list {
		flex-direction: row;
		gap: 8px;
		margin-inline: calc(var(--tmo-gutter) * -1);
		padding: 2px var(--tmo-gutter) 6px;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.tmo-blog:not(.tmo-blog--single) .tmo-blog-filter__list::-webkit-scrollbar {
		display: none;
	}

	.tmo-blog:not(.tmo-blog--single) .tmo-blog-filter__link {
		white-space: nowrap;
		border: 1px solid var(--blog-line);
		border-radius: 999px;
		background: #fff;
	}

	.tmo-blog:not(.tmo-blog--single) .tmo-blog-filter__link.is-active {
		border-color: var(--tmo-blue);
		background: var(--tmo-blue);
	}

	.tmo-blog--single .tmo-blog-aside__sticky {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 760px) {
	.tmo-post-card--featured {
		grid-template-columns: minmax(0, 1fr);
	}

	.tmo-post-card--featured .tmo-post-card__media {
		aspect-ratio: 4 / 3;
		min-height: 0;
	}

	.tmo-post-card--featured .tmo-post-card__body {
		padding: 22px;
	}

	.tmo-post-grid,
	.tmo-post-grid--3 {
		grid-template-columns: minmax(0, 1fr);
	}

	.tmo-blog--single .tmo-blog-aside__sticky {
		grid-template-columns: minmax(0, 1fr);
	}

	.tmo-article__content {
		font-size: 17px;
	}

	.tmo-article__lead {
		font-size: 18px;
	}

	.tmo-article__cover {
		margin: 22px 0 26px;
		border-radius: 18px;
	}

	.tmo-post-nav {
		grid-template-columns: minmax(0, 1fr);
	}

	.tmo-post-nav__link--next {
		grid-column: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tmo-blog *,
	.tmo-blog *::before,
	.tmo-blog *::after {
		transition: none !important;
	}
}
