/*
 * TD Theme base styles.
 * Loaded on the front end and in the editor (add_editor_style), so core blocks
 * in post bodies look the same in both places.
 */

body {
	margin: 0;
	-webkit-font-smoothing: antialiased;
}

input,
select,
textarea,
button {
	font: inherit;
}

summary {
	list-style: none;
}

summary::-webkit-details-marker {
	display: none;
}

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--periwinkle);
	outline-offset: 2px;
}

img {
	max-width: 100%;
	height: auto;
}

.screen-reader-text:not(:focus) {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* Template wrappers: blocks own their own width, so the site blocks sit flush. */
.wp-site-blocks {
	padding: 0;
}

.wp-site-blocks > * + *,
.wp-site-blocks > main > * + * {
	margin-block-start: 0;
}

.td-main {
	margin: 0;
}

/* ---------------------------------------------------------------
 * Post body (single.html) — core blocks styled to match the design.
 * ------------------------------------------------------------- */

.td-article,
.editor-styles-wrapper .wp-block-post-content {
	--td-grad: var(--wp--preset--gradient--brand);
	font-size: 18px;
	line-height: 1.8;
	color: #2E3740;
}

.td-article > .wp-block-post-content,
.td-article {
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.td-article .wp-block-post-content > *,
.editor-styles-wrapper .wp-block-post-content > * {
	margin-block: 0;
}

.td-article .wp-block-post-content > * + *,
.editor-styles-wrapper .wp-block-post-content > * + * {
	margin-block-start: 22px;
}

.td-article p,
.editor-styles-wrapper .wp-block-post-content p {
	margin: 0;
}

.td-article a,
.editor-styles-wrapper .wp-block-post-content a {
	color: var(--wp--preset--color--indigo);
	text-underline-offset: 3px;
}

.td-article h2.wp-block-heading,
.editor-styles-wrapper .wp-block-post-content h2.wp-block-heading {
	margin-top: 44px;
	display: flex;
	align-items: center;
	gap: 14px;
	font-size: 28px;
	line-height: 1.25;
	font-weight: 800;
	letter-spacing: -0.015em;
	color: var(--wp--preset--color--ink);
	scroll-margin-top: 24px;
}

.td-article h2.wp-block-heading::before,
.editor-styles-wrapper .wp-block-post-content h2.wp-block-heading::before {
	content: "";
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	transform: rotate(45deg);
	background: var(--td-grad);
}

.td-article h3.wp-block-heading,
.editor-styles-wrapper .wp-block-post-content h3.wp-block-heading {
	font-size: 22px;
	color: var(--wp--preset--color--ink);
}

.td-article ul.wp-block-list,
.editor-styles-wrapper .wp-block-post-content ul.wp-block-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.td-article ul.wp-block-list > li,
.editor-styles-wrapper .wp-block-post-content ul.wp-block-list > li {
	position: relative;
	padding-left: 22px;
}

.td-article ul.wp-block-list > li::before,
.editor-styles-wrapper .wp-block-post-content ul.wp-block-list > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 12px;
	width: 8px;
	height: 8px;
	background: var(--td-grad);
}

.td-article ol.wp-block-list,
.editor-styles-wrapper .wp-block-post-content ol.wp-block-list {
	margin: 0;
	padding-left: 1.4em;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.td-article .wp-block-quote,
.editor-styles-wrapper .wp-block-post-content .wp-block-quote {
	position: relative;
	margin: 12px 0;
	padding: 28px 32px;
	border: 0;
	background: var(--wp--preset--color--lavender);
	font-size: 22px;
	line-height: 1.5;
	font-weight: 700;
	color: var(--wp--preset--color--ink);
}

.td-article .wp-block-quote::before,
.editor-styles-wrapper .wp-block-post-content .wp-block-quote::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 6px;
	background: var(--td-grad);
}

.td-article .wp-block-quote p,
.editor-styles-wrapper .wp-block-post-content .wp-block-quote p {
	margin: 0;
}

.td-article .wp-block-quote cite,
.editor-styles-wrapper .wp-block-post-content .wp-block-quote cite {
	display: block;
	margin-top: 12px;
	font-size: 14px;
	font-weight: 600;
	font-style: normal;
	color: var(--wp--preset--color--ink-soft);
}

.td-article .wp-block-code,
.editor-styles-wrapper .wp-block-post-content .wp-block-code {
	margin: 4px 0;
	padding: 24px 26px;
	border: 0;
	border-radius: 0;
	background: var(--wp--preset--color--ink);
	color: #E3E6FB;
	overflow-x: auto;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 14px;
	line-height: 1.7;
	white-space: pre;
}

.td-article .wp-block-code code,
.editor-styles-wrapper .wp-block-post-content .wp-block-code code {
	font: inherit;
	white-space: inherit;
}

.td-article :not(pre) > code,
.editor-styles-wrapper .wp-block-post-content :not(pre) > code {
	padding: 1px 6px;
	background: var(--wp--preset--color--lavender);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.85em;
}

@media (max-width: 640px) {
	.td-article {
		font-size: 17px;
	}
}

/* ---------------------------------------------------------------
 * Single post layout: article + sidebar.
 * ------------------------------------------------------------- */

.td-post-layout {
	max-width: 1240px;
	margin: 0 auto;
	padding: 150px 24px 80px;
	display: flex;
	flex-wrap: wrap;
	gap: 64px;
	align-items: flex-start;
}

.td-post-layout > .td-article {
	flex: 999 1 640px;
	min-width: 0;
	max-width: 760px;
	margin: 0;
}

.td-post-layout > .wp-block-td-post-sidebar {
	flex: 1 1 280px;
	min-width: 0;
	margin: 0;
}

@media (max-width: 640px) {
	.td-post-layout {
		padding-top: 110px;
		gap: 40px;
	}
}

/* ---------------------------------------------------------------
 * Plain pages (Privacy Policy) and the index fallback.
 * ------------------------------------------------------------- */

.td-page__header {
	max-width: 1040px;
	margin: 0 auto;
	padding: 72px 24px 32px;
}

.td-page__title {
	margin: 0;
	font-size: clamp(36px, 4.6vw, 58px);
	line-height: 1.1;
	font-weight: 800;
	letter-spacing: -0.025em;
}

.td-page__body {
	max-width: 1040px;
	margin: 0 auto;
	padding: 0 24px 96px;
}

.td-page__body > .wp-block-post-content,
.td-page__body .wp-block-query {
	max-width: 760px;
}

/* Front page hero sits under the header bar, as in the design. */
.td-header-part {
	position: relative;
	z-index: 20;
}
