/**
 * Optional single-post reading layout (typography + spacing).
 *
 * Reversible:
 * - Turn off: add_filter( 'forageplus_post_meta_enable_single_layout_css', '__return_false' );
 *   in a child theme or Code Snippets plugin.
 * - Or dequeue handle `forageplus-single-post-layout` with priority 20+.
 *
 * Scoped to singular blog posts only:
 * body.forageplus-post-meta-active.single-post.forageplus-single-layout
 * (stylesheet + body classes only load on is_singular( 'post' ) when layout option is on).
 */

/* -------------------------------------------------------------------------
   Prose: body text
   ------------------------------------------------------------------------- */
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content {
	font-size: 1.0625rem;
	line-height: 1.75;
	color: #2c3338;
	letter-spacing: 0.01em;
}

@media screen and (min-width: 783px) {
	body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content {
		font-size: 1.125rem;
		line-height: 1.78;
	}
}

body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content a {
	color: #0066cc;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content a:hover,
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content a:focus {
	color: #004999;
}

/* Vertical rhythm between blocks (Gutenberg + classic) */
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content > * {
	margin-top: 0;
	margin-bottom: 0;
}

body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content > * + * {
	margin-top: 1.25em;
}

body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content > h2 + *,
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content > h3 + *,
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content > h4 + * {
	margin-top: 0.75em;
}

/* Headings inside content */
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content h2,
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content h3,
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content h4 {
	line-height: 1.25;
	font-weight: 700;
	color: #1d2327;
	letter-spacing: -0.01em;
}

body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content h2 {
	margin-top: 1.75em;
	font-size: clamp(1.35rem, 1.1rem + 1vw, 1.65rem);
}

body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content h3 {
	margin-top: 1.5em;
	font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.35rem);
}

body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content h4 {
	margin-top: 1.35em;
	font-size: 1.1rem;
}

body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content h2:first-child,
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content h3:first-child,
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content h4:first-child {
	margin-top: 0;
}

/* Lists */
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content ul,
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content ol {
	padding-left: 1.35em;
}

body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content li {
	margin: 0.35em 0;
}

body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content li > ul,
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content li > ol {
	margin-top: 0.35em;
}

/* Quotes */
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content blockquote {
	margin: 1.5em 0;
	padding: 0.85em 0 0.85em 1.1em;
	border-left: 4px solid #c3c4c7;
	background: #f6f7f7;
	border-radius: 0 6px 6px 0;
	color: #1d2327;
}

body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content blockquote p:last-child {
	margin-bottom: 0;
}

/* Code */
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content code {
	padding: 0.12em 0.35em;
	font-size: 0.92em;
	background: #f0f0f1;
	border-radius: 4px;
}

body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content pre {
	padding: 1rem 1.1rem;
	overflow-x: auto;
	background: #1d2327;
	color: #f0f0f1;
	border-radius: 8px;
	font-size: 0.9em;
	line-height: 1.55;
}

body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content pre code {
	background: transparent;
	padding: 0;
	color: inherit;
}

/* Images & captions */
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content img {
	height: auto;
	max-width: 100%;
	border-radius: 6px;
}

body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content .wp-block-image figcaption,
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content .wp-caption-text {
	margin-top: 0.5rem;
	font-size: 0.88rem;
	line-height: 1.45;
	color: #50575e;
	text-align: center;
}

/* Tables (scroll on small screens) */
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content .wp-block-table {
	margin: 1.25em 0;
}

body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content .wp-block-table table {
	border-collapse: collapse;
	width: 100%;
}

body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content .wp-block-table th,
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content .wp-block-table td {
	padding: 0.5em 0.65em;
	border: 1px solid #dcdcde;
}

@media screen and (max-width: 600px) {
	body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content .wp-block-table {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
}

/* Separator */
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content hr,
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content .wp-block-separator {
	margin: 2em 0;
	border: none;
	border-top: 1px solid #dcdcde;
}

/* Entry header spacing (title area — theme markup varies) */
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-header {
	margin-bottom: 1.15rem;
}

/* Featured / post thumbnail */
body.forageplus-post-meta-active.single-post.forageplus-single-layout .post-thumbnail img,
body.forageplus-post-meta-active.single-post.forageplus-single-layout .wp-post-image,
body.forageplus-post-meta-active.single-post.forageplus-single-layout .entry-content .post-thumbnail img {
	border-radius: 8px;
}
