@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
  --base-bg: #f3f6fb;
  --surface: #ffffff;
  --text: #32404a;
  --muted: #6f7f8a;
  --line: #dfe7ee;
  --accent: #1f6fb6;
  --accent-strong: #159957;
  --shadow: 0 18px 40px rgba(39, 73, 102, 0.12);
}

html,
body {
  background:
    radial-gradient(circle at 8% 4%, rgba(31, 111, 182, 0.12), transparent 36%),
    radial-gradient(circle at 92% 14%, rgba(21, 153, 87, 0.12), transparent 38%),
    var(--base-bg);
}

body {
  color: var(--text);
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
}

/* ヘッダーは維持し、本文だけをカード化 */
.main-content > .main-content {
  margin: 0 auto 2.5rem;
  background: var(--surface);
  border-radius: 0;
  box-shadow: var(--shadow);
  border: 1px solid rgba(31, 111, 182, 0.08);
  position: relative;
  z-index: 2;
}

.main-content > .main-content > *:not(.site-footer) {
  animation: rise-fade 0.55s ease both;
}

@keyframes rise-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.main-content > .main-content h1,
.main-content > .main-content h2,
.main-content > .main-content h3,
.main-content > .main-content h4,
.main-content > .main-content h5,
.main-content > .main-content h6 {
  color: #1d8a64;
  letter-spacing: 0.01em;
}

.main-content > .main-content h2 {
  margin-top: 2.8rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid #e6eef4;
}

.main-content > .main-content h3 {
  border-left: 4px solid rgba(31, 111, 182, 0.85);
  padding-left: 0.7rem;
}

.main-content p,
.main-content li,
.main-content td,
.main-content th {
  line-height: 1.85;
}

.main-content a {
  color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

.main-content hr {
  height: 1px;
  background: linear-gradient(to right, transparent, #d5e0ea 22%, #d5e0ea 78%, transparent);
}

/* 目次の最初のリストを読みやすいカードに */
.main-content h2 + ul {
  margin-top: 0.9rem;
  padding: 1rem 1.2rem;
  background: #f7fbff;
  border: 1px solid #d8e8f7;
  border-radius: 12px;
}

.main-content h2 + ul > li {
  margin-bottom: 0.4rem;
}

.main-content table {
  border-radius: 12px;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
}

.main-content table th {
  background: #edf5fc;
  color: #2a4f71;
  font-weight: 700;
}

.main-content table th,
.main-content table td {
  border: 0;
  border-bottom: 1px solid var(--line);
}

.main-content table tr:last-child td {
  border-bottom: 0;
}

.main-content blockquote {
  background: #f8fbfd;
  border-left: 4px solid rgba(21, 153, 87, 0.5);
  border-radius: 8px;
  padding: 0.7rem 1rem;
}

/* 基本情報テーブルの幅を制限 */
h2#基本情報 + table {
  display: table !important;
  width: auto !important;
  max-width: 50% !important;
  min-width: 320px;
}

.site-footer {
  color: var(--muted);
}

/* セクションインジケーター */
.section-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: rgba(21, 87, 153, 0.92);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 1.2rem;
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}

@media screen and (min-width: 769px) {
  .section-indicator {
    left: 260px;
  }
}

.page-header .project-name,
.page-header .project-tagline {
  color: #ffffff;
}

/* ハンバーガーメニューボタン */
.hamburger-menu {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  background: #159957;
  background: linear-gradient(120deg, #155799, #159957);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 8px;
  cursor: pointer;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.hamburger-menu:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hamburger-menu span {
  display: block;
  width: 26px;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* サイドバーナビゲーション */
.sidebar-nav {
  position: fixed;
  top: 0;
  right: -350px;
  width: 320px;
  height: 100vh;
  background: #ffffff;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  z-index: 1002;
  overflow-y: auto;
  transition: right 0.3s ease;
  padding: 20px;
}

.sidebar-nav.active {
  right: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #159957;
}

.sidebar-header h3 {
  margin: 0;
  color: var(--accent-strong);
  font-size: 1.5rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #606c71;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.close-btn:hover {
  color: #159957;
}

/* ナビゲーションリスト */
.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-list > li {
  margin-bottom: 8px;
}

.nav-list a {
  display: block;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.nav-list a:hover {
  background: #eef5fb;
  color: var(--accent-strong);
  padding-left: 16px;
}

.nav-list ul {
  list-style: none;
  padding-left: 20px;
  margin-top: 5px;
}

.nav-list ul li {
  margin-bottom: 4px;
}

.nav-list ul a {
  font-size: 0.85rem;
  color: var(--muted);
}

.nav-list ul a:hover {
  color: var(--accent-strong);
}

/* オーバーレイ */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* メインコンテンツの調整 */
.main-content {
  position: relative;
}

/* スクロールバーのスタイル（Webkit系ブラウザ） */
.sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: #159957;
  border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: #155799;
}

/* タブレット・PC: 左サイドバー常時表示 */
@media screen and (min-width: 769px) {
  .hamburger-menu {
    display: none;
  }

  .overlay {
    display: none !important;
  }

  .close-btn {
    display: none;
  }

  .sidebar-nav {
    position: fixed;
    left: 0;
    right: auto;
    top: 0;
    width: 260px;
    height: 100vh;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
    border-right: 1px solid var(--line);
  }

  /* ヘッダー・メインをサイドバー分右にずらす */
  .main-content {
    margin-left: 260px;
    max-width: 100%;
    padding: 0 !important;
  }

  /* テーマのmax-width/margin: autoを解除して全幅に */
  main.main-content {
    max-width: 100%;
    margin: 0;
    padding: 2rem 2rem 2rem 3rem !important;
  }
}

/* スマホ: ハンバーガーメニュー */
@media screen and (max-width: 768px) {
  .main-content > .main-content {
    margin-top: 0;
    border-radius: 0;
  }

  .sidebar-nav {
    width: 80%;
    right: -80%;
  }

  .hamburger-menu {
    width: 45px;
    height: 45px;
  }

  .hamburger-menu span {
    width: 22px;
  }
}

@media screen and (max-width: 480px) {
  .main-content > .main-content {
    margin-top: 0;
    border-radius: 0;
  }

  .main-content h2 {
    font-size: 1.35rem;
  }

  .sidebar-nav {
    width: 90%;
    right: -90%;
  }
}
