/* r-slides4 (4b9cfdc7). */
/* 1. Short sideways (landscape, height <= 500): ribbon panels wrap and scroll up/down inside the panel instead of sideways,
      so the transition gallery, the duration box and «معاينة» are never cut off. Galleries take a full row and wrap. */
@media (orientation:landscape) and (max-height:500px){
  :root #rpanel.rbody{flex-wrap:wrap;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;max-height:max(150px,calc(100dvh - 210px));align-content:flex-start;row-gap:6px;-webkit-mask-image:none;mask-image:none}
  :root #rpanel.rbody .rg:has(.fxgal,.thgal){flex:1 0 100%;max-width:100%;min-width:0}
  :root #rpanel.rbody :is(.fxgal,.thgal){flex-wrap:wrap;overflow:visible;max-width:100%;width:100%;justify-content:flex-start}
  :root #rpanel.rbody .rg:has(.fxgal,.thgal) :is(.rgi,.rgr){width:100%;max-width:100%}
}
/* 2. Phones (<= 760 px): the wrapped transition gallery grew the ribbon by several rows, pushing the slide over the thumbnails and
      the slide strip over the status-bar buttons. Keep the gallery to two rows that scroll up/down inside it. */
@media (max-width:760px){
  :root #rpanel .fxgal{max-height:140px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;align-content:flex-start}
  #ed #mainCol,#ed nav.ph2{min-height:0}
}
/* 3. While a slide show is open (#show is a full-screen opaque layer), the editor under it is hidden from view and from
      assistive tech, so nothing behind the show (e.g. «شريحة 1 من 1» in the status bar) is painted or reachable underneath. */
body:has(>#show:not([hidden])) :is(#ed,#home,aside.yoc){visibility:hidden!important}
