/* ===== Reset / Base ===== */
*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --hdr-h: 50px;
  --gap: 20px;
  --container-max: 1600px; /* 「全体80%だが上限1600px」に揃える */
}

body {
  margin: 0;
  font-family: sans-serif;
}

/* ===== Header ===== */
header {
  position: fixed;
  inset: 0 0 auto 0; /* top:0, left:0, right:0 */
  height: var(--hdr-h);
  background-color: #f9f9f9;
  border-bottom: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  z-index: 1000;
}

header a {
  color: #000;
  text-decoration: none;
}

/* ホバー時も下線を出さない */
header a:hover,
header a:focus,
header a:active {
  color: #000;
  text-decoration: none;
}

header img { height: calc(var(--hdr-h) - 5px); }
header .title { text-align: center; flex-grow: 1; font-weight: bold; }

/* ===== Footer ===== */
footer {
  /* 固定しない（固定したい場合は position: fixed; bottom: 0; left: 0; right: 0; を付与） */
  border-top: 1px solid #ccc;
  text-align: center;
  font-size: 0.9em;
  line-height: 75px;
  background: #f9f9f9;
  height: 75px;
}

/* ===== Layout: Container / Side Menu / Main ===== */
.container {
  display: flex;
  gap: var(--gap);
  align-items: flex-start;

  /* ヘッダー分の余白 */
  margin: calc(var(--hdr-h) + 30px) auto 125px;

  /* 常に画面幅80%＋中央寄せ、最大幅は変数 */
  width: 80vw;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;

  padding: 0 10px; /* 端のめり込み防止 */
}

.side-menu {
  width: 20vw;            /* 値とコメントを一致（20%相当） */
  max-width: 400px;
  min-width: 200px;
  position: sticky;
  top: var(--hdr-h);
  padding: 10px;
  background-color: #f4f4f4;
  border: 1px solid #ccc;
  overflow-y: auto;
  align-self: flex-start;
}

.side-menu h3 {
  margin: 6px 0 8px 0;
  font-size: 1em;
  font-weight: bold;
}
.side-menu hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 6px 0 10px 0;
}
.menu-btn {
  display: block;
  text-decoration: none;
  color: #0078d4;
  padding: 6px 0;
  background: transparent;
}
.menu-btn:hover,
.menu-btn:focus-visible {     /* アクセシビリティに配慮 */
  color: #005a9e;
  outline: none;
}

/* main は可変幅（残りを使用） */
.main-content {
  flex: 1 1 0;
  min-width: 0; /* 折返しさせるための保険 */
  padding: 20px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 5px;
}

/* ===== Common elements ===== */
.page-title {
  background-color: #ff99cc;
  color: #fff;
  font-size: 1.5em;
  font-weight: bold;
  padding: 15px 20px;
  margin-bottom: 12px;
  border-radius: 5px;
  width: 100%;
}

.breadcrumb {
  font-size: 0.95em;
  margin-bottom: 18px;
  width: 100%;
}
.breadcrumb a { text-decoration: none; color: #0078d4; }
.breadcrumb span { color: #555; }

/* ===== Step block ===== */
.step {
  border: 1px solid #e0e0e0;
  padding: 14px;
  margin-bottom: 18px;
  border-radius: 6px;
  background-color: #fafafa;
  width: 100%;
}

.step-header { 
  display:flex; 
  align-items:center; 
  margin-bottom:10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ccc; 
}

.step-number {
  font-weight: bold;
  background-color: #0078d4;
  color: white;
  padding: 6px 10px;
  border-radius: 5px;
  margin-right: 12px;
}
.step-title { font-weight: bold; font-size: 1.05em; }

.step-body {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: nowrap;
}

.step-text {
  flex: 1 1 100%;
  max-width: 100%;
  line-height: 1.6;
}

.step-image {
  flex: 0 0 40%;
  max-width: 40%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.step-image img {
  max-width: 100%;
  height: auto;
  border: 1px solid #ccc;
  border-radius: 5px;
  display: block;
}

/* ===== Responsive (<=900px) ===== */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
    gap: 10px;
    margin: calc(var(--hdr-h) + 70px) 0 100px; /* スマホは余白広め */
    width: 100%;          /* 100vwではなく100%にして横スクロール回避 */
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 0 12px;
  }

  .side-menu {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
    position: static; /* sticky解除 */
    height: auto;
  }

  .main-content {
    width: 100%;
    max-width: 100%;
    padding: 10px;
  }

  .step-body {
    flex-direction: column;
  }
  .step-image {
    max-width: 100%;
    flex: 0 0 auto;
  }
}

/* ===== 2カラムのカードレイアウト ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 横に2つ */
  gap: var(--gap);
}

/* ← このページだけ1カラムにしたい場合に使うクラス */
.cards.is-single {
  grid-template-columns: 1fr;
}

/* 既存のUIに馴染むカード */
.card {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;        /* 既存main-contentより少し柔らかく */
  padding: 16px;
  min-height: 160px;         /* 任意：高さそろえたいなら調整 */
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-header {
  font-weight: bold;
  font-size: 1.05em;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 8px;
}

.card-body {
  flex: 1;
}

/* リストの体裁（任意） */
.card-list {
  margin: 0;
  padding-left: 16px;
}
.card-list li {
  line-height: 1.6;
}

/* スマホは1カラムに */
@media (max-width: 900px) {
  .cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
