.koukyouzi-backimage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("/img/hasu-kuro.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
  opacity: 0.2;
  z-index: -1;
  }

/* タイトルエリア（.hero）スタイル */
.hero {
  height: 400px;
  background-image: url(../img/koukyouzi/top.jpg);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #ffffff;
  text-shadow: 1px 1px 10px rgb(17, 17, 17);
}

.hero h1 {
  font-size: 45px;
  font-weight: bold;
}

.hero p {
  font-size: 16px;
  margin-top: 15px;
}

/* 紹介文 */
.intro {
  max-width: 900px;
  margin: 3rem auto 6rem auto; /* ← 下に余白追加 */
  padding: 0 1rem;
  font-size: 1.1rem;
  line-height: 1.8;
}

/* 年表 */
.timeline {
  max-width: 900px;
  margin: 4rem auto;
  padding: 0 1rem;
  position: relative;
  overflow: visible; /* ← 修正ポイント */
  border-left: 3px solid #e6b422;
}

.timeline::before {
  content: "年表";
  position: absolute;
  top: -3.5rem; /* ← タイトルが見えるよう調整 */
  left: 0;
  font-size: 1.5rem;
  font-weight: bold;
  color: #111;
  padding-left: 1rem;
  border-left: 6px solid #e6b422;
}

.timeline::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background-color: #e6b422;
  z-index: -1;
  transition: height 2s ease;
}

.timeline.animate::after {
  height: 100%;
}

.timeline-entry {
  margin-bottom: 2rem;
  padding-left: 1.5rem;
  position: relative;
}

.timeline-entry::before {
  content: "";
  position: absolute;
  top: 0.4rem;
  left: -9px;
  width: 14px;
  height: 14px;
  background-color: #e6b422;
  border-radius: 50%;
}

.timeline-entry h4 {
  margin-bottom: 0.25rem;
  font-size: 1.2rem;
  color: #444;
  font-weight: bold;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
}

.timeline-entry h4 span.gengo {
  font-size: 0.95rem;
  color: #777;
}

.timeline-entry p {
  font-size: 1rem;
  color: #333;
  margin: 0.5rem 0 0;
}

.timeline-entry img {
  margin-top: 1rem;
  border-radius: 8px;
  max-width: 100%;
  cursor: pointer;
  display: block;
  margin-left: auto;
  margin-right: auto;
  pointer-events: auto;
  user-select: auto;
  -webkit-user-drag: auto;
}

.timeline img {
  max-width: 400px;
  width: 50%;
  height: auto;
  margin-top: 15px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* ギャラリー */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto 5rem;
  padding: 0 1rem;
}

.gallery-block {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.gallery-block img {
  width: 100%;
  height: auto;
  cursor: pointer;
  pointer-events: auto;
  user-select: auto;
  -webkit-user-drag: auto;
}

.gallery-block p {
  padding: 1rem;
  font-size: 1rem;
  color: #333;
}

/* モーダル */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-image {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@media (max-width: 800px) {
  .hero {
    height: 200px;
  }

  .hero h1 {
    font-size: 23px;
  }

  .hero p {
    font-size: 14px;
    margin-top: 5px;
  }

  .intro,
  .timeline,
  .gallery {
    padding: 0 1rem;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .timeline-entry {
    padding-left: 1rem;
  }

  .timeline-entry h4 {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .timeline-entry h4 span.gengo {
    font-size: 0.9rem;
  }
}
