/* リセット CSS */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: sans-serif;
  color: #333;
  background-color: #f8f9fa;
  min-height: 100vh;
  display: grid;
  grid-template-rows: 10vh 1fr 10vh;
  grid-template-columns: 100%;
}

/* ヘッダー */
.site-header {
  background-color: #2c3e50;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  position: relative;
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  background-color: #e74c3c;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.9rem;
}

.site-title {
  font-size: 1.2rem;
  font-weight: bold;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.btn-logout {
  color: #fff;
  text-decoration: none;
  background-color: #34495e;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.btn-logout:hover {
  background-color: #4e6d8c;
}

/* ハンバーガーボタン (PC表示では非表示) */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger-btn span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ハンバーガーボタン (開いたときのX印アニメーション) */
.hamburger-btn.is-active span:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);
}
.hamburger-btn.is-active span:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.is-active span:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
}

/* レイアウト（サイドバー + メインコンテンツ） */
.container {
  display: flex;
  width: 100%;
  min-height: 100%;
  position: relative;
}

/* サイドバー (PC表示) */
.site-sidebar {
  width: 15%;
  background-color: #ecf0f1;
  border-right: 1px solid #ddd;
  padding: 20px 10px;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 10px;
}

.sidebar-nav a {
  display: block;
  padding: 10px;
  color: #2c3e50;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.sidebar-nav a:hover {
  background-color: #bdc3c7;
}

/* メインコンテンツ */
.site-main {
  width: 85%;
  padding: 30px;
  background-color: #fff;
}

/* フッター */
.site-footer {
  background-color: #2c3e50;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.9rem;
}

/* ==========================================
   レスポンシブ対応 (画面幅768px以下)
========================================== */
@media (max-width: 768px) {
  body {
    grid-template-rows: auto 1fr auto;
  }

  .site-header {
    padding: 15px;
  }

  /* ハンバーガーボタンを表示 */
  .hamburger-btn {
    display: flex;
  }

  .container {
    display: block;
  }

  /* スマホ時のサイドバー：初期状態は画面外へ格納 */
  .site-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background-color: #ecf0f1;
    padding: 80px 20px 20px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    z-index: 90;
  }

  /* メニューオープン時 */
  .site-sidebar.is-open {
    right: 0;
  }

  .sidebar-nav li {
    margin-bottom: 15px;
  }

  .sidebar-nav a {
    background-color: #fff;
    border: 1px solid #bdc3c7;
  }

  .site-main {
    width: 100%;
    padding: 20px 15px;
  }

  .site-footer {
    padding: 15px 0;
  }
}