/* CENC Royale v000043 — authored participant media edge-to-edge polish
   Scope: real 2:3 artwork for ENTITY participants only.
   Legacy participants, fallbacks and premium-frame media keep their prior behavior. */

/* Authored 1024x1536 artwork is already final/composed. It must never inherit
   the legacy premium-frame safe area, inset, background or contain behavior. */
.entry-media.is-authored-2x3,
.profile-photo.is-authored-2x3,
.checkout-avatar.is-authored-2x3{
  position:relative;
  padding:0!important;
  margin-right:0;
  background:transparent!important;
  background-image:none!important;
  overflow:hidden;
  isolation:isolate;
  box-sizing:border-box;
}

.entry-media.is-authored-2x3,
.profile-photo.is-authored-2x3{
  aspect-ratio:2/3!important;
}

/* Defensive reset: even if a stale markup/class combination reaches the browser,
   authored 2:3 media still fills the slot and the legacy overlay stays hidden. */
.entry-media.is-authored-2x3>img:not(.royale-participant-frame),
.profile-photo.is-authored-2x3>img:not(.royale-participant-frame),
.checkout-avatar.is-authored-2x3>img:not(.royale-participant-frame),
.entry-media.has-premium-frame.is-authored-2x3>img:not(.royale-participant-frame),
.profile-photo.has-premium-frame.is-authored-2x3>img:not(.royale-participant-frame),
.checkout-avatar.has-premium-frame.is-authored-2x3>img:not(.royale-participant-frame){
  position:absolute!important;
  inset:0!important;
  left:0!important;
  right:0!important;
  top:0!important;
  bottom:0!important;
  width:100%!important;
  max-width:none!important;
  height:100%!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  object-fit:cover!important;
  object-position:50% 50%!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  transform:none!important;
}

.entry-media.is-authored-2x3 .royale-participant-frame,
.profile-photo.is-authored-2x3 .royale-participant-frame,
.checkout-avatar.is-authored-2x3 .royale-participant-frame{
  display:none!important;
}

/* Category/gallery cards: media touches every side of the card's media area. */
.royale-participant-grid .entry-card .entry-media.is-authored-2x3{
  display:block!important;
  width:100%!important;
  min-width:100%!important;
  max-width:none!important;
  margin:0!important;
  border:0!important;
  border-radius:0!important;
}

/* Profile/voting page: keep the outer premium shape on larger screens while
   removing the obsolete inner safe-area/frame. */
.profile-photo.is-authored-2x3{
  display:block!important;
  width:100%;
  max-width:620px;
}

/* Checkout: compact 2:3 thumbnail with the exact same source crop semantics. */
.checkout-avatar.is-authored-2x3{
  display:block!important;
  width:96px!important;
  height:auto!important;
  aspect-ratio:2/3!important;
  padding:0!important;
}

@media(max-width:900px){
  .profile-photo.is-authored-2x3{
    max-width:620px;
  }
}

@media(max-width:760px){
  /* Mobile gallery: no purple inset, no frame safe area and no centering box. */
  .entry-grid.royale-participant-grid .entry-card{
    overflow:hidden;
  }
  .entry-grid.royale-participant-grid .entry-media.is-authored-2x3{
    display:block!important;
    width:100%!important;
    min-width:100%!important;
    max-width:100%!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
  }

  /* The profile already intentionally bleeds beyond the narrow content gutter.
     Preserve that layout and make the authored image itself fill the bleed. */
  .profile-photo.is-authored-2x3{
    width:calc(100% + 32px)!important;
    max-width:none!important;
    margin-left:-16px!important;
    margin-right:-16px!important;
    padding:0!important;
    border-left:0!important;
    border-right:0!important;
    border-radius:0!important;
    background:transparent!important;
  }

  .checkout-avatar.is-authored-2x3{
    width:88px!important;
    height:auto!important;
    aspect-ratio:2/3!important;
    padding:0!important;
  }
}

@media(max-width:430px){
  .entry-grid.royale-participant-grid .entry-media.is-authored-2x3,
  .profile-photo.is-authored-2x3{
    background:transparent!important;
  }
}
