/* Evalu-8 theme — header, footer, blog and article styles. Modules are styled by the plugin. */
:root {
	--e8-header-bg: #423d39;
	--e8-gutter: var(--wp--custom--gutter, 20px);
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; overflow-x: clip; }
body.e8-brand-hr { background: #fff; color: #202431; }
body.e8-brand-hr :focus-visible { outline-color: #8bc53f; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--wp--preset--color--amber); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }

/* Header: rendered by the evalu8/site-header block (plugin). The bar floats over the first section of the page. */
.e8-site-header { background: transparent; }
.e8-main { margin-top: calc(-1 * var(--e8-header-offset, 0px)); }
.e8-landing .wp-block-post-content > .e8-section:first-child::before,
.e8-landing [data-e8-root] > .e8-section:first-child::before { content: ''; display: block; height: var(--e8-header-offset, 0px); }

/* No block gap between header, main and footer, nor between consecutive sections. */
.wp-site-blocks > * + * { margin-block-start: 0; }
.wp-site-blocks > .e8-main { margin-top: calc(-1 * var(--e8-header-offset, 0px)); }
.wp-block-post-content > .e8-section, .wp-block-post-content > .e8-dialog, [data-e8-root] > .e8-section,
.e8-section + .e8-section, .e8-landing .wp-block-post-content > * { margin-block-start: 0; }
.e8-article__body > .e8-section + .e8-section { margin-top: 0; }

/* Main content areas */
.e8-main { min-height: 40vh; }
.e8-page, .e8-404 { padding: clamp(32px, 6vw, 72px) var(--e8-gutter); }
.e8-page__title { margin-bottom: clamp(24px, 4vw, 40px); }
.e8-page .wp-block-post-content > * + * { margin-top: 1.25rem; }

/* ---- Editorial (blog + article): neutral off-white/white palette shared by HR and EHS content. ---- */
.e8-blog, .e8-article {
	--e8-line: #e6e4e1;
	--e8-surface-2: #f0efed;
	background: #fff;
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--body);
}

/* Blog index and archives */
.e8-blog { background: var(--wp--preset--color--surface, #fbfbfb); padding: clamp(32px, 6vw, 72px) var(--e8-gutter); }
.e8-blog__intro { margin-bottom: clamp(24px, 4vw, 40px); }
.e8-blog__intro h1, .e8-blog__intro .wp-block-query-title { font-size: clamp(2rem, 1.2rem + 3vw, 3.25rem); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 12px; }
.e8-blog__lead { color: var(--wp--preset--color--grey); margin: 0; max-width: 40rem; }
/* Blog index (posts page): centred intro, topic chips, featured lead, then the latest articles. */
.e8-blog__intro--center { text-align: center; }
.e8-blog__intro--center .e8-blog__lead { margin-inline: auto; }
.e8-blog__eyebrow { display: inline-block; margin: 0 0 18px; padding: 5px 12px; border: 1px solid var(--e8-line); border-radius: 8px; background: #fff; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.e8-blog--index .e8-blog__intro h1 { font-size: clamp(2.5rem, 1.4rem + 4vw, 4.5rem); line-height: 1.02; letter-spacing: -0.03em; margin-bottom: 16px; }
.e8-blog__topics { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 1140px; margin: 0 auto clamp(28px, 4vw, 44px); padding: 0; }
.e8-blog__topics--left { justify-content: flex-start; }
.e8-blog__topics a { display: inline-block; padding: 7px 15px; border-radius: 999px; background: #fff3df; color: var(--wp--preset--color--ink); font-size: 0.875rem; font-weight: 600; text-decoration: none; transition: background 0.15s ease, color 0.15s ease; }
.e8-blog__topics li:nth-child(4n+2) a { background: #edf7ff; }
.e8-blog__topics li:nth-child(4n+3) a { background: #f8e6ff; }
.e8-blog__topics li:nth-child(4n+4) a { background: #e6f5ec; }
.e8-blog__topics a:hover, .e8-blog__topics a:focus-visible, .e8-blog__topics .current-cat a { background: var(--wp--preset--color--ink); color: #fff; }
.e8-blog .e8-blog__section-title { max-width: 1140px; margin: clamp(40px, 6vw, 72px) auto 20px; font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem); line-height: 1.1; letter-spacing: -0.02em; }
.e8-blog .wp-block-search { max-width: 32rem; margin-top: 16px; }
.e8-blog .wp-block-search__input { border: 1px solid var(--e8-line); border-radius: 10px; padding: 10px 14px; }
.e8-blog .wp-block-search__button { border-radius: 10px; }
.e8-post-list { max-width: 1140px; margin-inline: auto; }
.wp-block-post-template.e8-post-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; grid-template-columns: 1fr; }
.wp-block-post-template.e8-post-grid.is-layout-grid { grid-template-columns: 1fr; }
@media (min-width: 640px) { .wp-block-post-template.e8-post-grid, .wp-block-post-template.e8-post-grid.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .wp-block-post-template.e8-post-grid, .wp-block-post-template.e8-post-grid.is-layout-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.e8-post-grid > .wp-block-post { margin: 0; }
.e8-pagination { margin-top: clamp(24px, 4vw, 48px); gap: 12px; }
.e8-pagination a, .e8-pagination .page-numbers { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--wp--preset--color--ink); }
.e8-pagination .page-numbers.current { background: var(--e8-surface-2); font-weight: 600; }
.e8-empty { color: var(--wp--preset--color--grey); }

/* Article: header band (plugin block), then a sticky contents column beside a 768px reading column. */
.e8-article__layout { max-width: 1140px; margin-inline: auto; padding: clamp(28px, 5vw, 64px) var(--e8-gutter) 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; justify-content: center; }
.e8-article__side { min-width: 0; }
.e8-article__side .e8-toc { margin: 0 0 28px; }
.e8-article__main { min-width: 0; max-width: 768px; width: 100%; margin-inline: auto; padding-bottom: clamp(40px, 6vw, 72px); }
@media (min-width: 1024px) {
	.e8-article__layout { grid-template-columns: auto minmax(0, 768px); }
	.e8-article__side { align-self: start; position: sticky; top: calc(var(--wp--custom--header--height, 76px) + 24px); }
	.e8-article__side .e8-toc { width: 300px; margin: 0 56px 0 0; }
	.e8-article__main { margin-inline: 0; }
}

/* Reading column typography */
.e8-article__body { font-size: 1.125rem; line-height: 1.65; }
.e8-article__body > * { margin-block-start: 0; }
.e8-article__body > * + * { margin-block-start: 1.25rem; }
.e8-article__body > h2 { margin-block-start: 2.75rem; font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem); line-height: 1.12; letter-spacing: -0.02em; }
.e8-article__body > h3 { margin-block-start: 2rem; font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem); line-height: 1.2; }
.e8-article__body > h2 + *, .e8-article__body > h3 + * { margin-block-start: 0.75rem; }
.e8-article__body a:not(.e8-btn) { color: inherit; text-decoration: underline; text-underline-offset: 0.15em; text-decoration-color: rgba(21, 20, 20, 0.35); }
.e8-article__body a:not(.e8-btn):hover { text-decoration-color: currentColor; }
.e8-article__body figure.wp-block-image { margin-block: 2rem; }
.e8-article__body figure.wp-block-image img { border-radius: var(--wp--custom--radius--card, 14px); border: 1px solid var(--e8-line); }
.e8-article__body .wp-block-image figcaption { color: var(--wp--preset--color--grey); font-size: 0.9375rem; text-align: left; }
.e8-article__body .wp-block-quote { border-left: 3px solid var(--wp--preset--color--ink); padding-left: 1.25rem; font-style: normal; font-size: 1.25rem; }
.e8-article__body .wp-block-quote cite { color: var(--wp--preset--color--grey); font-size: 0.9375rem; font-style: normal; }
.e8-article__body .wp-block-separator { border-color: var(--e8-line); }
.e8-article__body .wp-block-table table { width: 100%; border-collapse: collapse; }
.e8-article__body .wp-block-table th, .e8-article__body .wp-block-table td { border: 1px solid var(--e8-line); padding: 10px 12px; text-align: left; }
.e8-article__body .wp-block-table thead th { background: var(--e8-surface-2); }
.e8-article__body .wp-block-table figure { overflow-x: auto; }
.e8-article__body [id] { scroll-margin-top: calc(var(--wp--custom--header--height, 76px) + 16px); }
/* Modules inside an article stay boxed to the reading column and get rounded corners. */
.e8-article__body > .e8-section { margin-block: 2.5rem; border-radius: var(--wp--custom--radius--card, 14px); }
.e8-article__body > .e8-section + .e8-section { margin-top: 0; }
.e8-article__body > .e8-section > .e8-section__inner { padding-inline: clamp(20px, 4vw, 36px); }
.e8-article .e8-related__heading { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.25rem); letter-spacing: -0.02em; }

/* Footer */

/* Header overlay offset (declared last so it wins over the base padding above). */
.e8-page, .e8-blog, .e8-404 { padding-top: calc(clamp(32px, 6vw, 72px) + var(--e8-header-offset, 0px)); }
.e8-article .e8-article-header { padding-top: calc(clamp(28px, 5vw, 64px) + var(--e8-header-offset, 0px)); }
