/* osf-touch.css -- shared phone / tablet / iPhone fixes for every admin page
   (loaded from theme_style_tag()) and the public site (osf-site.php).
   Selectors carry :not(#_) so they win over each page's own rules without
   having to load last. Goes with osf-touch.js. */

/* A wide table scrolls sideways inside its card instead of pushing the whole
   page sideways (osf-touch.js adds .osf-xt only to tables that overflow). */
html body table.osf-xt:not(#_){display:block!important;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}

/* iPhone / iPad Safari zooms the whole page in whenever a focused field's
   text is under 16px. Some pages set 12-14px with higher specificity than
   mobile.css, so this one is stronger. iOS only (other phones don't zoom). */
@supports (-webkit-touch-callout:none){
  @media (max-width:1180px){
    html body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=submit]):not([type=button]):not([type=image]):not(#_),
    html body select:not(#_), html body textarea:not(#_){font-size:16px!important}
  }
}

/* Touch devices: blur behind a bar that stays on screen while the page moves
   is re-drawn on every frame -- the main cause of "sticky" scrolling on phones.
   osf-touch.js gives such bars a solid background and adds .osf-noblur. */
html.osf-touch .osf-noblur{-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
/* decorative looping animations that are off screen don't need to run */
.osf-paused,.osf-paused::before,.osf-paused::after{animation-play-state:paused!important}

/* ---------- page fixes found by the phone/tablet audit ---------- */
/* Print Center: the print buttons wrap instead of running off the screen */
html body .kc h2 > .r:not(#_){flex-wrap:wrap;min-width:0;max-width:100%}
/* Pages / Posts: the stat cards share the row instead of one card being 340px wide */
html body .ca-stats:not(#_){grid-template-columns:repeat(4,minmax(0,1fr))}
html body .ca-stat:not(#_), html body .ca-stat > div{min-width:0}
html body .ca-stat span, html body .ca-stat b:not(#_){overflow-wrap:anywhere;word-break:break-word}
@media (max-width:1100px){ html body .ca-stats > .ca-stat:nth-child(4) b:not(#_){font-size:15px;line-height:1.25} }
@media (max-width:760px){ html body .ca-stats:not(#_){grid-template-columns:repeat(2,minmax(0,1fr))} }
/* Sticker Designer: the panels under the preview fit the phone */
@media (max-width:760px){
  html body .belowc:not(#_){grid-template-columns:minmax(0,1fr)}
  html body .belowc > .panel:not(#_){min-width:0}
  html body .belowc select, html body .belowc input:not([type=checkbox]){max-width:100%;min-width:0}
}
/* Inbox on tablets: the three channel cards share the row */
@media (min-width:761px) and (max-width:1100px){
  html body .chanx-row:not(#_){grid-template-columns:repeat(3,minmax(0,1fr))}
  html body .chanx-row .chan-card:not(#_){min-width:0;max-width:none}
}
