/* OneScene UX11: one targeted finishing pass on accepted UX10.
 * Never alter React runtime, scripts for scenarios, or mobile surfaces.
 */
@media (min-width:980px) {
  /* The real /app hero uses .ss-today-hero-visual > two separate images.
   * UX10's .ss-today-scene-media selector did NOT match this branch.
   * Restore an actual portrait (head through waist/knee), anchored right.
   */
  html body .pv3-root .ss-today-page[data-today-ui="canonical-v2418"][data-today-freeze="v2422"]
  .ss-today-hero > .ss-today-hero-media > .ss-today-hero-visual > img.pv3-visual-card-foreground,
  html body .pv3-root .ss-today-page[data-today-ui="canonical-v2418"][data-today-freeze="v2422"]
  .ss-today-hero > .ss-today-hero-media > .ss-today-hero-visual > img.pv3-visual-card-foreground[data-r18-actor-frame] {
    position:absolute!important;
    inset:auto 3% 0 auto!important;
    top:auto!important; left:auto!important; right:3%!important; bottom:0!important;
    width:43%!important; max-width:43%!important;
    height:100%!important; max-height:100%!important;
    object-fit:contain!important;
    object-position:center bottom!important;
    transform:none!important; transform-origin:center bottom!important;
    filter:brightness(.94) saturate(.92) drop-shadow(-12px 4px 14px rgba(0,0,0,.36))!important;
    opacity:1!important;
    -webkit-mask-image:none!important; mask-image:none!important;
    pointer-events:none!important;
  }
  html body .pv3-root .ss-today-page[data-today-ui="canonical-v2418"][data-today-freeze="v2422"]
  .ss-today-hero:hover > .ss-today-hero-media > .ss-today-hero-visual > img.pv3-visual-card-foreground {
    transform:none!important;
  }

  /* Live UX9 also uses this exact branch for ACTIVE PROGRAM / STORY heroes:
   * a single (sometimes landscape-sized) actor render plus CSS scene backdrop.
   * Do not depend on file name or intrinsic aspect ratio as UX10 did. */
  html body .pv3-root .ss-today-page[data-today-ui="canonical-v2418"][data-today-freeze="v2422"]
  .ss-today-hero > .ss-today-hero-media.ss-today-scene-media > img.ss-today-hero-art {
    position:absolute!important;
    top:auto!important;left:auto!important;right:3%!important;bottom:0!important;
    width:45%!important;max-width:45%!important;
    height:100%!important;max-height:100%!important;
    object-fit:contain!important;object-position:center bottom!important;
    transform:none!important;transform-origin:center bottom!important;
    filter:brightness(.94) saturate(.95)!important;
    z-index:1!important;
    -webkit-mask-image:linear-gradient(90deg,transparent 0%,#000 18%,#000 100%);
    mask-image:linear-gradient(90deg,transparent 0%,#000 18%,#000 100%);
  }
  html body .pv3-root .ss-today-page[data-today-ui="canonical-v2418"][data-today-freeze="v2422"]
  .ss-today-hero:hover > .ss-today-hero-media.ss-today-scene-media > img.ss-today-hero-art {
    transform:none!important;
  }

  /* Fallback when the hero has a single portrait rather than visual layers.
   * JS applies this class only to known portrait/aspect-matched images.
   */
  html body .pv3-root .ss-today-page[data-today-ui="canonical-v2418"][data-today-freeze="v2422"]
  .ss-today-hero > .ss-today-hero-media.ux11-single-portrait {
    isolation:isolate;
    background:#17110d;
  }
  html body .pv3-root .ss-today-page[data-today-ui="canonical-v2418"][data-today-freeze="v2422"]
  .ss-today-hero > .ss-today-hero-media.ux11-single-portrait::before {
    content:"";
    position:absolute;inset:0;
    background-image:var(--ux11-scene-backdrop,none);
    background-position:center;
    background-repeat:no-repeat;
    background-size:cover;
    filter:brightness(.37) blur(5px);
    transform:scale(1.06);
    z-index:0;
    pointer-events:none;
  }
  html body .pv3-root .ss-today-page[data-today-ui="canonical-v2418"][data-today-freeze="v2422"]
  .ss-today-hero > .ss-today-hero-media.ux11-single-portrait > img.ss-today-hero-art {
    position:absolute!important;
    inset:auto 3% 0 auto!important;
    width:44%!important;max-width:44%!important;
    height:100%!important;max-height:100%!important;
    object-fit:contain!important;
    object-position:center bottom!important;
    transform:none!important;
    filter:brightness(.94) saturate(.94)!important;
    mask-image:linear-gradient(90deg,transparent 0%,#000 18%,#000 100%);
    z-index:1!important;
  }
  html body .pv3-root .ss-today-page[data-today-ui="canonical-v2418"][data-today-freeze="v2422"]
  .ss-today-hero > .ss-today-hero-media.ux11-single-portrait > .ss-today-hero-shade,
  html body .pv3-root .ss-today-page[data-today-ui="canonical-v2418"][data-today-freeze="v2422"]
  .ss-today-hero > .ss-today-hero-media.ux11-single-portrait > .ss-today-hero-glow {z-index:2!important;}
}

/* Restore the original editorial proportions for the story/training catalog.
 * The JS computes heights based on REAL available viewport space. No hidden
 * pager or truncated cards; when content doesn't fit, ordinary scroll returns.
 */
@media (min-width:1300px) and (min-height:740px) {
  html body .pv3-root[data-r18-standard-shell="today-authority-v1"]
  .pv3-programs-page.pv3-programs-journey-page[data-build177="programs-catalog-category-freeze"].ux11-balanced {
    display:grid!important;
    grid-template-rows:auto auto auto auto!important;
    gap:var(--ux11-gap,13px)!important;
    height:auto!important;min-height:0!important;max-height:none!important;
    overflow:visible!important;align-content:start!important;
    margin:0!important;padding:0!important;
  }
  html body .pv3-root[data-r18-standard-shell="today-authority-v1"]
  .pv3-programs-page.pv3-programs-journey-page[data-build177="programs-catalog-category-freeze"].ux11-balanced
  .pv3-program-journey-layout-final {
    height:var(--ux11-lead)!important;
    min-height:var(--ux11-lead)!important;
    max-height:var(--ux11-lead)!important;
    gap:16px!important;align-items:stretch!important;
  }
  html body .pv3-root[data-r18-standard-shell="today-authority-v1"]
  .pv3-programs-page.pv3-programs-journey-page[data-build177="programs-catalog-category-freeze"].ux11-balanced
  :is(.pv3-program-journey-hero-final,.pv3-program-next-programs-two) {
    height:100%!important;min-height:0!important;max-height:100%!important;
    box-sizing:border-box!important;
  }
  html body .pv3-root[data-r18-standard-shell="today-authority-v1"]
  .pv3-programs-page.pv3-programs-journey-page[data-build177="programs-catalog-category-freeze"].ux11-balanced
  .pv3-program-catalog-simple {
    height:auto!important;min-height:0!important;
    gap:14px!important;align-items:stretch!important;
  }
  html body .pv3-root[data-r18-standard-shell="today-authority-v1"]
  .pv3-programs-page.pv3-programs-journey-page[data-build177="programs-catalog-category-freeze"].ux11-balanced
  .pv3-program-catalog-simple > .pv3-program-vertical-card {
    height:var(--ux11-card)!important;
    min-height:var(--ux11-card)!important;
    max-height:var(--ux11-card)!important;
    grid-template-rows:minmax(0,59%) minmax(0,41%)!important;
    box-sizing:border-box!important;
  }
  html body .pv3-root[data-r18-standard-shell="today-authority-v1"]
  .pv3-programs-page.pv3-programs-journey-page[data-build177="programs-catalog-category-freeze"].ux11-balanced
  .pv3-program-vertical-head-final {
    height:auto!important;min-height:40px!important;
  }
  html body .pv3-root[data-r18-standard-shell="today-authority-v1"]
  .pv3-programs-page.pv3-programs-journey-page[data-build177="programs-catalog-category-freeze"].ux11-balanced
  .pv3-w2-program-pager {
    height:auto!important;min-height:32px!important;
    padding:0!important;
  }
  html body .pv3-root[data-r18-standard-shell="today-authority-v1"]
  > .r18-page-scroll-owner.ux11-fit-viewport:has(> .r18-page-scroll-content > .pv3-programs-journey-page.ux11-balanced) {
    overflow-y:hidden!important;overflow-x:hidden!important;
  }
}
