@charset "utf-8";

/* ==========================================================================
   モバイル用（768px以下）の設定
   ========================================================================== */
@media only screen and (max-width: 768px) {
  
  /* 1. ヘッダー追従の設定（最前面に固定） */
  #header {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10001 !important; /* メニューより上に配置 */
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  }

  /* ヘッダーが浮いた分の余白確保 */
  body {
    padding-top: 80px !important;
  }

  #header_top {
    width: 100% !important;
    padding: 10px 15px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    position: relative;
    z-index: 10002; /* ボタンを確実に押せるように */
  }

  /* ロゴのサイズ調整 */
  #header_top .logo img {
    width: auto !important;
    max-width: 200px !important;
    height: auto !important;
  }

  /* 2. ハンバーガーボタンのデザイン */
  #nav_toggle {
    display: block !important;
    width: 30px;
    height: 24px;
    position: relative;
    cursor: pointer;
  }

  #nav_toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #2854b5;
    position: absolute;
    left: 0;
    transition: all 0.3s ease-in-out;
    border-radius: 2px;
  }

  #nav_toggle span:nth-child(1) { top: 0; }
  #nav_toggle span:nth-child(2) { top: 10px; }
  #nav_toggle span:nth-child(3) { top: 20px; }

  #nav_toggle.active span:nth-child(1) { transform: translateY(10px) rotate(-45deg); }
  #nav_toggle.active span:nth-child(2) { opacity: 0; }
  #nav_toggle.active span:nth-child(3) { transform: translateY(-10px) rotate(45deg); }

  /* 3. ナビゲーションメニュー（ヘッダーの下に配置） */
  #globalnavi {
    display: none;
    position: fixed !important;
    top: 80px; /* ヘッダーの高さ分下げる */
    left: 0;
    width: 100%;
    height: calc(100vh - 80px);
    background: #fff;
    z-index: 10000 !important;
    overflow-y: auto;
    padding-bottom: 40px;
  }

  #globalnavi ul {
    width: 100% !important;
    flex-direction: column !important;
    padding: 0 !important;
  }

  #globalnavi li {
    width: 100% !important;
    height: auto !important;
    border-bottom: 1px solid #eee;
  }

  #globalnavi li a {
    padding: 20px !important;
    display: flex !important;
    justify-content: center;
  }

  /* 4. サイドバー・コンテンツの1カラム化 */
  #contents {
    flex-direction: column !important;
    width: 100% !important;
    padding: 15px !important;
  }

  #main, #sidebar {
    width: 100% !important;
  }

  aside#sidebar {
    display: none !important; /* PC用サイドバーは非表示 */
  }

  #sp_sidebar_content {
    display: block !important;
    padding: 20px;
    background-color: #f4f3ed;
  }

  /* 5. テーブルのスマホ最適化 */
  .table_basic, .table_event {
    display: block !important;
    width: 100% !important;
  }
  .table_basic tr, .table_basic th, .table_basic td {
    display: block !important;
    width: 100% !important;
  }
  .table_basic th {
    background-color: #eef2fa !important;
    border-bottom: none !important;
  }
}

@media only screen and (min-width: 769px) {
  #nav_toggle, #sp_sidebar_content {
    display: none !important;
  }
}

/* assets/css/responsive.css の @media only screen and (max-width: 768px) 内に追記 */

@media only screen and (max-width: 768px) {
  /* 画像の横幅を100%にして横スクロールを防止 */
  #access_floor img.zoom-img {
    width: 100% !important;
    height: auto !important;
    cursor: zoom-in;
    margin-bottom: 10px;
  }

  /* 2枚並びの画像を縦に並べる */
  #access_floor .floor_02 {
    flex-direction: column !important;
    align-items: center;
  }
}

/* ズーム用モーダルのスタイル（全画面共通） */
.modal {
  display: none;
  position: fixed;
  z-index: 20000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
  overflow: auto;
}
.modal-content {
  margin: auto;
  display: block;
  width: 90%;
  max-width: 1000px;
  padding: 40px 0;
}
.modal-close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}