/**
 * Smart MFO Sync — внутрішня перелінковка і хаб статей.
 *
 * Кольори задано явно селектором із двох класів: успадкування тут уже двічі
 * ламала тема (світлий текст на світлій картці). Контраст на #fff:
 * #111827 — 16,9:1 · #4b5563 — 7,5:1 · #1a56db — 6,3:1 · #1f2937 — 14,7:1.
 */

/* ================= БЛОКИ ПЕРЕЛІНКОВКИ ================= */

.smfo-il {
	margin: 36px 0 8px;
	padding-top: 24px;
	border-top: 1px solid #e5e7eb;
	max-width: 100%;
}

.smfo-il .smfo-il__title {
	margin: 0 0 16px;
	font-size: clamp(19px, 3.4vw, 23px);
	line-height: 1.3;
	font-weight: 700;
	color: #111827;
	-webkit-text-fill-color: #111827;
}

.smfo-il .smfo-il__grid,
.smfo-hub .smfo-il__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
	gap: 14px;
	list-style: none;
	margin: 0;
	padding: 0;
	max-width: 100%;
}

.smfo-il .smfo-il__item,
.smfo-hub .smfo-il__item {
	list-style: none;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.smfo-il .smfo-il__item::before,
.smfo-hub .smfo-il__item::before {
	content: none;
}

.smfo-il .smfo-il__card,
.smfo-hub .smfo-il__card {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-width: 0;
	overflow: hidden;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	text-decoration: none;
	box-shadow: none;
	transition: border-color .15s ease, transform .15s ease;
}

.smfo-il .smfo-il__card:hover,
.smfo-il .smfo-il__card:focus-visible,
.smfo-hub .smfo-il__card:hover,
.smfo-hub .smfo-il__card:focus-visible {
	border-color: #1a56db;
	transform: translateY(-2px);
}

.smfo-il .smfo-il__card:focus-visible,
.smfo-hub .smfo-il__card:focus-visible {
	outline: 2px solid #1a56db;
	outline-offset: 2px;
}

.smfo-il .smfo-il__thumb,
.smfo-hub .smfo-il__thumb {
	display: block;
	/* 40/21 = 1200x630 — рівно розмір обкладинок і OG-картинки.
	   При 16/10 ширша картинка обрізалась з боків і зʼїдала текст. */
	aspect-ratio: 40 / 21;
	background: #f3f4f6;
	overflow: hidden;
}

.smfo-il .smfo-il__img,
.smfo-hub .smfo-il__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
}

.smfo-il .smfo-il__body,
.smfo-hub .smfo-il__body {
	display: block;
	padding: 12px 14px 14px;
	min-width: 0;
}

.smfo-il .smfo-il__heading,
.smfo-hub .smfo-il__heading {
	display: block;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	color: #111827;
	-webkit-text-fill-color: #111827;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.smfo-il .smfo-il__date,
.smfo-hub .smfo-il__date {
	display: block;
	margin-top: 8px;
	font-size: 12px;
	line-height: 1.4;
	color: #4b5563;
	-webkit-text-fill-color: #4b5563;
}

.smfo-il .smfo-il__excerpt,
.smfo-hub .smfo-il__excerpt {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	line-height: 1.5;
	color: #374151;
	-webkit-text-fill-color: #374151;
	overflow-wrap: anywhere;
}

/* ================= ХАБ СТАТЕЙ ================= */

.smfo-hub {
	max-width: 1040px;
	margin: 0 auto;
	padding: 20px 16px 40px;
	box-sizing: border-box;
	overflow-wrap: anywhere;
}

.smfo-hub .smfo-hub__crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-bottom: 14px;
	font-size: 13px;
	line-height: 1.5;
	color: #4b5563;
	-webkit-text-fill-color: #4b5563;
}

.smfo-hub .smfo-hub__crumb {
	color: #1a56db;
	-webkit-text-fill-color: #1a56db;
	text-decoration: none;
}

.smfo-hub .smfo-hub__crumb:hover {
	text-decoration: underline;
}

.smfo-hub .smfo-hub__crumb--current {
	color: #4b5563;
	-webkit-text-fill-color: #4b5563;
	text-decoration: none;
}

.smfo-hub .smfo-hub__crumb-sep {
	color: #6b7280;
	-webkit-text-fill-color: #6b7280;
}

.smfo-hub .smfo-hub__header {
	margin-bottom: 18px;
}

.smfo-hub .smfo-hub__h1 {
	margin: 0 0 10px;
	font-size: clamp(24px, 5.2vw, 34px);
	line-height: 1.2;
	font-weight: 700;
	color: #111827;
	-webkit-text-fill-color: #111827;
}

.smfo-hub .smfo-hub__lead {
	margin: 0;
	max-width: 70ch;
	font-size: 15px;
	line-height: 1.6;
	color: #374151;
	-webkit-text-fill-color: #374151;
}

.smfo-hub .smfo-hub__filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 14px;
	max-width: 100%;
}

.smfo-hub .smfo-hub__filters-label {
	font-size: 13px;
	font-weight: 600;
	color: #374151;
	-webkit-text-fill-color: #374151;
}

.smfo-hub .smfo-hub__chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border: 1px solid #e5e7eb;
	border-radius: 999px;
	background: #f3f4f6;
	font-size: 13px;
	line-height: 1.3;
	text-decoration: none;
	color: #1f2937;
	-webkit-text-fill-color: #1f2937;
}

.smfo-hub .smfo-hub__chip:hover,
.smfo-hub .smfo-hub__chip:focus-visible {
	border-color: #1a56db;
	color: #14328a;
	-webkit-text-fill-color: #14328a;
}

.smfo-hub .smfo-hub__chip--active {
	background: #1a56db;
	border-color: #1a56db;
	color: #ffffff;
	-webkit-text-fill-color: #ffffff;
}

.smfo-hub .smfo-hub__chip-count {
	font-size: 11px;
	font-variant-numeric: tabular-nums;
	color: #4b5563;
	-webkit-text-fill-color: #4b5563;
}

.smfo-hub .smfo-hub__chip--active .smfo-hub__chip-count {
	color: #e5edff;
	-webkit-text-fill-color: #e5edff;
}

.smfo-hub .smfo-hub__grid {
	margin-bottom: 24px;
}

.smfo-hub .smfo-hub__pager {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin: 8px 0 16px;
}

.smfo-hub .smfo-hub__pager a,
.smfo-hub .smfo-hub__pager span {
	display: inline-block;
	padding: 8px 13px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.2;
	text-decoration: none;
	background: #ffffff;
	color: #1a56db;
	-webkit-text-fill-color: #1a56db;
}

.smfo-hub .smfo-hub__pager span.current {
	background: #1a56db;
	border-color: #1a56db;
	color: #ffffff;
	-webkit-text-fill-color: #ffffff;
}

.smfo-hub .smfo-hub__pager span.dots {
	border-color: transparent;
	background: transparent;
	color: #4b5563;
	-webkit-text-fill-color: #4b5563;
}

.smfo-hub .smfo-hub__more,
.smfo-hub .smfo-hub__empty {
	margin: 8px 0 0;
	font-size: 14px;
	line-height: 1.6;
	color: #374151;
	-webkit-text-fill-color: #374151;
}

.smfo-hub .smfo-hub__empty-link {
	color: #1a56db;
	-webkit-text-fill-color: #1a56db;
}

/* ================= НАВІГАЦІЯ АРХІВУ НОВИН ================= */

.smfo-newsnav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 18px;
	max-width: 100%;
}

.smfo-newsnav .smfo-newsnav__label {
	font-size: 13px;
	font-weight: 600;
	color: #374151;
	-webkit-text-fill-color: #374151;
}

.smfo-newsnav .smfo-newsnav__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border: 1px solid #e5e7eb;
	border-radius: 999px;
	background: #f3f4f6;
	font-size: 13px;
	line-height: 1.3;
	text-decoration: none;
	color: #1f2937;
	-webkit-text-fill-color: #1f2937;
}

.smfo-newsnav .smfo-newsnav__link:hover,
.smfo-newsnav .smfo-newsnav__link:focus-visible {
	border-color: #1a56db;
	color: #14328a;
	-webkit-text-fill-color: #14328a;
}

.smfo-newsnav .smfo-newsnav__link--active {
	background: #1a56db;
	border-color: #1a56db;
	color: #ffffff;
	-webkit-text-fill-color: #ffffff;
}

.smfo-newsnav .smfo-newsnav__count {
	font-size: 11px;
	font-variant-numeric: tabular-nums;
	color: #4b5563;
	-webkit-text-fill-color: #4b5563;
}

.smfo-newsnav .smfo-newsnav__link--active .smfo-newsnav__count {
	color: #e5edff;
	-webkit-text-fill-color: #e5edff;
}

/* ================= ФОЛБЕК-СМУЖКА В ПІДВАЛІ ================= */

.smfo-hubnav {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	padding: 14px 16px;
	background: #f3f4f6;
	border-top: 1px solid #e5e7eb;
}

.smfo-hubnav .smfo-hubnav__inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px 20px;
	max-width: 1040px;
	margin: 0 auto;
}

.smfo-hubnav .smfo-hubnav__link {
	font-size: 14px;
	line-height: 1.4;
	text-decoration: none;
	color: #1a56db;
	-webkit-text-fill-color: #1a56db;
}

.smfo-hubnav .smfo-hubnav__link:hover,
.smfo-hubnav .smfo-hubnav__link:focus-visible {
	text-decoration: underline;
	color: #14328a;
	-webkit-text-fill-color: #14328a;
}

@media (max-width: 420px) {
	.smfo-hub {
		padding: 16px 12px 32px;
	}

	.smfo-il .smfo-il__grid,
	.smfo-hub .smfo-il__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.smfo-il .smfo-il__card,
	.smfo-hub .smfo-il__card {
		transition: none;
	}

	.smfo-il .smfo-il__card:hover,
	.smfo-hub .smfo-il__card:hover {
		transform: none;
	}
}
