/* =========================================================================
   ERG Blog Post — site-wide layer for .erg-post articles
   Purpose: on posts that use the .erg-post design block, hide the theme's
   duplicate H1, style the tag/category rows, and let content go full-width.
   Loaded via erg-assets-loader.php after 60-site-pages.
   ========================================================================= */

/* -----------------------------------------------------------------------
   1) Hide the theme's built-in post title on posts using our design block
   ----------------------------------------------------------------------- */
body:has(.erg-post) .entry-title,
body:has(.erg-post) header.entry-header .entry-title,
body:has(.erg-post) .page-title,
body:has(.erg-post) .post-title,
body:has(.erg-post) h1.entry-title,
body:has(.erg-post) .wp-block-post-title,
body:has(.erg-post) .single-post-title {
  display: none !important;
}

/* Also hide bare page/entry headers that only contain the title */
body:has(.erg-post) .entry-header:has(> .entry-title:only-child),
body:has(.erg-post) header.page-header:has(> .page-title:only-child) {
  display: none !important;
}

/* -----------------------------------------------------------------------
   2) Let our design block go full width (Elementor / theme containers)
   ----------------------------------------------------------------------- */
body:has(.erg-post) .entry-content,
body:has(.erg-post) .post-content,
body:has(.erg-post) .single-content,
body:has(.erg-post) article.post,
body:has(.erg-post) .e-con-inner {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Kill any theme container narrowness on the article body */
body:has(.erg-post) .content-area,
body:has(.erg-post) .site-main,
body:has(.erg-post) main.content-area {
  max-width: 100% !important;
}

.erg-post {
  max-width: 1200px !important;
}

/* -----------------------------------------------------------------------
   3) Style the tag / category rows the theme outputs after our content
   Covers WP defaults, block themes, and older classic-theme markup
   ----------------------------------------------------------------------- */
body:has(.erg-post) .entry-footer,
body:has(.erg-post) .entry-meta,
body:has(.erg-post) .post-meta,
body:has(.erg-post) .article-meta,
body:has(.erg-post) .tags-links,
body:has(.erg-post) .tag-links,
body:has(.erg-post) .cat-links,
body:has(.erg-post) .post-tags,
body:has(.erg-post) .wp-block-post-terms,
body:has(.erg-post) footer.entry-footer,
body:has(.erg-post) .single-post .entry-footer {
  max-width: 1200px !important;
  margin: 8px auto 24px !important;
  padding: 22px 40px !important;
  background: #0c0f14 !important;
  color: rgba(242,244,246,.55) !important;
  font-size: 12px !important;
  letter-spacing: 2px !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
  border-top: 1px solid rgba(255,255,255,.08) !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
}

/* The link chips themselves — gold pills matching the .erg-post design */
body:has(.erg-post) .entry-footer a,
body:has(.erg-post) .entry-meta a,
body:has(.erg-post) .tags-links a,
body:has(.erg-post) .tag-links a,
body:has(.erg-post) .cat-links a,
body:has(.erg-post) .post-tags a,
body:has(.erg-post) .wp-block-post-terms a,
body:has(.erg-post) .post-tag a,
body:has(.erg-post) a[rel~="tag"],
body:has(.erg-post) a[rel~="category"] {
  display: inline-block !important;
  background: #13181f !important;
  border: 1px solid rgba(200,168,75,.4) !important;
  color: #C8A84B !important;
  padding: 6px 14px !important;
  border-radius: 999px !important;
  margin: 0 6px 6px 0 !important;
  text-decoration: none !important;
  font-size: 11px !important;
  letter-spacing: 1.5px !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
  transition: all .15s ease !important;
}

body:has(.erg-post) .entry-footer a:hover,
body:has(.erg-post) .entry-meta a:hover,
body:has(.erg-post) .tags-links a:hover,
body:has(.erg-post) .tag-links a:hover,
body:has(.erg-post) .cat-links a:hover,
body:has(.erg-post) .post-tags a:hover,
body:has(.erg-post) .wp-block-post-terms a:hover,
body:has(.erg-post) a[rel~="tag"]:hover,
body:has(.erg-post) a[rel~="category"]:hover {
  background: rgba(200,168,75,.14) !important;
  color: #d4b65c !important;
  border-color: #C8A84B !important;
  text-decoration: none !important;
}

/* Page background dark so the full-width block blends into the theme */
body.single:has(.erg-post),
body.single-post:has(.erg-post) {
  background: #0a0d11 !important;
}

/* -----------------------------------------------------------------------
   4) Fallback (browsers without :has support — very old Firefox <121)
   Ships default WP tag styling so it still reads OK.
   ----------------------------------------------------------------------- */
@supports not selector(:has(*)) {
  /* No-op — tag row falls back to theme default which is acceptable */
}
