/* v0.5.270: fixed-gap bottom sheet. Only the full-width dialog scrolls.
   The original article stays mounted and its desktop scrollbar gutter remains stable. */
html:has(>body.single-hp_pattern){scrollbar-gutter:stable}
body.single-hp_pattern .hp-pattern-reader{
  --hp-reader-peek:var(--hp-touch-nav-height,47px);
  position:fixed!important;inset:0!important;z-index:96!important;
  display:block!important;width:100vw!important;height:100dvh!important;
  margin:0!important;padding:0!important;overflow:hidden!important;
  isolation:isolate;zoom:1!important;background:transparent!important;
}
body.single-hp_pattern .hp-pattern-reader[hidden]{display:none!important}
body.single-hp_pattern .hp-pattern-reader__backdrop{
  display:block!important;position:absolute!important;inset:0!important;
  background:rgba(0,0,0,.46)!important;
  backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);
  opacity:0;pointer-events:none;
  transition:opacity 320ms ease;
}
body.single-hp_pattern .hp-pattern-reader.is-visible .hp-pattern-reader__backdrop{
  opacity:1;pointer-events:auto;
}
body.single-hp_pattern .hp-pattern-reader.is-closing .hp-pattern-reader__backdrop{
  opacity:0;pointer-events:none;
}
/* Paint the same blur above each overview and below the Reader and its controls.
   The Reader's existing backdrop still supplies the fade colour and close hit area. */
@supports (backdrop-filter:blur(3px)) or (-webkit-backdrop-filter:blur(3px)){
  body.single-hp_pattern:is(.hp-current-layout,.hp-vf-inline-reader-open).hp-pattern-reader-open:not(.hp-feed-embed)::after{
    content:"";position:fixed;inset:0;z-index:var(--hp-reader-backdrop-z-index,95);pointer-events:none;
    -webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);
    opacity:0;transition:opacity 320ms ease;
  }
  body.single-hp_pattern:is(.hp-current-layout,.hp-vf-inline-reader-open).hp-pattern-reader-open:not(.hp-feed-embed):has(>.hp-pattern-reader.is-visible:not([hidden]))::after{
    opacity:1;
  }
  body.single-hp_pattern:is(.hp-current-layout,.hp-vf-inline-reader-open):not(.hp-feed-embed)>.hp-pattern-reader>.hp-pattern-reader__backdrop{
    -webkit-backdrop-filter:none!important;backdrop-filter:none!important;
  }
}
@supports not ((backdrop-filter:blur(3px)) or (-webkit-backdrop-filter:blur(3px))){
  body.single-hp_pattern:is(.hp-current-layout,.hp-vf-inline-reader-open):not(.hp-feed-embed):has(>.hp-pattern-reader:is(.is-visible,.is-closing):not([hidden]))
  >:is(.site-header,.site-main,.site-footer,.hp-vf-as-below-container,.hp-below-menu-ads):where(:not([data-vf-reader-measure])){
    filter:blur(3px);
  }
}
/* The peek gap is a persistent toolbar, not a temporary snap gesture. */
body.single-hp_pattern .hp-reader-peek-close{
  position:absolute;z-index:8;top:calc((var(--hp-reader-peek) - 29px) / 2);left:50%;
  display:grid;place-items:center;width:29px;height:29px;min-width:0;min-height:0;aspect-ratio:1;box-sizing:border-box;
  padding:0;border:0;border-radius:50%;
  min-inline-size:29px;max-inline-size:29px;min-block-size:29px;max-block-size:29px;
  appearance:none;-webkit-appearance:none;line-height:0;
  background:rgba(255,255,255,.96);color:#252525;
  box-shadow:0 2px 10px rgba(0,0,0,.16);cursor:pointer;
  transform:translateX(-50%);opacity:0;pointer-events:none;
  transition:opacity 200ms ease;
}
body.single-hp_pattern .hp-pattern-reader.is-visible .hp-reader-peek-close{
  opacity:1;pointer-events:auto;
}
body.single-hp_pattern .hp-reader-peek-close svg{
  display:block;width:18px;height:18px;margin:0;padding:0;
  align-self:center;justify-self:center;
}
/* v0.5.280: match the existing lower image edge in each Reader palette.
   The first image's top edge is suppressed independently; don't inherit it. */
body.single-hp_pattern .hp-pattern-reader.hp-reader-desktop .hp-pattern-reader__visuals .visual-block .hp-block-text{border-top-color:#3d3d3d!important}
body.single-hp_pattern .hp-pattern-reader.hp-reader-touch .hp-pattern-reader__visuals .visual-block .hp-block-text{border-top-color:#303030!important}
body.single-hp_pattern [data-reader-loading]{margin:0;padding:24px 16px;color:#fff;background:#000}
/* Leave the 47px toolbar visible throughout reading. The dialog itself owns
   the scrollbar, so on desktop it lives at the RIGHT EDGE of the viewport. */
body.single-hp_pattern .hp-pattern-reader__dialog,
body.single-hp_pattern .hp-pattern-reader.hp-reader-desktop .hp-pattern-reader__dialog{
  box-sizing:border-box!important;
  position:absolute!important;inset:var(--hp-reader-peek) 0 auto 0!important;
  z-index:2!important;display:block!important;width:100vw!important;
  min-width:0!important;max-width:none!important;
  height:calc(100dvh - var(--hp-reader-peek))!important;
  min-height:0!important;max-height:none!important;
  margin:0!important;padding:0!important;
  border:0!important;border-radius:0!important;
  background:#fff!important;box-shadow:0 -4px 28px rgba(0,0,0,.16)!important;
  overflow-x:hidden!important;overflow-y:auto!important;
  overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important;
  transform:translate3d(0,105dvh,0)!important;
  transition:transform 350ms cubic-bezier(.22,.75,.24,1)!important;
  will-change:transform;
  scrollbar-gutter:auto;
}

body.single-hp_pattern .hp-pattern-reader.is-visible .hp-pattern-reader__dialog,
body.single-hp_pattern .hp-pattern-reader.hp-reader-desktop.is-visible .hp-pattern-reader__dialog{
  transform:translate3d(0,0,0)!important;
}
body.single-hp_pattern .hp-pattern-reader.is-closing .hp-pattern-reader__dialog,
body.single-hp_pattern .hp-pattern-reader.hp-reader-desktop.is-closing .hp-pattern-reader__dialog{
  transform:translate3d(0,105dvh,0)!important;
}
/* The former snapped-close bar and old Back bar must not show. */
body.single-hp_pattern .hp-reader-snap-bar,
body.single-hp_pattern .hp-pattern-reader__header--touch,
body.single-hp_pattern .hp-pattern-reader__close--touch,
body.single-hp_pattern .hp-pattern-reader__close--desktop,
body.single-hp_pattern .hp-pattern-reader.hp-reader-desktop .hp-pattern-reader__close--desktop{
  display:none!important;
}
/* Make content a full-height centered two-column section of the scrolling page,
   not a nested scroller with its scrollbar stranded beside the sidebar. */
body.single-hp_pattern .hp-pattern-reader__layout,
body.single-hp_pattern .hp-pattern-reader.hp-reader-desktop .hp-pattern-reader__layout{
  position:relative!important;display:grid!important;
  box-sizing:border-box!important;
  width:min(100%,calc(var(--hp-reader-image-width,684px) + var(--hp-reader-sidebar-width,496px)))!important;
  min-width:0!important;max-width:100%!important;
  height:auto!important;min-height:100%!important;max-height:none!important;
  margin:0 auto!important;padding:0!important;
  grid-template-columns:var(--hp-reader-media-columns,minmax(0,58%) minmax(0,42%))!important;
  zoom:1!important;
  overflow:visible!important;overscroll-behavior:auto!important;
  scrollbar-gutter:auto!important;
}
/* Freeze the underlying post in place without removing its gutter. */
body.single-hp_pattern.hp-pattern-reader-open{overflow:hidden!important}
@media (any-pointer:coarse) and (min-width:640px) and (min-device-width:640px) and (min-device-height:640px){
  body.single-hp_pattern .hp-pattern-reader.hp-reader-desktop .hp-pattern-reader__layout{
    width:100%!important;max-width:100%!important;
    grid-template-columns:var(--hp-reader-media-columns,minmax(0,calc((100% - var(--hp-tablet-reader-gap,clamp(12px,2.4vw,30px))) * .58)) minmax(0,1fr))!important;
  }
}
@media (max-width:639px), (any-pointer:coarse) and (not ((min-width:640px) and (min-device-width:640px) and (min-device-height:640px))){
  body.single-hp_pattern .hp-pattern-reader__dialog,
  body.single-hp_pattern .hp-pattern-reader.hp-reader-touch .hp-pattern-reader__dialog{
    padding:0!important;background:#fff!important;
  }
  body.single-hp_pattern .hp-pattern-reader__layout,
  body.single-hp_pattern .hp-pattern-reader.hp-reader-touch .hp-pattern-reader__layout{
    display:flex!important;flex-direction:column!important;
    width:100%!important;max-width:100%!important;
    height:auto!important;min-height:100%!important;
    margin:0!important;padding:0!important;
    background:#fff!important;overflow:visible!important;
    touch-action:auto!important;
  }
  body.single-hp_pattern .hp-pattern-reader__sidebar,
  body.single-hp_pattern .hp-reader-touch .hp-pattern-reader__sidebar{
    order:1!important;width:100%!important;
    background:#fff!important;color:#111!important;
    border-bottom:0!important;
  }
  body.single-hp_pattern .hp-pattern-reader__sidebar .article-sidebar,
  body.single-hp_pattern .hp-reader-touch .hp-pattern-reader__sidebar .article-sidebar{
    display:flex!important;flex-direction:column!important;
    height:auto!important;max-height:none!important;gap:14px!important;
    padding:11px var(--hp-article-edge,16px) 15px!important;
    background:#fff!important;color:#111!important;
  }
  body.single-hp_pattern .hp-pattern-reader__sidebar .article-sidebar>h1{
    display:block!important;order:1!important;position:static!important;top:auto!important;
    margin:0!important;color:#111!important;font-size:20px!important;
    line-height:1.3!important;font-weight:var(--hp-font-weight-strong)!important;
    overflow-wrap:anywhere;
  }
  body.single-hp_pattern .hp-pattern-reader__sidebar .article-sidebar>.article-action-row{order:2!important;position:static!important;top:auto!important;margin:0!important}
  body.single-hp_pattern .hp-pattern-reader__sidebar .article-sidebar>.creator-card{order:3!important;position:static!important;top:auto!important;margin:0!important}
  body.single-hp_pattern .hp-pattern-reader__sidebar .article-sidebar>.article-description-meta{order:4!important;position:static!important;top:auto!important;margin:0!important}
  body.single-hp_pattern .hp-pattern-reader__sidebar .article-sidebar>.hp-translation-guide-sidebar{order:5!important;position:static!important;top:auto!important;margin:0!important}
  body.single-hp_pattern .hp-pattern-reader__sidebar .article-sidebar>.interaction-message{order:6!important;margin:0!important}
  /* Match the overview's visible row gaps, including its existing -2/-12/-18px
     offsets. Use flow margins so every row after the description follows it. */
  body.single-hp_pattern .hp-pattern-reader.hp-reader-touch .hp-pattern-reader__sidebar .article-sidebar>.article-action-row{
    margin-top:calc(10 * var(--hp-touch-ui-unit,1px) - 16px)!important;
  }
  body.single-hp_pattern .hp-pattern-reader.hp-reader-touch .hp-pattern-reader__sidebar .article-sidebar>.creator-card{
    margin-top:calc(20 * var(--hp-touch-ui-unit,1px) - 24px)!important;
  }
  body.single-hp_pattern .hp-pattern-reader.hp-reader-touch .hp-pattern-reader__sidebar .article-sidebar>.article-description-meta{
    margin-top:calc(20 * var(--hp-touch-ui-unit,1px) - 20px)!important;
  }
  /* The first image begins exactly where the former sidebar divider sat. */
  body.single-hp_pattern .hp-pattern-reader.hp-reader-touch .hp-pattern-reader__content{padding-top:0!important}
  body.single-hp_pattern .hp-pattern-reader.hp-reader-touch .hp-pattern-reader__visuals>.visual-block:first-child{border-top:0!important}

  body.single-hp_pattern .hp-pattern-reader__sidebar .article-sidebar h1,
  body.single-hp_pattern .hp-pattern-reader__sidebar .article-action,
  body.single-hp_pattern .hp-pattern-reader__sidebar .article-action--rating.is-active .rating-inline,
  body.single-hp_pattern .hp-pattern-reader__sidebar .creator-card__identity strong,
  body.single-hp_pattern .hp-pattern-reader__sidebar .article-sidebar__summary,
  body.single-hp_pattern .hp-pattern-reader__sidebar .article-description-meta,
  body.single-hp_pattern .hp-reader-touch .hp-pattern-reader__sidebar .creator-card__identity strong{
    color:#111!important;
  }
  body.single-hp_pattern .hp-reader-touch .hp-pattern-reader__sidebar .creator-card,
  body.single-hp_pattern .hp-pattern-reader__sidebar .creator-card{
    background:#fff!important;border-color:transparent!important;box-shadow:none!important;
  }
  body.single-hp_pattern .hp-reader-touch .hp-pattern-reader__sidebar .article-sidebar-save.is-saved,
  body.single-hp_pattern .hp-reader-touch .hp-pattern-reader__sidebar .article-sidebar-save[aria-pressed="true"]{
    background:#111!important;color:#fff!important;
  }
  body.single-hp_pattern .hp-pattern-reader__sidebar .creator-card__identity>span{color:#666!important}
  body.single-hp_pattern .hp-pattern-reader__content,
  body.single-hp_pattern .hp-reader-touch .hp-pattern-reader__content{
    order:2!important;width:100%!important;background:#fff!important;color:#111!important;
  }
  body.single-hp_pattern .hp-pattern-reader__visuals .visual-block,
  body.single-hp_pattern .hp-reader-touch .hp-pattern-reader__visuals .visual-block{
    background:#fff!important;border-color:#dedede!important;
  }
  body.single-hp_pattern .hp-pattern-reader__visuals .visual-block figcaption,
  body.single-hp_pattern .hp-reader-touch .hp-pattern-reader__visuals .visual-block figcaption{
    background:#f3f3f3!important;color:#111!important;border-color:#dedede!important;
  }
  body.single-hp_pattern .hp-pattern-reader__visuals .visual-block figcaption strong,
  body.single-hp_pattern .hp-pattern-reader__visuals .visual-block figcaption span{color:#111!important}
  body.single-hp_pattern .hp-pattern-reader__visuals .visual-block figcaption small{color:#666!important}
}
@media (prefers-reduced-motion:reduce){
  body.single-hp_pattern .hp-pattern-reader__dialog,
  body.single-hp_pattern .hp-pattern-reader__backdrop,
  body.single-hp_pattern:is(.hp-current-layout,.hp-vf-inline-reader-open).hp-pattern-reader-open:not(.hp-feed-embed)::after,
  body.single-hp_pattern .hp-reader-peek-close{transition-duration:0.01ms!important}
}

/* v0.5.270: keep the Reader's Back-to-top fixed to the screen, not inside
   the scrolling images; only the Reader's own button receives this rule. */
body.single-hp_pattern .hp-pattern-reader>.hp-reader-floating-actions{
  position:fixed!important;
  right:max(13px,env(safe-area-inset-right))!important;bottom:117px!important;
  z-index:10!important;
  transform:none!important;
}
/* The displayed, passive snapshot keeps the overview sidebar in place while
   the original interactive sidebar is temporarily mounted in Reader. */
body.single-hp_pattern .hp-pattern-sidebar-home .hp-overview-sidebar-snapshot{
  pointer-events:none!important;
  user-select:none!important;
}
/* v0.5.270: on phones do NOT hide the page behind the transparent gap.
   Legacy touch-Reader rules previously hid the whole post and exposed a
   solid black body, explaining the black flash after closing. */
@media (max-width:639px), (any-pointer:coarse) and (not ((min-width:640px) and (min-device-width:640px) and (min-device-height:640px))){
  html.hp-pattern-touch-reader-root{overflow:hidden!important;overscroll-behavior:none!important}
  body.single-hp_pattern.hp-pattern-touch-reader-open{
    overflow:hidden!important;overflow-x:hidden!important;overflow-y:hidden!important;
  }
  body.single-hp_pattern.hp-pattern-touch-reader-open>.site-header,
  body.single-hp_pattern.hp-pattern-touch-reader-open>.site-main,
  body.single-hp_pattern.hp-pattern-touch-reader-open>.site-footer{
    display:block!important;
  }
  body.single-hp_pattern .hp-pattern-reader .hp-pattern-reader__backdrop{
    display:block!important;
    background:rgba(0,0,0,.46)!important;
    backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
  }

}
/* A small viewport unit can leave the post exposed below an in-app browser.
   Cover the visible tablet viewport; height changes do not resize the columns. */
@media (any-pointer:coarse) and (min-width:640px) and (min-device-width:640px) and (min-device-height:640px){
  body.single-hp_pattern .hp-pattern-reader{height:var(--hp-reader-viewport-height,100dvh)!important}
  /* v0.5.303: this shield is a BODY sibling of Reader, so a stale/clipped
     Reader layer cannot clip it. The canvas is also opaque if the native
     browser exposes space before fixed layers have been recomposited. */
  html.hp-reader-underlay-root,
  body.single-hp_pattern.hp-reader-underlay-open{background:#fff!important}
  body.single-hp_pattern>.hp-reader-underlay-shield{
    position:fixed!important;left:0!important;right:0!important;
    height:200vmax!important;z-index:95!important;
    margin:0!important;padding:0!important;border:0!important;
    background:#fff!important;pointer-events:none!important;
  }
  body.single-hp_pattern>.hp-reader-underlay-shield[hidden]{display:none!important}
  body.single-hp_pattern>.hp-reader-overview-clipped{
    -webkit-clip-path:inset(0 -100vmax calc(100% - var(--hp-reader-overview-cut,0px)) -100vmax)!important;
    clip-path:inset(0 -100vmax calc(100% - var(--hp-reader-overview-cut,0px)) -100vmax)!important;
  }
  html:has(>body.single-hp_pattern.hp-pattern-reader-open){overflow:hidden!important;overscroll-behavior-y:none!important}
  body.single-hp_pattern.hp-pattern-reader-open{overscroll-behavior-y:none!important}
  body.single-hp_pattern .hp-pattern-reader__dialog,
  body.single-hp_pattern .hp-pattern-reader.hp-reader-desktop .hp-pattern-reader__dialog{overscroll-behavior-y:none!important}

  body.single-hp_pattern .hp-pattern-reader__dialog,
  body.single-hp_pattern .hp-pattern-reader.hp-reader-desktop .hp-pattern-reader__dialog{
    height:calc(var(--hp-reader-viewport-height,100dvh) - var(--hp-reader-peek))!important;
    -webkit-overflow-scrolling:touch!important;
  }
  body.single-hp_pattern .hp-pattern-reader__backdrop{
    backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
  }
}

/* v0.5.277: native page zoom must retain both horizontal and vertical panning.
   No custom zoom transform or image-only gesture is introduced. */
body.single-hp_pattern .hp-pattern-reader,
body.single-hp_pattern .hp-pattern-reader .hp-pattern-reader__dialog,
body.single-hp_pattern .hp-pattern-reader .hp-pattern-reader__layout{
  touch-action:auto!important;
}

/* Only at native pinch zoom, use the document scroll surface. A fixed nested
   overflow box otherwise traps one-finger horizontal panning on mobile. */
html.hp-reader-document-zoom-root,
html.hp-reader-document-zoom-root>body.single-hp_pattern.hp-pattern-reader-open{
  overflow:visible!important;overflow-x:visible!important;overflow-y:visible!important;
  overscroll-behavior:auto!important;touch-action:auto!important;
}
body.single-hp_pattern .hp-pattern-reader.hp-reader-document-zoom{
  position:absolute!important;inset:auto 0 auto 0!important;
  top:var(--hp-reader-zoom-page-top,0px)!important;
  height:auto!important;min-height:100dvh!important;overflow:visible!important;
}
body.single-hp_pattern .hp-pattern-reader.hp-reader-document-zoom .hp-pattern-reader__dialog,
body.single-hp_pattern .hp-pattern-reader.hp-reader-desktop.hp-reader-document-zoom .hp-pattern-reader__dialog{
  position:relative!important;inset:auto!important;
  height:auto!important;min-height:calc(100dvh - var(--hp-reader-peek))!important;
  margin-top:var(--hp-reader-peek)!important;
  overflow:visible!important;overscroll-behavior:auto!important;
  transform:none!important;will-change:auto!important;
}

/* v0.5.278: author information takes the removed action row's exact top edge.
   A flow margin carries the same upward shift through every following row. */
body.single-hp_pattern .hp-pattern-reader.hp-reader-desktop .hp-pattern-reader__sidebar .article-sidebar>.creator-card{margin-top:0!important;min-height:42px!important}

@media (max-width:639px), (any-pointer:coarse) and (not ((min-width:640px) and (min-device-width:640px) and (min-device-height:640px))){
  body.single-hp_pattern .hp-pattern-reader.hp-reader-touch .hp-pattern-reader__sidebar .article-sidebar>.creator-card{margin-top:calc(10 * var(--hp-touch-ui-unit,1px) - 16px)!important}
}

/* v0.5.279: balance the visible gaps without moving the title, description
   or subsequent content. Desktop/tablet row offsets differ by six pixels. */
body.single-hp_pattern .hp-pattern-reader.hp-reader-desktop .hp-pattern-reader__sidebar .article-sidebar>.creator-card{top:-9px}
@media (max-width:639px), (any-pointer:coarse) and (not ((min-width:640px) and (min-device-width:640px) and (min-device-height:640px))){
  body.single-hp_pattern .hp-pattern-reader.hp-reader-touch .hp-pattern-reader__sidebar .article-sidebar>.creator-card{
    position:relative!important;top:calc(5 * var(--hp-touch-ui-unit,1px) - 2px)!important;
  }
}

/* v0.5.281: center the visible desktop content, including the sidebar's
   existing right inset. Move the whole layout by half that inset so its
   image, columns, text and internal spacing retain their exact sizes.
   Coarse-pointer devices keep their existing tablet/phone layout. */
@media (min-width:1025px) and (hover:hover) and (pointer:fine) and (not (any-pointer:coarse)){
  body.single-hp_pattern .hp-pattern-reader.hp-reader-desktop .hp-pattern-reader__layout{
    left:calc(var(--hp-article-sidebar-gap,14px) / 2);
  }
}

/* The overview still owns the shared Guide control when the sidebar moves back. */
body.single-hp_pattern .hp-pattern-reader .hp-translation-guide-sidebar,
body.hp-pattern-reader-open [data-touch-floating-nav] [data-translation-guide-trigger] {
  display: none !important;
}
