/* mobile.css — تجربة الجوال: شريط تنقّل سفلي، رؤوس مضغوطة، وضع تركيز في الاختبار، لمس أوضح.
   كل ما هنا لا يؤثر على الكمبيوتر إلا القواعد العامة القليلة في الأعلى. */

/* ---------- general (all sizes) ---------- */
.g-tab .gs{display:none}
html{-webkit-tap-highlight-color:transparent}
button,a,.opt,.jy-node,[role="button"]{touch-action:manipulation}
.m-nav,.m-install{display:none}

/* ---------- touch devices: no hover lifts, clear press feedback ---------- */
@media (hover:none){
  .door:hover,.unit:hover,.jy-banner:hover,.tb-ic:hover,.jy-w:hover,.btn:hover{transform:none}
  .opt:hover:not(:disabled){transform:none;border-color:var(--line-2)}
  .btn:active,.btn-ghost:active,.opt:active:not(:disabled),.jy-opt:active:not(:disabled),.unit:active,.door:active,.g-tab:active,.jy-chip:active,.jy-w:active,.m-nav button:active,.tb-ic:active{transform:scale(.97)}
  .btn,.btn-ghost,.opt,.jy-opt,.unit,.door,.g-tab,.jy-chip,.jy-w,.tb-ic{transition:transform .12s ease,background .2s,border-color .2s,color .2s}
}

/* ---------- phones & small tablets ---------- */
@media (max-width:760px){
  /* bottom navigation */
  .m-nav{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;inset-inline:0;bottom:0;z-index:45;
    padding:6px 6px calc(6px + env(safe-area-inset-bottom,0px));
    background:color-mix(in srgb,var(--bg-2) 92%,transparent);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
    border-top:1px solid var(--line);transition:transform .3s var(--ease)}
  .m-nav button{border:0;background:transparent;color:var(--text-3);font:inherit;font-size:11.5px;font-weight:500;display:flex;flex-direction:column;align-items:center;gap:3px;
    padding:6px 2px;border-radius:14px;cursor:pointer;min-height:52px;position:relative}
  .m-nav svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
  .m-nav button[aria-current="page"]{color:var(--gold)}
  .m-nav button[aria-current="page"]::before{content:"";position:absolute;top:0;width:28px;height:3px;border-radius:0 0 3px 3px;background:var(--gold)}
  body.m-focus .m-nav,body.m-kbd .m-nav,body:has(.modal:not([hidden])) .m-nav,body:has(.m-sheet) .m-nav{transform:translateY(110%)}
  main{padding-bottom:calc(96px + env(safe-area-inset-bottom,0px))}
  body:not(.m-focus) footer{padding-bottom:calc(92px + env(safe-area-inset-bottom,0px))}
  .jy-toast{bottom:calc(88px + env(safe-area-inset-bottom,0px))}

  /* top bar hides while scrolling down, comes back when scrolling up */
  .topbar{transition:transform .3s var(--ease)}
  body.tb-hide .topbar{transform:translateY(-100%)}
  .topbar{min-height:58px;gap:10px}
  .burger{width:42px;height:42px;border-radius:12px}
  .brand{font-size:19px}.brand svg{width:32px;height:32px}

  /* compact page headers */
  main{padding-top:18px;padding-inline:14px}
  .page-head{grid-template-columns:1fr;gap:4px;margin-bottom:18px}
  .page-head .glyph{display:none}
  .page-head h2{font-size:27px}
  .page-head .lead{font-size:14.5px;line-height:1.8;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;cursor:pointer}
  .page-head .lead.open{-webkit-line-clamp:unset;display:block}

  /* grade tabs: short names, full width, scrollable */
  .g-tab .gl{display:none}.g-tab .gs{display:inline}
  .grade-tabs{width:100%;justify-content:flex-start}
  .g-tab{flex:1 0 auto;padding:9px 10px;font-size:13.5px}

  /* readable, tappable controls; 16px inputs stop iOS from zooming */
  input,textarea,select{font-size:16px!important}
  .btn{min-height:44px;padding:10px 20px}
  .btn-ghost{min-height:40px}
  .opt{padding:14px 16px;font-size:19px;min-height:54px}
  .jy-opt{min-height:52px}
  .unit{padding:16px 16px 18px}
  .panel{border-radius:20px}

  /* quiz focus mode: the header and bottom bar step aside while answering */
  body.m-focus .page:not([hidden]) > .page-head{display:none}
  body.m-focus main{padding-top:10px}
  .q-top{gap:8px;margin-bottom:8px}
  .q-meta{gap:10px}
  .timer-wrap{width:50px;height:50px}

  /* journey + videos */
  .jy-map-wrap{border-radius:22px;border-width:2px}
  .jy-card{padding:18px}
  .jy-lhead .btn-ghost{min-height:38px}
  .vd-body h3{font-size:18px}

  /* install button inside the drawer */
  .m-install{display:flex;align-items:center;gap:12px;width:100%;border:1px dashed var(--line-2);background:transparent;border-radius:14px;padding:11px 14px;margin-top:8px;
    font:inherit;font-size:15px;color:var(--gold);cursor:pointer;text-align:start}
  .m-install svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}
  .m-sheet{position:fixed;inset-inline:0;bottom:0;z-index:90;background:var(--bg-2);border-top:1px solid var(--line-2);border-radius:24px 24px 0 0;
    padding:22px 20px calc(22px + env(safe-area-inset-bottom,0px));box-shadow:0 -20px 50px -20px rgba(0,0,0,.6);animation:mSheet .35s var(--ease) both}
  .m-sheet h3{margin:0 0 8px;font-family:var(--f-display);font-size:21px}
  .m-sheet ol{margin:0 0 14px;padding-inline-start:22px;color:var(--text-2);line-height:2}
  .m-sheet .btn{width:100%}
  @keyframes mSheet{from{transform:translateY(100%)}to{transform:none}}

  /* drawer: drag to close */
  .drawer.dragging{transition:none}
}
@media (max-width:380px){
  .m-nav button{font-size:10.5px}
  .page-head h2{font-size:24px}
  .opt{font-size:18px}
}

/* ===== تعديلات الجوال (٢) ===== */
@media (max-width:760px){
  /* the bottom bar has «القائمة», so the top burger goes away */
  .burger{display:none}
  .topbar{padding-inline:16px}

  /* pop-up sheets (signs example + positions) slide up from the bottom */
  .modal{align-items:flex-end;padding:0}
  .modal-card{width:100%;max-height:82vh;border-radius:26px 26px 0 0;padding:22px 20px calc(24px + env(safe-area-inset-bottom,0px));animation:mSheet .35s var(--ease) both}
  .modal-card::before{content:"";display:block;width:44px;height:5px;border-radius:5px;background:var(--line-2);margin:-8px auto 14px}
  .modal-card h3{font-size:28px}
  .modal-card .ex{font-size:24px}
  .modal-card .x{position:relative;z-index:2}
  .modal-card .sg-detail{clear:both;padding:0;position:static;min-height:0;background:none;border:0;box-shadow:none}
  .modal-card .sg-detail .big{font-size:32px}
  .modal-card .sg-detail .ex{font-size:24px}
  /* the side panel is replaced by the pop-up on phones */
  #signs .sg-detail{display:none}

  /* positions: one tidy list, tap a group to open it */
  .tree-root,.tree-bar{display:none}
  .tree{grid-template-columns:1fr;gap:10px;margin-top:14px}
  .branch{gap:6px}
  .branch h3{scroll-margin-top:72px}
  .branch h3{display:flex;align-items:center;gap:10px;text-align:start;padding:14px 16px;margin:0;cursor:pointer;font-size:19px}
  .branch h3 small{display:inline;margin-inline-start:auto;font-size:12px}
  .branch h3::after{content:"";width:9px;height:9px;flex:none;border-inline-end:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin-top:-4px;transition:transform .3s var(--ease);opacity:.7}
  .branch.open h3::after{transform:rotate(-135deg);margin-top:4px}
  .branch .node{display:none;padding:12px 14px;font-size:16px}
  .branch.open .node{display:block;animation:fadeUp .3s var(--ease) both}
  .tree.searching .branch .node.match{display:block}
  .tree.searching .branch .node.dim{display:none}
}
