/* ===== スマホ用 共通レイアウト =====
   PC(951px以上)では何も効かないので、PCの見た目はそのまま */
@media screen and (max-width:950px){
  html{-webkit-text-size-adjust:100%}
  body{background-size:auto 300px}
  #wrapper{width:auto}
  #header img{margin-top:20px}
  #container{margin-top:10px;background:none}

  /* 左メニュー → 上に横並び */
  #left{width:auto;float:none;margin-top:0 !important}
  #left ul{display:flex;flex-wrap:wrap;justify-content:center;margin:0 10px;padding:5px 0 15px;border-bottom:1px dotted #d3d3d3}
  #left li{margin:10px 8px 0;padding-left:18px;font-size:14px;line-height:150%}
  #left #to_top_page{display:none}
  #left #to_page_top{position:fixed;left:auto;right:0;top:auto !important;bottom:20px;z-index:10;opacity:.8}

  /* 本文 */
  #right{width:auto;float:none;border-left:none}
  #right #content_header{height:auto;padding-bottom:10px}
  #right #content_header #jan,#right #content_header #eng{margin-left:10px}
  #right #content_header #jan{margin-top:15px}

  #footer{height:auto;background-size:auto 100%;text-align:center}
  #footer p{padding:20px 10px;font-size:11px}
}

/* ===== スマホ用 本文の共通部品（診療案内・教室員募集・リンクなど） ===== */
@media screen and (max-width:950px){
  #right img{max-width:100%;height:auto}
  #right .section{margin:30px 10px 0}
  #right .section p{margin-left:0.5em}
  #right #last{margin-bottom:60px}
  .link_with_arrow a{margin-left:0.5em}
}

/* ===== スマホ用 ハンバーガーメニュー ===== */
#sp_menu_btn,#sp_menu_overlay{display:none}
@media screen and (max-width:950px){
  /* ボタン：スクロールしても常に右上 */
  #sp_menu_btn{display:block;position:fixed;top:14px;right:12px;width:44px;height:44px;padding:0;border:none;border-radius:6px;background:#4169e1;box-shadow:0 2px 6px rgba(0,0,0,.25);cursor:pointer;z-index:1002}
  #sp_menu_btn span{display:block;position:absolute;left:11px;width:22px;height:2px;background:#fff;transition:transform .2s,opacity .2s}
  #sp_menu_btn span:nth-child(1){top:14px}
  #sp_menu_btn span:nth-child(2){top:21px}
  #sp_menu_btn span:nth-child(3){top:28px}
  #sp_menu_btn.open span:nth-child(1){transform:translateY(7px) rotate(45deg)}
  #sp_menu_btn.open span:nth-child(2){opacity:0}
  #sp_menu_btn.open span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

  /* 背景のグレーのレイヤー（向こうのページが透けて見える） */
  #sp_menu_overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.45);z-index:1000}
  #sp_menu_overlay.open{display:block}
  body.sp_menu_open{overflow:hidden}

  /* メニュー本体：モーダルとして表示 */
  #left ul{display:none;position:fixed;top:70px;left:16px;right:16px;max-height:calc(100vh - 100px);overflow-y:auto;margin:0;padding:0;border:none;border-radius:8px;background:#fff;box-shadow:0 6px 24px rgba(0,0,0,.3);z-index:1001}
  #left.open ul{display:block}
  #left li{margin:0;padding:0;background:none;font-size:15px}
  #left li:not(:first-child){border-top:1px dotted #d3d3d3}
  #left li a,#left li#here{display:block;padding:14px 14px 14px 40px;background:url(../images/gray_ring.png) no-repeat 16px center}
  #left li#here{background-image:url(../images/blue_ring.png)}
}
