/*
 * Article reading styles for single standard posts, also loaded in the post
 * editor canvas so the body looks the same while writing.
 *
 * Title order, the date-only byline, the featured image position and ratio,
 * previous/next links and related posts are Kadence Customizer settings
 * (Posts/Pages Layout → Single Post Layout). These rules only supply the
 * local brand fonts, the reading width and a few details. Font sizes and
 * colours chosen on a block in the editor still win: the defaults below are
 * set on the containers or through Kadence's own variables.
 */

body.single-post,
body.editor-styles-wrapper {
	--sj-gold: #fbac0e;
	--sj-ink: #001524;
	--sj-text: #1f2d38;
	--sj-muted: #4a5a66;
	--sj-line: #e3e8ee;
	--sj-sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
	--sj-serif: "Libre Baskerville", georgia, "Times New Roman", serif;
	--global-body-font-family: var(--sj-sans);
	--global-heading-font-family: var(--sj-serif);
}

/* Room for a featured image up to 960px wide; the text column stays narrower. */
body.single-post {
	--global-content-narrow-width: 1072px;
}

/* Reading column, about 68 characters. */
.single-post .single-entry .entry-content-wrap > :not(.article-post-thumbnail) {
	max-width: 45rem;
	margin-inline: auto;
}

.single-post .entry-header .entry-title,
body.editor-styles-wrapper h1.editor-post-title.editor-post-title__input {
	font-family: var(--sj-serif);
	font-size: clamp(1.875rem, 1.5rem + 1.5vw, 2.5rem);
	line-height: 1.25;
	color: var(--sj-ink);
}

.single-post .entry-header .entry-meta {
	font-size: 0.9375rem;
	color: var(--sj-muted);
}

/* Featured image: full picture, never cropped; tall images are capped and centred. */
.single-post .article-post-thumbnail {
	margin-block: 0 2.5rem;
}

.single-post .article-post-thumbnail img {
	display: block;
	width: auto;
	max-width: 100%;
	max-height: min(80vh, 45rem);
	margin-inline: auto;
	border-radius: 6px;
}

/* Body text and links. Kadence's highlight colour drives link colour, so a link colour set on a block still wins. */
.single-post .entry-content,
body.editor-styles-wrapper {
	--global-palette-highlight: var(--sj-ink);
	--global-palette-highlight-alt: #00324f;
	font-family: var(--sj-sans);
	font-size: 1.125rem;
	line-height: 1.7;
	color: var(--sj-text);
}

.single-post .entry-content :where(h1, h2, h3, h4, h5, h6),
.editor-styles-wrapper .wp-block-heading {
	font-family: var(--sj-serif);
	line-height: 1.3;
}

.single-post .entry-content a:where(:not(.wp-element-button):not(.kb-button):not(.button)),
.editor-styles-wrapper .is-root-container a:where(:not(.wp-element-button):not(.kb-button):not(.button)) {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

.single-post .entry-content a:where(:not(.wp-element-button):not(.kb-button):not(.button)):hover {
	text-decoration-thickness: 2px;
}

.single-post .entry-content :where(ul, ol),
.editor-styles-wrapper .is-root-container :where(ul, ol) {
	padding-left: 1.5em;
}

.single-post .entry-content :where(li),
.editor-styles-wrapper .is-root-container :where(li) {
	margin-block: 0.4em;
}

.single-post .entry-content .wp-block-quote,
.editor-styles-wrapper .wp-block-quote {
	margin-inline: 0;
	padding-left: 1.25em;
	border-left: 4px solid var(--sj-gold);
}

/* Keyboard focus anywhere in the article, previous/next links included. */
.single-post .site-main a:focus-visible {
	outline: 2px solid var(--sj-ink);
	outline-offset: 2px;
	border-radius: 2px;
}

/* "All articles" link and the closing contact invitation (added in functions.php). */
.single-post .sj-article-back {
	margin-block: 0 1.25rem;
	font-size: 0.9375rem;
	font-weight: 500;
}

.single-post .sj-article-contact {
	margin-block: 3rem 0;
	padding-top: 1.5rem;
	border-top: 1px solid var(--sj-line);
	font-size: 1rem;
	color: var(--sj-text);
}

.single-post :is(.sj-article-back, .sj-article-contact) a {
	color: var(--sj-ink);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}
