/* ===========================
   ベース
=========================== */
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  line-height: 1.7;
  background: #f9f9f9;
  color: #333;
}

.wrapper {
  display: flex;
  max-width: 1200px;
  margin: auto;
  padding: 20px;
}

/* ===========================
   ヘッダー
=========================== */
.site-header {
  background: #1855a8;
  color: white;
  padding: 15px;
}
.site-header .inner {
  max-width: 1200px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-title {
  color: #fff;
  text-decoration: none;
  font-size: 1.6rem;
  font-weight: bold;
}

.menu-button {
  font-size: 24px;
  cursor: pointer;
}

/* ヘッダーナビ（PC用） */
.site-nav a {
  color: #fff;
  margin-left: 15px;
  text-decoration: none;
}

/* ===========================
   サイドメニュー（PC）
=========================== */
.sidebar {
  width: 280px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
  height: fit-content;
}
.sidebar a {
  text-decoration: none;
  color: #333;
}
.sidebar h3 {
  margin-top: 0;
}
/*
.sidebar-desktop {
  width: 280px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
  height: fit-content;
}
*/
#mobile-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: #fff;
  padding: 20px;
  overflow-y: auto;
  box-shadow: -2px 0 5px rgba(0,0,0,0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  z-index: 1001;
}

#mobile-sidebar.open {
  transform: translateX(0);
}

/* ===========================
   メインコンテンツ
=========================== */
.date {
  color: #888;
  font-size: 0.9em;
}
.main-content {
  flex: 1;
  margin-left: 20px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

/* 目次 */
.post-nav-links {
  border: 1px solid #000000;
  background-color: #f5f5f5;
  margin-top: 2rem;
}
.post-nav-links h4 {
  font-weight: bold;
  text-align: center;
}

/* テーブルスクロール */
.scroll-table-wrapper {   
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1em;
  box-sizing: border-box; /* パディングを含めて幅計算 */
}
.scroll-table-wrapper table {
  border-collapse: collapse;
  min-width: 600px;  /* 横スクロールを発生させる */
}
.scroll-table-wrapper th,
.scroll-table-wrapper td {
  border: 1px solid #ccc;
  padding: 8px;
  white-space: nowrap;
}
.scroll-table-wrapper th {
  background: #f3f3f3; /* 見出し行の薄いグレー */
  font-weight: bold;
}
.wrapper,
.main-content {
  overflow-x: hidden;
}
/* flex 子がコンテンツ幅に引っ張られて親をはみ出すのを防ぐ */
.main-content {
  min-width: 0; /* ← 重要：flex子が縮むことを許可する */
}


/* ===========================
   フッター
=========================== */
.site-footer {
  background: #1855a8;
  color: #fff;
  text-align: center;
  padding: 15px;
  font-size: 14px;
}

@media (min-width:769px){
   #mobile-sidebar{
      display: none;
   }
   .menu-button {
      display: none;
   } 
   .sidebar-desktop{
      display: block;
   }
}

/* ===========================
   スマホ対応（max-width:768px）
=========================== */
@media (max-width: 768px) {
   #mobile-sidebar {
      display: block;
  }
  /* ヘッダー内のナビは非表示 */
  .site-nav {
    display: none;
  }
   .sidebar-desktop{
      display: none;
   }
   
  .sidebar .close-button {
    font-size: 24px;
    cursor: pointer;
    display: block;
    margin-bottom: 20px;
  }

  .sidebar a {
    display: block;
    margin-bottom: 15px;
    color: #333;
  }

  /* オーバーレイ */
  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
    z-index: 900;
  }

  .overlay.active {
    display: block;
  }

  /* メインコンテンツはマージンなしで広く表示 */
  .wrapper {
    flex-direction: column;
    padding: 10px;
  }

  .main-content {
    margin-left: 0;
    padding: 15px;
  }
}
