html {
  scroll-behavior: smooth; /* #news へなめらかにスクロールする */
}

body {
  font-family: sans-serif;
  margin: 0;
  line-height: 1.7;
  color: #222;
}

/* お知らせセクション */
#news {
  margin-top: 48px;
  scroll-margin-top: 16px;
}

/* 枠の中だけ独立してスクロールする */
.news-scroll {
  max-height: 220px; /* 枠の高さ。大きくすると一度にたくさん見える */
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 4px 16px;
  background: #fafafa;
}

.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-list li {
  padding: 10px 4px;
  border-bottom: 1px solid #ddd;
}

.news-list li:last-child {
  border-bottom: none;
}

.news-list time {
  color: #666;
  margin-right: 12px;
  white-space: nowrap;
}

.news-note {
  font-size: 0.85rem;
  color: #666;
}

/* 行事予定の表 */
table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  border: 1px solid #ccc;
  padding: 8px 12px;
  text-align: left;
}

table th {
  background: #eef3f9;
}

/* 地図の仮の枠（Googleマップの埋め込みコードと差し替える） */
.map-placeholder {
  border: 1px dashed #999;
  border-radius: 8px;
  padding: 48px 16px;
  text-align: center;
  color: #666;
  background: #fafafa;
}

.map-placeholder iframe,
iframe {
  max-width: 100%;
}

/* 架空の案内図（アクセスページ） */
.fictional-map {
  margin: 0;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.fictional-map svg {
  display: block;
  width: 100%;
  height: auto;
}

.fictional-map figcaption {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #666;
  text-align: center;
}

/* ナビの下のスライダー */
.slider {
  position: relative;
  overflow: hidden; /* 枠からはみ出た画像を見せない */
  aspect-ratio: 3 / 1; /* 枠の縦横比を固定：画面幅が変わってもトリミングが変わらない */
  width: 100%;
}

.slider-track {
  display: flex;
  height: 100%;
  transition: transform 0.8s ease; /* 横へ流れる動き */
}

.slider-track img {
  display: block;
  flex: 0 0 100%; /* 1枚を必ず枠の幅ちょうどにする（縮んで見え方が変わらない） */
  width: 100%;
  height: 100%;
  object-fit: cover; /* 画像を枠いっぱいに切り取って表示 */
  object-position: center center; /* トリミングの中心位置。変え方は下のメモ参照 */
}

/* スライドの下の丸：画像の下に中央並び */
.slider-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 4px;
}

.slider-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background: #c9d2dc;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s, transform 0.3s;
}

.slider-dots .dot.active {
  background: #1a4f8a; /* 今表示中の丸だけ学校カラー */
  transform: scale(1.25);
}

header {
  background: #1a4f8a; /* 学校らしい色に変えてOK */
  color: #fff;
  padding: 16px;
  position: relative;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  margin: 0;
  font-size: 1.4rem;
}

header nav a {
  color: #fff;
  margin-right: 12px;
  text-decoration: none;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
}

footer {
  text-align: center;
  padding: 24px 16px 16px;
  background: #f0f0f0;
}

/* フッターの住所など（©の上に表示） */
.footer-info {
  margin-bottom: 12px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-info p {
  margin: 0;
}

.footer-school {
  font-weight: bold;
}

.footer-info address {
  font-style: normal; /* 住所が斜体にならないように */
}

footer > p {
  margin: 0;
}

/* 三本線ボタン：PCでは隠す */
.menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  padding: 8px;
}

.menu-btn span {
  display: block;
  height: 2px;
  background: #fff;
  margin: 6px 0;
  transition: 0.3s;
}

/* 開いたら × になる */
.menu-btn.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* スマホ幅：三本線に切り替え */
@media (max-width: 768px) {
  .menu-btn {
    display: block;
  }

  header nav {
    display: none;
    flex-direction: column;
    padding-top: 12px;
  }

  header nav.open {
    display: flex;
  }

  header nav a {
    margin: 0;
    padding: 10px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
  }
}

/* 行事予定の図（表の下） */
.events-figure {
  margin: 24px 0;
}

.events-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.events-figure figcaption {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #666;
  text-align: center;
}

/* お問い合わせボタン（マシュマロへのリンク） */
.contact-btn {
  display: inline-block;
  background: #1a4f8a;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  padding: 12px 24px;
  border-radius: 999px;
}

.contact-btn:hover {
  opacity: 0.85;
}

/* 学校についてのカテゴリーカード */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.category-card {
  display: block;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fafafa;
  padding: 18px 16px;
  text-decoration: none;
  color: #222;
}

.category-card:hover {
  border-color: #1a4f8a;
  background: #eef3f9;
}

.category-title {
  display: block;
  font-weight: bold;
  font-size: 1.1rem;
  color: #1a4f8a;
  margin-bottom: 6px;
}

.category-desc {
  display: block;
  font-size: 0.9rem;
  line-height: 1.6;
}

.category-more {
  display: block;
  margin-top: 10px;
  font-size: 0.85rem;
  color: #1a4f8a;
}

/* 子ページから親ページへ戻るリンク */
.back-link {
  color: #1a4f8a;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* 学校設備の図（表の下） */
.facilities-figure {
  margin: 24px 0;
}

.facilities-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.facilities-figure figcaption {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #666;
  text-align: center;
}

/* 校歌の歌詞 */
.song-lyrics {
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fafafa;
  padding: 20px 24px;
  line-height: 2;
  margin: 16px 0;
}

.song-lyrics .song-verse {
  font-weight: bold;
  color: #1a4f8a;
  margin-bottom: 0;
}

/* 沿革の表を枠の中だけスクロールさせる（お知らせと同じ仕組み） */
.history-scroll {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fafafa;
}

.history-scroll table {
  margin: 0;
}

/* スクロールしても「年／出来事」の見出しが上に残る */
.history-scroll th {
  position: sticky;
  top: 0;
  background: #eef3f9;
  z-index: 1;
}
