/**
 * Loaded after sackers-esg/styles.css on single ESG CPT only.
 * The hub bundle scopes typography/background on `body` for standalone HTML; restore the theme shell.
 */
body.single-esg {
  background: #ffffff !important;
}

body.single-esg .subpaage-banner,
body.single-esg #main-content {
  margin-top: revert;
  overflow-x: visible;
  overflow-y: visible;
}

/* Apply hub standalone “article page” backdrop + type only around imported HTML */
body.single-esg .esg-hub-wp-scope {
  box-sizing: border-box;
  font-family: var(--font-body, "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  background: var(--page-bg, #fff8f2);
  color: var(--text-primary, #000000);
}

body.single-esg .esg-hub-wp-scope *,
body.single-esg .esg-hub-wp-scope *::before,
body.single-esg .esg-hub-wp-scope *::after {
  box-sizing: border-box;
}

/* Related sidebar icons: parent theme / WP block styles sometimes set img { max-width:100%; height:auto }
   which defeats the hub bundle’s fixed 56×56 flex row thumbnails. Reinforce sizing after hub styles.css. */
body.single-esg .esg-hub-wp-scope aside.related .related-list a {
  display: flex !important;
  align-items: center;
  gap: 14px;
}

body.single-esg .esg-hub-wp-scope aside.related .related-list img {
  display: block;
  flex-shrink: 0 !important;
  width: 56px !important;
  height: 56px !important;
  max-width: none !important;
  /* Full icon artwork (covers can crop oddly on mixed-aspect sprites) */
  object-fit: contain;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.6);
}

/*
 * Bare `<h3>` in imported hub HTML has no sizing in sackers-esg/styles.css beyond global heading face;
 * Bootstrap/theme reboot boosts `h3` well above neighbouring 16px body copy. Normalize sub-section titles
 * to sit clearly under `.section-heading` / `.timeline-heading` h2 majors (24px in the hub bundle).
 */
body.single-esg .esg-hub-wp-scope .article-body h3 {
  font-family: var(--font-heading, serif);
  font-size: 1.0625rem;
  line-height: 1.35;
  font-weight: 500;
  color: var(--text-primary, #000000);
  margin: 1.25rem 0 0.5rem;
}

/*
 * Keep real `<p>` from the editor / targeted `wpautop` (we no longer unwrap every `<p>` into `<br><br>` on output).
 * TinyMCE prose uses `<p>` and `<br>`; `pre-line` + unwrap used to create huge vertical gaps.
 */
body.single-esg .esg-hub-wp-scope .article-body {
  white-space: normal;
}

/* Direct-child paragraphs only (blockquotes / figures may contain their own `<p>` with hub styles). */
body.single-esg .esg-hub-wp-scope .article-body > p {
  margin: 0 0 1em;
}

/*
 * Theme / Bootstrap defaults sometimes set `img { max-width: 100% }`, overriding the hub card’s constrained
 * cross-promo thumbnails (matches static sackers-esg articles).
 */
body.single-esg .esg-hub-wp-scope .cross-cta .cross-cta-visual img {
  max-width: none !important;
}

body.single-esg .esg-hub-wp-scope .article-body > p:last-child {
  margin-bottom: 0;
}

/* Diagram / infographic list items rely on layout (e.g. TCFD four pillars). */
body.single-esg .esg-hub-wp-scope .article-body figure.tcfd-pillars-figure li,
body.single-esg .esg-hub-wp-scope .article-body .tcfd-pillars-infographic li {
  white-space: normal;
}

body.single-esg .esg-hub-wp-scope .article-body table :is(td, th) {
  white-space: normal;
}

/* Spacer paragraphs inserted when editors leave NBSP/newline blobs outside `<p>` (see sackers_esg_normalize_*_orphan_spacing). */
body.single-esg .esg-hub-wp-scope .article-body p.esg-prose-gap {
  margin: 0 0 1rem;
  white-space: normal;
}

/* Injected hub article bar (orange nav row) — sticky under theme masthead like hub landing `.header-stack`. */
body.single-esg .sackers-esg-hub-subnav-wrap {
  width: 100%;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 400;
}

body.single-esg #esg-hub-site-header.site-header {
  background: var(--page-bg);
}

/*
 * Bootstrap / theme `<a>` reset can recolour the hub wordmark (“ESG Hub”); standalone bundle relies on `#fff`.
 */
body.single-esg .sackers-esg-hub-subnav-wrap a.logo,
body.single-esg .sackers-esg-hub-subnav-wrap a.logo:link,
body.single-esg .sackers-esg-hub-subnav-wrap a.logo:visited,
body.single-esg .sackers-esg-hub-subnav-wrap a.logo:hover,
body.single-esg .sackers-esg-hub-subnav-wrap a.logo:focus,
body.single-esg .sackers-esg-hub-subnav-wrap a.logo:focus-visible,
body.single-esg .sackers-esg-hub-subnav-wrap a.logo:active {
  color: #ffffff !important;
  text-decoration: none !important;
}

/* Same rationale as landing: masthead stacking must not swallow ESG burger taps */
@media (max-width: 900px) {
  body.single-esg .sackers-esg-hub-subnav-wrap {
    z-index: 1100;
  }
}

@media (max-width: 767px) {
  body.single-esg header.style-1.sticky ~ .sackers-esg-hub-subnav-wrap {
    top: clamp(52px, 18vw, 88px);
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  body.single-esg header.style-1.sticky ~ .sackers-esg-hub-subnav-wrap {
    top: clamp(72px, 11vw, 110px);
  }
}

@media (min-width: 1200px) {
  body.single-esg header.style-1.sticky ~ .sackers-esg-hub-subnav-wrap {
    top: clamp(88px, 9vw, 132px);
  }
}

/* Mirror hub landing: theme masthead hidden on narrow viewports — article uses `.site-header`-only hub chrome. */
@media (max-width: 991px) {
  body.single-esg header.header-area.style-1 {
    display: none !important;
  }

  body.single-esg .sackers-esg-hub-subnav-wrap,
  body.single-esg header.style-1.sticky ~ .sackers-esg-hub-subnav-wrap {
    top: 0 !important;
  }
}

/* Masthead breadcrumbs duplicate the hub’s in-article crumb + current-item RDFa markup. */
body.single-esg .header-area.style-1 .breadcrumb-wrapper {
  display: none !important;
}

/*
 * Tick/cross in `.impl-requirements-table`: WP often strips `<svg class="impl-icon">`; `:has()` is also
 * unavailable in older browsers — always paint marks in this table and hide any survivor SVG.
 */
body.single-esg .esg-hub-wp-scope .impl-requirements-table .impl-mark.impl-mark--yes svg.impl-icon {
  display: none !important;
}

body.single-esg .esg-hub-wp-scope .impl-requirements-table .impl-mark.impl-mark--no svg.impl-icon {
  display: none !important;
}

body.single-esg .esg-hub-wp-scope .impl-requirements-table .impl-mark.impl-mark--yes::after {
  content: "\2713";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  min-height: 1.75rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1;
  color: #ed8e38;
}

body.single-esg .esg-hub-wp-scope .impl-requirements-table .impl-mark.impl-mark--no::after {
  content: "\2715";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  min-height: 1.75rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1;
  color: #7a2840;
}

body.single-esg .our-client-area {
  background: white;
}

body.single-esg .cta {
  min-height: 40dvh;
}

body.single-esg .cta-inner {
  padding: clamp(38px, 8vw, 38px) 0;
}

body.single-esg .cta-left h2 {
  margin-top: -40px;
}
