/**
 * content/custom/css/adsense-backfill.css
 *
 * Site-specific tweak for the sticky-bottom house ad (`.sgc-ad` inside
 * the ad unit's backfill_html): cap the visible ad width to the site's
 * content-area width on desktop so it doesn't stretch edge-to-edge on
 * wide monitors, where a full-viewport banner reads as sprawling and
 * hard to focus on.
 *
 * The wrapper stays full-width (needed so the sticky-position anchoring
 * works and the on-screen space reservation is stable). Only the
 * visible backfill content is centred and capped. On mobile the ad
 * already fits within the viewport, so the cap only kicks in at the
 * desktop breakpoint.
 *
 * Specificity note: this must beat the .sgc-ad rules inside the
 * admin-supplied <style> block that ships with the backfill_html. That
 * block is parsed later in the document (it lives in the page body),
 * so an equal-specificity selector loses on cascade order. The
 * .ad-sticky descendant combinator here (0,2,0) beats the backfill's
 * plain .sgc-ad (0,1,0) regardless of parse order.
 *
 * 1200px matches the site's .container max-width used across the
 * page-wide layout (see template/assets/default-head.html critical CSS).
 */

@media (min-width: 768px) {
    .ad-sticky .sgc-ad {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }
}

/**
 * Centre the underlying <ins> so it hides BEHIND the centred backfill
 * on wide screens instead of poking out on the left.
 *
 * template/css/ads.css line 254 forces `.ad-has-backfill ins.adsbygoogle
 * [data-ad-status="unfilled"] { display: block !important }`. With
 * display:block plus width:728px inline, the ins is left-aligned inside
 * a full-width sticky wrapper. When Google returns a WHITE-background
 * iframe (common for house / policy fills), that white 728px block is
 * visible in the left transparent margin of the 1200px-capped backfill.
 *
 * Forcing inline-block puts the ins back inside the parent's
 * `text-align: center`, so it sits centred at the SAME horizontal
 * position as the backfill and gets hidden behind it. Specificity here
 * is (0,4,1) — beats the template rule's (0,3,1) regardless of load
 * order, and only fires inside a sticky wrapper carrying a backfill.
 */
.ad-sticky.ad-has-backfill ins.adsbygoogle[data-ad-status="unfilled"] {
    display: inline-block !important;
}

