/*
 * Layout for the new template parts and for pages that are not William's composed pages.
 * Everything is scoped (.tc-*), so composed pages render exactly as before.
 * dms.css starts with a reset (headings inherit size, lists lose bullets, links lose colour); the article
 * styles below restore normal reading typography for the ~210 old classic-editor posts and pages.
 */

/* Header template part: no box of its own, so .site-header stays sticky for the whole page (as when embedded). */
.tc-header-part { display: contents; }
/* WordPress puts a 24px gap between template blocks; content sat flush under the header before, keep it that way. */
.wp-site-blocks > .tc-header-part + * { margin-block-start: 0; }

/* ---------- Article pages (body.tc-article) ---------- */
.tc-entry-title {
	box-sizing: border-box;
	max-width: 800px;
	margin: 56px auto 0 !important;
	padding: 0 20px;
	font: 400 clamp(2rem, 1.4rem + 2.4vw, 2.85rem)/1.2 "Libre Baskerville", Georgia, serif;
	letter-spacing: -0.015em;
	color: #1b2142;
	text-wrap: balance;
}

body.tc-article .wp-block-post-content {
	box-sizing: border-box;
	max-width: 800px;
	margin: 28px auto 72px !important;
	padding: 0 20px;
	font: 400 1.0625rem/1.75 Montserrat, Arial, sans-serif;
	color: #1f1f1f;
	overflow-wrap: break-word;
}
body.tc-article .wp-block-post-content > * + *,
body.tc-article .wp-block-post-content :is(div, section) > * + * { margin-block-start: 0; }
body.tc-article .wp-block-post-content :is(p, ul, ol, table, blockquote, figure, iframe, .wp-caption, pre) { margin: 0 0 1.15em; }
body.tc-article .wp-block-post-content :is(h1, h2, h3, h4) {
	font-family: "Libre Baskerville", Georgia, serif;
	font-weight: 400;
	color: #1b2142;
	line-height: 1.3;
	letter-spacing: -0.01em;
	text-wrap: balance;
	margin: 1.8em 0 0.6em;
}
body.tc-article .wp-block-post-content h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 2.85rem); line-height: 1.2; margin-top: 0; }
body.tc-article .wp-block-post-content h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.85rem); }
body.tc-article .wp-block-post-content h3 { font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem); }
body.tc-article .wp-block-post-content h4 { font-size: 1.1rem; font-family: Montserrat, Arial, sans-serif; font-weight: 700; }
body.tc-article .wp-block-post-content :is(h1, h2, h3, h4):first-child { margin-top: 0; }
body.tc-article .wp-block-post-content :is(strong, b) { font-weight: 700; }
body.tc-article .wp-block-post-content :is(em, i) { font-style: italic; }
body.tc-article .wp-block-post-content a { color: #0b7a96; text-decoration: underline; text-underline-offset: 2px; }
body.tc-article .wp-block-post-content a:hover { color: #1b2142; }
body.tc-article .wp-block-post-content ul { list-style: disc; padding-left: 1.4em; }
body.tc-article .wp-block-post-content ol { list-style: decimal; padding-left: 1.5em; }
body.tc-article .wp-block-post-content li { margin: 0 0 0.45em; padding-left: 0.2em; }
body.tc-article .wp-block-post-content li > :is(ul, ol) { margin: 0.45em 0 0; }
body.tc-article .wp-block-post-content sup { font-size: 0.72em; line-height: 0; vertical-align: super; }
body.tc-article .wp-block-post-content hr { border: 0; border-top: 1px solid #dce6ec; margin: 2.2em 0; }
body.tc-article .wp-block-post-content blockquote {
	border-left: 4px solid #3dc9ea;
	background: #f3f8fb;
	padding: 1em 1.25em;
	color: #2d3663;
}
body.tc-article .wp-block-post-content blockquote > :last-child { margin-bottom: 0; }

/* Images: classic alignment classes, captions, hotlinked widgets */
body.tc-article .wp-block-post-content img { max-width: 100%; height: auto; border-radius: 6px; }
body.tc-article .wp-block-post-content :is(.aligncenter, .wp-caption.aligncenter) { display: block; margin-left: auto; margin-right: auto; }
body.tc-article .wp-block-post-content .alignnone { display: block; }
body.tc-article .wp-block-post-content .alignleft { float: left; margin: 0.3em 1.4em 1em 0; max-width: 50%; }
body.tc-article .wp-block-post-content .alignright { float: right; margin: 0.3em 0 1em 1.4em; max-width: 50%; }
body.tc-article .wp-block-post-content .wp-caption { max-width: 100%; }
body.tc-article .wp-block-post-content .wp-caption-text { font-size: 0.86rem; color: #56707f; margin: 0.5em 0 0; }
body.tc-article .wp-block-post-content :is(h2, h3, h4, hr, table) { clear: both; }
body.tc-article .wp-block-post-content iframe { display: block; max-width: 100%; }
body.tc-article .wp-block-post-content iframe[src*="youtube"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }

/* Tables */
body.tc-article .wp-block-post-content table {
	display: block;
	overflow-x: auto;
	border-collapse: collapse;
	font-size: 0.95rem;
	max-width: 100%;
}
body.tc-article .wp-block-post-content :is(th, td) { border: 1px solid #dce6ec; padding: 0.55em 0.8em; text-align: left; vertical-align: top; }
body.tc-article .wp-block-post-content th { background: #f3f8fb; font-weight: 700; color: #1b2142; }

/* Text pasted from chat tools carries layout utility classes that dms.css also defines; read it as plain text. */
body.tc-article .wp-block-post-content :is(.flex, .flex-col, .flex-grow, .gap-3, .items-start) { display: block; gap: 0; }
body.tc-article .wp-block-post-content .prose { max-width: none; }

/* ---------- Archives and search ---------- */
.tc-archive {
	box-sizing: border-box;
	max-width: 1200px;
	margin: 56px auto 80px !important;
	padding: 0 20px;
	font-family: Montserrat, Arial, sans-serif;
	color: #1f1f1f;
}
.tc-archive-title {
	font: 400 clamp(2rem, 1.4rem + 2.4vw, 2.85rem)/1.2 "Libre Baskerville", Georgia, serif;
	letter-spacing: -0.015em;
	color: #1b2142;
	margin: 0 0 12px;
}
.tc-archive-description { max-width: 720px; color: #56707f; font-size: 1.0625rem; line-height: 1.7; margin: 0 0 8px; }
.tc-archive-query { margin-top: 36px !important; }
.tc-archive-grid {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 36px 28px;
	list-style: none;
	margin: 0 !important;
	padding: 0 !important;
}
.tc-archive-grid > li { display: flex; flex-direction: column; gap: 12px; margin: 0 !important; min-width: 0; }
.tc-archive-grid > li > * { margin: 0 !important; }
.tc-card-image img { width: 100%; border-radius: 8px; object-fit: cover; }
.tc-card-title { font: 400 1.3rem/1.35 "Libre Baskerville", Georgia, serif; color: #1b2142; }
.tc-card-title a { color: inherit; text-decoration: none; }
.tc-card-title a:hover { color: #0b7a96; }
.tc-card-excerpt { color: #56707f; font-size: 0.95rem; line-height: 1.65; }
.tc-card-excerpt .wp-block-post-excerpt__excerpt { margin: 0; }
.tc-pagination { margin-top: 48px !important; display: flex; flex-wrap: wrap; gap: 8px 14px; font-weight: 600; }
.tc-pagination a, .tc-pagination .current { color: #2d3663; text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.tc-pagination .current { background: #2d3663; color: #fff; }
.tc-search-form { max-width: 560px; margin: 20px 0 0 !important; }
.tc-search-form .wp-block-search__input { border: 1px solid #bbd9e2; border-radius: 8px; padding: 10px 12px; font: inherit; min-height: 46px; }
.tc-search-form .wp-block-search__button { background: #2d3663; color: #fff; border: 0; border-radius: 8px; padding: 0 20px; font: 600 0.95rem Montserrat, Arial, sans-serif; margin-left: 8px; cursor: pointer; }

/* ---------- 404 ---------- */
.tc-404 {
	box-sizing: border-box;
	max-width: 720px;
	margin: 72px auto 96px !important;
	padding: 0 20px;
	font: 400 1.0625rem/1.7 Montserrat, Arial, sans-serif;
	color: #1f1f1f;
}
.tc-404 > * + * { margin-top: 20px !important; }
.tc-404-title { font: 400 clamp(2rem, 1.4rem + 2.4vw, 2.85rem)/1.2 "Libre Baskerville", Georgia, serif; color: #1b2142; letter-spacing: -0.015em; }
.tc-404-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.tc-404-links a { color: #0b7a96; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 600px) {
	body.tc-article .wp-block-post-content :is(.alignleft, .alignright) { float: none; max-width: 100%; margin: 0 0 1em; }
	.tc-entry-title, .tc-archive, .tc-404 { margin-top: 36px !important; }
}

/* HubSpot chat bubble stays hidden (was a <style> in the footer template part). */
#hubspot-messages-iframe-container { display: none !important; }

/* Home page header height. dms.css sets it for the header that used to be pasted inside the home page content
   (.home-v3-preview .site-header); the header now comes from the template, outside that wrapper. */
body:has(.home-v3-preview) .site-header { height: 78px; }
@media (width <= 700px) {
	body:has(.home-v3-preview) .site-header { height: 70px; }
}
