/*
Theme Name: Confia Consulting Child
Description: Consulting child theme for Confia Agency. Keeps custom styling separate from parent theme updates.
Author: Confia Agency
Template: consulting
Version: 1.3.4
Text Domain: confia-consulting-child
*/

/* Match the site's Elementor palette; fallback values match the installed kit. */
body.single-post {
	--confia-primary: var(--e-global-color-primary, #1b3041);
	--confia-secondary: var(--e-global-color-secondary, #009fb7);
}

/* Article styles are scoped to blog posts; pages, headers and footers are excluded. */
body.single-post article.type-post .entry-content {
	--confia-heading: var(--confia-primary);
	--confia-text: #334155;
	--confia-link: #006b70;
	--confia-link-hover: #004b50;
	--confia-soft: #f1f5f9;
	--confia-border: #cbd5e1;
	color: var(--confia-text);
	font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
	line-height: 1.8;
	overflow-wrap: anywhere;
}

/* Inherit the site's chosen font family rather than loading another webfont. */
body.single-post article.type-post .entry-content :where(.elementor-widget-text-editor, .elementor-widget-theme-post-content) {
	color: var(--confia-text);
	font-size: inherit;
	line-height: inherit;
	min-width: 0;
}

/* Keep long-form text at a comfortable reading width within its existing column. */
body.single-post article.type-post .entry-content .elementor-widget-text-editor {
	max-width: 72ch;
	margin-inline: auto;
}

body.single-post article.type-post .entry-content :where(h1, h2, h3, h4, h5, h6) {
	color: var(--confia-heading);
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.015em;
	text-transform: none;
	text-wrap: pretty;
	margin-block: 2em 0.65em;
	scroll-margin-top: 7rem;
}

body.single-post article.type-post .entry-content h1 {
	font-size: clamp(2rem, 1.35rem + 2.2vw, 3rem);
	line-height: 1.18;
}

body.single-post article.type-post .entry-content h2 {
	font-size: clamp(1.5rem, 1.15rem + 1.2vw, 2.125rem);
}

body.single-post article.type-post .entry-content h3 {
	font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.625rem);
}

body.single-post article.type-post .entry-content h4 {
	font-size: clamp(1.125rem, 1rem + 0.45vw, 1.375rem);
}

body.single-post article.type-post .entry-content :where(h5, h6) {
	font-size: 1.125rem;
}

body.single-post article.type-post .entry-content :where(p, li, blockquote) {
	font-size: inherit;
	line-height: inherit;
}

body.single-post article.type-post .entry-content p {
	margin-block: 0 1.25em;
}

body.single-post article.type-post .entry-content :where(ul, ol) {
	margin-block: 0 1.5em;
	padding-inline-start: 1.6em;
	list-style-position: outside;
}

body.single-post article.type-post .entry-content ul { list-style-type: disc; }
body.single-post article.type-post .entry-content ol { list-style-type: decimal; }
body.single-post article.type-post .entry-content ul ul { list-style-type: circle; }
body.single-post article.type-post .entry-content li::marker { color: var(--confia-primary); font-weight: 700; }
body.single-post article.type-post .entry-content li::before { content: none; }

body.single-post article.type-post .entry-content li {
	margin-block: 0.65em;
	padding-inline-start: 0.35em;
}

body.single-post article.type-post .entry-content li > p { margin-block: 0 0.5em; }

body.single-post article.type-post .entry-content li :where(ul, ol) {
	margin-block: 0.5em;
}

body.single-post article.type-post .entry-content :where(p, li, blockquote, td, th, figcaption) a {
	color: var(--confia-link);
	text-decoration: underline;
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.2em;
}

body.single-post article.type-post .entry-content :where(p, li, blockquote, td, th, figcaption) a:hover {
	color: var(--confia-link-hover);
}

body.single-post article.type-post .entry-content a:focus-visible {
	outline: 0.1875rem solid var(--confia-link);
	outline-offset: 0.1875rem;
}

body.single-post article.type-post .entry-content blockquote {
	margin: 2em 0;
	padding: 1.25em 1.5em;
	border: 0;
	border-inline-start: 0.25rem solid var(--confia-link);
	background: var(--confia-soft);
	color: var(--confia-heading);
	font-style: normal;
}

body.single-post article.type-post .entry-content blockquote > :last-child {
	margin-bottom: 0;
}

body.single-post article.type-post .entry-content :where(img, video) {
	max-width: 100%;
	height: auto;
}

body.single-post article.type-post .entry-content :where(figure, .wp-caption) {
	max-width: 100%;
	margin-inline: 0;
}

body.single-post article.type-post .entry-content :where(figcaption, .wp-caption-text) {
	color: #475569;
	font-size: 0.875rem;
	line-height: 1.6;
	margin-top: 0.75em;
}

body.single-post article.type-post .entry-content table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
	margin-block: 1.5em;
	font-size: 0.95em;
	line-height: 1.6;
}

body.single-post article.type-post .entry-content :where(th, td) {
	padding: 0.75em 1em;
	border: 1px solid var(--confia-border);
	text-align: start;
	vertical-align: top;
}

body.single-post article.type-post .entry-content th {
	background: var(--confia-soft);
	color: var(--confia-heading);
	font-weight: 700;
}

body.single-post article.type-post .entry-content pre {
	max-width: 100%;
	overflow-x: auto;
	padding: 1.25em;
	background: var(--confia-soft);
	color: var(--confia-heading);
	font-size: 0.9em;
	line-height: 1.6;
}

body.single-post article.type-post .entry-content hr {
	border: 0;
	border-top: 1px solid var(--confia-border);
	margin-block: 2.5em;
}

/* Balanced outer gutters keep blog content clear of laptop and mobile edges. */
body.single-post #main > .container {
	width: 100%;
	max-width: 1370px;
	margin-inline: auto;
	padding-inline: 0;
	box-sizing: border-box;
}

/* Keep the article and sidebar within the padded blog container. */
body.single-post .confia-post-layout {
	box-sizing: border-box;
	width: 100%;
	padding-inline: 40px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem);
	gap: clamp(2rem, 4vw, 4rem);
	max-width: none;
	margin-inline: auto;
	padding-block: clamp(2rem, 4vw, 4rem);
	align-items: start;
}

.confia-article, .confia-post-sidebar { min-width: 0; }
.confia-post-meta { display: flex; flex-wrap: wrap; gap: 0.8rem 1.5rem; color: #475569; font-size: 0.9375rem; line-height: 1.6; margin-bottom: 1.5rem; padding-block: 1rem; border-block: 1px solid #dce3ea; }
.confia-meta-item { display: inline-flex; align-items: flex-start; gap: 0.6rem; min-width: 0; overflow-wrap: anywhere; }
.confia-meta-item svg { width: 1.2rem; height: 1.2rem; flex: 0 0 1.2rem; margin-top: 0.15rem; fill: none; stroke: var(--confia-secondary); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.confia-post-meta a { color: var(--confia-primary); text-decoration: none; }
.confia-post-meta a:hover { text-decoration: underline; }
.confia-featured-image { margin: 0 0 2rem; }
.confia-featured-image img { display: block; width: 100%; height: auto; }

/* Remove the extra boxed gutter from the existing one-column text articles. */
body.single-post .confia-article-body > .elementor > .elementor-section > .elementor-container {
	max-width: 100%;
}
body.single-post .confia-article-body > .elementor > .elementor-section > .elementor-container > .elementor-col-100 > .elementor-widget-wrap {
	padding-inline: 0;
}
body.single-post article.type-post .entry-content.confia-article-body .elementor-widget-text-editor {
	max-width: 100%;
	margin-inline: 0;
}
body.single-post .confia-article-body :where(.elementor-widget-text-editor, .elementor-widget-theme-post-content) :where(p, li) {
	font-size: inherit;
	line-height: 1.8;
}

.confia-post-sidebar { display: grid; gap: 1.5rem; }
.confia-sidebar-card { padding: 1.5rem; background: #f0f7fb; border: 1px solid #dce7ee; border-top: 0.1875rem solid var(--confia-secondary); }
.confia-sidebar-card[hidden] { display: none; }
body.single-post .confia-sidebar-card h2 { font-size: 1.125rem; line-height: 1.4; color: var(--confia-primary); margin: 0 0 1rem; font-weight: 700; letter-spacing: 0; }
body.single-post .confia-sidebar-card h2::after { display: none; }
.confia-sidebar-card :where(p, li) { font-size: 0.9375rem; line-height: 1.65; }
.confia-sidebar-card :where(ul, ol) { list-style: none; padding: 0; margin: 0; }
.confia-sidebar-card li + li { margin-top: 0.8rem; }
.confia-sidebar-card a { color: var(--confia-primary); text-decoration: none; overflow-wrap: anywhere; }
.confia-sidebar-card a:hover { color: var(--confia-primary); text-decoration: none; background-color: #dceef4; }
.confia-sidebar-card li a { display: block; padding-block: 0.25rem; }
.confia-sidebar-card a:focus-visible, .confia-post-meta a:focus-visible { outline: 0.1875rem solid #006b70; outline-offset: 0.1875rem; }
.confia-toc-list .confia-toc-subsection { padding-inline-start: 0.875rem; border-inline-start: 2px solid #cbd5e1; }
.confia-contact-card { background: var(--confia-primary); }
body.single-post .confia-contact-card h2, .confia-contact-card p { color: #fff; }
/* A slightly deeper cyan keeps the compact white label readable. */
body.single-post .confia-contact-card .confia-contact-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	box-sizing: border-box;
	max-width: 100%;
	min-height: 52px;
	padding: 14px 24px;
	background: #007f94;
	color: #fff;
	border: 2px solid #007f94;
	border-radius: 3px;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	font-weight: 600;
	letter-spacing: normal;
	text-transform: none;
	text-align: center;
	text-decoration: none;
	transition: background-color 180ms ease, border-color 180ms ease;
}
body.single-post .confia-contact-card .confia-contact-link span[aria-hidden="true"] {
	flex-shrink: 0;
	font-size: 22px;
	line-height: 1;
}
body.single-post .confia-contact-card .confia-contact-link:hover {
	background: #006778;
	border-color: #006778;
	color: #fff;
	text-decoration: none;
}
body.single-post .confia-contact-card .confia-contact-link:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 4px;
}
body.single-post .confia-contact-card .confia-contact-link:active {
	background: #005565;
	border-color: #005565;
}
@media (prefers-reduced-motion: reduce) {
	body.single-post .confia-contact-card .confia-contact-link { transition: none; }
}
/* Adjacent articles use their own featured images and remain usable without one. */
body.single-post .confia-adjacent-posts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.25rem;
	border-top: 1px solid #cbd5e1;
	padding-block: 1.5rem;
	margin-top: 2rem;
}
body.single-post .confia-adjacent-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	border: 1px solid #dce7ee;
	border-radius: 4px;
	background: #f0f7fb;
	color: var(--confia-primary);
	text-decoration: none;
	overflow-wrap: anywhere;
}
body.single-post .confia-adjacent-card .confia-adjacent-image {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 3px 3px 0 0;
	margin: 0;
}
body.single-post .confia-adjacent-copy { display: grid; gap: 0.5rem; padding: 1.125rem; }
body.single-post .confia-adjacent-label { color: #006778; font-size: 14px; line-height: 1.5; font-weight: 600; }
body.single-post .confia-adjacent-title { font-size: 18px; line-height: 1.5; font-weight: 600; }
body.single-post .confia-adjacent-card:hover { background: #dceef4; border-color: #007f94; color: var(--confia-primary); text-decoration: none; }
body.single-post .confia-adjacent-card:hover .confia-adjacent-title { text-decoration: underline; text-underline-offset: 3px; }
body.single-post .confia-adjacent-card:focus-visible { outline: 3px solid #007f94; outline-offset: 4px; }
@media (max-width: 40rem) {
	body.single-post .confia-adjacent-posts { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 60rem) {
	body.single-post .confia-post-layout { padding-inline: 32px; }
	body.single-post .confia-post-layout { grid-template-columns: minmax(0, 1fr); }
	.confia-post-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.confia-toc { grid-column: 1 / -1; }
}

@media (max-width: 40rem) {
	body.single-post .confia-post-layout { padding-inline: 20px; }
	.confia-post-sidebar { grid-template-columns: minmax(0, 1fr); }
	body.single-post article.type-post .entry-content {
		line-height: 1.75;
	}

	body.single-post article.type-post .entry-content blockquote {
		padding: 1em;
	}
}
