/* 全体の横幅は画面幅を超えないようにする */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden; /* 横スクロールを防止 */
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
}

main, .content-wrapper, .posts {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/*レイアウトは Grid や Flexbox を使う*/
.main-wrapper {
  display: flex;
  flex-wrap: wrap;
}


header {
  height: 200px;
  background-image: url("/画像/ヘッダー8.jpg");
  background-size: cover;
  background-position: center;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

header h1 {
  font-size: 2rem;
  margin: 0;
  font-weight: 600;
  color: black;
}

/* スマホ向け調整（768px以下） */
@media (max-width: 768px) {
  header {
    height: 100px !important;
  }

  header h1 {
    font-size: 1.2rem !important;
  }
}

.header-image {
  width: 100%;        /* 親要素（header）の横幅に合わせる */
  height: auto;       /* 縦横比を保つ */
  display: block;     /* 画像の下に変な余白が出ないように */
  border-radius: 0;   /* 必要なら角を丸めない */
}


/*フッター*/
footer {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  background-color: #e5f3ff;
  color: black;
  padding: 15px;
  text-align: center;
  font-size: 1.0rem;
}

footer .sns {
  text-align: left;        /* ← 左寄せ */
  padding-left: 20px;     /* 左に余白 */
}


footer .sns ul {
  list-style: none;        /* ← ・を消す */
  padding-left: 0;         /* ← 左の余白もなくす */
  margin: 0;
}

footer .sns li {
  display: inline-block;   /* 複数アイコンが横並びになるように */
  margin-right: 10px;      /* 必要に応じてスペース調整 */
}


/*これで画像がスマホの横幅にフィット*/
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* カテゴリバー全体の背景・余白・幅*/
.category-bar {
  background-color: #374653;
  padding: 0.2rem 1rem;
  width:100%;
  max-width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
  white-space: nowrap;
}

/* リストを横並びにし、中央揃えに */
.category-bar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  padding: 1rem 0;  /* ← 縦幅を太くする */
  justify-content: center;
}



/* 各リンクのスタイル */
.category-bar a {
  text-decoration: none;
  color: white;
  font-weight: 400;              /* 通常：400、やや細くしたいなら 300 */
  padding: 0.3rem 0.6rem;
  transition: color 0.3s ease;   /* 色変化をスムーズに */
}

/* ホバー時の色変化 */
.category-bar a:hover {
  color: #007acc;
}

@media (max-width: 768px) {
  .category-bar ul {
    flex-wrap: wrap;             /* 項目を折り返し可能に */
    justify-content: center;     /* 中央寄せ（必要に応じて） */
    padding: 0.1rem;/* ← ul自体の上下余白も調整 */
    gap: 0.4rem;/* ← カテゴリー項目間のスペースも少し縮める */
    overflow: hidden;
  }

  .category-bar a {
    font-size: 0.85rem;          /* 文字サイズを小さく */
    padding: 0.2rem 0.3rem;      /* 余白を小さくして幅を節約 */
    white-space: nowrap;         /* 項目の途中で改行しないように */
    display: inline-block;
    max-width: 100%;             /* はみ出さないよう制限 */
    overflow: hidden;            /* はみ出しを隠す */
    text-overflow: ellipsis;     /* 長すぎる場合は「...」で省略 */
  }

  .category-bar {
    overflow-x: hidden;          /* 横スクロールを無効に */
    width: 100%;
  }
}