/* Metric-matched fallbacks (computed from the woff2 files vs Arial / Georgia) to cut font-swap layout shift.
   The "Android" faces cover devices without Arial or Georgia (system Roboto and Noto Serif). Computed with fontTools:
   size-adjust = letter-frequency-weighted average advance of the web font / of the fallback (Roboto 400 and Noto Serif 400
   from Google Fonts, hhea metrics); ascent and descent = the web font's hhea values / size-adjust; line gap 0. */
@font-face { font-family: "Atkinson Fallback"; src: local("Arial"), local("Liberation Sans"), local("Helvetica"); size-adjust: 100%; ascent-override: 98.4%; descent-override: 31.6%; line-gap-override: 0%; }
@font-face { font-family: "Source Serif Fallback"; src: local("Georgia"), local("Gelasio"); size-adjust: 98.5%; ascent-override: 105.2%; descent-override: 34%; line-gap-override: 0%; }
@font-face { font-family: "Atkinson Fallback Android"; src: local("Roboto"), local("Roboto-Regular"); size-adjust: 99.7%; ascent-override: 98.7%; descent-override: 31.7%; line-gap-override: 0%; }
@font-face { font-family: "Source Serif Fallback Android"; src: local("Noto Serif"), local("NotoSerif-Regular"); size-adjust: 90.7%; ascent-override: 114.3%; descent-override: 36.9%; line-gap-override: 0%; }

/* The Heating Guide, design A (teal, orange, serif headings).
   Tokens live in theme.json; this file only adds layout and components. Budget: under 30 KB. */

:root {
	--thg-gutter: 20px;
	--thg-r: 8px;
	--thg-r-lg: 14px;
	--thg-header-h: 72px;
}

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--thg-header-h) + var(--wp-admin--admin-bar--height, 0px) + 16px); }
body { overflow-wrap: break-word; }
img, svg, video { max-width: 100%; height: auto; }
.wp-site-blocks > * + * { margin-block-start: 0; }
strong, b, th { font-weight: 700; }
table { font-variant-numeric: tabular-nums; }

.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important; }
.screen-reader-text:focus { clip: auto; clip-path: none; height: auto; width: auto; margin: 0; }
.skip-link { position: absolute; left: 8px; top: -200px; z-index: 100000; padding: 1rem 1.5rem; background: var(--wp--preset--color--ink); color: var(--wp--preset--color--white); font-weight: 700; text-decoration: underline; border-radius: 0 0 var(--thg-r) var(--thg-r); }
.skip-link:focus { top: 0; color: var(--wp--preset--color--white); }

/* ---------- Text ---------- */
.thg-lead { font-size: 1.25rem; max-width: 34em; }
.thg-micro { font-weight: 700; color: var(--wp--preset--color--brand-dark); }
.thg-muted { color: var(--wp--preset--color--muted); }
.thg-fine { font-size: 1rem; color: var(--wp--preset--color--muted); }
.thg-placeholder { color: var(--wp--preset--color--muted); font-style: italic; }
.thg-byline { color: var(--wp--preset--color--muted); font-size: 1rem; display: flex; flex-wrap: wrap; gap: 0 1em; }
:where(.wp-block-post-content, .thg-page__main) :where(ul, ol) { padding-left: 1.4em; }
:where(.wp-block-post-content) li + li { margin-top: .5em; }

/* ---------- Buttons (action orange is for actions only) ---------- */
.wp-block-button__link, .wp-element-button { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 56px; box-sizing: border-box; text-decoration: none; cursor: pointer; transition: background .15s; }
.wp-block-button__link:hover, .wp-element-button:hover { color: var(--wp--preset--color--white); }
.thg-btn-sm .wp-block-button__link { min-height: 48px; padding-inline: 20px; font-size: 1rem; }
.wp-block-button.is-style-secondary .wp-block-button__link { background: var(--wp--preset--color--white); color: var(--wp--preset--color--brand); border: 2px solid var(--wp--preset--color--brand); }
.wp-block-button.is-style-secondary .wp-block-button__link:hover { background: var(--wp--preset--color--mist); color: var(--wp--preset--color--brand-dark); }
.wp-block-search__button { min-height: 48px; background: var(--wp--preset--color--brand); color: var(--wp--preset--color--white); border: 0; border-radius: var(--thg-r); padding: 0 20px; font-weight: 700; font-size: 1.0625rem; cursor: pointer; }
.wp-block-search__button:hover { background: var(--wp--preset--color--brand-dark); }
.wp-block-search__input { min-height: 48px; padding: 0 14px; border: 2px solid var(--wp--preset--color--ink); border-radius: var(--thg-r); font: inherit; background: var(--wp--preset--color--white); }
.wp-block-search__label { font-weight: 700; display: block; margin-bottom: 6px; }

/* ---------- Header ---------- */
.thg-header-wrap { position: relative; z-index: 30; }
.thg-header { background: var(--wp--preset--color--white); border-bottom: 1px solid var(--wp--preset--color--line); }
.thg-header__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; min-height: var(--thg-header-h); max-width: 1200px; margin-inline: auto; padding-inline: var(--thg-gutter); box-sizing: border-box; }
.thg-header__inner > * { margin: 0; }
.thg-logo { margin-right: auto !important; font-size: 1rem; line-height: 1; }
.thg-logo a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-height: 48px; }
.thg-mark { width: 36px; height: 36px; flex: none; }
.thg-wordmark { display: block; width: auto; height: 21px; }
.thg-header .thg-header__cta { display: flex; } /* Core's flex layout class (two classes) would beat a single-class rule. */
/* Below 1280px: compact sticky header, logo left, "Get quotes" then the Menu button on the right. Sticky and fixed height, so no layout shift. */
@media (max-width: 1279px) {
	:root { --thg-header-h: 60px; }
	.thg-header-wrap { position: sticky; top: var(--wp-admin--admin-bar--height, 0px); z-index: 100; }
	.thg-header__inner { flex-wrap: nowrap; gap: 8px; height: var(--thg-header-h); min-height: 0; }
	.thg-header__inner > .thg-nav { order: 3; flex: none; }
	.thg-header__inner > .thg-header__cta { order: 2; flex: none; }
	.thg-logo a { min-height: 44px; }
	.thg-header .thg-btn-sm .wp-block-button__link { min-height: 44px; padding-inline: 14px; font-weight: 700; white-space: nowrap; }
}
/* Below 600px the WP admin bar scrolls away with the page, so the sticky header sits at the very top. */
@media (max-width: 600px) { .thg-header-wrap { top: 0; } }
/* No scripting: the header holds the full link list, so it is too tall to stick; it scrolls with the page. */
@media (max-width: 1279px) and (scripting: none) { .thg-header-wrap { position: relative; } .thg-header__inner { flex-wrap: wrap; height: auto; min-height: var(--thg-header-h); } .thg-header__inner > .thg-nav { flex: 1 1 100%; order: 4; } }
@media (min-width: 1280px) { .thg-header__inner { column-gap: 12px; flex-wrap: nowrap; } .thg-header .thg-btn-sm .wp-block-button__link { white-space: nowrap; } } /* Logo, seven nav items and the quote button must share one row. */
.thg-header__fee { font-size: 1rem; font-weight: 600; }
/* Narrow phones: wordmark, "Get quotes" and Menu must share one row (a wrapped header is tall and pushes the page down). The mark is dropped and the wordmark shrinks to make room. */
@media (max-width: 460px) {
	.thg-header__inner { gap: 6px; padding-inline: 12px; }
	.thg-header .thg-mark { display: none; }
	.thg-header .thg-wordmark { height: 18px; }
	.thg-header .thg-btn-sm .wp-block-button__link { padding-inline: 12px; }
	.thg-nav__menu-btn { padding-inline: 10px !important; }
}
@media (max-width: 380px) { .thg-header .thg-wordmark { height: 15px; } }
@media (max-width: 339px) {
	.thg-nav__menu-btn > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ---------- Sections and grids ---------- */
.thg-main { padding-inline: 0; }
.thg-sec, .thg-hero { padding-inline: var(--thg-gutter); box-sizing: border-box; }
.thg-sec { padding-block: 48px; }
.thg-sec--panel { background: var(--wp--preset--color--mist); }
.thg-sec h2:first-child { margin-top: 0; }
.thg-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.thg-grid > * { margin: 0 !important; min-width: 0; }
.thg-center { align-items: center; }
.thg-box { background: var(--wp--preset--color--white); border: 1px solid var(--wp--preset--color--line); border-radius: var(--thg-r); padding: 22px; }
.thg-sec--panel .thg-box { border-color: transparent; }
.thg-box h3 { margin-top: 0; }
.thg-iconbox { display: flex; gap: 14px; }
.thg-iconbox > * { margin: 0; }
.thg-iconbox__text > * { margin-top: 0; }
.thg-iconbox__text p { margin: 0; }
.thg-ico { flex: none; width: 32px; height: 32px; color: var(--wp--preset--color--brand); }
.thg-photo { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 220px; border: 2px dashed var(--wp--preset--color--line-strong); border-radius: var(--thg-r); background: var(--wp--preset--color--mist); color: var(--wp--preset--color--muted); padding: 20px; font-weight: 600; margin-block: 1.5rem; }
.thg-photo p { margin: 0; }
@media (min-width: 760px) {
	.thg-g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.thg-g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) { .thg-sec { padding-block: 72px; } }

/* Hero */
.thg-hero { padding-block: 32px 40px; background: var(--wp--preset--color--off-white); }
.thg-hero h1 { max-width: 18ch; }
.thg-hero__grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
.thg-hero__grid > * { margin: 0 !important; min-width: 0; }
.thg-hero__form:empty { display: none; }
/* Mobile: the funnel card comes first (visually; the H1 stays first in the DOM) so step 1, postcode and Start, is on screen
   at 360x640 without scrolling. The card is about 617px tall; its Start button ends 513px below its top. */
@media (max-width: 959px) {
	.thg-hero { padding-block: 12px 32px; }
	.thg-hero__form { order: -1; }
}
@media (min-width: 960px) {
	.thg-hero { padding-block: 64px 72px; }
	.thg-hero__grid { grid-template-columns: 1.05fr 1fr; align-items: center; }
}

/* Numbered steps (group of .thg-step groups; list roles are added by functions.php) */
.thg-steps { display: grid; gap: 20px; counter-reset: s; }
.thg-steps > * { margin: 0 !important; }
.thg-step { counter-increment: s; position: relative; padding-left: 60px; }
.thg-step::before { content: counter(s); position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--wp--preset--color--brand-dark); color: var(--wp--preset--color--white); font: 600 1.25rem/44px var(--wp--preset--font-family--heading); text-align: center; }
.thg-step h3 { margin: 0 0 .2em; }
.thg-step p { margin: 0; }

/* Tool picker tiles: a list whose links fill the tile */
.thg-tiles { list-style: none; margin: 0; padding: 0 !important; }
.thg-tiles li { margin: 0; }
.thg-tiles a { display: flex; flex-direction: column; justify-content: center; position: relative; min-height: 64px; padding: 12px 52px 12px 18px; background: var(--wp--preset--color--white); border: 2px solid var(--wp--preset--color--line-strong); border-radius: var(--thg-r); color: var(--wp--preset--color--ink); font-weight: 700; text-decoration: none; }
.thg-tiles a::after { content: "\2192"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--wp--preset--color--brand); font-size: 1.4rem; }
.thg-tiles a:hover { border-color: var(--wp--preset--color--brand); color: var(--wp--preset--color--brand); }
.thg-tiles em { display: block; font-style: normal; font-weight: 400; color: var(--wp--preset--color--muted); font-size: 1rem; }

/* Hub tiles (home) and plugin card grids share one look */
.thg-hub, .thg-card-grid .thg-card { position: relative; background: var(--wp--preset--color--white); border: 1px solid var(--wp--preset--color--line); border-top: 5px solid var(--wp--preset--color--brand); border-radius: var(--thg-r); box-shadow: none; padding: 20px; }
.thg-card-grid .thg-card.thg-card--linked { padding: 0; }
.thg-hub:hover, .thg-card-grid .thg-card:hover { box-shadow: 0 6px 18px rgba(23, 33, 43, .12); border-color: var(--wp--preset--color--line); border-top-color: var(--wp--preset--color--brand); }
.thg-hub .thg-ico { width: 44px; height: 44px; margin-bottom: 8px; }
.thg-hub h3 { margin: 0 0 .3em; }
.thg-hub h3 a { color: var(--wp--preset--color--brand); text-decoration: none; }
.thg-hub h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--thg-r); }
.thg-hub p { margin: 0 0 .5em; }
.thg-hub__go { color: var(--wp--preset--color--brand); text-decoration: underline; }
.thg-card-grid { list-style: none; }
.thg-card-grid .thg-card__link, .thg-card__title a { color: var(--wp--preset--color--brand); }
.thg-card__title { font-family: var(--wp--preset--font-family--heading); }
.thg-card__title a { text-decoration: none; }
.thg-hub-cards__heading { margin-top: 0; }

/* ---------- Article pages ---------- */
.thg-main > .thg-breadcrumbs, .thg-main > .thg-page, .thg-main > .thg-related { max-width: 1200px; margin-inline: auto; padding-inline: var(--thg-gutter); box-sizing: border-box; }
.thg-main > .thg-related-guides, .thg-main > .wp-block-thg-related-guides { max-width: 1200px; margin-inline: auto; padding-inline: var(--thg-gutter); box-sizing: border-box; }
.thg-breadcrumbs { margin-block: 0; padding-top: 16px; }
.thg-breadcrumbs a { padding-block: 10px; }
.thg-page { display: grid; gap: 32px; padding-block: 16px 56px; grid-template-columns: minmax(0, 1fr); }
.thg-page > * { margin: 0 !important; min-width: 0; }
.thg-page__main > * + * { margin-block-start: 1.125rem; }
.thg-page__main > h1 { margin-block-end: .4em; }
.thg-page__aside .thg-toc { background: var(--wp--preset--color--white); border: 1px solid var(--wp--preset--color--line); margin-block: 0; }
.thg-toc summary { font-family: inherit; font-size: 1.0625rem; }
@media (min-width: 1000px) {
	.thg-page { grid-template-columns: minmax(0, 760px) 300px; gap: 56px; justify-content: center; }
	.thg-page--single, .thg-page--wide { grid-template-columns: minmax(0, 1fr); }
	.thg-page--single > .thg-page__main { max-width: 760px; margin-inline: auto !important; width: 100%; }
	.thg-page__aside .thg-toc { position: sticky; top: 20px; }
}
.thg-quick-answer { border-left-width: 6px; border-radius: 0 var(--thg-r) var(--thg-r) 0; padding: 20px 22px; margin-block: 0 28px; }
.thg-quick-answer__q { font-size: 1.2rem; }
.thg-quick-answer__a { font-size: inherit; }
.thg-key-facts, .thg-price-card { border: 1px solid var(--wp--preset--color--line); }
.thg-cta, .thg-verdict { background: var(--wp--preset--color--mist); border: 2px solid var(--wp--preset--color--brand); border-radius: var(--thg-r-lg); padding: 22px; margin-block: 30px; }
.thg-cta > :first-child, .thg-verdict > :first-child { margin-top: 0; }
.thg-cta > :last-child, .thg-verdict > :last-child { margin-bottom: 0; }
.thg-next { background: var(--wp--preset--color--mist); border-radius: var(--thg-r-lg); padding: 26px; margin-block: 36px; }
.thg-next > :first-child { margin-top: 0; }
.thg-safety { background: var(--wp--preset--color--white); border: 3px solid var(--wp--preset--color--ink); border-radius: var(--thg-r-lg); padding: 22px; margin-block: 0 28px; }
.thg-safety h2 { margin-top: 0; font-size: 1.4rem; }
.thg-safety p { margin-bottom: 0; }
.thg-result { background: var(--wp--preset--color--mist); border-radius: var(--thg-r-lg); padding: 20px; }
.thg-proscons { gap: 20px; }
.thg-trust-strip { border-radius: var(--thg-r); border: 1px solid var(--wp--preset--color--line-strong); }
.thg-author-box { border: 1px solid var(--wp--preset--color--line-strong); border-radius: var(--thg-r); background: var(--wp--preset--color--white); }
.thg-quote { max-width: 1200px; margin-inline: auto; padding: 24px var(--thg-gutter) 56px; box-sizing: border-box; }
.thg-quote > * { margin-inline: auto; }
.thg-quote__head { max-width: 860px; margin-bottom: 20px; }
.thg-quote .wp-block-post-content { max-width: 860px; }
.thg-quote-wrap, .thg-tool-wrap { margin-block: 0 28px; }
.thg-thanks { max-width: 760px; }
.thg-link-list { padding-left: 1.2em; }
.thg-link-list a { display: inline-block; padding-block: 6px; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 0 0 .6em; font-size: 1.0625rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--wp--preset--color--line-strong); vertical-align: top; }
thead th { background: var(--wp--preset--color--brand-dark); color: var(--wp--preset--color--white); }
.thg-table td:nth-child(2) { font-weight: 700; }
@media (max-width: 640px) {
	.thg-table thead { position: absolute; left: -999px; }
	.thg-table tr { display: block; border-bottom: 2px solid var(--wp--preset--color--line-strong); padding: 10px 0; }
	.thg-table td { display: block; border: 0; padding: 3px 14px; }
	.thg-table td:first-child { font-weight: 700; }
	.thg-table td:nth-child(2) { color: var(--wp--preset--color--brand-dark); }
}
.wp-element-caption { color: var(--wp--preset--color--muted); font-size: 1rem; }

/* FAQ */
/* Summary rule: :not(:empty) is always true here; it keeps the specificity above the toc and changelog block rules. */
details:not(.thg-toc details) { margin-block: 8px; border: 2px solid var(--wp--preset--color--line-strong); border-radius: var(--thg-r); background: var(--wp--preset--color--white); }
details:not(:empty) > summary { display: flex; align-items: center; min-height: 48px; padding: .75rem 1.25rem; font-weight: 700; cursor: pointer; }
details:not(.thg-toc details) > :not(summary) { margin-inline: 1.25rem; }
details:not(.thg-toc details) > :last-child { margin-bottom: 1.25rem; }

/* Query loop */
.thg-card-grid { display: grid; gap: 20px; padding: 0; margin: 0 0 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .thg-card-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); } }
.wp-block-query-pagination { margin-block: 24px; gap: 16px; }
.wp-block-query-pagination a { display: inline-flex; align-items: center; min-height: 48px; padding-inline: 8px; }

/* ---------- Footer ---------- */
.thg-footer { background: var(--wp--preset--color--brand-dark); color: var(--wp--preset--color--footer-text); padding: 48px var(--thg-gutter) 28px; font-size: 1rem; }
.thg-footer a { color: var(--wp--preset--color--footer-text); }
.thg-footer a:hover { color: var(--wp--preset--color--white); }
.thg-footer__inner { max-width: 1200px; margin-inline: auto; }
.thg-footer__cols { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
.thg-footer__cols > * { margin: 0 !important; }
.thg-footer__about > * + * { margin-top: .75rem; }
.thg-footer__heading { font-family: var(--wp--preset--font-family--body); font-size: 1.1rem; font-weight: 700; color: var(--wp--preset--color--white); margin: 0 0 .5rem; }
.thg-footer__list { list-style: none; margin: 0; padding: 0 !important; }
.thg-footer__list li { margin: 0; }
.thg-footer__list a { display: inline-block; padding: 7px 0; }
.thg-footer__list--row { display: flex; flex-wrap: wrap; gap: 0 24px; margin-bottom: 12px; }
.thg-footer__brand { margin: 0; }
.thg-footer__brand-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-height: 48px; }
.thg-footer__brand-link .thg-mark { box-shadow: 0 0 0 2px var(--wp--preset--color--white); border-radius: 10px; }
.thg-footer__legalname, .thg-footer__company { margin: 0; }
.thg-footer__fee { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .25); font-size: 1rem; }
.thg-footer--slim { padding-block: 28px; }
.thg-footer--slim .thg-footer__fee { margin-top: 16px; }
@media (min-width: 760px) { .thg-footer__cols { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.thg-footer .thg-phone a { color: var(--wp--preset--color--white); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print { .thg-header-wrap, .thg-footer, .skip-link, .thg-sticky-cta { display: none; } }

/* ---------- Focus (merged from focus.css) ---------- */
/* The Heating Guide: focus styles. 3px solid ink ring, 3px offset, white halo so it shows on any surface
   (WCAG 2.4.7, 2.4.11, 2.4.13). White ring on dark surfaces. */
:focus-visible {
	outline: 3px solid var(--wp--preset--color--ink);
	outline-offset: 3px;
	box-shadow: 0 0 0 6px var(--wp--preset--color--white);
}

/* Form fields: always ring on focus, including mouse focus. */
:where(input, select, textarea):focus {
	outline: 3px solid var(--wp--preset--color--ink);
	outline-offset: 3px;
}

/* Dark surfaces. */
.thg-footer :focus-visible,
.thg-footer :where(input, select, textarea):focus,
.has-ink-background-color :focus-visible,
.has-brand-dark-background-color :focus-visible {
	outline-color: var(--wp--preset--color--white);
	box-shadow: 0 0 0 6px var(--wp--preset--color--ink);
}

/* The skip link must be unmistakable when focused. */
.skip-link:focus-visible {
	outline: 3px solid var(--wp--preset--color--white);
	outline-offset: 2px;
	box-shadow: 0 0 0 6px var(--wp--preset--color--ink);
}

/* Whole-card links: ring the card, not the invisible stretched link. */
:is(.thg-card, .thg-hub):has(a:focus-visible) {
	outline: 3px solid var(--wp--preset--color--ink);
	outline-offset: 3px;
}
:is(.thg-card, .thg-hub) a:focus-visible {
	outline: none;
	box-shadow: none;
}

@media (forced-colors: active) {
	:focus-visible {
		outline: 3px solid CanvasText;
	}
}
