/* ==========================================================================
   BEST FOR PC — custom front page (front-page-bfp.php)
   Loaded only on the front page. Uses the --bfp-* tokens defined in style.css.
   ========================================================================== */

.bfp-front {
	--fp-blue: var(--bfp-blue, #0461a8);
	--fp-blue-deep: var(--bfp-blue-deep, #034b82);
	--fp-blue-tint: var(--bfp-blue-tint, #eaf2fa);
	--fp-hero: #0a4f8f;
	--fp-green: var(--bfp-green, #2a7f35);
	--fp-ink: var(--bfp-ink, #13253d);
	--fp-text: var(--bfp-text, #3b4a5c);
	--fp-muted: var(--bfp-muted, #5e6c7d);
	--fp-line: var(--bfp-line, #d8e0e9);
	--fp-line-soft: var(--bfp-line-soft, #e8edf3);
	--fp-page: var(--bfp-page, #eef2f6);
	--fp-surface: #fff;
	/* Plus Jakarta Sans is loaded from Google Fonts in functions.php (front page only) */
	--fp-display: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
	--fp-sans: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

	display: block;
	padding: 0 0 8px;
	background: var(--fp-page);
	color: var(--fp-text);
	font: 400 15px/1.5 var(--fp-sans);
}

.bfp-front *,
.bfp-front *::before,
.bfp-front *::after {
	box-sizing: border-box;
}

/* The hero sits flush under the header (style.css adds top padding on the old home page) */
body.home main.bfp-front {
	margin-top: 0;
	padding-top: 0;
}

.bfp-front a {
	color: inherit;
	text-decoration: none;
}

.bfp-front a:focus-visible,
.bfp-front button:focus-visible,
.bfp-front input:focus-visible {
	outline: 2px solid var(--fp-blue);
	outline-offset: 2px;
}

.bfp-front ul,
.bfp-front ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bfp-front h1,
.bfp-front h2,
.bfp-front h3 {
	margin: 0;
	font-family: var(--fp-display);
	letter-spacing: -0.01em;
	text-transform: none;
}

.bfp-front .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.bfp-wrap {
	width: 100%;
	max-width: 1220px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 20px;
	padding-right: 20px;
}

/* --------------------------------------------------------------------------
   Shared bits: app icon, chips, section heads
   -------------------------------------------------------------------------- */

.bfp-front .bfp-icon {
	display: block;
	flex: none;
	width: 64px;
	height: 64px;
	max-width: none;
	border-radius: 16px;
	background: var(--fp-surface);
	box-shadow: 0 0 0 1px rgba(19, 37, 61, .09);
	object-fit: cover;
}

.bfp-front .bfp-icon--letter {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--fp-blue-tint);
	color: var(--fp-blue);
	font: 700 24px/1 var(--fp-display);
}


.bfp-section {
	margin-top: 44px;
}

.bfp-section--last {
	margin-bottom: 36px;
}

.bfp-section__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 16px;
	margin-bottom: 16px;
}

.bfp-front .bfp-section__title {
	color: var(--fp-ink);
	font-size: 24px;
	font-weight: 700;
	line-height: 1.25;
}

.bfp-section__sub {
	flex-basis: 100%;
	margin: 0;
	color: var(--fp-muted);
	font-size: 14.5px;
}

.bfp-front .bfp-section__link {
	color: var(--fp-blue);
	font: 500 14.5px/1.4 var(--fp-display);
}

.bfp-front .bfp-section__link:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Ads: spacing only, never framed like content */
.bfp-ad {
	margin-top: 32px;
	text-align: center;
}

.bfp-ad:empty {
	display: none;
}

.bfp-ad .stcon {
	margin: 0;
}

/* --------------------------------------------------------------------------
   Hero: one centred column on a calm deep-blue gradient (the logo's blue)
   -------------------------------------------------------------------------- */

.bfp-hero {
	position: relative;
	isolation: isolate;
	padding: 76px 0 80px;
	color: #fff;
	text-align: center;
	/* Paint the gradient edge to edge without widening the page (border-image outset never scrolls) */
	border-image: linear-gradient(120deg, #06345f 0%, #0a4a87 55%, #0e5c9e 100%) fill 0 / / 0 max(0px, calc(50vw - 600px));
}

/* Soft light behind the headline */
.bfp-hero::before {
	content: "";
	position: absolute;
	z-index: -1;
	inset: 0;
	background: radial-gradient(ellipse 44% 75% at 50% 0%, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0));
	pointer-events: none;
}

.bfp-front .bfp-hero__title {
	max-width: 30ch;
	margin: 0 auto;
	text-wrap: balance;
	color: #fff;
	font-size: 52px;
	font-weight: 800;
	line-height: 1.06;
	letter-spacing: -0.03em;
}

.bfp-hero__lead {
	max-width: 52ch;
	margin: 18px auto 0;
	color: rgba(255, 255, 255, .88);
	font-size: 18px;
	line-height: 1.55;
}

.bfp-search {
	position: relative;
	display: flex;
	align-items: center;
	max-width: 660px;
	margin: 34px auto 0;
	padding: 7px;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 24px 48px -26px rgba(2, 28, 58, .7);
	text-align: left;
	transition: box-shadow .15s ease;
}

.bfp-search:focus-within {
	box-shadow: 0 0 0 4px rgba(255, 255, 255, .35), 0 24px 48px -26px rgba(2, 28, 58, .7);
}

.bfp-front .bfp-search__icon.fa {
	position: absolute;
	left: 24px;
	color: var(--fp-muted);
	font-size: 18px;
	line-height: 1;
	pointer-events: none;
}

.bfp-front .bfp-search__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 54px;
	margin: 0;
	padding: 0 14px 0 50px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	box-shadow: none;
	color: var(--fp-ink);
	font: 400 17px/1 var(--fp-sans);
}

.bfp-front .bfp-search__input::placeholder {
	color: var(--fp-muted);
	opacity: 1;
}

.bfp-front .bfp-search__input:focus {
	outline: 0;
}

/* The logo's green, darkened so white text passes contrast */
.bfp-front .bfp-search__btn {
	flex: none;
	height: 54px;
	padding: 0 30px;
	border: 0;
	border-radius: 12px;
	background: #237a3a;
	color: #fff;
	font: 700 16px/54px var(--fp-display);
	text-transform: none !important;
	cursor: pointer;
	transition: background-color .15s ease;
}

.bfp-front .bfp-search__btn:hover {
	background: #1b632f;
}

/* Text inside list rows (Top downloads, Latest additions) */
.bfp-row__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.bfp-row__name {
	overflow: hidden;
	color: var(--fp-ink);
	font: 600 15px/1.35 var(--fp-display);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bfp-row:hover .bfp-row__name {
	color: var(--fp-blue);
}

/* --------------------------------------------------------------------------
   Trending apps: Play Store style shelf (icon, name, downloads)
   -------------------------------------------------------------------------- */

.bfp-apps {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 28px 20px;
}

.bfp-app__link {
	display: flex;
	flex-direction: column;
	height: 100%;
}

/* Icon tile: white card, soft border, inner padding, whole image visible */
.bfp-front .bfp-app__link .bfp-icon {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	margin-bottom: 12px;
	padding: 14%;
	border: 1px solid #e1e8f0;
	border-radius: 20%;
	background: #fff;
	box-shadow: 0 1px 2px rgba(19, 37, 61, .05);
	object-fit: contain;
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.bfp-front .bfp-app__link .bfp-icon--letter {
	font-size: 40px;
}

.bfp-app__link:hover .bfp-icon {
	transform: translateY(-3px);
	border-color: #c9d8e8;
	box-shadow: 0 14px 26px -16px rgba(19, 37, 61, .4);
}

.bfp-app__name {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	color: var(--fp-ink);
	font: 600 15px/1.35 var(--fp-display);
}

.bfp-app__link:hover .bfp-app__name {
	color: var(--fp-blue);
}

.bfp-app__stat {
	display: block;
	overflow: hidden;
	margin-top: 4px;
	color: var(--fp-muted);
	font-size: 12.5px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bfp-app__stat .fa {
	margin-right: 5px;
	color: var(--fp-green);
	font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
	.bfp-front .bfp-app__link .bfp-icon {
		transition: none;
	}

	.bfp-app__link:hover .bfp-icon {
		transform: none;
	}
}

/* --------------------------------------------------------------------------
   Top downloads + latest additions
   -------------------------------------------------------------------------- */

.bfp-split {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 20px;
	margin-top: 44px;
}

.bfp-panel {
	padding: 20px 20px 12px;
	border: 1px solid var(--fp-line);
	border-radius: 16px;
	background: var(--fp-surface);
}

.bfp-panel__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 0 4px 8px;
}

.bfp-panel__note {
	color: var(--fp-muted);
	font: 500 13px/1.4 var(--fp-sans);
}

.bfp-rank,
.bfp-latest {
	counter-reset: none;
}

.bfp-rank > li + li,
.bfp-latest > li + li {
	border-top: 1px solid var(--fp-line-soft);
}

.bfp-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 6px;
	border-radius: 10px;
	transition: background-color .15s ease;
}

.bfp-row:hover {
	background: var(--fp-blue-tint);
}

.bfp-front .bfp-row .bfp-icon {
	width: 44px;
	height: 44px;
	border-radius: 11px;
}

.bfp-row__text {
	flex: 1 1 auto;
}

.bfp-row__meta {
	overflow: hidden;
	color: var(--fp-muted);
	font-size: 13px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bfp-row__stat,
.bfp-row__date {
	flex: none;
	color: var(--fp-muted);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.bfp-row__stat {
	color: var(--fp-ink);
	font-weight: 500;
}

.bfp-row__stat-label {
	color: var(--fp-muted);
	font-weight: 400;
}

.bfp-rank__num {
	flex: none;
	width: 26px;
	color: #8a99aa;
	font: 700 17px/1 var(--fp-display);
	font-variant-numeric: tabular-nums;
	text-align: center;
}

.bfp-rank__item:nth-child(-n+3) .bfp-rank__num {
	color: var(--fp-blue);
}

/* --------------------------------------------------------------------------
   Categories
   -------------------------------------------------------------------------- */

.bfp-cats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.bfp-cat {
	--tile-tint: var(--fp-blue-tint);
	--tile-ink: var(--fp-blue);
	display: flex;
	flex-direction: column;
	padding: 18px 18px 16px;
	border: 1px solid var(--fp-line);
	border-radius: 16px;
	background: var(--fp-surface);
}

.bfp-cat__head {
	display: grid;
	grid-template-columns: 42px minmax(0, 1fr);
	grid-template-rows: auto auto;
	column-gap: 12px;
	align-items: center;
	margin-bottom: 10px;
}

/* .fa (FontAwesome) loads after this file, so the icon box needs the extra class weight */
.bfp-front .bfp-cat__icon.fa {
	grid-row: 1 / span 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 11px;
	background: var(--tile-tint);
	color: var(--tile-ink);
	font-size: 18px;
	line-height: 1;
	text-align: center;
}

.bfp-front .bfp-cat__name {
	color: var(--fp-ink);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
}

.bfp-front .bfp-cat__name a:hover {
	color: var(--fp-blue);
}

.bfp-cat__count {
	color: var(--fp-muted);
	font-size: 13px;
}

.bfp-cat__apps {
	margin: 0 -6px;
}

.bfp-cat__app {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px;
	border-radius: 9px;
	color: var(--fp-ink);
	font: 500 14.5px/1.3 var(--fp-display);
	transition: background-color .15s ease;
}

.bfp-cat__app span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bfp-cat__app:hover {
	background: var(--fp-blue-tint);
	color: var(--fp-blue);
}

.bfp-front .bfp-cat__app .bfp-icon {
	width: 36px;
	height: 36px;
	border-radius: 9px;
}

.bfp-front .bfp-cat__more {
	align-self: flex-start;
	margin-top: auto;
	padding-top: 12px;
	color: var(--fp-blue);
	font: 500 14px/1.4 var(--fp-display);
}

.bfp-front .bfp-cat__more:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Tech news
   -------------------------------------------------------------------------- */

.bfp-news {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
}

.bfp-news__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 10px 10px 14px;
	border: 1px solid var(--fp-line);
	border-radius: 16px;
	background: var(--fp-surface);
	transition: border-color .15s ease;
}

.bfp-news__link:hover {
	border-color: #9fbfdf;
}

.bfp-news__media {
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: 10px;
	background: var(--fp-page);
}

.bfp-front .bfp-news__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.bfp-news__title {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 12px 4px 0;
	color: var(--fp-ink);
	font: 600 15.5px/1.4 var(--fp-display);
}

.bfp-news__link:hover .bfp-news__title {
	color: var(--fp-blue);
}

.bfp-news__date {
	margin: 8px 4px 0;
	color: var(--fp-muted);
	font-size: 13px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 991px) {
	.bfp-apps {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.bfp-front .bfp-hero__title {
		font-size: 42px;
	}

	.bfp-split {
		grid-template-columns: minmax(0, 1fr);
	}

	.bfp-cats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.bfp-news {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.bfp-wrap {
		padding-left: 16px;
		padding-right: 16px;
	}

	.bfp-hero {
		padding: 44px 0 48px;
	}

	.bfp-front .bfp-hero__title {
		font-size: 31px;
		letter-spacing: -0.025em;
	}

	.bfp-hero__lead {
		font-size: 15.5px;
	}

	.bfp-search {
		margin-top: 24px;
		padding: 5px;
		border-radius: 15px;
	}

	.bfp-front .bfp-search__input {
		height: 48px;
		padding-left: 42px;
		font-size: 16px;
	}

	.bfp-front .bfp-search__icon.fa {
		left: 18px;
	}

	.bfp-front .bfp-search__btn {
		height: 48px;
		padding: 0 18px;
		line-height: 48px;
	}

	.bfp-section,
	.bfp-split {
		margin-top: 32px;
	}

	.bfp-front .bfp-section__title {
		font-size: 21px;
	}

	/* Trending: one swipeable row, like an app store shelf */
	.bfp-apps {
		display: flex;
		gap: 16px;
		margin: 0 -16px;
		padding: 2px 16px 6px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scroll-padding: 0 16px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.bfp-apps::-webkit-scrollbar {
		display: none;
	}

	.bfp-app {
		flex: 0 0 104px;
		scroll-snap-align: start;
	}

	.bfp-front .bfp-app__link .bfp-icon {
		margin-bottom: 8px;
	}

	.bfp-app__name {
		font-size: 14px;
	}

	.bfp-app__stat {
		font-size: 12px;
	}

	.bfp-panel {
		padding: 16px 12px 8px;
	}

	.bfp-cats {
		grid-template-columns: minmax(0, 1fr);
	}

	.bfp-news {
		grid-template-columns: minmax(0, 1fr);
	}

	.bfp-news__link {
		display: grid;
		grid-template-columns: 120px minmax(0, 1fr);
		grid-template-rows: auto 1fr;
		column-gap: 12px;
		padding: 10px;
	}

	.bfp-news__media {
		grid-row: 1 / span 2;
		aspect-ratio: 4 / 3;
	}

	.bfp-news__title {
		margin: 2px 0 0;
		font-size: 15px;
		-webkit-line-clamp: 3;
	}

	.bfp-news__date {
		margin: 6px 0 0;
	}

	/* List rows: let long app names use two lines instead of cutting them off */
	.bfp-row__name {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		white-space: normal;
	}
}

/* --------------------------------------------------------------------------
   All categories: icon tiles (+ "Show all" for the rest)
   -------------------------------------------------------------------------- */

.bfp-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 12px;
}

.bfp-tile {
	--tile-tint: var(--fp-blue-tint);
	--tile-ink: var(--fp-blue);
	display: flex;
	align-items: center;
	gap: 14px;
	height: 100%;
	padding: 12px 14px 12px 12px;
	border: 1px solid var(--fp-line);
	border-radius: 14px;
	background: var(--fp-surface);
	transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.bfp-tile:hover {
	border-color: var(--tile-ink);
	box-shadow: 0 12px 26px -20px rgba(19, 37, 61, .5);
	transform: translateY(-1px);
}

.bfp-tile--c2,
.bfp-cat--c2 { --tile-tint: #e5f3e8; --tile-ink: #23753a; }
.bfp-tile--c3,
.bfp-cat--c3 { --tile-tint: #fdf0db; --tile-ink: #9a5800; }
.bfp-tile--c4,
.bfp-cat--c4 { --tile-tint: #eee9fb; --tile-ink: #5a3db3; }
.bfp-tile--c5,
.bfp-cat--c5 { --tile-tint: #fceaee; --tile-ink: #b0263f; }
.bfp-tile--c6,
.bfp-cat--c6 { --tile-tint: #e0f3f3; --tile-ink: #0d6e70; }

.bfp-front .bfp-tile__icon.fa {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 13px;
	background: var(--tile-tint);
	color: var(--tile-ink);
	font-size: 20px;
	line-height: 1;
	transition: background-color .15s ease, color .15s ease;
}

.bfp-tile:hover .bfp-tile__icon {
	background: var(--tile-ink);
	color: #fff;
}

.bfp-tile__text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
}

.bfp-tile__name {
	overflow: hidden;
	color: var(--fp-ink);
	font: 650 15.5px/1.3 var(--fp-display);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bfp-tile:hover .bfp-tile__name {
	color: var(--tile-ink);
}

.bfp-tile__count {
	margin-top: 3px;
	color: var(--fp-muted);
	font-size: 13px;
}

.bfp-front .bfp-tile__arrow.fa {
	flex: none;
	color: #a7b4c2;
	font-size: 20px;
	line-height: 1;
	transition: color .15s ease, transform .15s ease;
}

.bfp-tile:hover .bfp-tile__arrow {
	color: var(--tile-ink);
	transform: translateX(3px);
}

.bfp-more {
	margin-top: 16px;
	text-align: center;
}

.bfp-more__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 22px;
	border: 1px solid var(--fp-line);
	border-radius: 999px;
	background: var(--fp-surface);
	color: var(--fp-blue);
	font: 600 15px/1 var(--fp-display);
	list-style: none;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease;
}

.bfp-more__btn::-webkit-details-marker {
	display: none;
}

.bfp-more__btn:hover {
	border-color: var(--fp-blue);
	background: var(--fp-blue-tint);
}

.bfp-more__btn:focus-visible {
	outline: 2px solid var(--fp-blue);
	outline-offset: 2px;
}

/* Once opened, the button gives way to the rest of the grid */
.bfp-more[open] > .bfp-more__btn {
	display: none;
}

.bfp-more[open] {
	margin-top: 12px;
	text-align: left;
}

@media (prefers-reduced-motion: reduce) {
	.bfp-tile,
	.bfp-tile__arrow {
		transition: none;
	}

	.bfp-tile:hover,
	.bfp-tile:hover .bfp-tile__arrow {
		transform: none;
	}
}

@media (max-width: 767px) {
	.bfp-tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.bfp-more[open] {
		margin-top: 10px;
	}

	.bfp-tile {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
		padding: 14px;
	}

	.bfp-front .bfp-tile__icon.fa {
		width: 40px;
		height: 40px;
		border-radius: 11px;
		font-size: 18px;
	}

	.bfp-tile__name {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		font-size: 15px;
		white-space: normal;
	}

	.bfp-front .bfp-tile__arrow.fa {
		display: none;
	}
}
