@charset "UTF-8";

:root {
  --paper: #d7d6d2;
  --ink: #2f3030;
  --line: #2f3030;

  /* 背景テクスチャ */
  --paper-texture: url("back.jpg");
  --paper-size: 430px auto;

  /* デザイン画に近い、中央より少し右の軸 */
  --line-x: 58.5%;

  /* 左側テキスト幅 */
  --info-width: 39%;

  /* 年代数字の背景箱 */
  --year-box-width: 128px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: var(--paper-texture);
  background-repeat: repeat;
  background-size: var(--paper-size);
  background-position: center top;
  background-attachment: fixed;
  font-family:
    "Yu Mincho",
    "Hiragino Mincho ProN",
    "Hiragino Mincho Pro",
    "Noto Serif JP",
    serif;
}

/* PCで見てもスマホ幅の紙面として中央に置く */
.page {
  width: 100%;
  max-width: 450px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 18px 140px;
}

/* 冒頭説明エリア */
.site-intro {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  column-gap: 18px;

  width: 100%;
  max-width: 414px;
  margin: 0 auto;

  padding: 42px 0 34px;
  color: var(--ink);
  align-items: start;
}

.intro-title {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

.intro-title img {
  display: block;
  width: 88px;
  height: auto;
  margin-top: 0;
}

.intro-text {
  padding-top: 2px;
  font-family:
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    "YuGothic",
    "Noto Sans JP",
    sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.85;
  letter-spacing: 0.04em;
}

.intro-text p {
  margin: 0 0 22px;
}

.intro-text p:last-child {
  margin-bottom: 0;
}

/* 年表全体 */
.timeline {
  position: relative;
  width: 100%;
  max-width: 414px;
  min-height: 120vh;
  margin: 0 auto;
  padding: 0 0 160px;
}

/* 年代の縦軸 */
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--line-x);
  width: 3px;
  background: var(--line);
  transform: translateX(-50%);
  z-index: 1;
}

/* 年表の説明ボックス */
.timeline-guide {
  position: relative;
  z-index: 5;
  width: 100%;
  margin: 0 0 24px;
  padding: 14px 15px 15px;
  border: 3px solid var(--line);
  background: transparent;
  overflow: hidden;

  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

/* 年表説明ボックス内にも back.jpg を敷く */
.timeline-guide::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;

  background-image: var(--paper-texture);
  background-repeat: repeat;
  background-size: var(--paper-size);
  background-position: center top;
  background-attachment: fixed;
}

/* 年表説明ボックス内の文字・画像を背景より前に出す */
.timeline-guide > * {
  position: relative;
  z-index: 1;
}

/* 年表説明ボックス内の画像タイトル */
.timeline-guide-title {
  width: 100%;
  margin: 0 0 12px;
  text-align: left;
}

.timeline-guide-title img {
  display: block;
  width: 100%;
  max-width: 330px;
  height: auto;
  margin: 0;
}

.timeline-guide p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  letter-spacing: 0.07em;
}

.timeline-guide p + p {
  margin-top: 0.8em;
}

/* 年表1項目 */
.timeline-item {
  position: relative;
  padding: 24px 0 48px;
}

.timeline-item:first-of-type {
  padding-top: 26px;
}

.event-summary {
  position: relative;
  min-height: 82px;
}

/* 左側のタイトル・開閉テキスト */
.event-info {
  position: relative;
  z-index: 3;
  width: var(--info-width);
  padding-top: 4px;
}

.event-title {
  margin: 0 0 5px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: 0.02em;
  word-break: keep-all;
  overflow-wrap: normal;
  color: #2f3030;

  /* タイトルの凹凸感。年代より控えめ */
  text-shadow:
    -1px -1px 0 rgba(255, 255, 255, 0.28),
    1px 1px 0 rgba(0, 0, 0, 0.14),
    2px 2px 0 rgba(0, 0, 0, 0.05);
}

/* 詳細開閉ボタン */
.detail-toggle {
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
  max-width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 11.5px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.detail-toggle:focus {
  outline: none;
}

.detail-toggle:focus-visible {
  outline: 1px solid var(--line);
  outline-offset: 2px;
}

.detail-icon {
  display: inline-block;
  flex: 0 0 auto;
  margin-top: 0.08em;
  font-size: 0.9em;
  line-height: 1;
  transition: transform 0.25s ease;
}

.accordion.is-open .detail-icon {
  transform: rotate(90deg);
}

.detail-label {
  display: inline-block;
}

/* 年代 */
.year-block {
  position: absolute;
  top: 0;
  left: var(--line-x);
  z-index: 4;
  width: var(--year-box-width);
  padding: 4px 3px 8px;
  text-align: center;
  transform: translateX(-50%);

  /* 年号の背景にも back.jpg を反映 */
  background-color: var(--paper);
  background-image: var(--paper-texture);
  background-repeat: repeat;
  background-size: var(--paper-size);
  background-position: center top;
  background-attachment: fixed;
}

.year-large {
  display: block;
  font-family:
    "Oswald",
    "Arial Narrow",
    "Helvetica Neue Condensed",
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-size: 48px;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: 0.005em;
  white-space: nowrap;
  color: #2f3030;

  /* 年代数字の凹凸感 */
  text-shadow:
    -1px -1px 0 rgba(255, 255, 255, 0.35),
    1px 1px 0 rgba(0, 0, 0, 0.18),
    2px 2px 0 rgba(0, 0, 0, 0.08);
}

/* 1956-57など、横に長い年代用 */
.year-wide {
  font-size: 48px;
  letter-spacing: 0.002em;
  transform: scaleX(0.84);
  transform-origin: center;
}

.year-small {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* 開閉パネル */
.accordion-panel {
  height: 0;
  overflow: hidden;
  opacity: 0;
  position: relative;
  z-index: 5;
  transition:
    height 0.35s ease,
    opacity 0.25s ease;
}

.accordion.is-open .accordion-panel {
  opacity: 1;
}

/* コメント欄 */
.comment {
  position: relative;
  width: 100%;
  margin: 2px 0 20px;
  padding: 14px 16px;
  border: 3px solid var(--line);
  background: transparent;
  overflow: hidden;

  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

/* コメント欄の黒枠内にも back.jpg を敷く */
.comment::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;

  /* グレーを重ねず、back.jpg だけを表示 */
  background-image: var(--paper-texture);
  background-repeat: repeat;
  background-size: var(--paper-size);
  background-position: center top;
  background-attachment: fixed;
}

/* コメント内の文字・画像を背景より前に出す */
.comment > * {
  position: relative;
  z-index: 1;
}

.comment-title {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.08em;
  color: #2f3030;

  /* コメント見出しにも少しだけ凹凸感 */
  text-shadow:
    -1px -1px 0 rgba(255, 255, 255, 0.24),
    1px 1px 0 rgba(0, 0, 0, 0.12),
    2px 2px 0 rgba(0, 0, 0, 0.04);
}

/* コメント内の目立たせたい情報欄：場所・登場妖怪など */
.comment-meta {
  position: relative;
  z-index: 1;
  margin: 8px 0 13px;
  padding: 8px 10px;
  border-top: 1px solid rgba(47, 48, 48, 0.55);
  border-bottom: 1px solid rgba(47, 48, 48, 0.55);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.04em;
}

.comment-meta-row {
  display: grid;
  grid-template-columns: 7.8em 1fr;
  column-gap: 0.6em;
  align-items: start;
}

.comment-meta-row + .comment-meta-row {
  margin-top: 3px;
}

.comment-meta-label {
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
}

.comment-meta-label::before {
  content: "◆";
  margin-right: 4px;
  font-size: 0.75em;
}

.comment-meta-text {
  min-width: 0;
}

/* コメント本文 */
.comment p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.07em;
}

.comment p + p {
  margin-top: 0.9em;
}

/* コメント内のイラスト欄 */
.comment-illust {
  position: relative;
  z-index: 1;
  margin: 15px 0 0;
  padding: 10px 0 0;
  border-top: 1px dashed rgba(47, 48, 48, 0.45);
}

.comment .comment-illust-title {
  margin: 0 0 7px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.08em;
}

.comment-illust-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

.comment .comment-illust-caption {
  margin: 7px 0 0;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.05em;
}

/* 同じイラスト欄に複数画像を入れる場合の余白 */
.comment-illust-image + .comment-illust-caption {
  margin-bottom: 10px;
}

.comment-illust-caption + .comment-illust-image {
  margin-top: 12px;
}

/* コメント内の関連リンク欄 */
.comment-links {
  position: relative;
  z-index: 1;
  margin: 15px 0 0;
  padding: 10px 0 0;
  border-top: 1px dashed rgba(47, 48, 48, 0.45);
  font-size: 11.5px;
  line-height: 1.65;
  letter-spacing: 0.05em;
}

.comment .comment-links-title {
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.08em;
}

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

.comment-link-list li {
  margin: 0;
  padding: 0;
}

.comment-link-list li + li {
  margin-top: 3px;
}

.comment-link-list a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.comment-link-list a::before {
  content: "・";
}

.comment-link-list a:hover {
  opacity: 0.7;
}

/* コメント末尾の印刷仕様メモ */
.comment-print {
  position: relative;
  z-index: 1;
  margin: 15px 0 0;
  padding: 10px 0 0;
  border-top: 1px dashed rgba(47, 48, 48, 0.55);
  font-size: 11.5px;
  line-height: 1.65;
  letter-spacing: 0.05em;
}

.comment .comment-print-title {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.08em;
}

.comment-print-list {
  margin: 0;
  padding: 0;
}

.comment-print-row {
  display: grid;
  grid-template-columns: 4.8em 1fr;
  column-gap: 0.6em;
  align-items: start;
}

.comment-print-row + .comment-print-row {
  margin-top: 2px;
}

.comment-print-row dt {
  min-width: 0;
  margin: 0;
  font-weight: 600;
  white-space: nowrap;
}

.comment-print-row dt::before {
  content: "・";
}

.comment-print-row dd {
  min-width: 0;
  margin: 0;
}

/* 印刷仕様の補足コメント */
.comment .comment-print-note {
  margin: 8px 0 0;
  padding: 7px 0 0;
  border-top: 1px dotted rgba(47, 48, 48, 0.4);
  font-size: 11.5px;
  line-height: 1.65;
  letter-spacing: 0.05em;
}

.comment .comment-print-note + .comment-print-note {
  margin-top: 7px;
  padding-top: 0;
  border-top: none;
}

/* コメント下部の閉じるボタン */
.detail-close {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  margin: 16px 0 0;
  padding: 8px 0;
  border: 1px solid rgba(47, 48, 48, 0.55);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-align: center;
  cursor: pointer;
}

.detail-close:focus {
  outline: none;
}

.detail-close:focus-visible {
  outline: 1px solid var(--line);
  outline-offset: 2px;
}

.detail-close:hover {
  opacity: 0.75;
}

/* コメント欄内の画像 */
.comment-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 12px 0;
  border-radius: 2px;
}

/* 右下に追従するGIF画像 */
.floating-illust {
  position: fixed;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  width: 80px;
  height: auto;
  z-index: 9999;
  pointer-events: none;
}

/* 通常スマホ調整 */
@media (max-width: 450px) {
  .page {
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  .site-intro {
    grid-template-columns: 74px minmax(0, 1fr);
    column-gap: 16px;

    width: 100%;
    margin: 0 auto;

    padding: 34px 0 30px;
    align-items: start;
  }

  .intro-title {
    justify-content: flex-start;
    align-items: flex-start;
  }

  .intro-title img {
    display: block;
    width: 70px;
    height: auto;
    margin-top: 0;
  }

  .intro-text {
    padding-top: 2px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.8;
  }

  .intro-text p {
    margin-bottom: 18px;
  }

  .timeline-guide-title {
    margin-bottom: 11px;
  }

  .timeline-guide-title img {
    max-width: 310px;
  }

  .floating-illust {
    width: 76px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
  }
}

/* 小さめスマホ調整 */
@media (max-width: 360px) {
  :root {
    --line-x: 59%;
    --info-width: 38%;
    --year-box-width: 118px;
    --paper-size: 390px auto;
  }

  .site-intro {
    grid-template-columns: 70px minmax(0, 1fr);
    column-gap: 14px;

    padding: 34px 0 30px;
  }

  .intro-title img {
    width: 66px;
    margin-top: 0;
  }

  .intro-text {
    font-size: 13px;
    line-height: 1.8;
  }

  .timeline {
    max-width: 360px;
    padding-top: 0;
  }

  .timeline-guide {
    padding: 12px 14px;
    margin-bottom: 22px;
  }

  .timeline-guide-title {
    margin-bottom: 10px;
  }

  .timeline-guide-title img {
    max-width: 290px;
  }

  .timeline-guide p {
    font-size: 12.5px;
  }

  .timeline-item {
    padding-top: 22px;
    padding-bottom: 42px;
  }

  .timeline-item:first-of-type {
    padding-top: 24px;
  }

  .event-summary {
    min-height: 78px;
  }

  .event-info {
    padding-top: 4px;
  }

  .event-title {
    font-size: 16px;
    line-height: 1.32;
    text-shadow:
      -1px -1px 0 rgba(255, 255, 255, 0.26),
      1px 1px 0 rgba(0, 0, 0, 0.12),
      2px 2px 0 rgba(0, 0, 0, 0.04);
  }

  .detail-toggle {
    font-size: 11px;
    line-height: 1.3;
  }

  .year-large {
    font-size: 44px;
    text-shadow:
      -1px -1px 0 rgba(255, 255, 255, 0.32),
      1px 1px 0 rgba(0, 0, 0, 0.16),
      2px 2px 0 rgba(0, 0, 0, 0.07);
  }

  .year-wide {
    font-size: 44px;
    transform: scaleX(0.84);
  }

  .year-small {
    font-size: 11px;
  }

  .comment {
    padding: 13px 15px;
  }

  .comment-title {
    font-size: 20px;
    text-shadow:
      -1px -1px 0 rgba(255, 255, 255, 0.22),
      1px 1px 0 rgba(0, 0, 0, 0.10),
      2px 2px 0 rgba(0, 0, 0, 0.035);
  }

  .comment-meta {
    font-size: 11.5px;
    padding: 7px 9px;
  }

  .comment-meta-row {
    grid-template-columns: 7.4em 1fr;
  }

  .comment p {
    font-size: 12.5px;
  }

  .comment .comment-illust-title,
  .comment .comment-links-title {
    font-size: 11.5px;
  }

  .comment .comment-illust-caption,
  .comment-links {
    font-size: 11px;
  }

  .comment-print {
    font-size: 11px;
  }

  .comment .comment-print-title {
    font-size: 11.5px;
  }

  .comment-print-row {
    grid-template-columns: 4.4em 1fr;
  }

  .comment .comment-print-note {
    font-size: 11px;
  }

  .detail-close {
    font-size: 11.5px;
    padding: 7px 0;
  }

  .floating-illust {
    width: 72px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
  }
}

/* 動きを減らす設定の人向け */
@media (prefers-reduced-motion: reduce) {
  .accordion-panel,
  .detail-icon {
    transition: none;
  }
}