* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #170d22;
  color: #fff;
  font-family: "Yu Gothic", "Meiryo", sans-serif;
}

/* ページ全体 */
.timeline-page {
  min-height: 100vh;
  padding: 36px 22px 60px;

  background-image:
    linear-gradient(rgba(20, 10, 30, 0.45), rgba(20, 10, 30, 0.72)),
    url("../img/bg/top-main.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;

  border: 10px solid #241033;
}

/* タイトル */
.timeline-header {
  width: min(900px, 100%);
  margin: 0 auto 22px;
  padding: 26px 28px 30px;

  border: 2px solid rgba(255, 190, 230, 0.7);
  border-radius: 18px;
  background: rgba(25, 10, 35, 0.72);
  backdrop-filter: blur(7px);

  text-align: center;
  box-shadow: 0 0 24px rgba(255, 160, 220, 0.25);
}

.timeline-header h1 {
  margin: 0 0 12px;
  font-size: 40px;
  color: #fff;

  text-shadow:
    0 0 14px #f5b6e4,
    0 0 24px rgba(255, 180, 230, 0.7),
    2px 2px 8px rgba(0, 0, 0, 0.9);
}

.timeline-header .timeline-subtitle {
  margin: 0;
  color: #ffe0f4;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.7;
}

.timeline-header .timeline-notice {
  display: inline-block;
  margin: 18px auto 0;
  padding: 10px 18px;

  border: 1px solid rgba(255, 190, 230, 0.65);
  border-radius: 12px;
  background: rgba(255, 210, 240, 0.1);

  color: #f4d7ea;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  text-align: center;
}

/* 年表本体 */
.timeline-window {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 28px;

  border: 2px solid rgba(210, 230, 255, 0.9);
  border-radius: 20px;
  background: rgba(198, 225, 248, 0.86);
  color: #263040;
  backdrop-filter: blur(6px);

  box-shadow:
    0 0 28px rgba(180, 210, 255, 0.28),
    inset 0 0 20px rgba(255, 255, 255, 0.24);
}

/* 各年 */
.timeline-year {
  scroll-margin-top: 100px;

  margin: 0 0 18px;
  border: 1px solid rgba(170, 200, 235, 0.75);
  border-radius: 14px;

  background: rgba(220, 240, 255, 0.82);
  overflow: hidden;
}

/* 年の見出し */
.timeline-year > summary {
  padding: 18px 22px;

  cursor: pointer;
  color: #30445f;
  font-size: 24px;
  font-weight: bold;

  text-shadow: none;
  list-style: none;
}

.timeline-year > summary::-webkit-details-marker {
  display: none;
}

.timeline-year > summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 10px;
  font-size: 16px;
  transition: transform 0.2s ease;
}

.timeline-year[open] > summary::before {
  transform: rotate(90deg);
}

/* 年の中身 */
.timeline-content {
  padding: 0 26px 24px 48px;
  color: #263040;
}

.timeline-content p {
  margin: 10px 0;
  line-height: 1.8;
  font-size: 17px;
}

.event-title {
  margin-top: 20px;
  color: #1f2f45;
  font-size: 18px;
  font-weight: bold;
}

/* 月ごとの折りたたみ */
.timeline-month {
  margin: 14px 0 18px;

  border: 1px solid rgba(170, 200, 235, 0.85);
  border-radius: 12px;
  background: rgba(235, 247, 255, 0.72);

  overflow: hidden;
  box-shadow:
    0 0 10px rgba(90, 130, 180, 0.12),
    inset 0 0 12px rgba(255, 255, 255, 0.28);
}

.timeline-month > summary {
  display: block;
  padding: 14px 18px;

  cursor: pointer;
  color: #30445f;
  font-weight: bold;
  font-size: 18px;

  background: rgba(245, 250, 255, 0.38);
  border-bottom: 1px solid rgba(170, 200, 235, 0.45);
}

.timeline-month:not([open]) > summary {
  border-bottom: none;
}

.timeline-month > summary:hover {
  color: #1f2f45;
  background: rgba(245, 250, 255, 0.9);
}

/* 月の中にある本文 */
.timeline-month > p {
  margin-left: 18px;
  margin-right: 18px;
}

.timeline-month > p:first-of-type {
  margin-top: 18px;
}

/* 補足・スクショの折りたたみ */
.event-note {
  margin: 10px 18px 22px;
  padding: 10px 14px;

  border: 1px solid rgba(170, 200, 235, 0.75);
  border-radius: 10px;
  background: rgba(245, 250, 255, 0.45);
}

.event-note > summary {
  cursor: pointer;
  color: #405875;
  font-size: 14px;
  font-weight: bold;
}

.event-note > summary:hover {
  color: #1f2f45;
}

.event-note p {
  margin: 12px 0 0;
  line-height: 1.8;
}

/* スクショ画像 */
.event-image-link {
  display: block;
  width: min(320px, 100%);
  margin: 16px 0 8px;
}

.event-image {
  display: block;
  width: 100%;
  height: 220px;

  object-fit: cover;
  object-position: top;

  border: 2px solid rgba(170, 200, 235, 0.9);
  border-radius: 12px;
  box-shadow: 0 0 16px rgba(80, 120, 170, 0.25);
}

.event-image:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 22px rgba(80, 120, 170, 0.38);
}

.image-caption {
  margin: 0 0 26px;
  color: #405875;
  font-size: 13px;
  line-height: 1.6;
}

/* 戻るボタン */
.back-area {
  width: min(900px, 100%);
  margin: 34px auto 0;

  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.back-area a {
  display: inline-block;
  min-width: 240px;
  padding: 15px 48px;

  border: 2px solid #ffb8e8;
  border-radius: 999px;
  background: linear-gradient(#ff85c8, #d84b9b);

  color: #fff;
  text-align: center;
  text-decoration: none;
  font-weight: bold;
  font-size: 18px;

  text-shadow: 0 0 6px #000;
  box-shadow: 0 0 18px rgba(255, 120, 200, 0.45);
}

.back-area a:hover {
  background: linear-gradient(#ff9bd5, #e65aaa);
}

.back-area a.continue-button {
  border-color: #b9d8ff;
  background: linear-gradient(#7bb8ff, #4f7fd8);
  box-shadow: 0 0 18px rgba(120, 180, 255, 0.45);
}

.back-area a.continue-button:hover {
  background: linear-gradient(#94c8ff, #6392e8);
}

/* スマホ縦 */
@media (max-width: 768px) and (orientation: portrait) {
  .timeline-page {
    padding: 18px 14px 42px;
    border: 8px solid #241033;
    background-attachment: scroll;
  }

  .timeline-header {
    padding: 20px 18px;
    margin-bottom: 16px;
  }

  .timeline-header h1 {
    font-size: 28px;
  }

  .timeline-subtitle,
  .timeline-header > p:not(.timeline-notice) {
    font-size: 14px;
  }

  .timeline-header .timeline-notice {
    font-size: 13px;
  }

  .timeline-window {
    padding: 18px 16px;
    border-radius: 16px;
  }

  .timeline-year {
    scroll-margin-top: 92px;
  }

  .timeline-year > summary {
    padding: 15px 16px;
    font-size: 20px;
  }

  .timeline-content {
    padding: 0 18px 20px 30px;
  }

  .timeline-content p {
    font-size: 15px;
    line-height: 1.75;
  }

  .event-title {
    font-size: 15px;
  }

  .timeline-month {
    margin: 12px 0 16px;
  }

  .timeline-month > summary {
    padding: 12px 14px;
    font-size: 16px;
  }

  .timeline-month > p {
    margin-left: 12px;
    margin-right: 12px;
  }

  .event-note {
    margin-left: 12px;
    margin-right: 12px;
  }

  .back-area a {
    width: 100%;
    max-width: 320px;
    min-width: 0;
    padding: 15px 20px;
    text-align: center;
  }

}

/* スマホ横 */
@media (max-width: 950px) and (orientation: landscape) {
  .timeline-page {
    padding: 16px 18px 36px;
    border: 8px solid #241033;
    background-attachment: scroll;
  }

  .timeline-header {
    padding: 16px 20px;
  }

  .timeline-header h1 {
    font-size: 28px;
  }

  .timeline-subtitle,
  .timeline-header > p:not(.timeline-notice) {
    font-size: 14px;
  }

  .timeline-header .timeline-notice {
    font-size: 13px;
  }

  .timeline-window {
    padding: 20px;
  }

  .timeline-year > summary {
    font-size: 20px;
  }

  .timeline-content p {
    font-size: 14px;
  }

  .event-title {
    font-size: 15px;
  }

  .timeline-month > summary {
    font-size: 16px;
  }
}
