/* the phone rules of views/partials/topbar.ejs (they used to be @media blocks inside the page's own <style>); sent only to m.<domain> (src/middleware/mobileSite.js) */
@media (max-width:768px){
  .fb-topbar{display:flex!important;align-items:center;justify-content:space-between;padding:0 10px;gap:8px;transition:transform .25s ease}
  .fb-topbar--scroll-hidden{transform:translateY(-100%)}
  .fb-topbar__left{display:flex;align-items:center;flex:none;gap:8px}
  .fb-topbar-logo__badge{display:none!important}
  .fb-topbar-logo__word{display:inline!important}
  #mob-more-btn{display:flex!important}
  .fb-topbar__center{display:none!important}
  .fb-topbar__right{display:flex;align-items:center;gap:12px;flex:none}
  /* ค้นหา: ไอคอนฝั่งขวา แบบ Facebook แทนช่อง input ฝั่งซ้าย */
  .fb-topbar-search{display:none!important}
  .mobile-search-open{display:flex!important}
  .fb-panel{left:8px!important;right:8px!important;width:auto!important;max-height:75vh}
  #waffle-btn{display:none!important}
  /* Notifications + profile moved down to the bottom nav (Facebook-style) — hide the top-bar copies */
  #notif-btn{display:none!important}
  #avatar-menu-btn{display:none!important}

  /* bottom nav */
  #mob-bottom-nav{
    display:flex!important;
    position:fixed;bottom:0;left:0;right:0;
    height:calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom:env(safe-area-inset-bottom, 0px);
    background:color-mix(in srgb,var(--bg) 88%,transparent);
    backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
    border-top:1px solid var(--border);
    box-shadow:0 -2px 20px rgba(0,0,0,.18);
    z-index:9999;
    align-items:stretch;
    padding-left:4px;padding-right:4px;
    box-sizing:border-box;
    transition:transform .25s ease;
  }
  #mob-bottom-nav.fb-bottomnav--scroll-hidden{transform:translateY(100%)}
  body{ padding-bottom:calc(60px + env(safe-area-inset-bottom, 0px)); }
  /* push page content above bottom nav */

  /* lock the page behind the More drawer — only the drawer itself scrolls */
  body.mob-scroll-lock{ overflow:hidden; position:fixed; width:100%; }
}
@media (max-width:480px){
  .fb-topbar{padding:0 6px}
  .fb-topbar-icon-btn{width:32px;height:32px}
  .fb-topbar-icon-btn svg{width:18px;height:18px}
  .fb-topbar-avatar{width:32px;height:32px;border-width:1.5px}
  .fb-topbar-btn{padding:0 10px;font-size:12px;height:32px}
}
