/* ==========================================================================
   The Healthy Boddie – fonts, brand tokens and post pattern styles.
   Loaded on the front end and inside the block editor.
   ========================================================================== */

/* ---- Fonts (self-hosted, SIL OFL) ---- */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/roboto-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: italic; font-weight: 300; font-display: swap; src: url("fonts/roboto-latin-300-italic.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/roboto-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/roboto-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/roboto-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: italic; font-weight: 500; font-display: swap; src: url("fonts/roboto-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/roboto-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: italic; font-weight: 700; font-display: swap; src: url("fonts/roboto-latin-700-italic.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/lora-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/lora-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/lora-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-style: italic; font-weight: 500; font-display: swap; src: url("fonts/lora-latin-500-italic.woff2") format("woff2"); }

/* ---- Brand tokens (also used by the Etch header/footer stylesheet) ---- */
:root {
	--hb-blue: #899abc;          /* original brand slate blue – decoration only */
	--hb-blue-text: #56688f;     /* darker slate blue for text: 5.6:1 on white */
	--hb-blue-tint: #eef1f7;
	--hb-pink: #bc9289;          /* original dusty pink – decoration only */
	--hb-pink-text: #8f5f55;     /* darker pink for text: 5.3:1 on white */
	--hb-pink-tint: #f8efed;
	--hb-teal: #1b545b;          /* footer */
	--hb-teal-tint: #e7f1f2;
	--hb-ink: #212121;
	--hb-muted: #5f6368;
	--hb-white: #fff;

	--hb-font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
	--hb-font-accent: "Lora", Georgia, serif;

	--hb-radius: 6px;
	--hb-gap: clamp(1.25rem, 3vw, 2rem);
	--hb-measure: 46rem;         /* post content width */
}

/* ---- Post body typography ----
   .hb-post = class on the post content wrapper in the Etch single-post template.
   .editor-styles-wrapper = the block editor canvas. */
:where(.hb-post, .editor-styles-wrapper) {
	font-family: var(--hb-font);
	font-size: 1.125rem;
	line-height: 1.7;
	color: var(--hb-ink);
}
:where(.hb-post, .editor-styles-wrapper) :where(h1, h2, h3, h4) {
	font-family: var(--hb-font);
	font-weight: 500;
	line-height: 1.2;
	color: var(--hb-blue-text);
	margin: 1.6em 0 0.5em;
}
:where(.hb-post, .editor-styles-wrapper) h2 { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 1.85rem); }
:where(.hb-post, .editor-styles-wrapper) h3 { font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.6rem); }
:where(.hb-post, .editor-styles-wrapper) h4 { font-size: 1.2rem; }
:where(.hb-post, .editor-styles-wrapper) :where(p, ul, ol) { margin: 0 0 1em; }
:where(.hb-post, .editor-styles-wrapper) a { color: var(--hb-blue-text); text-decoration: underline; text-underline-offset: 0.15em; }
:where(.hb-post, .editor-styles-wrapper) a:hover { color: var(--hb-teal); }
:where(.hb-post, .editor-styles-wrapper) strong { font-weight: 700; }
:where(.hb-post) img { max-width: 100%; height: auto; }
:where(.hb-post) figure { margin: 0 0 1.5em; }
:where(.hb-post) figcaption,
:where(.editor-styles-wrapper) figcaption { font-size: 0.875rem; color: var(--hb-muted); margin-top: 0.4em; }

/* ---- Block styles ---- */
.is-style-hb-standfirst {
	font-size: 1.3rem;
	font-style: italic;
	font-weight: 300;
	line-height: 1.6;
	color: var(--hb-ink);
}
.wp-block-heading.is-style-hb-section {
	border-top: 1px solid var(--hb-blue);
	padding-top: 1em;
	margin-top: 2em;
}
.wp-block-heading.is-style-hb-facts {
	font-size: 1.35rem;
	color: var(--hb-pink-text);
	text-transform: none;
}
.is-style-hb-sources {
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--hb-muted);
	border-top: 1px solid #ddd;
	padding-top: 0.75em;
	margin-top: 2.5em;
}
.is-style-hb-sources + .is-style-hb-sources { border-top: 0; padding-top: 0; margin-top: 0; }

/* ---- Product ---- */
.hb-product { margin: 0 0 1.5em; }
.hb-product > * { margin: 0; }
.hb-product .hb-product__image { margin-bottom: 0.6em; }
.hb-product .hb-product__image img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--hb-radius); display: block; }
.hb-product .hb-product__name { font-weight: 500; font-size: 1rem; color: var(--hb-ink); }
.hb-product .hb-product__meta { font-size: 0.9rem; color: var(--hb-muted); }
.hb-product .hb-product__link { font-size: 0.9rem; }

/* ---- Comparison ---- */
.hb-compare { margin: 1.5em 0; }
.hb-compare .wp-block-columns { gap: var(--hb-gap); margin: 0; }
.hb-compare .hb-compare__item {
	background: var(--hb-blue-tint);
	border-top: 4px solid var(--hb-blue);
	border-radius: var(--hb-radius);
	padding: 1.25rem 1.5rem;
}
.hb-compare .hb-compare__item { display: flex; flex-direction: column; }
.hb-compare .hb-compare__item > * { margin-block: 0 1em; }
.hb-compare .hb-compare__item > :first-child { margin-top: 0; }
.hb-compare .hb-compare__item > .hb-product { margin-top: auto; padding-top: 0.5em; }
.hb-compare .hb-compare__item > :last-child { margin-bottom: 0; }
.hb-compare .hb-compare__item h4 { color: var(--hb-blue-text); }

/* ---- Numbered feature (numbers count automatically) ---- */
body, .editor-styles-wrapper { counter-reset: hb-feature; }
.hb-feature { counter-increment: hb-feature; margin: 2em 0; }
.hb-feature .wp-block-columns { gap: var(--hb-gap); margin: 0; }
.hb-feature .hb-feature__image { margin: 0; }
.hb-feature .hb-feature__image img { width: 100%; height: auto; border-radius: var(--hb-radius); display: block; }
.hb-feature .hb-feature__title {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem);
	font-weight: 300;
	margin-top: 0;
}
.hb-feature .hb-feature__title::before {
	content: counter(hb-feature);
	flex: none;
	display: inline-grid;
	place-items: center;
	width: 2.4rem;
	height: 2.4rem;
	border-radius: 50%;
	background: var(--hb-blue-text);
	color: var(--hb-white);
	font-size: 1.25rem;
	font-weight: 500;
	line-height: 1;
	align-self: center;
}

/* ---- Callout ---- */
.hb-callout {
	background: var(--hb-blue-text);
	color: var(--hb-white);
	border-radius: var(--hb-radius);
	padding: 1.5rem 1.75rem 1.5rem 4rem;
	margin: 2em 0;
	position: relative;
	font-size: 1.25rem;
	line-height: 1.5;
	font-weight: 400;
}
.hb-callout::before {
	content: "\201C";
	position: absolute;
	left: 1.1rem;
	top: 0.6rem;
	font-family: var(--hb-font-accent);
	font-size: 4rem;
	line-height: 1;
	color: var(--hb-blue-tint);
	opacity: 0.6;
}
.hb-callout > * { margin: 0; }
.hb-callout > * + * { margin-top: 0.6em; }
.hb-callout a { color: var(--hb-white); }

/* ---- DO / DON'T ---- */
.hb-dodont { gap: var(--hb-gap); margin: 2em 0; }
.hb-dodont > .wp-block-column {
	border: 2px solid var(--hb-blue);
	border-radius: var(--hb-radius);
	padding: 1.25rem 1.5rem;
}
.hb-dodont > .hb-dodont__dont { border-color: var(--hb-pink); }
.hb-dodont h3 { margin-top: 0; letter-spacing: 0.04em; }
.hb-dodont > .hb-dodont__do h3 { color: var(--hb-blue-text); }
.hb-dodont > .hb-dodont__dont h3 { color: var(--hb-pink-text); }
.hb-dodont ul { list-style: none; padding: 0; margin: 0; }
.hb-dodont li { position: relative; padding-left: 1.75rem; margin-bottom: 0.5em; }
.hb-dodont li::before {
	position: absolute;
	left: 0;
	top: 0;
	font-weight: 700;
}
.hb-dodont__do li::before { content: "✓"; color: var(--hb-blue-text); }
.hb-dodont__dont li::before { content: "✕"; color: var(--hb-pink-text); }

/* ---- Ticks list style (general use) ---- */
.wp-block-list.is-style-hb-ticks { list-style: none; padding-left: 0; }
.wp-block-list.is-style-hb-ticks li { position: relative; padding-left: 1.75rem; }
.wp-block-list.is-style-hb-ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--hb-blue-text); font-weight: 700; }

/* ---- Columns: consistent gap wherever she uses them ---- */
:where(.hb-post, .editor-styles-wrapper) .wp-block-columns { gap: var(--hb-gap); }

/* ---- Text + product columns ---- */
.hb-text-product { gap: var(--hb-gap); align-items: flex-start; }

/* ---- Intro columns (e.g. Turmeric / Ginger / Cinnamon) ---- */
.hb-trio { margin: 1.5em 0 2em; }
.hb-trio .hb-trio__image { margin: 0 0 0.75em; }
.hb-trio .hb-trio__image img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--hb-radius); display: block; }
.hb-trio h3 { margin: 0 0 0.4em; font-size: 1.3rem; }
.hb-trio p { font-size: 1rem; line-height: 1.6; }

/* ---- Centred images (core alignment styles aren't loaded under Etch) ---- */
:where(.hb-post, .editor-styles-wrapper) .wp-block-image.aligncenter { display: table; margin-inline: auto; }
:where(.hb-post, .editor-styles-wrapper) .wp-block-image.aligncenter > figcaption { display: table-caption; caption-side: bottom; }
:where(.hb-post) .wp-block-image img { border-radius: var(--hb-radius); }

/* ---- Small images beside text (from older posts or her own choice) ---- */
:where(.hb-post, .editor-styles-wrapper) .wp-block-image.alignright,
:where(.hb-post, .editor-styles-wrapper) .alignright > .wp-block-image,
:where(.hb-post) figure.alignright { float: right; margin: 0.3em 0 1em 1.5rem; max-width: 45%; }
:where(.hb-post, .editor-styles-wrapper) .wp-block-image.alignleft,
:where(.hb-post) figure.alignleft { float: left; margin: 0.3em 1.5rem 1em 0; max-width: 45%; }
:where(.hb-post, .editor-styles-wrapper) :where(.alignright, .alignleft) img { border-radius: var(--hb-radius); }
:where(.hb-post) :where(h2, h3, .hb-callout, .hb-compare, .hb-feature, .hb-dodont, .wp-block-columns) { clear: both; }
:where(.hb-post)::after { content: ""; display: table; clear: both; }

/* ---- Mobile ---- */
@media (max-width: 600px) {
	:where(.hb-post) :where(.alignright, .alignleft) { float: none !important; margin: 0 auto 1em !important; max-width: 100% !important; }
}
@media (max-width: 781px) {
	.hb-callout { padding-left: 1.5rem; padding-top: 3.25rem; }
	.hb-callout::before { top: 0.4rem; left: 1.25rem; }
}

/* ---- Contact form (WS Form block with class hb-contact-form) ---- */
.hb-post .hb-contact-form.wsf-form {
	--wsf-form-color-primary: var(--hb-blue-text);
	--wsf-field-border-color: #767b80;            /* 4.4:1 on white */
	--wsf-field-border-radius: var(--hb-radius);
	--wsf-field-button-width: auto;
	--wsf-field-button-border-radius: var(--hb-radius);
	--wsf-field-button-primary-color: #fff;
	--wsf-field-button-primary-color-background: var(--hb-blue-text);
	--wsf-field-button-primary-border-color: var(--hb-blue-text);
	--wsf-field-button-primary-color-background-hover: var(--hb-teal);
	--wsf-field-button-primary-border-color-hover: var(--hb-teal);
	--wsf-field-button-primary-color-background-focus: var(--hb-teal);
	--wsf-field-button-primary-border-color-focus: var(--hb-teal);
	margin: 1.5rem 0 2rem;
}
.hb-post .hb-contact-form label { font-weight: 500; }
.hb-post .hb-contact-form button.wsf-button { padding-inline: 2rem; min-width: 12rem; font-weight: 500; }

/* ---- Past comments (read-only) ---- */
.hb-comments { clear: both; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--hb-blue); }
.hb-comments__title { margin: 0 0 1rem; font-size: 1.4rem; }
.hb-comments__list, .hb-comments .children { list-style: none; margin: 0; padding: 0; }
.hb-comments .children { margin-left: clamp(1rem, 4vw, 2.5rem); }
.hb-comment__body {
	margin: 0 0 1rem;
	padding: 1rem 1.25rem;
	background: #f7f7f8;
	border-radius: var(--hb-radius);
}
.hb-comment--author > .hb-comment__body { background: var(--hb-blue-tint); border-left: 4px solid var(--hb-blue); }
.hb-comment__meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; margin-bottom: 0.4rem; }
.hb-comment__author { font-weight: 500; color: var(--hb-ink); }
.hb-comment__date { font-size: 0.85rem; color: var(--hb-muted); }
.hb-comment__text { font-size: 1rem; line-height: 1.6; }
.hb-comment__text p { margin: 0 0 0.6em; }
.hb-comment__text p:last-child { margin-bottom: 0; }
.hb-comments__closed { font-size: 0.9rem; color: var(--hb-muted); margin: 0.5rem 0 0; }

/* ---- Comment form (only shows while comments are open) ---- */
.hb-comment__reply { margin: 0.5rem 0 0; font-size: 0.9rem; }
.hb-comment__reply a { color: var(--hb-blue-text); font-weight: 500; }
.hb-comment-form__title { font-size: 1.2rem; margin: 2rem 0 0.5rem; }
.hb-comment-form__title small { margin-left: 0.75rem; font-size: 0.85rem; font-weight: 400; }
.hb-comment-form__note { font-size: 0.9rem; color: var(--hb-muted); }
.hb-comment-form p { margin: 0 0 1rem; }
.hb-comment-form label { display: block; font-weight: 500; margin-bottom: 0.3rem; }
.hb-comment-form :is(input[type="text"], input[type="email"], input[type="url"], textarea) {
	width: 100%;
	padding: 0.6rem 0.75rem;
	font: inherit;
	font-size: 1rem;
	border: 1px solid #767b80;
	border-radius: var(--hb-radius);
	background: #fff;
}
.hb-comment-form :is(input, textarea):focus { outline: 3px solid var(--hb-blue); outline-offset: 1px; }
.hb-comment-form .comment-form-cookies-consent { display: flex; gap: 0.5rem; align-items: flex-start; }
.hb-comment-form .comment-form-cookies-consent label { font-weight: 400; }
.hb-comment-form .hb-button {
	padding: 0.8rem 2rem;
	border: 0;
	border-radius: var(--hb-radius);
	background: var(--hb-blue-text);
	color: #fff;
	font: inherit;
	font-weight: 500;
	cursor: pointer;
}
.hb-comment-form .hb-button:hover, .hb-comment-form .hb-button:focus-visible { background: var(--hb-teal); }
/* Links inside WS Form help text stay in the sentence (WS Form makes them block-level) */
.hb-post .hb-contact-form .wsf-help a { display: inline; color: var(--hb-blue-text); text-decoration: underline; }
