/**
 * Smart MFO Sync — Homepage styles.
 * Mobile-first.
 */

.smfo-homepage {
	max-width: 1100px;
	margin: 0 auto;
	padding: 16px;
	color: #111827;
}

/* ============ HERO ============ */

.smfo-hp-hero {
	background: linear-gradient(135deg, #1a56db 0%, #1e40af 50%, #1e3a8a 100%);
	color: #fff;
	border-radius: 20px;
	padding: 36px 24px;
	margin-bottom: 16px;
	text-align: center;
	box-shadow: 0 10px 40px rgba(30, 64, 175, 0.25);
}

.smfo-hp-hero h1 {
	font-size: clamp(28px, 5vw, 42px);
	font-weight: 800;
	margin: 0 0 10px;
	color: #fff;
	line-height: 1.15;
	letter-spacing: -0.5px;
}

.smfo-hp-subtitle {
	font-size: clamp(14px, 2vw, 17px);
	color: rgba(255, 255, 255, 0.95);
	margin: 0 0 24px;
	line-height: 1.55;
}

.smfo-hp-subtitle strong {
	color: #fde047;
	font-weight: 700;
}

.smfo-hp-hero-stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	max-width: 600px;
	margin: 0 auto;
}

.smfo-hp-stat {
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 12px;
	padding: 12px;
	backdrop-filter: blur(8px);
}

.smfo-hp-stat strong {
	display: block;
	font-size: clamp(20px, 3vw, 28px);
	font-weight: 800;
	color: #fde047;
	line-height: 1;
	margin-bottom: 4px;
}

.smfo-hp-stat span {
	font-size: 11px;
	color: rgba(255, 255, 255, 0.85);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* ============ CATEGORY TABS (sticky horizontal) ============ */

.smfo-hp-tabs {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	padding: 8px;
	margin-bottom: 16px;
	display: flex;
	gap: 6px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	position: sticky;
	top: 0;
	z-index: 50;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
	white-space: nowrap;
}

.smfo-hp-tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 16px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 600;
	color: #4b5563;
	text-decoration: none;
	transition: all 0.15s;
	flex-shrink: 0;
}

.smfo-hp-tab:hover {
	background: #f3f4f6;
	color: #2271b1;
}

.smfo-hp-tab.active {
	background: #2271b1;
	color: #fff;
}

.smfo-hp-tab small {
	color: inherit;
	opacity: 0.7;
	font-weight: 400;
	font-size: 11px;
}

/* ============ SECTIONS ============ */

.smfo-hp-section {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 24px;
	margin-bottom: 16px;
}

.smfo-hp-section-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 18px;
	gap: 12px;
}

.smfo-hp-section-head h2 {
	font-size: clamp(18px, 3vw, 24px);
	font-weight: 700;
	margin: 0;
	color: #111827;
}

.smfo-hp-see-all {
	font-size: 13px;
	color: #2271b1;
	text-decoration: none;
	font-weight: 600;
	white-space: nowrap;
	flex-shrink: 0;
}

.smfo-hp-see-all:hover {
	text-decoration: underline;
}

/* ============ TOP-3 GRID ============ */

.smfo-hp-top-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px;
}

.smfo-top-card {
	background: #fff;
	border: 2px solid #e5e7eb;
	border-radius: 14px;
	padding: 18px;
	position: relative;
	transition: all 0.2s;
	display: flex;
	flex-direction: column;
}

.smfo-top-card:hover {
	border-color: #2271b1;
	box-shadow: 0 8px 24px rgba(34, 113, 177, 0.15);
	transform: translateY(-2px);
}

.smfo-top-card-rank {
	position: absolute;
	top: -10px;
	left: 14px;
	background: linear-gradient(135deg, #f59e0b, #ef4444);
	color: #fff;
	font-weight: 800;
	font-size: 13px;
	padding: 4px 10px;
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.smfo-top-card-head {
	display: flex;
	gap: 10px;
	margin-bottom: 12px;
	align-items: center;
}

.smfo-top-card-logo {
	width: 100px;
	height: 60px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 6px;
	overflow: hidden;
}

.smfo-top-card-logo img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

.smfo-top-card h3 {
	font-size: 15px;
	font-weight: 700;
	margin: 0 0 4px;
	line-height: 1.2;
}

.smfo-top-card h3 a {
	color: #111827;
	text-decoration: none;
}

.smfo-top-card h3 a:hover {
	color: #2271b1;
}

.smfo-top-card-rating {
	font-size: 11px;
	color: #6b7280;
}

.smfo-stars-yellow {
	color: #f59e0b;
	letter-spacing: 1px;
}

.smfo-top-card-params {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
	background: #f9fafb;
	border-radius: 8px;
	padding: 10px;
	margin-bottom: 12px;
}

.smfo-top-card-params > div {
	text-align: center;
}

.smfo-top-card-params strong {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: #111827;
	margin-bottom: 2px;
	font-variant-numeric: tabular-nums;
}

.smfo-top-card-params span {
	font-size: 10px;
	color: #6b7280;
	text-transform: uppercase;
}

.smfo-top-card-cta {
	display: block;
	background: #15803d;
	color: #fff !important;
	text-align: center;
	font-weight: 700;
	font-size: 14px;
	padding: 11px;
	border-radius: 8px;
	text-decoration: none !important;
	transition: background 0.15s;
	margin-bottom: 6px;
}

.smfo-top-card-cta:hover {
	background: #166534;
}

.smfo-top-card-more {
	display: block;
	color: #2271b1;
	text-align: center;
	font-size: 12px;
	text-decoration: none;
	padding: 4px;
}

.smfo-top-card-more:hover {
	text-decoration: underline;
}

/* ============ COMPACT LIST ROWS ============ */

.smfo-hp-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.smfo-hp-row {
	display: grid;
	grid-template-columns: 80px 1fr 200px auto;
	gap: 14px;
	align-items: center;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 10px 14px;
	transition: all 0.15s;
}

.smfo-hp-row:hover {
	border-color: #2271b1;
	background: #f9fafb;
}

.smfo-hp-row-logo {
	width: 80px;
	height: 50px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	overflow: hidden;
	flex-shrink: 0;
}

.smfo-hp-row-logo img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

.smfo-hp-row-name a {
	font-weight: 700;
	color: #111827;
	font-size: 14px;
	text-decoration: none;
}

.smfo-hp-row-name a:hover {
	color: #2271b1;
}

.smfo-hp-badge-free {
	display: inline-block;
	background: #dcfce7;
	color: #166534;
	font-size: 10px;
	padding: 2px 8px;
	border-radius: 8px;
	margin-left: 6px;
	font-weight: 600;
}

.smfo-hp-row-params {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	font-size: 12px;
	color: #6b7280;
	font-variant-numeric: tabular-nums;
}

.smfo-hp-row-params strong {
	display: block;
	color: #111827;
	font-size: 13px;
}

.smfo-hp-row-cta {
	background: #15803d;
	color: #fff !important;
	text-decoration: none !important;
	padding: 8px 16px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	transition: background 0.15s;
}

.smfo-hp-row-cta:hover {
	background: #166534;
}

/* ============ TAGS CLOUD ============ */

.smfo-hp-tags-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.smfo-hp-tag {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #f3f4f6;
	color: #374151;
	padding: 8px 14px;
	border-radius: 18px;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.15s;
	border: 1.5px solid transparent;
}

.smfo-hp-tag:hover {
	background: #2271b1;
	color: #fff;
	border-color: #1e5a92;
	transform: translateY(-1px);
}

.smfo-hp-tag small {
	background: rgba(0, 0, 0, 0.08);
	padding: 1px 6px;
	border-radius: 8px;
	font-size: 10px;
	font-weight: 600;
	color: inherit;
	opacity: 0.7;
}

.smfo-hp-tag:hover small {
	background: rgba(255, 255, 255, 0.2);
	opacity: 0.9;
}

/* ============ FAQ ============ */

.smfo-hp-faq-item {
	border-bottom: 1px solid #e5e7eb;
	padding: 14px 0;
}

.smfo-hp-faq-item:last-child {
	border-bottom: none;
}

.smfo-hp-faq-item summary {
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	color: #111827;
	padding: 4px 0;
	user-select: none;
	list-style: none;
	display: flex;
	align-items: center;
	gap: 10px;
}

.smfo-hp-faq-item summary::-webkit-details-marker { display: none; }

.smfo-hp-faq-item summary::before {
	content: '+';
	font-size: 22px;
	font-weight: 300;
	color: #2271b1;
	flex-shrink: 0;
	width: 22px;
	transition: transform 0.2s;
	line-height: 1;
}

.smfo-hp-faq-item[open] summary::before {
	content: '−';
}

.smfo-hp-faq-item[open] summary {
	color: #2271b1;
}

.smfo-hp-faq-item p {
	margin: 10px 0 0 32px;
	color: #374151;
	line-height: 1.65;
	font-size: 14px;
}

.smfo-hp-faq-item a {
	color: #2271b1;
}

/* ============ CALCULATOR SECTION ============ */

.smfo-hp-calc-section {
	background: linear-gradient(180deg, #f9fafb 0%, #fff 100%);
}

.smfo-hp-calc-section .smfo-calc {
	max-width: none;
	box-shadow: none;
	border: none;
	margin: 0;
	padding: 0;
}

/* ============ MOBILE ============ */

@media (max-width: 900px) {
	.smfo-hp-top-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 700px) {
	.smfo-hp-row {
		grid-template-columns: 80px 1fr;
		gap: 8px;
	}

	.smfo-hp-row-params {
		grid-column: 1 / -1;
		grid-template-columns: repeat(3, 1fr);
		font-size: 11px;
		padding-top: 6px;
		border-top: 1px solid #e5e7eb;
	}

	.smfo-hp-row-cta {
		grid-column: 1 / -1;
		text-align: center;
	}
}

@media (max-width: 500px) {
	.smfo-homepage {
		padding: 8px;
	}

	.smfo-hp-hero {
		padding: 24px 16px;
		border-radius: 14px;
	}

	.smfo-hp-section {
		padding: 16px;
		border-radius: 12px;
	}

	.smfo-hp-hero-stats {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* ============ LOGO RESET (захист від теми сайту) ============ */
/* Деякі теми WP додають width:100% до всіх img — це ламає логотипи */
.smfo-homepage .smfo-hp-row-logo img,
.smfo-homepage .smfo-top-card-logo img,
.smfo-archive .smfo-hp-row-logo img,
.smfo-archive .smfo-top-card-logo img {
	width: auto !important;
	height: auto !important;
	max-width: 100% !important;
	max-height: 100% !important;
	object-fit: contain !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	box-shadow: none !important;
}

/* ============ NEWS BLOCK on Homepage ============ */

.smfo-hp-news-section {
	margin: 24px 0;
}

.smfo-hp-news-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px;
}

.smfo-hp-news-card {
	display: block;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	text-decoration: none !important;
	transition: all 0.2s;
}

.smfo-hp-news-card:hover {
	border-color: #2271b1;
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(34, 113, 177, 0.1);
}

.smfo-hp-news-thumb {
	aspect-ratio: 16 / 10;
	background-size: cover;
	background-position: center;
	background-color: #f3f4f6;
}

.smfo-hp-news-thumb-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 48px;
	background: linear-gradient(135deg, #dbeafe, #e0f2fe);
}

.smfo-hp-news-body {
	padding: 14px;
}

.smfo-hp-news-cat {
	display: inline-block;
	background: #dbeafe;
	color: #1e40af;
	font-size: 10px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 8px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	margin-bottom: 8px;
}

.smfo-hp-news-card h3 {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.35;
	margin: 0 0 6px;
	color: #111827;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.smfo-hp-news-card small {
	color: #9ca3af;
	font-size: 11px;
}

@media (max-width: 800px) {
	.smfo-hp-news-grid {
		grid-template-columns: 1fr;
	}
}
