/* =========================================================
   650 KGL BLOG V4.2 HOTFIX
   1) Full-bleed featured image in Blog hero
   2) Hard-hide legacy/inherited post-query remnants
   ========================================================= */

/* ---------------------------------------------------------
   BLOG LANDING HERO
   The featured image MUST occupy the complete rounded stage.
   --------------------------------------------------------- */

body.page .kgl-blog-v2 .kgl-v2-feature-card {
  position: relative !important;
  overflow: hidden !important;
  background: #eef2f3 !important;
  isolation: isolate;
}

body.page .kgl-blog-v2 .kgl-v2-feature-image {
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;

  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 100% !important;

  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

body.page .kgl-blog-v2 .kgl-v2-feature-image > a,
body.page .kgl-blog-v2 .kgl-v2-feature-image > span,
body.page .kgl-blog-v2 .kgl-v2-feature-image picture {
  position: absolute !important;
  inset: 0 !important;

  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;

  margin: 0 !important;
  padding: 0 !important;
}

body.page .kgl-blog-v2 .kgl-v2-feature-image img {
  position: absolute !important;
  inset: 0 !important;

  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 100% !important;

  margin: 0 !important;
  padding: 0 !important;

  object-fit: cover !important;
  object-position: center center !important;
}

/*
 * WordPress can emit width/height sizing through inline image classes.
 * These rules deliberately override those intrinsic constraints.
 */
body.page .kgl-blog-v2 .kgl-v2-feature-card figure,
body.page .kgl-blog-v2 .kgl-v2-feature-card .wp-block-post-featured-image {
  max-width: none !important;
}

/* No navy should remain visible as a side gutter under any crop. */
body.page .kgl-blog-v2 .kgl-v2-feature-card::before {
  content: none !important;
}

/* Keep the readability overlay, but make it neutral rather than visibly navy. */
body.page .kgl-blog-v2 .kgl-v2-feature-card::after {
  background:
    linear-gradient(90deg, rgba(15,24,35,.10) 0%, rgba(15,24,35,0) 48%, rgba(15,24,35,.07) 100%),
    linear-gradient(180deg, rgba(15,24,35,0) 55%, rgba(15,24,35,.12) 100%) !important;
}

/* ---------------------------------------------------------
   SINGLE POST
   CSS fallback in addition to the PHP render suppression.
   --------------------------------------------------------- */

body.single-post .wp-block-query,
body.single-post .wp-block-query-loop,
body.single-post .wp-block-post-template:not(.kgl-v4-related-grid) {
  display: none !important;
}

/*
 * The custom V4 related section is plain semantic HTML, not a WP Query block.
 * Keep it visible.
 */
body.single-post .kgl-v4-related,
body.single-post .kgl-v4-related-grid,
body.single-post .kgl-v4-related-card {
  display: block;
}

body.single-post .kgl-v4-related-grid {
  display: grid;
}

/* Remove any orphan taxonomy/meta rows belonging to the inherited theme query. */
body.single-post .wp-block-post-terms.taxonomy-category:has(+ .wp-block-post-title),
body.single-post .taxonomy-category + .wp-block-post-title {
  /* article's own V4 meta is injected separately */
}
