/**
 * discovery.css — Phase 6: hero, homepage sections, AI Tool card, archive
 * headers, the AI Tool hub header, search results, breadcrumbs,
 * pagination, and the rich empty-state. Enqueued only on the front page,
 * archives, search, and 404 (see inc/enqueue.php) — never on a single
 * article. Uses only the existing --fn-* design tokens; no new colors,
 * no new typography scale.
 */

/* ---------- hero ---------- */

.fn-main--homepage {
	padding-top: 0;
}

.fn-hero {
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	min-height: 380px;
	padding: var(--fn-space-7) 0;
	text-align: left;
}

.fn-hero > .fn-container {
	width: 100%;
}

@media (min-width: 768px) {
	.fn-hero {
		min-height: 460px;
	}
}

@media (min-width: 1024px) {
	.fn-hero {
		min-height: 560px;
	}
}

.fn-hero__media {
	position: absolute;
	top: 0;
	left: 50%;
	width: 100vw;
	height: 100%;
	transform: translateX(-50%);
	z-index: 0;
}

.fn-hero__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.fn-hero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to right, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.86) 32%, rgba(255, 255, 255, 0.4) 54%, rgba(255, 255, 255, 0) 74%);
}

.fn-hero__grid {
	width: 100%;
}

.fn-hero__content {
	position: relative;
	z-index: 2;
	min-width: 0;
	max-width: 560px;
}

.fn-hero__title {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	font-size: var(--fn-fs-display);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.1;
	margin-bottom: var(--fn-space-4);
}

.fn-hero__title-line--ink {
	color: var(--fn-ink);
}

.fn-hero__title-line--accent {
	color: var(--fn-accent);
}

.fn-hero__subtitle {
	max-width: 46ch;
	margin: 0 0 var(--fn-space-6);
	font-size: var(--fn-fs-body-lg);
	color: var(--fn-ink-2);
}

.fn-hero__search {
	justify-content: flex-start;
	margin: 0 0 var(--fn-space-5);
}

.fn-hero__examples {
	justify-content: flex-start;
}

.fn-hero__examples-label {
	font-size: var(--fn-fs-small);
	font-weight: 600;
	color: var(--fn-ink-2);
}

/* ---------- reusable "pill" link — hero examples, empty-state topics ---------- */

.fn-pill {
	display: inline-flex;
	align-items: center;
	padding: 8px 14px;
	border-radius: 999px;
	border: 1px solid var(--fn-border);
	background: var(--fn-surface);
	font-size: var(--fn-fs-small);
	font-weight: 600;
	color: var(--fn-ink-2);
	text-decoration: none;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.fn-pill:hover {
	border-color: var(--fn-accent);
	color: var(--fn-accent-ink);
}

/* ---------- homepage discovery sections ---------- */

.fn-discovery-section {
	padding: var(--fn-space-7) 0;
}

.fn-discovery-section + .fn-discovery-section {
	border-top: 1px solid var(--fn-border);
}

.fn-discovery-section__header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--fn-space-4);
	margin-bottom: var(--fn-space-5);
}

.fn-discovery-section__title {
	font-size: var(--fn-fs-h2);
	font-weight: 700;
	margin: 0;
}

.fn-discovery-section__view-all {
	flex-shrink: 0;
	font-size: var(--fn-fs-small);
	font-weight: 600;
	color: var(--fn-accent-ink);
	text-decoration: none;
	white-space: nowrap;
}

.fn-discovery-section__view-all:hover {
	color: var(--fn-accent-hover);
}

/* ---------- Browse by Category (horizontal tiles) ---------- */

.fn-card-grid--categories {
	grid-template-columns: repeat(2, 1fr);
	gap: var(--fn-space-4);
}

@media (min-width: 768px) {
	.fn-card-grid--categories {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1024px) {
	.fn-card-grid--categories {
		grid-template-columns: repeat(6, 1fr);
	}
}

.fn-card--category {
	background: var(--fn-surface);
	border: 1px solid var(--fn-border);
	border-radius: var(--fn-radius-md);
	box-shadow: var(--fn-shadow-sm);
	transition: border-color 0.15s ease;
}

.fn-card--category:hover {
	border-color: var(--fn-border-strong);
}

.fn-card--category .fn-card__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: var(--fn-space-3);
	padding: var(--fn-space-5) var(--fn-space-3);
	text-decoration: none;
	color: inherit;
}

.fn-card--category .fn-card__icon {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--fn-accent);
	color: var(--fn-accent);
}

.fn-card--category .fn-card__icon svg {
	display: none;
}

.fn-card--category .fn-card__icon::before {
	content: '';
	width: 26px;
	height: 26px;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
}

.fn-card--category .fn-card__body {
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--fn-space-1);
}

.fn-card--category .fn-card__title {
	font-size: var(--fn-fs-h4);
	font-weight: 700;
	margin: 0;
}

.fn-card--category .fn-card__title::after {
	display: block;
	font-size: var(--fn-fs-small);
	font-weight: 400;
	color: var(--fn-ink-2);
	margin-top: var(--fn-space-1);
}

.fn-card--category .fn-card__excerpt {
	font-size: var(--fn-fs-small);
	color: var(--fn-ink-2);
	margin: var(--fn-space-1) 0 0;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* ---------- AI Tool card ---------- */

.fn-tool-card {
	border: 1px solid var(--fn-border);
	border-radius: var(--fn-radius-md);
	background: var(--fn-surface);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fn-tool-card:hover {
	border-color: var(--fn-border-strong);
	box-shadow: var(--fn-shadow-sm);
}

.fn-tool-card__link {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--fn-space-2);
	padding: var(--fn-space-4);
	text-decoration: none;
	color: inherit;
}

.fn-tool-card__logo {
	width: 40px;
	height: 40px;
	object-fit: contain;
	border-radius: var(--fn-radius-sm);
	border: 1px solid var(--fn-border);
	background: var(--fn-surface);
	padding: 4px;
}

.fn-tool-card__name {
	font-size: 15px;
	font-weight: 700;
	color: var(--fn-ink);
}

.fn-tool-card__description {
	font-size: 13px;
	color: var(--fn-ink-2);
	line-height: 1.5;
	margin: 0;
}

.fn-tool-card__count {
	font-size: 11.5px;
	color: var(--fn-ink-3);
	margin-top: auto;
	padding-top: var(--fn-space-1);
}

/* ---------- archive headers (category / tag) ---------- */

.fn-archive-header {
	padding: var(--fn-space-6) 0 var(--fn-space-5);
}

.fn-archive-header__title {
	font-size: var(--fn-fs-h1);
	font-weight: 800;
	letter-spacing: -0.01em;
	margin-bottom: var(--fn-space-2);
}

.fn-archive-header__description {
	color: var(--fn-ink-2);
	max-width: 68ch;
}

.fn-archive-header__children {
	display: flex;
	flex-wrap: wrap;
	gap: var(--fn-space-2);
	margin-bottom: var(--fn-space-6);
}

/* ---------- AI Tool hub header ---------- */

.fn-tool-hub__header {
	display: flex;
	gap: var(--fn-space-4);
	align-items: flex-start;
	padding: var(--fn-space-6) 0 var(--fn-space-7);
	border-bottom: 1px solid var(--fn-border);
	margin-bottom: var(--fn-space-2);
}

.fn-tool-hub__logo {
	width: 72px;
	height: 72px;
	object-fit: contain;
	flex-shrink: 0;
	border-radius: var(--fn-radius-md);
	border: 1px solid var(--fn-border);
	background: var(--fn-surface);
	padding: var(--fn-space-2);
}

.fn-tool-hub__title {
	font-size: var(--fn-fs-h1);
	font-weight: 800;
	margin-bottom: var(--fn-space-2);
}

.fn-tool-hub__description {
	color: var(--fn-ink-2);
	max-width: 68ch;
	margin-bottom: var(--fn-space-3);
}

.fn-tool-hub__website {
	display: inline-flex;
	font-size: var(--fn-fs-small);
	font-weight: 600;
	color: var(--fn-accent-ink);
	text-decoration: none;
}

.fn-tool-hub__website:hover {
	color: var(--fn-accent-hover);
}

@media (max-width: 480px) {
	.fn-tool-hub__header {
		flex-direction: column;
	}
}

/* ---------- search results — single-column list, titles prioritized ---------- */

.fn-card-grid--list {
	grid-template-columns: 1fr;
	max-width: var(--fn-container-article);
}

.fn-card-grid--list .fn-card__link {
	flex-direction: row;
	align-items: center;
	gap: var(--fn-space-4);
}

.fn-card-grid--list .fn-card__media {
	flex-shrink: 0;
	width: 96px;
}

/* ---------- breadcrumbs ---------- */

.fn-breadcrumbs {
	padding-top: var(--fn-space-5);
}

.fn-breadcrumbs__list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0;
	margin: 0;
	padding: 0;
	font-size: var(--fn-fs-small);
	color: var(--fn-ink-3);
}

.fn-breadcrumbs__item {
	display: flex;
	align-items: center;
}

.fn-breadcrumbs__item:not(:last-child)::after {
	content: "/";
	margin: 0 var(--fn-space-2);
	color: var(--fn-ink-3);
}

.fn-breadcrumbs__item a {
	color: var(--fn-ink-2);
	text-decoration: none;
}

.fn-breadcrumbs__item a:hover {
	color: var(--fn-accent-ink);
}

.fn-breadcrumbs__item [aria-current="page"] {
	color: var(--fn-ink-3);
}

/* ---------- Rank Math breadcrumb restyle (Phase 7) ----------
   Only applies when Rank Math is active and breadcrumbs.php has deferred
   to rank_math_the_breadcrumbs() (see that file). The .fn-breadcrumbs
   wrapper above already supplies spacing/positioning; these rules target
   Rank Math's own default breadcrumb markup/classes directly (the
   documented lower-risk "CSS-only" approach) so the visible trail still
   matches FaqsNow's typography and color tokens without needing the
   rank_math/frontend/breadcrumb/html filter. Flagged in the Phase 7
   live-testing checklist: confirm against a real Rank Math install, since
   exact DOM structure can vary slightly by Rank Math version/settings. */

.fn-breadcrumbs--rank-math,
.fn-breadcrumbs--rank-math .rank-math-breadcrumb,
.fn-breadcrumbs--rank-math p {
	font-size: var(--fn-fs-small);
	color: var(--fn-ink-3);
	margin: 0;
}

.fn-breadcrumbs--rank-math a {
	color: var(--fn-ink-2);
	text-decoration: none;
}

.fn-breadcrumbs--rank-math a:hover {
	color: var(--fn-accent-ink);
}

/* ---------- author archive header (Phase 7) ---------- */

.fn-author-header {
	display: flex;
	gap: var(--fn-space-4);
	align-items: flex-start;
	padding: var(--fn-space-6) 0 var(--fn-space-7);
	border-bottom: 1px solid var(--fn-border);
	margin-bottom: var(--fn-space-2);
}

.fn-author-header__avatar {
	border-radius: 50%;
	flex-shrink: 0;
}

.fn-author-header__title {
	font-size: var(--fn-fs-h1);
	font-weight: 800;
	margin-bottom: var(--fn-space-2);
}

.fn-author-header__bio {
	color: var(--fn-ink-2);
	max-width: 68ch;
}

@media (max-width: 480px) {
	.fn-author-header {
		flex-direction: column;
	}
}

/* ---------- pagination — styling core's own the_posts_pagination() markup ---------- */

.pagination.navigation {
	margin-top: var(--fn-space-7);
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--fn-space-2);
	justify-content: center;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	min-height: 40px;
	padding: 0 var(--fn-space-3);
	border-radius: var(--fn-radius-sm);
	border: 1px solid var(--fn-border);
	font-size: var(--fn-fs-small);
	font-weight: 600;
	color: var(--fn-ink-2);
	text-decoration: none;
}

.pagination a.page-numbers:hover {
	border-color: var(--fn-border-strong);
	color: var(--fn-ink);
}

.pagination .page-numbers.current {
	background: var(--fn-accent);
	border-color: var(--fn-accent);
	color: #fff;
}

.pagination .page-numbers.dots {
	border-color: transparent;
	color: var(--fn-ink-3);
}

/* ---------- rich empty-state (search / 404) ---------- */

.fn-empty-state--rich {
	max-width: 640px;
}

.fn-empty-state__search {
	max-width: 480px;
	margin: 0 auto var(--fn-space-7);
}

.fn-empty-state__section {
	margin-top: var(--fn-space-7);
	text-align: left;
}

.fn-empty-state__heading {
	font-size: var(--fn-fs-h4);
	font-weight: 700;
	margin-bottom: var(--fn-space-3);
	text-align: center;
}

.fn-empty-state__pills {
	display: flex;
	flex-wrap: wrap;
	gap: var(--fn-space-2);
	justify-content: center;
}

.fn-empty-state__section .fn-card-grid {
	text-align: left;
}

/* ---------- mobile refinement ---------- */

@media (max-width: 480px) {
	.fn-hero {
		padding: var(--fn-space-6) 0 var(--fn-space-6);
	}

	.fn-discovery-section__header {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--fn-space-2);
	}

	.fn-card-grid--list .fn-card__link {
		flex-direction: column;
		align-items: stretch;
	}

	.fn-card-grid--list .fn-card__media {
		width: 100%;
	}
}


/* per-category colors, icons, subtitles */

.fn-card--category:nth-child(1) .fn-card__icon {
	background: #3B82F6;
}

.fn-card--category:nth-child(1) .fn-card__icon::before {
	background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%202v20M4.2%207l15.6%2010M19.8%207L4.2%2017%22%2F%3E%3C%2Fsvg%3E");
}

.fn-card--category:nth-child(1) .fn-card__title::after {
	content: "AI news & explainers";
}

.fn-card--category:nth-child(2) .fn-card__icon {
	background: #8B5CF6;
}

.fn-card--category:nth-child(2) .fn-card__icon::before {
	background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%227%22%20y%3D%227%22%20width%3D%2210%22%20height%3D%2210%22%20rx%3D%221%22%2F%3E%3Cpath%20d%3D%22M10%204v3M14%204v3M10%2017v3M14%2017v3M4%2010h3M4%2014h3M17%2010h3M17%2014h3%22%2F%3E%3C%2Fsvg%3E");
}

.fn-card--category:nth-child(2) .fn-card__title::after {
	content: "Gadgets & software";
}

.fn-card--category:nth-child(3) .fn-card__icon {
	background: #06B6D4;
}

.fn-card--category:nth-child(3) .fn-card__icon::before {
	background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14.5%206.5a3.5%203.5%200%2010-4.95%204.95L4%2017l3%203%205.55-5.55a3.5%203.5%200%20004.95-4.95l-2.47%202.47-1.5-.5-.5-1.5z%22%2F%3E%3C%2Fsvg%3E");
}

.fn-card--category:nth-child(3) .fn-card__title::after {
	content: "Reviews & tutorials";
}

.fn-card--category:nth-child(4) .fn-card__icon {
	background: #22C55E;
}

.fn-card--category:nth-child(4) .fn-card__icon::before {
	background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M2%206c2-1%205-1%207%200v12c-2-1-5-1-7%200V6z%22%2F%3E%3Cpath%20d%3D%22M15%206c2-1%205-1%207%200v12c-2-1-5-1-7%200V6z%22%2F%3E%3C%2Fsvg%3E");
}

.fn-card--category:nth-child(4) .fn-card__title::after {
	content: "Step-by-step guides";
}

.fn-card--category:nth-child(5) .fn-card__icon {
	background: #F97316;
}

.fn-card--category:nth-child(5) .fn-card__icon::before {
	background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%203v15M8%2021h8M12%206l-6%203M12%206l6%203M4%209l2%205a3%203%200%20004%200l2-5M14%209l2%205a3%203%200%20004%200l2-5%22%2F%3E%3C%2Fsvg%3E");
}

.fn-card--category:nth-child(5) .fn-card__title::after {
	content: "Tool vs. tool";
}

.fn-card--category:nth-child(6) .fn-card__icon {
	background: #EF4444;
}

.fn-card--category:nth-child(6) .fn-card__icon::before {
	background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%204l9%2015H3z%22%2F%3E%3Cpath%20d%3D%22M12%2010v4M12%2017h.01%22%2F%3E%3C%2Fsvg%3E");
}

.fn-card--category:nth-child(6) .fn-card__title::after {
	content: "Fixes & how-tos";
}
