body {
  font-family: sans-serif;
  text-align: center;
  background-color: #f5f5f5;
  margin: 0;
}
header {
  background-color: #ff4646;
  color: white;
  padding: 0.8em 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1em;
  flex-wrap: wrap;
}
header img {
  height: 70px;
}

/* ナビゲーションボタン関係 */
nav {
  background-color: #ff8c8c;
  font-size: 0; /* インライン要素の空白対策 */
}

nav a {
  width: 140px; /* 等幅にする */
  text-align: center;
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 0.8em 1.5em; /* ←ここで上下の余白を調整 */
  display: inline-block;
  font-size: 16px; /* font-size 戻す */
  line-height: 1; /* ← 行の高さを詰める */
  border-right: 1px solid rgba(255,255,255,0.4);
  box-sizing: border-box; /* ← paddingで高さがズレないようにする */
  transition: background-color 0.2s ease;
}

nav a:first-child {
  border-left: 1px solid rgba(255,255,255,0.4);
}

/* ホバー時のスタイル */
nav a:hover {
  background-color: white;
  color: #ff8c8c;
}

/* スマホ表示時（600px以下）は幅を自動に */
@media (max-width: 600px) {
  nav a {
    display: block;
    width: auto;
    margin: 0;
    padding: 1em;
    border: none;
  }
}



main {
  max-width: 800px;
  margin: 2em auto;
  padding: 1em;
}

/* フッター */
footer {
    text-align: center;
    padding: 10px;
    background-color: #5c5c5c;
    color: white;
}

/* セクション内見出しは中央寄せ */
section h2 {
  text-align: center;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.3em;
  margin-bottom: 1em;
}

/* セクション内容は左寄せ */
section {
  background-color: white;
  margin: 2em 0;
  padding: 1em;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  text-align: left;
}
/* 掲示板本文のテキストも左寄せ */
section p {
  text-align: left;
}

/* お知らせのリストアイテム：画像とテキストを横並びに */
#news ul li {
  display: flex;
  align-items: center;
  gap: 1em;
  flex-wrap: wrap;
}

/* お知らせ画像のスタイル */
#news ul li img {
  width: 200px;
  height: auto;
}

ul {
  list-style: none;
  padding: 0;
}
li {
  border-bottom: 1px solid #ddd;
  padding: 1em 0;
  position: relative;
}
.date {
  color: gray;
  font-size: 0.8em;
}
.delete-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  background: crimson;
  color: white;
  border: none;
  padding: 0.3em 0.6em;
  border-radius: 5px;
  cursor: pointer;
}
form textarea,
form input[type="text"] {
  width: 90%;
  padding: 0.5em;
  margin-top: 0.5em;
}
form button {
  margin-top: 0.5em;
  padding: 0.5em 1em;
  background-color: #aaaaaa;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

@media (max-width: 600px) {
  nav a {
    display: block;
    margin: 0.5em 0;
  }
  header {
    flex-direction: column;
  }
}

/* 掲示板内の要素を左寄せ */
main section {
  text-align: left;
}

/* 投稿の本文だけ強制的に左寄せ（親が中央寄せでも効くように） */
main section p {
  text-align: left !important;
}

/* お知らせ内の画像は親要素に収まるようにする */
section img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* 全体を縦並びにするための設定 */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* mainを伸び縮みさせて、余ったスペースを埋める */
main {
  flex: 1;
}

/* 画像を折り返して横並びにする */
.image-row {
  display: flex;
  gap: 10px;           /* 画像同士の間隔 */
  flex-wrap: wrap;     /* 狭い画面では折り返し */
  justify-content: center;  /* 🔸中央寄せ */
  margin-top: 0.5em;
}
.image-row img {
  height: auto;
  max-width: 100%;
}

/* 最新情報の表示について */
.latest-info {
  max-height: 8.5em; /* およそ5〜6行分 */
  overflow-y: auto;
  border: 1px solid #ccc;
  padding: 0.5em;
  margin-bottom: 1em;
  background-color: #f9f9f9;
  border-radius: 5px;
}
.latest-info ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.latest-info li {
  margin-bottom: 0.3em;
}
.latest-info a {
  text-decoration: none;
  color: #0066cc;
}
.latest-info a:hover {
  text-decoration: underline;
}

/* 最新情報リスト内の仕切り線を無くす */
.no-border li {
  border-bottom: none;
  padding: 0.5em 0;
}

/* 最新情報リストの余白・行間を調整 */
.no-border li {
  border-bottom: none;
  padding: 0.3em 0;
  line-height: 0.8; /* 行間を詰める */
  font-size: 0.95em; /* 少し文字サイズも調整（お好みで） */
}
