/* =====================================================================
   DENIR INŽINERIJA — v2.9.2 · SCOPED ANCESTOR RELEASE (FRONT-END ONLY)
   =====================================================================
   ROOT CAUSE of the header/footer BACKGROUND stopping ~100px from the
   viewport edges (with rounded corners) is NOT the widget. It is the
   ANCESTOR CHAIN:
     • the active theme uses a "boxed" content layout — a white card with
       max-width + margin + border-radius + box-shadow, and
     • Elementor wraps the widget in boxed sections / .e-con containers.
   So we walk the ancestor chain and release it to full width — but ONLY
   for elements that actually CONTAIN a Denir widget (:has(.denir-hp)),
   so every OTHER container on the site keeps its normal boxed layout.
   The inner .denir-hp .container still caps content at 1200px and centres
   it, so text never touches the edges.

   WHY A SEPARATE FILE: this stylesheet is enqueued ONLY on the real
   front-end — never inside the Elementor editor or its preview iframe —
   because :has() targeting broad Elementor nodes makes the editor
   freeze / "stuck loading" on widget drag (the browser re-evaluates
   :has() on every DOM mutation). See includes/class-denir-assets.php.

   CONSTRAINTS HONOURED (all previously tried and rejected):
     NO 100vw · NO calc(50% - 50vw) · NO negative margins ·
     NO JS width measurement · NO before_render() wrapper hacks.
   NO horizontal overflow by construction: we only set max-width/width to
   100% and zero the side padding/margin — nothing ever exceeds the
   viewport, so no overflow-x band-aid is needed anywhere.
   ===================================================================== */

/* --- 1 + 3. Scoped release (modern browsers with :has()) -------------- */
/* Walk every boxing ancestor that contains a Denir widget and full-bleed
   it, AND release Elementor's own container-width custom properties on the
   same nodes so flexbox/.e-con containers stop capping to --container-max-width. */
:is(.elementor-section,
    .elementor-container,
    .e-con,
    .e-con-inner,
    .elementor-widget-wrap,
    .site-content,
    .content-area,
    #content,
    .site-main,
    .entry-content,
    .page-content,
    .ast-container,
    .elementor-location-header,
    .elementor-location-footer,
    .ehf-header,
    .ehf-footer):has(.denir-hp){
  max-width:100% !important;
  width:100% !important;
  padding-left:0 !important;
  padding-right:0 !important;
  padding-top:0 !important;
  padding-bottom:0 !important;
  margin-left:0 !important;
  margin-right:0 !important;
  margin-top:0 !important;
  margin-bottom:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
  background:transparent !important;
  --container-max-width:100% !important;
  --content-width:100% !important;
}

/* --- 4. no-:has() FALLBACK (older browsers) --------------------------- */
/* The main plugin file (denir-homepage-widget.php) adds the body classes
   .denir-has-fullbleed-header / .denir-has-fullbleed-footer when the
   respective Denir widget is present on the page. Without :has() we cannot
   test "contains a Denir widget" per element, so under those body classes
   we release the same ancestor list broadly. This is safe: the body class
   is only present when a Denir header/footer is actually on the page, and
   those pages are built entirely from Denir widgets. Mirrors the rule
   above exactly (minus the :has() test). */
body.denir-has-fullbleed-header :is(.elementor-section,.elementor-container,.e-con,.e-con-inner,.elementor-widget-wrap,.site-content,.content-area,#content,.site-main,.entry-content,.page-content,.ast-container,.elementor-location-header,.ehf-header),
body.denir-has-fullbleed-footer :is(.elementor-section,.elementor-container,.e-con,.e-con-inner,.elementor-widget-wrap,.site-content,.content-area,#content,.site-main,.entry-content,.page-content,.ast-container,.elementor-location-footer,.ehf-footer){
  max-width:100% !important;
  width:100% !important;
  padding-left:0 !important;
  padding-right:0 !important;
  padding-top:0 !important;
  padding-bottom:0 !important;
  margin-left:0 !important;
  margin-right:0 !important;
  margin-top:0 !important;
  margin-bottom:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
  background:transparent !important;
  --container-max-width:100% !important;
  --content-width:100% !important;
}
