/* Important layout rules live in one layer so older high-specificity Reader
   offsets cannot reintroduce overlapping ads or full-width inline emoji. */
@layer hpLayoutRepairs {
 /* Desktop post information scrolls as one column inside the preview frame.
    Attribute ownership keeps touch pages and the popup Reader out of scope. */
 body.single-hp_pattern .hp-pattern-entry-card .hp-pattern-sidebar-home[data-hp-post-sidebar-scroll]{
  box-sizing:border-box!important;min-width:0!important;min-height:0!important;
  height:var(--hp-post-sidebar-height)!important;max-height:var(--hp-post-sidebar-height)!important;
  overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior-y:auto!important;
  scrollbar-width:none!important;scrollbar-gutter:auto!important;
 }
 body.single-hp_pattern .hp-pattern-entry-card .hp-pattern-sidebar-home[data-hp-post-sidebar-overflow]{overscroll-behavior-y:contain!important}
 body.single-hp_pattern .hp-pattern-entry-card .hp-pattern-sidebar-home[data-hp-post-sidebar-scroll]>.article-sidebar{
  position:static!important;top:auto!important;height:auto!important;min-height:0!important;max-height:none!important;
  overflow:visible!important;
 }
 body.single-hp_pattern .hp-pattern-entry-card .hp-pattern-sidebar-home[data-hp-post-sidebar-scroll] [data-description-ad-scroll]:not([hidden]){
  height:auto!important;min-height:0!important;max-height:none!important;flex:0 0 auto!important;
  overflow:visible!important;contain:layout!important;scrollbar-width:none!important;scrollbar-gutter:auto!important;
 }
 body.single-hp_pattern .hp-pattern-entry-card .hp-pattern-sidebar-home[data-hp-post-sidebar-scroll]::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}
 /* Viewport sheets sit above the navigation even after an ad has established
    a containing block on the article. Their live nodes are portaled to body. */
 body.hp-current-layout.hp-modal-open>.hp-navigation-header{z-index:70!important}
 body.hp-current-layout>:is(#comment-modal,#rating-modal,#report-modal,[data-share-modal]){z-index:110!important}
 /* The menu placement owns its measured 20px gap to ALL following content.
    The server supplies it only for Feed's AdSense-only placement. */
 .hp-vf-menu-content-gap[hidden]{display:none!important}
 .hp-vf-menu-content-gap:not([hidden]){
  display:block!important;box-sizing:border-box!important;position:static!important;
  height:20px!important;min-height:20px!important;max-height:20px!important;
  margin:0!important;padding:0!important;border:0!important;flex:0 0 20px!important;pointer-events:none!important;
 }
 body.hp-video-feed-page:has(>.hp-vf-as-below-container:not([data-vf-device-hidden])>[data-vf-menu-content-gap]:not([hidden]))>.hp-vf-as-below-container{margin-bottom:0!important}
 body.hp-video-feed-page:has(>.hp-vf-as-below-container:not([data-vf-device-hidden])>[data-vf-menu-content-gap]:not([hidden]))>.hp-vf-main{
  display:flow-root!important;margin-top:0!important;padding-top:0!important;
 }
 body.hp-video-feed-page:has(>.hp-vf-as-below-container:not([data-vf-device-hidden])>[data-vf-menu-content-gap]:not([hidden]))>.hp-vf-main>:nth-child(1 of :not([hidden],script,style,template)){margin-top:0!important}
 @media (max-width:639px), (any-pointer:coarse) and (not ((min-width:640px) and (min-device-width:640px) and (min-device-height:640px))){
  /* Keep one root scroll surface; provider widgets cannot start a second
     elastic page below the sticky phone menu. Older WebKit uses the JS guard. */
  html:has(>body.hp-current-layout):not(.hp-reader-document-zoom-root),
  body.hp-current-layout:not(.hp-pattern-reader-open){overscroll-behavior-y:none!important}
 }
 /* These three placements grow only after a creative actually paints. */
 .hp-vf-as-below-container:not(:has([data-hp-vf-visible="1"])){margin-block:0!important}
 [data-description-ads][hidden]{display:none!important}
 body.hp-current-layout [data-description-ads]:has(>.hp-vf-description-shell){
  display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:0!important;
  flex:0 0 auto!important;height:auto!important;min-height:0!important;max-height:none!important;
  position:relative!important;top:0!important;overflow:visible!important;
 }
 body.hp-current-layout [data-description-ads][hidden]{display:none!important}
 body.hp-current-layout [data-description-ads]:has(>.hp-vf-description-shell)>.hp-ad-shell{
  flex:0 0 auto!important;margin:0!important;
 }
 body.hp-current-layout [data-description-ads]>.hp-vf-description-shell{
  order:0!important;position:relative!important;height:auto!important;
  min-height:0!important;max-height:none!important;overflow:visible!important;
 }
 body.hp-current-layout [data-description-ads]:has(>.hp-vf-description-shell)>.hp-ad-shell:not(.hp-vf-description-shell){order:1!important}
 body.hp-current-layout [data-description-ads]:has(>.hp-vf-description-shell)>.hp-ad-shell[data-hp-current-ad-visible]~.hp-ad-shell[data-hp-current-ad-visible]{margin-top:20px!important}
 body.hp-current-layout [data-description-ads]:has(>.hp-vf-description-shell[data-hp-current-ad-visible]){
  margin-top:calc(20px - var(--hp-description-row-gap,0px))!important;margin-bottom:20px!important;
 }
 body.hp-current-layout .hp-pattern-reader__visuals>.visual-block:has(+[data-description-ads]>.hp-vf-description-shell[data-hp-current-ad-visible]){margin-bottom:0!important}
 body.hp-current-layout .hp-pattern-reader__visuals>[data-description-ads]:has(>.hp-vf-description-shell[data-hp-current-ad-visible])+.visual-block{margin-top:0!important}
 /* One local scrollport holds both networks. Paint/layout containment also
    captures fixed/absolute provider descendants after a late expansion. */
 body .hp-description-ads[data-description-ads][data-description-ad-scroll]{
  box-sizing:border-box!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:0!important;
  position:relative!important;top:0!important;z-index:0!important;isolation:isolate!important;contain:layout paint!important;
  width:100%!important;max-width:100%!important;min-width:0!important;flex:0 0 auto!important;
  height:auto!important;min-height:0!important;max-height:var(--hp-description-scroll-height,calc(100dvh - 96px))!important;
  padding:0!important;border:0!important;overflow-x:hidden!important;overflow-y:auto!important;
  scrollbar-width:thin;scrollbar-color:#999 transparent;scrollbar-gutter:stable;overflow-anchor:none;-webkit-overflow-scrolling:touch;
 }
 body .hp-description-ads[data-description-ad-scroll]>.hp-ad-shell{
  flex:0 0 auto!important;min-width:0!important;width:100%!important;max-width:100%!important;
  position:relative!important;contain:layout!important;isolation:isolate!important;
 }
 body .hp-description-ads[data-description-ad-scroll]>.hp-vf-description-shell{
  position:relative!important;height:auto!important;min-height:0!important;max-height:none!important;
 }
 .hp-description-ads[data-description-ad-scroll]::-webkit-scrollbar{width:5px}
 .hp-description-ads[data-description-ad-scroll]::-webkit-scrollbar-thumb{background:#999;border-radius:4px}
 .hp-description-ads[data-description-ad-scroll]::-webkit-scrollbar-track{background:transparent}
 body .hp-description-ads[data-description-ads][data-description-ad-scroll][hidden]{display:none!important}
 /* Current's outer placements must participate in flow as well as their
    internal scrollports; a collapsed ancestor cannot lift the next cards. */
 body.hp-current-layout [data-hp-current-ad-flow]{
  display:flow-root!important;position:relative!important;height:auto!important;
  min-height:var(--hp-current-flow-height,0px)!important;max-height:none!important;flex:0 0 auto!important;
 }
 body.hp-current-layout [data-hp-current-ad-flow][data-vf-device-hidden],
 body.hp-current-layout [data-hp-current-ad-flow][hidden]{display:none!important}
 body.hp-current-layout:has(>.hp-vf-as-below-container[data-hp-current-flow-filled="1"],>.hp-below-menu-ads[data-hp-current-flow-filled="1"])>.site-main{margin-top:0!important;padding-top:0!important}
 body.hp-current-layout .related-patterns:has(>.hp-post-description-ad-slot[data-hp-current-flow-filled="1"]){margin-top:0!important}
 body.hp-current-layout .hp-description-ads[data-description-ad-scroll]>.hp-ad-shell{contain:layout paint!important}
 /* Current's inline ads occupy real document height as soon as they paint.
    The measuring pseudo-spacer is only needed by Feed's absolute stage. */
 body.hp-current-layout .hp-vf-as--fluid{
  display:flow-root!important;position:relative!important;top:0!important;left:0!important;
  height:auto!important;min-height:var(--hp-vf-frame-height,0px)!important;max-height:none!important;
  flex:0 0 auto!important;overflow:visible!important;
 }
 body.hp-current-layout .hp-vf-as--fluid::before{content:none!important;display:none!important}
 body.hp-current-layout .hp-vf-as--fluid>.hp-vf-as-content{
  position:absolute!important;top:0!important;left:0!important;right:auto!important;
  width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;
 }
 body.hp-current-layout .hp-vf-as--fluid[data-hp-vf-visible="1"]>.hp-vf-as-content{position:relative!important}
 /* Menu/Reader-description content stays in flow from the server render,
    before any provider request or fill-state measurement. The group remains
    the desktop/tablet scrollport; an empty inner paint box cannot clip an ad. */
 body.hp-current-layout .hp-vf-as--fluid[data-hp-vf-native-flow]>.hp-vf-as-content{position:relative!important}
 body.hp-current-layout .hp-description-ads[data-description-ad-scroll]>.hp-vf-description-shell:has(>[data-hp-vf-native-flow]){contain:layout!important}
 /* Phones show the complete description ad stack in page flow. Preserve
    the existing finite scrollport only on computers and tablets. */
 body.hp-current-layout .hp-description-ads[data-description-ads][data-description-ad-scroll][data-hp-description-natural]{
  height:auto!important;max-height:none!important;contain:layout!important;
  overflow:visible!important;scrollbar-width:none;scrollbar-gutter:auto;
 }
 body.hp-current-layout .hp-description-ads[data-description-ad-scroll][data-hp-description-natural]>.hp-ad-shell{contain:layout!important}
 .hp-description-ads[data-hp-description-natural]::-webkit-scrollbar{display:none;width:0;height:0}
 /* Feed menu/Reader-description units need real flow too. A late status
    update must not leave a visible absolute iframe inside a zero-height box. */
 body.hp-video-feed-page .hp-vf-as--fluid[data-hp-vf-native-flow]{
  display:flow-root!important;position:relative!important;top:0!important;left:0!important;
  height:auto!important;min-height:var(--hp-vf-frame-height,0px)!important;max-height:none!important;
  flex:0 0 auto!important;overflow:visible!important;
 }
 body.hp-video-feed-page .hp-vf-as--fluid[data-hp-vf-native-flow]::before{content:none!important;display:none!important}
 body.hp-video-feed-page .hp-vf-as--fluid[data-hp-vf-native-flow]:is([data-vf-device-hidden],[hidden]){display:none!important}
 body.hp-video-feed-page .hp-vf-as--fluid[data-hp-vf-native-flow]>.hp-vf-as-content{
  position:relative!important;top:0!important;left:0!important;right:auto!important;
  width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;
 }
 body.hp-video-feed-page>.hp-vf-as-below-container[data-hp-current-ad-flow]{
  display:flow-root!important;position:relative!important;height:auto!important;
  min-height:var(--hp-current-flow-height,0px)!important;max-height:none!important;flex:0 0 auto!important;
 }
 body.hp-video-feed-page>.hp-vf-as-below-container[data-hp-current-ad-flow]:is([data-vf-device-hidden],[hidden]){display:none!important}
 /* Current's in-page AdSense spacing is independent of the Feed's black bands. */
 body.hp-current-layout>.hp-vf-as-below-container:has([data-hp-vf-visible="1"]){margin-block:20px!important}
 body.hp-current-layout>.hp-vf-as-below-container:has([data-hp-vf-visible="1"])+.hp-below-menu-ads>.hp-ad-shell[data-hp-ad-filled="1"]:first-child{margin-top:0!important;top:0!important}
 body.hp-current-layout>.hp-vf-as-below-container:has([data-hp-vf-visible="1"])+.site-main{padding-top:0!important;margin-top:0!important}
 body.hp-current-layout .hp-pattern-reader__visuals>.hp-vf-reader-ad.hp-vf-ad--adsense{padding-block:88px!important;min-height:507px!important}
 body.hp-current-layout .hp-pattern-reader__visuals>.hp-ad-shell[data-reader-ad][data-hp-ad-filled="1"]{padding-block:88px!important}
 body.hp-current-layout .hp-pattern-reader__visuals>.visual-block:has(+.hp-vf-reader-ad){margin-bottom:0!important}
 body.hp-current-layout .hp-pattern-reader__visuals>.hp-vf-reader-ad+.visual-block{margin-top:0!important}
 body.hp-current-layout .hp-pattern-reader__visuals>.hp-vf-reader-ad:has(+.hp-ad-shell[data-reader-ad][data-hp-ad-filled="1"]){padding-bottom:88px!important}
 body.hp-current-layout .hp-pattern-reader__visuals>.hp-vf-reader-ad+.hp-ad-shell[data-reader-ad][data-hp-ad-filled="1"]{padding-top:0!important}
 body.hp-current-layout .hp-pattern-reader__visuals>.hp-ad-shell[data-reader-ad][data-hp-ad-filled="1"]:has(+.hp-vf-reader-ad){padding-bottom:0!important}
 /* WordPress emoji are inline text images, never the Reader's media image. */
 .hp-pattern-reader .hp-pattern-reader__visuals .visual-block .hp-block-text img:is(.emoji,.wp-smiley,[src*="/emoji/"]){
  display:inline!important;position:static!important;width:1em!important;height:1em!important;
  min-width:0!important;min-height:0!important;max-width:1em!important;max-height:1em!important;
  margin:0 .07em!important;padding:0!important;border:0!important;border-radius:0!important;
  vertical-align:-.1em!important;aspect-ratio:auto!important;object-fit:contain!important;
  background:none!important;box-shadow:none!important;float:none!important;
 }
 @media (min-width:1025px) and (hover:hover) and (pointer:fine){
  html.hp-vf-feed-y-only{min-width:0!important;max-width:100%!important;overflow-x:hidden!important;overscroll-behavior-x:none}
  body.hp-vf-feed-y-only{min-width:0!important;max-width:100%!important;overflow-x:clip!important;overscroll-behavior-x:none}
  /* In-page and automatic ads can overflow even without a sticky banner. */
  html:not(.hp-reader-document-zoom-root):has(>body.hp-current-adsense-on:not(.hp-pattern-reader-open,.hp-modal-open,.hp-mobile-search-open)){
   overflow-x:hidden!important;overscroll-behavior-x:none;
  }
  html:not(.hp-reader-document-zoom-root)>body.hp-current-adsense-on:not(.hp-pattern-reader-open,.hp-modal-open,.hp-mobile-search-open){
   overflow-x:clip!important;overscroll-behavior-x:none;
  }
 }
}
