/*
 * SimCriterio UI-1: typography and article readability.
 * SimCriterio UI-2: editorial component polish.
 * This stylesheet intentionally leaves content, templates, SEO and behavior untouched.
 */

body {
	font-size: 18px;
	line-height: 1.7;
}

main h1 {
	font-size: clamp(2.1875rem, 1.85rem + 1.5vw, 3rem);
	line-height: 1.12;
	text-wrap: balance;
}

main h2 {
	font-size: clamp(1.75rem, 1.6rem + 0.75vw, 2.125rem);
	line-height: 1.2;
	text-wrap: balance;
}

main h3 {
	font-size: clamp(1.3125rem, 1.25rem + 0.25vw, 1.4375rem);
	line-height: 1.3;
}

body.single-post main > .wp-block-group.alignwide > :where(:not(.alignleft):not(.alignright):not(.alignfull):not(.alignwide)) {
	max-width: 760px;
}

body.single-post .wp-block-post-title + .wp-block-group {
	column-gap: 0.5rem;
	margin-block: 0.875rem 2rem !important;
	color: #5f5b55;
	font-size: 0.875rem;
	line-height: 1.5;
}

body.single-post .wp-block-post-title + .wp-block-group > .wp-block-post-date + p:last-child {
	display: none;
}

body.single-post .wp-block-post-content > h2 {
	margin-block: clamp(3rem, 5vw, 3.5rem) 1rem !important;
}

body.single-post .wp-block-post-content > h3 {
	margin-block: 2.25rem 0.75rem !important;
}

body.single-post .wp-block-post-content > p {
	margin-block: 0 1.25em !important;
}

body.single-post .wp-block-post-content > :where(ul, ol) {
	margin-block: 0 1.5em !important;
	padding-inline-start: 1.4em;
}

body.single-post .wp-block-post-content li + li {
	margin-block-start: 0.5em;
}

body.single-post .wp-block-post-content :where(a, code, kbd, samp) {
	overflow-wrap: anywhere;
}

body.single-post .wp-block-post-content pre {
	max-width: 100%;
	overflow-x: auto;
	white-space: pre;
}

body.single-post .wp-block-post-content pre code {
	overflow-wrap: normal;
	white-space: inherit;
}

main a:not(.wp-element-button) {
	text-decoration-skip-ink: auto;
	text-decoration-thickness: max(1px, 0.08em);
	text-underline-offset: 0.18em;
}

main a:not(.wp-element-button):hover {
	text-decoration-thickness: max(2px, 0.11em);
}

:where(a, button, summary, [tabindex]):focus-visible {
	border-radius: 2px;
	outline: 3px solid #9a4f36;
	outline-offset: 3px;
	box-shadow: 0 0 0 2px #fff;
}

.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	box-sizing: border-box;
	min-width: 44px;
	min-height: 44px;
	padding: 10px;
	align-items: center;
	justify-content: center;
}

.wp-block-navigation__responsive-container-open {
	margin: -10px;
}

/* Existing article-end transition and previous/next navigation. */
body.single-post .wp-block-post-content + .wp-block-separator {
	margin-block-start: 4.5rem !important;
	border-color: #d9ddd4;
}

body.single-post .wp-block-post-content + .wp-block-separator + .wp-block-heading {
	margin-block: 1.75rem 0.75rem !important;
	color: #171914;
}

body.single-post .wp-block-post-navigation-link {
	box-sizing: border-box;
	margin-block-start: 0.875rem;
	padding: 1rem 1.125rem;
	border: 1px solid #d9ddd4;
	border-radius: 8px;
	background: #fbfaf3;
}

body.single-post .wp-block-post-navigation-link a {
	display: block;
	color: #586443;
	font-weight: 650;
	line-height: 1.45;
}

body.single-post .wp-block-post-navigation-link-next {
	text-align: end;
}

/* Existing Easy Table of Contents output. */
body.single-post #ez-toc-container {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin-block: 2rem;
	padding: 1.25rem;
	border: 1px solid #d9ddd4;
	border-radius: 10px;
	background: #fbfaf3;
	box-shadow: none;
}

body.single-post #ez-toc-container .ez-toc-title-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

body.single-post #ez-toc-container .ez-toc-title {
	margin: 0;
	color: #171914;
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.4;
}

body.single-post #ez-toc-container .ez-toc-toggle {
	display: inline-flex;
	min-width: 44px;
	min-height: 44px;
	align-items: center;
	justify-content: center;
	border: 1px solid transparent;
	border-radius: 8px;
	color: #586443;
}

body.single-post #ez-toc-container .ez-toc-toggle:hover {
	border-color: #d9ddd4;
	background: #fff;
}

body.single-post #ez-toc-container nav {
	margin-block-start: 0.875rem;
}

body.single-post #ez-toc-container :where(ul, ol) {
	margin-block: 0;
	padding-inline-start: 1.25rem;
}

body.single-post #ez-toc-container li + li {
	margin-block-start: 0.55rem;
}

body.single-post #ez-toc-container :where(ul, ol) :where(ul, ol) {
	margin-block-start: 0.55rem;
}

body.single-post #ez-toc-container .ez-toc-link {
	color: #586443;
	line-height: 1.5;
}

/* Existing WordPress table blocks. */
body.single-post .wp-block-post-content > .wp-block-table {
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid #d9ddd4;
	border-radius: 8px;
	background: #fbfaf3;
}

body.single-post .wp-block-post-content > .wp-block-table table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	background: #fff;
}

body.single-post .wp-block-post-content > .wp-block-table :where(th, td) {
	padding: 0.75rem 0.875rem;
	border: 0;
	border-bottom: 1px solid #d9ddd4;
	vertical-align: top;
	text-align: start;
}

body.single-post .wp-block-post-content > .wp-block-table th {
	background: #fbfaf3;
	color: #171914;
	font-weight: 700;
}

body.single-post .wp-block-post-content > .wp-block-table tr:last-child > :where(th, td) {
	border-bottom: 0;
}

/* List rhythm without changing native list semantics or markers. */
body.single-post .wp-block-post-content li > :where(p, ul, ol) {
	margin-block: 0.45em;
}

body.single-post .wp-block-post-content li > :where(ul, ol) {
	padding-inline-start: 1.35em;
}

body.single-post .wp-block-post-content li::marker {
	color: #586443;
}

/* Existing editorial quotations and explicitly bordered Group blocks. */
body.single-post .wp-block-post-content blockquote {
	margin-block: 2rem;
	padding: 1rem 1.25rem;
	border-inline-start: 4px solid #586443;
	border-radius: 0 8px 8px 0;
	background: #fbfaf3;
	color: #171914;
}

body.single-post .wp-block-post-content blockquote > :last-child {
	margin-block-end: 0;
}

body.single-post .wp-block-post-content > .wp-block-group[style*="border"] {
	background: #fbfaf3;
	box-shadow: inset 4px 0 0 #586443;
}

/* Inline and preformatted technical content. */
body.single-post .wp-block-post-content :not(pre) > code {
	padding: 0.12em 0.35em;
	border: 1px solid #d9ddd4;
	border-radius: 4px;
	background: #fbfaf3;
	color: #39422f;
	font-size: 0.92em;
}

body.single-post .wp-block-post-content pre {
	padding: 1rem 1.125rem;
	border: 1px solid #333a2d;
	border-radius: 8px;
	background: #171914;
	color: #fbfaf3;
	line-height: 1.55;
	tab-size: 4;
}

/* Native disclosure blocks, including the homepage FAQ. */
main details {
	border-top: 1px solid #d9ddd4;
}

main details:last-of-type {
	border-bottom: 1px solid #d9ddd4;
}

main details > summary {
	box-sizing: border-box;
	min-height: 44px;
	padding-block: 0.75rem;
	cursor: pointer;
	color: #171914;
	font-weight: 650;
	line-height: 1.45;
}

main details > summary::marker {
	color: #586443;
}

main details[open] > summary {
	color: #586443;
}

main details > summary + * {
	margin-block-start: 0;
}

main details > :last-child {
	margin-block-end: 1rem;
}

@media (max-width: 600px) {
	body {
		font-size: 17px;
		line-height: 1.65;
	}

	body.single-post main.wp-block-group {
		padding-right: 20px !important;
		padding-left: 20px !important;
	}

	body.single-post .wp-block-post-title + .wp-block-group {
		margin-block-end: 1.5rem !important;
	}

	body.single-post #ez-toc-container {
		padding: 1rem;
	}

	body.single-post .wp-block-post-content > .wp-block-table :where(th, td) {
		padding: 0.65rem 0.75rem;
	}
}
