/* ==========================================================================
   Compatibility layer for blocks printed by other plugins (see inc/compat.php).
   Nothing is removed from the page. Blocks are seated, restyled with theme
   tokens and — only in "tidy" mode — the ones duplicating theme UI are hidden.
   ========================================================================== */

/* 1. ORDER: the body is a column so injected sections can be seated by `order`. */
body.bhf { display: flex; flex-direction: column; min-height: 100vh; }
body.bhf > * { order: 30; min-width: 0; max-width: 100%; }
body.bhf > .bhf-skip { order: 0; }
body.bhf > .bhf-strap { order: 1; }
body.bhf > .bhf-header { order: 2; }
body.bhf > .bhf-main { order: 10; flex: 1 0 auto; }
body.bhf > .wo-home-ext { order: 11; }
body.bhf > .premier-paa { order: 12; }
body.bhf > .bhf-cta { order: 13; }
body.bhf > .coral-footer-sitemap { order: 14; }
body.bhf > .bpt-desk { order: 15; }
body.bhf > .bhf-footer { order: 20; }

/* 2. ELEMENTS THAT DUPLICATE THE THEME'S OWN UI (tidy mode only) ---------------- */
body.bhf-tidy .coral-sticky-bar,
body.bhf-tidy .coral-wa-floating,
body.bhf-tidy .coral-wa-cta,
body.bhf-tidy .bpt-wafab,
body.bhf-tidy #lv91650-cb,
body.bhf-tidy .coral-breadcrumb { display: none !important; }
/* Second hero the network layer adds after <body>: keep its H1 for search + screen readers, drop the duplicate visual. */
body.bhf-tidy > section:not([class]) {
    position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0 !important; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Those bars also reserve space at the bottom; the theme's own dock does that job. */
body.bhf { padding-bottom: 62px !important; }
@media (min-width: 900px) { body.bhf { padding-bottom: 0 !important; } }

/* 3. HELPERS THAT RIDE ON wp_body_open (homepage: seated at the end of <main>) -------------- */
.bhf-preamble { max-width: calc(var(--bhf-wrap) + var(--bhf-gutter) * 2); margin-inline: auto; padding-inline: var(--bhf-gutter); }
.bhf-preamble:empty { display: none; }
.bhf-preamble--end { padding-block: clamp(1.75rem, 4vw, 2.75rem) clamp(2.5rem, 6vw, 4rem); }
.bhf .bhf-preamble .premier-aeo-band { max-width: none !important; margin: 0 !important; padding: 0 !important; }
.bhf .coral-breadcrumb { background: transparent !important; padding: .75rem 0 !important; font-size: .82rem !important; color: var(--bhf-muted) !important; }
.bhf .coral-breadcrumb a { color: var(--bhf-emerald) !important; font-weight: 700; }

/* Shared look of the quick-answer notes (homepage band and the one inside content) */
.bhf .premier-aeo, .bhf .coral-aeo-summary {
    max-width: none !important; margin: 0 !important; padding: 1.1rem 1.3rem !important;
    background: var(--bhf-white) !important; color: var(--bhf-text-soft) !important;
    border: 1px solid var(--bhf-line) !important; border-left: 4px solid var(--bhf-gold) !important;
    border-radius: var(--bhf-r) !important; font-size: .95rem !important; line-height: 1.65 !important;
}
.bhf .premier-aeo strong, .bhf .coral-aeo-summary strong { color: var(--bhf-ink) !important; }
.bhf .coral-aeo-summary h3 { margin: 0 0 .4rem !important; font-family: var(--bhf-sans); font-size: .74rem !important; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--bhf-gold-d) !important; }
.bhf .coral-aeo-summary p { margin: 0 !important; }

/* 4. SECTIONS PRINTED AFTER <main> (in flow above the footer) ------------------------------ */
body.bhf > .wo-home-ext {
    width: 100%; max-width: none !important; margin: 0 !important;
    padding: var(--bhf-sec) max(var(--bhf-gutter), calc((100% - 52rem) / 2)) !important;
    background: var(--bhf-paper); border-top: 1px solid var(--bhf-line);
    color: var(--bhf-text-soft); font-size: 1rem; line-height: 1.75 !important;
}
.wo-home-ext h2 { margin: 2.2em 0 .6em !important; font-size: clamp(1.4rem, 1.2rem + .8vw, 1.9rem); color: var(--bhf-ink); }
.wo-home-ext h2:first-child { margin-top: 0 !important; }
.wo-home-ext h2:last-child { display: none; } /* trailing heading without content */
.wo-home-ext p { margin: 0 0 1.1em; }
.wo-home-ext ul { display: grid; gap: .5rem; list-style: none; margin: 0 0 1.2em; }
.wo-home-ext li { position: relative; padding-left: 1.4rem; }
.wo-home-ext li::before { content: ""; position: absolute; left: 0; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: var(--bhf-gold); }
.wo-home-ext strong { color: var(--bhf-ink); }
.wo-home-ext a { color: var(--bhf-emerald); font-weight: 700; text-decoration: underline; text-decoration-color: var(--bhf-gold); }

body.bhf > .premier-paa {
    width: 100%; max-width: none !important; margin: 0 !important;
    padding: clamp(2.5rem, 6vw, 4rem) max(var(--bhf-gutter), calc((100% - 52rem) / 2)) !important;
    background: var(--bhf-cream); border-top: 1px solid var(--bhf-line);
}
.premier-paa h2 { margin: 0 0 1.2rem !important; font-size: clamp(1.35rem, 1.15rem + .8vw, 1.8rem); color: var(--bhf-ink); }
.premier-paa h3 { margin: 1.2rem 0 .3rem !important; font-family: var(--bhf-sans); font-size: 1rem; font-weight: 800; letter-spacing: 0; color: var(--bhf-emerald-d); }
.premier-paa p { margin: 0 !important; font-size: .95rem; color: var(--bhf-muted); }

body.bhf > .coral-footer-sitemap {
    width: 100%; margin: 0 !important; background: #0f332c !important; color: rgba(238, 243, 239, .72) !important;
    padding: clamp(2rem, 5vw, 3rem) var(--bhf-gutter) !important; border-top: 1px solid var(--bhf-line-inv);
}
.coral-footer-sitemap > div { max-width: var(--bhf-wrap) !important; }
.coral-footer-sitemap h4 { margin: 0 0 .8rem !important; font-family: var(--bhf-sans); font-size: .74rem !important; font-weight: 800; letter-spacing: .14em !important; color: var(--bhf-gold-l) !important; }
.coral-footer-sitemap ul { display: grid; gap: .5rem; }
.coral-footer-sitemap a { color: rgba(238, 243, 239, .82) !important; font-size: .9rem; line-height: 1.4; font-weight: 600; }
.coral-footer-sitemap a:hover { color: var(--bhf-gold-l) !important; }

body.bhf > .bpt-desk { width: 100%; background: #0d2b25 !important; color: rgba(238, 243, 239, .8) !important; padding: clamp(1.75rem, 4vw, 2.5rem) var(--bhf-gutter) !important; font-family: var(--bhf-sans) !important; border-top: 1px solid var(--bhf-line-inv); }
.bpt-desk__k { color: var(--bhf-gold-l) !important; }
.bpt-desk__rail a { color: rgba(238, 243, 239, .88) !important; border-color: var(--bhf-line-inv-2) !important; }
.bpt-desk__rail a:hover { border-color: var(--bhf-gold-l) !important; color: #fff !important; }
.bpt-desk__rail .bpt-desk__rail-main { background: var(--bhf-emerald) !important; border-color: var(--bhf-emerald) !important; color: #fff !important; }
.bpt-desk__meta, .bpt-desk__meta a { color: rgba(238, 243, 239, .6) !important; }
.bpt-desk__meta a:hover { color: var(--bhf-gold-l) !important; }

/* 5. INSIDE ARTICLES ------------------------------------------------------------------------- */
.bhf-prose .coral-v11-byline { margin: 0 !important; padding: .75rem 1rem !important; background: var(--bhf-white) !important; border: 1px solid var(--bhf-line); border-left: 3px solid var(--bhf-gold) !important; border-radius: var(--bhf-r-sm); font-size: .84rem !important; color: var(--bhf-muted) !important; }
.bhf-prose .coral-v11-byline strong { color: var(--bhf-ink) !important; }
.bhf-prose .coral-trust { margin: 2.2em 0 0 !important; padding: 1.25rem 1.3rem !important; text-align: left !important; background: var(--bhf-white) !important; border: 1px solid var(--bhf-line) !important; border-radius: var(--bhf-r) !important; }
.bhf-prose .coral-trust h3 { margin: 0 0 .7rem !important; font-family: var(--bhf-sans); font-size: .74rem !important; font-weight: 800; letter-spacing: .14em !important; color: var(--bhf-gold-d) !important; }
.bhf-prose .coral-trust-items, .bhf-prose .coral-trust-row { display: flex; flex-wrap: wrap; justify-content: flex-start !important; gap: .4rem .5rem !important; margin: 0 !important; font-size: .82rem !important; }
.bhf-prose .coral-trust-items span, .bhf-prose .coral-trust-row span { padding: .3rem .75rem; border-radius: 999px; background: var(--bhf-emerald-soft); color: var(--bhf-emerald-d) !important; font-weight: 700; }
.bhf-prose .coral-related { margin: 2.2em 0 0 !important; padding: 1.3rem !important; background: var(--bhf-white) !important; border: 1px solid var(--bhf-line); border-radius: var(--bhf-r) !important; }
.bhf-prose .coral-related h3 { margin: 0 0 .8rem !important; font-size: 1.1rem; }
.bhf-prose .coral-related ul { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem !important; padding: 0; margin: 0; }
.bhf-prose .coral-related li { padding: .55rem .8rem !important; background: var(--bhf-cream) !important; border-left: 3px solid var(--bhf-gold) !important; border-radius: var(--bhf-r-sm) !important; }
.bhf-prose .coral-related li::before { display: none; }
.bhf-prose .coral-related a { color: var(--bhf-ink) !important; font-size: .92rem !important; text-decoration: none; }
.bhf-prose > p[style*="font-size:13px"] { font-size: .82rem !important; color: var(--bhf-muted) !important; border-top: 1px solid var(--bhf-line) !important; }

/* 6. GLOBAL RULES FROM OTHER PLUGINS THAT TARGET BARE ELEMENTS ---------------------------------- */
.bhf-phead { position: relative !important; top: auto !important; z-index: auto !important; }
.bhf a[style*="93c5fd"] { color: inherit !important; }
