@font-face {
	font-family: 'TikTok Sans';
	src: url('./fonts/tiktok-sans-variable.ttf') format('truetype');
	font-style: normal;
	font-weight: 300 900;
	font-display: swap;
}

@font-face {
	font-family: 'PP Writer';
	src:
		url('./fonts/ppwriter-booktext.woff2') format('woff2'),
		url('./fonts/ppwriter-booktext.woff') format('woff');
	font-style: normal;
	font-weight: 400;
	font-display: swap;
}

@font-face {
	font-family: 'PP Writer';
	src:
		url('./fonts/ppwriter-bookitalic.woff2') format('woff2'),
		url('./fonts/ppwriter-bookitalic.woff') format('woff');
	font-style: italic;
	font-weight: 400;
	font-display: swap;
}

:root {
	--font-family-headings: 'TikTok Sans', 'Geist', sans-serif;
	--font-family-body: 'TikTok Sans', 'Geist', sans-serif;
	--font-family-button: 'TikTok Sans', 'Geist', sans-serif;
	--font-family-dates: 'PP Writer', Georgia, serif;
	--font-features-pp-writer:
		'kern' 1,
		'liga' 1,
		'clig' 1,
		'calt' 1,
		'dlig' 1,
		'hlig' 1,
		'salt' 1,
		'ss01' 1,
		'ss02' 1,
		'ss03' 1,
		'ss04' 1;
}

/* Accent typography: force TikTok Sans variable axis for headings */
:where(h1, h2, h3, h4, h5, h6, .kg-header-card-heading, .kg-signup-card-heading) {
	font-family: var(--font-family-headings);
	font-style: normal;
	font-weight: 700;
	font-variation-settings: 'opsz' 36, 'wdth' 100, 'wght' 700, 'slnt' 0;
}

/* Date typography: keep dates in PP Writer */
:where(
	.post-meta-date,
	.card-post-date,
	.post-meta > li > time[datetime],
	.section-hero-meta time[datetime]
) {
	font-family: var(--font-family-dates);
	font-style: italic;
	font-feature-settings: var(--font-features-pp-writer);
	font-kerning: normal;
	font-variant-ligatures: common-ligatures discretionary-ligatures historical-ligatures contextual;
	font-optical-sizing: auto;
	text-rendering: optimizeLegibility;
}

/* TikTok Sans should never render in italic style */
:where(
	body,
	p,
	li,
	blockquote,
	figcaption,
	input,
	textarea,
	select,
	em,
	i,
	.post-content :where(p, li, blockquote, figcaption, em, i),
	.post-meta,
	.post-meta-time,
	.post-meta-author,
	.post-tags,
	.post-tag,
	.card-post-meta,
	.card-post-time,
	.card-post-tag,
	.card-post-primary-tag,
	.card-post-author-name,
	.section-hero-meta,
	.kg-bookmark-metadata,
	.kg-file-card-metadata
) {
	font-style: normal;
}

/* Post body paragraphs in PP Writer */
.post-content p {
	font-family: 'PP Writer', Georgia, serif;
	font-style: normal;
	font-feature-settings: var(--font-features-pp-writer);
	font-kerning: normal;
	font-variant-ligatures: common-ligatures discretionary-ligatures historical-ligatures contextual;
	font-optical-sizing: auto;
	text-rendering: optimizeLegibility;
}

/* Keep announcement accent color from Ghost settings in dark mode */
.gh-announcement-bar.accent {
	background-color: var(--announcement-bar-accent-color, var(--ghost-accent-color)) !important;
}
