/* 変数定義（色などを一括管理） */
:root {
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-main: #333333;
  --text-sub: #666666;
  --accent: #4a90e2;
  --border: #e0e0e0;
}

/* 全体の基本設定 */
html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh; /* 画面の高さ100%を最低限確保 */
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family:
    "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans",
    Meiryo, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
}

/* ヘッダー */
header {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 100;
}

.logo a {
  display: flex;
  align-items: center;
  color: var(--text-main);
  font-size: 1.25rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.logo a .site-icon {
  height: 1.25em; /* 親のfont-sizeに合わせる */
  width: auto;
  margin-right: 8px;
  vertical-align: middle;
}

/* ロゴリンクの訪問済み・アクティブ時も色を変えない */
.logo a:visited,
.logo a:active {
  color: var(--text-main);
  text-decoration: none;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

nav a {
  text-decoration: none;
  color: #808080;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s;
}

nav a:hover {
  color: var(--accent);
}

/* ハンバーガーメニュー（スマホ表示時のみ使用） */
.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 101;
}

.nav-toggle-label span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 画面幅が狭い時、ナビをスライドメニュー化してハンバーガーボタンで開閉する */
@media (max-width: 700px) {
  header {
    padding: 1rem 1.2rem;
  }

  .nav-toggle-label {
    display: flex;
  }

  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: calc(100vh - 100%);
    overflow-y: auto;
    background-color: var(--card-bg);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1);
    padding: 1rem 1.2rem 1.5rem;
    box-sizing: border-box;
  }

  nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
  }

  nav a {
    font-size: 1rem;
    color: var(--text-main);
  }

  .nav-toggle:checked ~ nav {
    display: block;
  }

  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

/* メインコンテンツ */
main {
  flex: 1;
  width: 100%;
  max-width: 95%;
  margin: 0 auto;
  padding: 80px 1.5rem 1rem; /* ヘッダーの高さに合わせて調整 */
  box-sizing: border-box;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/* カードデザイン */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.card .icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.card h2 {
  margin: 0 0 1rem 0;
  font-size: 1.4rem;
}

.card p {
  color: var(--text-sub);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  flex-grow: 1;
}

/* ボタン */
.btn {
  display: inline-block;
  background-color: var(--accent);
  color: white;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.9rem;
  transition:
    background-color 0.3s,
    opacity 0.3s;
}

.btn:hover {
  opacity: 0.9;
  filter: brightness(1.1);
}

/* フッター */
footer {
  width: 100%;
  text-align: center;
  padding: 2rem;
  background-color: white;
  border-top: 1px solid var(--border);
  color: var(--text-sub);
  margin-top: auto; /* 念のための保険 */
}

footer a {
  color: #808080;
}

/* 共通コンテナ・レイアウト */
.page-container {
  display: flex;
  margin: 0 auto; /* 中央寄せ */
  padding: 10px 0; /* 左右の余白を調整 (schedule-mainで調整) */
  gap: 30px;
  width: 100%;
  box-sizing: border-box;
  align-items: flex-start;
  max-width: 1200px; /* 追加: 全体の最大幅を設定 */
}

/* メインコンテンツエリア */
.display-area {
  background: #f4f7f8;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  min-height: 500px;
  box-sizing: border-box;
  flex: 1;
  min-width: 0;
}

/* フォーム項目やトグル行の共通スタイル */
.control-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #ccc;
}

.control-item label {
  font-weight: bold;
  font-size: 0.85rem;
  color: #333;
}

/* ツールタイトル */
.tool-title {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 20px;
  border-left: 5px solid #e91e63;
  padding-left: 15px;
  line-height: 1.2;
}

/* 共通ボタン（マゼンタピンク） */
.main-btn, .main-copy-btn {
  width: 100%;
  background: #e91e63;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
  box-sizing: border-box;
}

.main-btn:hover, .main-copy-btn:hover {
  opacity: 0.9;
}

/* 更新履歴セクション */
.update-history {
  margin-top: 40px;
  padding: 20px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.update-history h3 {
  font-size: 1rem;
  color: #333;
  margin-bottom: 10px;
  border-bottom: 2px solid #e91e63;
  display: inline-block;
}

.history-container {
  max-height: 150px;
  overflow-y: auto;
  font-size: 0.85rem;
  color: #666;
}

.history-container ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.history-container li {
  padding: 4px 0;
  border-bottom: 1px dashed #eee;
}

.history-container li strong {
  color: #333;
  margin-right: 10px;
}

/* ツールタイトルエリア */
.tool-title-area {
  max-width: 100% !important;
  padding: 20px 40px 0;
}

.tool-title-area h1 {
  font-size: 1.2rem;
  color: #333;
  border-left: 4px solid #e91e63;
  padding-left: 10px;
}

/* 画面幅が狭い時（スマホ・タブレット等）の調整 */
@media (max-width: 900px) {
  .page-container {
    flex-direction: column;
    padding: 10px 15px;
    margin: 0 auto;
  }

  /* ツールタイトルが縦長に潰れるのを防ぐ */
  .tool-title {
    white-space: nowrap;
    font-size: 1.2rem;
  }

  /* サイドバーとメインコンテンツの調整 */
  .sidebar {
    width: 100% !important;
    position: static !important;
    margin-bottom: 20px;
  }

  .growth-main {
    width: 100%;
  }
}
