/* -------------------------------------------------------
 * コンテナ
 * ------------------------------------------------------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}
.container-sm { max-width: 640px; margin: 0 auto; padding: 0 var(--space-lg); }
.container-xs { max-width: 520px; margin: 0 auto; padding: 0 var(--space-lg); }

/* -------------------------------------------------------
 * グリッド
 * ------------------------------------------------------- */
.grid-2col { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
.grid-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.grid-4col { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); }

/* -------------------------------------------------------
 * Flex ユーティリティ
 * ------------------------------------------------------- */
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-start   { display: flex; align-items: center; justify-content: flex-start; gap: var(--space-md); }
.flex-wrap    { flex-wrap: wrap; }

/* -------------------------------------------------------
 * セクション
 * ------------------------------------------------------- */
.section {
  padding: 80px 0;
}
.section-sm { padding: 48px 0; }

.section-bg-page    { background: var(--color-bg-page); }
.section-bg-section { background: var(--color-bg-section); }
.section-bg-navy    { background: var(--color-navy); }

.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-title {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-md);
}
.section-title.on-dark { color: #fff; }

.section-desc {
  font-size: 16px;
  color: var(--color-text-secondary);
  text-align: center;
  line-height: 1.7;
  max-width: 580px;
  margin: 0 auto;
}

.section-subtitle {
  font-size: 16px;
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: var(--space-2xl);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* -------------------------------------------------------
 * サイドバー付きレイアウト
 * ------------------------------------------------------- */
.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-2xl);
  align-items: start;
}
.layout-sidebar-left {
  grid-template-columns: 240px 1fr;
}

/* マイページ・管理画面 */
.mypage-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 64px);
}
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* -------------------------------------------------------
 * スペーシングユーティリティ
 * ------------------------------------------------------- */
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

/* -------------------------------------------------------
 * ブレークポイント SP (〜767px)
 * ------------------------------------------------------- */
@media (max-width: 767px) {
  .container,
  .container-sm,
  .container-xs {
    padding: 0 var(--space-md);
  }

  .grid-2col,
  .grid-3col,
  .grid-4col {
    grid-template-columns: 1fr;
  }

  .layout-with-sidebar,
  .layout-sidebar-left {
    grid-template-columns: 1fr;
  }

  .mypage-layout,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .section { padding: 56px 0; }
  .section-sm { padding: 32px 0; }
  .section-title { font-size: 24px; }
}

/* -------------------------------------------------------
 * ブレークポイント TAB (768px〜1023px)
 * ------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 1023px) {
  .grid-3col { grid-template-columns: repeat(2, 1fr); }
  .grid-4col { grid-template-columns: repeat(2, 1fr); }

  .layout-with-sidebar {
    grid-template-columns: 1fr 260px;
  }
}
