.topics-discover-page {
	background: #fff;
	color: var(--rfj-text-primary);
}

.topics-editorial-section,
.topics-scroll-section,
.topics-ranking-section,
.topics-app-list-section,
.topics-top-apps-section,
.topics-group-section {
	padding: 18px 0 34px;
}

.topics-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 18px;
}

.topics-section-head h2 {
	margin: 0;
	color: var(--rfj-text-primary);
	font-size: 30px;
	line-height: 1.16;
	font-weight: 800;
	letter-spacing: 0;
}

.topics-section-head span {
	color: var(--rfj-text-tertiary);
	font-size: 15px;
}

.topics-feature-strip {
	display: grid;
	grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1fr);
	gap: 22px;
}

.topics-feature-card {
	position: relative;
	display: flex;
	min-height: 310px;
	flex-direction: column;
	justify-content: flex-end;
	overflow: hidden;
	padding: 26px;
	border-radius: 22px;
	background: #f5f5f7;
	color: var(--rfj-text-primary);
	text-decoration: none;
}

/* Background image layer */
.topics-feature-bg {
	position: absolute;
	inset: 0;
	background: var(--card-bg-image) center / cover no-repeat;
	z-index: 0;
}

/* Gradient mask overlay - App Store style, focused on bottom-left */
.topics-feature-gradient {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: linear-gradient(0deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.5) 35%, rgba(0, 0, 0, 0.15) 60%, transparent 100%);
	-webkit-mask-image: radial-gradient(ellipse 170% 120% at 10% 100%, #000 15%, rgba(0, 0, 0, 0.75) 40%, rgba(0, 0, 0, 0.3) 65%, transparent 80%);
	mask-image: radial-gradient(ellipse 170% 120% at 10% 100%, #000 15%, rgba(0, 0, 0, 0.75) 40%, rgba(0, 0, 0, 0.3) 65%, transparent 80%);
	-webkit-backdrop-filter: blur(30px);
	backdrop-filter: blur(30px);
	-webkit-filter: saturate(1.4) brightness(0.85);
	filter: saturate(1.4) brightness(0.85);
}

/* Gradient background layer - Morandi palette fallback */
.topics-feature-gradient-bg {
	position: absolute;
	inset: 0;
	z-index: 0;
}

/* Text adjustments when background image present */
.topics-feature-card.has-bg-image,
.topics-feature-card.has-gradient-bg {
	color: #fff;
}

.topics-feature-card.has-bg-image .topics-feature-copy,
.topics-feature-card.has-gradient-bg .topics-feature-copy {
	max-width: 82%;
}

.topics-feature-card.has-bg-image .topics-feature-label,
.topics-feature-card.has-gradient-bg .topics-feature-label {
	color: rgba(255, 255, 255, 0.8);
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.topics-feature-card.has-bg-image .topics-feature-copy h2,
.topics-feature-card.has-gradient-bg .topics-feature-copy h2 {
	color: #fff;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.topics-feature-card.has-bg-image .topics-feature-copy p,
.topics-feature-card.has-gradient-bg .topics-feature-copy p {
	color: rgba(255, 255, 255, 0.7);
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.topics-feature-card.has-bg-image .topics-feature-count,
.topics-feature-card.has-gradient-bg .topics-feature-count {
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
}

.topics-feature-card.has-bg-image .topics-feature-bottom,
.topics-feature-card.has-gradient-bg .topics-feature-bottom {
	background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
	margin: 14px -26px -26px;
	padding: 18px 26px 20px;
}

.topics-feature-card:hover {
	color: var(--rfj-text-primary);
	text-decoration: none;
}

.topics-feature-card.is-large {
	min-height: 420px;
	background: #eef4ff;
}

.topics-feature-copy {
	position: relative;
	z-index: 1;
	max-width: 75%;
}

.topics-feature-label {
	display: block;
	margin-bottom: 10px;
	color: #007aff;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.topics-feature-copy h2 {
	display: -webkit-box;
	overflow: hidden;
	margin: 0;
	font-size: 30px;
	line-height: 1.12;
	font-weight: 800;
	letter-spacing: 0;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.topics-feature-card.is-large .topics-feature-copy h2 {
	font-size: clamp(34px, 3.3vw, 48px);
}

.topics-feature-copy p {
	display: -webkit-box;
	overflow: hidden;
	margin: 12px 0 0;
	color: var(--rfj-text-tertiary);
	font-size: 17px;
	line-height: 1.38;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.topics-feature-count {
	display: inline-flex;
	position: relative;
	z-index: 1;
	width: fit-content;
	padding: 5px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.72);
	color: var(--rfj-text-primary);
	font-size: 12px;
	font-weight: 700;
	backdrop-filter: blur(16px);
	flex-shrink: 0;
}

.topics-feature-bottom {
	display: flex;
	align-items: center;
	gap: 12px;
	position: relative;
	z-index: 1;
	margin-top: 14px;
}

.topics-feature-logos {
	display: flex;
	gap: 6px;
	align-items: center;
}

.topics-feature-logo-item {
	display: flex;
	width: 44px;
	height: 44px;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.48);
	backdrop-filter: blur(12px);
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.topics-feature-logo-item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.topics-feature-logo-item span {
	display: flex;
	width: 100%;
	height: 100%;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.9);
	font-size: 18px;
	font-weight: 700;
}

.topics-editor-picks {
	display: grid;
	grid-auto-columns: minmax(300px, 390px);
	grid-auto-flow: column;
	gap: 18px;
	overflow-x: auto;
	padding-bottom: 8px;
	scroll-snap-type: x mandatory;
}

.topics-editor-picks .topics-feature-card {
	min-height: 280px;
	scroll-snap-align: start;
}

.topics-app-row-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: 58px;
	row-gap: 0;
}

.topics-app-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 16px;
	align-items: center;
	min-height: 112px;
	padding: 18px 0;
	border-bottom: 1px solid #dedee3;
}

.topics-app-row-main {
	display: grid;
	grid-template-columns: 82px minmax(0, 1fr);
	gap: 16px;
	align-items: center;
	min-width: 0;
	color: var(--rfj-text-primary);
	text-decoration: none;
}

.topics-app-row-main:hover {
	color: var(--rfj-text-primary);
	text-decoration: none;
}

.topics-app-row-logo {
	display: flex;
	width: 68px;
	height: 68px;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 16px;
	background: #f5f5f7;
	box-shadow: 0 7px 16px rgba(0, 0, 0, 0.12);
}

.topics-app-row-logo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.topics-app-row-logo span,
.topics-rank-logo span {
	display: flex;
	width: 100%;
	height: 100%;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #f0f6ff 0%, #dce9ff 100%);
	color: #007aff;
	font-size: 28px;
	font-weight: 800;
}

.topics-app-row-copy {
	display: block;
	min-width: 0;
}

.topics-app-row-copy strong,
.topics-app-row-copy em {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
}

.topics-app-row-copy strong {
	display: -webkit-box;
	color: var(--rfj-text-primary);
	font-size: 18px;
	line-height: 1.24;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.topics-app-row-copy em {
	margin-top: 4px;
	color: var(--rfj-text-tertiary);
	font-size: 15px;
	font-style: normal;
	white-space: nowrap;
}

.topics-app-view-btn {
	display: inline-flex;
	min-width: 74px;
	height: 34px;
	align-items: center;
	justify-content: center;
	padding: 0 18px;
	border: 0;
	border-radius: 999px;
	background: #f2f2f7;
	color: #007aff;
	font-size: 16px;
	font-weight: 800;
	cursor: pointer;
}

.topics-app-view-btn:hover {
	background: #e9e9ef;
	color: #007aff;
}

.topics-top-apps-row {
	display: grid;
	grid-auto-columns: minmax(230px, 1fr);
	grid-auto-flow: column;
	gap: 24px;
	overflow-x: auto;
	padding: 3px 2px 14px;
	scroll-snap-type: x mandatory;
}

.topics-rank-app-card {
	position: relative;
	display: flex;
	min-height: 260px;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 28px 24px 24px;
	border-radius: 26px;
	background: #fff;
	box-shadow: 0 7px 24px rgba(0, 0, 0, 0.08);
	scroll-snap-align: start;
	text-align: center;
}

.topics-rank-number {
	position: absolute;
	top: 20px;
	left: 20px;
	color: #9a9aa0;
	font-size: 30px;
	font-weight: 700;
	line-height: 1;
}

.topics-rank-logo {
	display: flex;
	width: 74px;
	height: 74px;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 18px;
	background: #f5f5f7;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.topics-rank-logo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.topics-rank-title {
	display: -webkit-box;
	overflow: hidden;
	min-height: 44px;
	margin-top: 22px;
	color: #1d1d1f;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.22;
	text-decoration: none;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.topics-rank-title:hover {
	color: #1d1d1f;
	text-decoration: none;
}

.topics-rank-subtitle {
	overflow: hidden;
	width: 100%;
	margin: 6px 0 22px;
	color: #86868b;
	font-size: 14px;
	line-height: 1.25;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.topics-rank-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: 46px;
}

.topics-collection-card {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas:
		"main button"
		"main note";
	gap: 5px 16px;
	align-items: center;
	min-height: 108px;
	padding: 18px 0;
	border-bottom: 1px solid #dedee3;
}

.topics-collection-link {
	display: grid;
	grid-area: main;
	grid-template-columns: 74px minmax(0, 1fr);
	gap: 14px;
	align-items: center;
	min-width: 0;
	color: var(--rfj-text-primary);
	text-decoration: none;
}

.topics-collection-link:hover {
	color: var(--rfj-text-primary);
	text-decoration: none;
}

.topics-collection-art {
	display: flex;
	width: 64px;
	height: 64px;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 15px;
	background: #f5f5f7;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.topics-collection-art img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.topics-collection-art > span {
	display: flex;
	width: 100%;
	height: 100%;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #f0f6ff 0%, #dce9ff 100%);
	color: #007aff;
	font-size: 28px;
	font-weight: 800;
}

.topics-collection-copy {
	display: block;
	min-width: 0;
}

.topics-collection-copy strong,
.topics-collection-copy em {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.topics-collection-copy strong {
	color: var(--rfj-text-primary);
	font-size: 17px;
	line-height: 1.22;
}

.topics-collection-copy em {
	margin-top: 4px;
	color: var(--rfj-text-tertiary);
	font-size: 14px;
	font-style: normal;
}

.topics-open-btn {
	display: inline-flex;
	grid-area: button;
	min-width: 66px;
	height: 30px;
	align-items: center;
	justify-content: center;
	padding: 0 15px;
	border-radius: 999px;
	background: #f2f2f7;
	color: #007aff;
	font-size: 15px;
	font-weight: 800;
	text-decoration: none;
}

.topics-open-btn:hover {
	background: #e9e9ef;
	color: #007aff;
	text-decoration: none;
}

.topics-count-note {
	grid-area: note;
	color: var(--rfj-text-tertiary);
	font-size: 12px;
	text-align: center;
}

.topics-empty-state {
	padding: 56px 0;
	color: var(--rfj-text-tertiary);
	font-size: 17px;
	text-align: center;
}

/* ===== Topic Group Section ===== */
.topics-group-list {
	display: flex;
	flex-direction: column;
	gap: 52px;
}

.topics-group-block {
	padding-bottom: 0;
}

.topics-group-head {
	margin-bottom: 14px;
}

.topics-group-head-link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--rfj-text-primary);
	text-decoration: none;
}

.topics-group-head-link:hover {
	color: #007aff;
	text-decoration: none;
}

.topics-group-head-link h2 {
	margin: 0;
	color: inherit;
	font-size: 30px;
	line-height: 1.16;
	font-weight: 800;
	letter-spacing: 0;
}

.topics-group-head-link svg {
	flex-shrink: 0;
	margin-top: 2px;
	transition: transform 0.2s ease;
}

.topics-group-head-link:hover svg {
	transform: translateX(3px);
}

.topics-group-feature {
	margin: -12px 0;
}

.topics-group-feature-strip {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
}

.topics-group-feature-strip .topics-feature-card {
	min-height: 380px;
}

/* ===== Quick Links Section ===== */
.topics-quick-links-section {
	padding: 18px 0 44px;
}

.topics-quick-links-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.topics-quick-links-grid li {
	border-bottom: 1px solid #dedee3;
}

.topics-quick-links-grid a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 0;
	color: #007aff;
	font-size: 18px;
	font-weight: 500;
	text-decoration: none;
}

.topics-quick-links-grid a::after {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%23007aff' d='M4.5 1.5L10 7l-5.5 5.5' stroke='%23007aff' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center no-repeat;
	flex-shrink: 0;
	margin-left: 8px;
}

.topics-quick-links-grid a:hover {
	text-decoration: underline;
}

@media (max-width: 1180px) {
	.topics-feature-strip,
	.topics-rank-grid,
	.topics-app-row-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.topics-feature-card.is-large {
		grid-column: 1 / -1;
	}
}

@media (max-width: 820px) {
	.topics-section-head {
		display: block;
	}

	.topics-section-head h2 {
		font-size: 25px;
	}

	.topics-section-head span {
		display: block;
		margin-top: 5px;
	}

	.topics-feature-strip,
	.topics-rank-grid,
	.topics-app-row-grid {
		display: block;
	}

	.topics-feature-card,
	.topics-feature-card.is-large {
		min-height: 330px;
		margin-bottom: 16px;
		padding: 22px;
	}

	.topics-feature-copy {
		max-width: 88%;
	}

	.topics-feature-copy h2,
	.topics-feature-card.is-large .topics-feature-copy h2 {
		font-size: 29px;
	}

	.topics-editor-picks {
		grid-auto-columns: minmax(280px, 86vw);
	}

	.topics-collection-card {
		min-height: 96px;
	}

	.topics-app-row {
		min-height: 96px;
	}

	.topics-app-row-main {
		grid-template-columns: 72px minmax(0, 1fr);
	}

	.topics-app-row-logo {
		width: 60px;
		height: 60px;
		border-radius: 14px;
	}

	.topics-app-row-copy strong {
		font-size: 16px;
	}

	.topics-app-row-copy em {
		font-size: 14px;
	}

	.topics-top-apps-row {
		grid-auto-columns: minmax(210px, 72vw);
	}

	.topics-group-feature-strip {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.topics-group-feature-strip .topics-feature-card {
		min-height: 320px;
	}

	.topics-quick-links-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.topics-group-head-link h2 {
		font-size: 25px;
	}

	.topics-group-feature-strip {
		display: block;
	}

	.topics-group-feature-strip .topics-feature-card {
		min-height: 280px;
		margin-bottom: 16px;
	}

	.topics-quick-links-grid {
		display: block;
	}
}
