/* HTMLと同じフォルダに保存してください。 */
:root {
  --ink: #49382d;
  --wine: #792f39;
  --gold: #a28750;
  --line: rgba(162, 135, 80, 0.38);
  --paper: rgba(255, 253, 248, 0.94);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  font-size: 16px;
  line-height: 2;
  overflow-wrap: anywhere;
  background-color: #f1e9da;
  /* 壁紙のファイル名。CSSファイルから見た場所です。 */
  background-image: url("koretaka-birthday-kabe.jpg");
  background-repeat: repeat;
  background-size: 600px auto;
}
figure, p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--wine); text-underline-offset: 0.2em; }
a:focus-visible { outline: 3px solid var(--wine); outline-offset: 5px; }

/* キーボード操作時に表示される本文へのリンク */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10;
  padding: 8px 16px;
  background: #fffdf8;
}
.skip-link:focus { top: 12px; }

/* 上下のナビゲーション */
.page-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 94%;
  margin: 24px auto;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 14px;
}
.page-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf8;
  text-decoration: none;
}
.page-nav a:hover { background: #f5e9da; }

/* 上下の大きなイラスト：高さを固定せず、全体を表示 */
.large-illustration {
  width: min(94%, 1120px);
  margin-inline: auto;
}
.large-illustration img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 10px 32px rgba(67, 42, 25, 0.16);
}
.hero { margin-bottom: 42px; }
.ending { margin-top: 42px; margin-bottom: 36px; }

/* 文章と６枚の挿絵を包む、少し透けた紙 */
.story-paper {
  width: min(92%, 1060px);
  margin: 0 auto;
  padding: 66px 54px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 8px 30px rgba(67, 42, 25, 0.09);
  scroll-margin-top: 24px;
}
.story-intro { margin-bottom: 62px; text-align: center; }
.anniversary {
  color: var(--wine);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  letter-spacing: 0.14em;
}
h1 {
  margin: 16px 0 28px;
  color: var(--wine);
  font-size: clamp(27px, 4vw, 40px);
  font-weight: 600;
  line-height: 1.6;
}
h1 span { display: inline-block; }
.intro-text { max-width: 640px; margin: 0 auto; }
.intro-text p + p, .scene-text p + p, .story-closing p + p {
  margin-top: 1em;
}

/* 本文→挿絵。偶数の場面だけ左右を入れ替える */
.scene {
  display: flex;
  align-items: center;
  gap: 36px;
  padding-block: 46px;
  border-top: 1px solid var(--line);
}
.scene.reverse { flex-direction: row-reverse; }
.scene-text { flex: 1 1 0; min-width: 0; }
.scene-illustration { flex: 1 1 0; min-width: 0; }
.scene-illustration img {
  width: 100%;
  height: auto;
  border-radius: 12px;
}
.scene-number {
  color: #80602b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  letter-spacing: 0.1em;
}
.scene h2 {
  margin: 6px 0 20px;
  color: var(--wine);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.7;
}
.story-closing {
  padding-top: 40px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.birthday-wish { color: var(--wine); font-size: 20px; }
.site-footer {
  padding: 8px 16px 32px;
  background: var(--paper);
  text-align: center;
}

/* スマホ：全場面を「文章→挿絵」の縦並びに */
@media screen and (max-width: 760px) {
  body { background-size: 420px auto; }
  .page-nav { margin: 18px auto; gap: 10px; }
  .page-nav a { padding: 8px 16px; }
  .hero { margin-bottom: 28px; }
  .ending { margin-top: 28px; margin-bottom: 28px; }
  .large-illustration img { border-radius: 12px; }
  .story-paper { padding: 40px 22px; border-radius: 16px; }
  .story-intro { margin-bottom: 38px; }
  .anniversary { font-size: 12px; letter-spacing: 0.09em; }
  h1 span { display: block; }
  .scene, .scene.reverse {
    flex-direction: column;
    align-items: stretch;
    gap: 26px;
    padding-block: 34px;
  }
  .scene-text, .scene-illustration { flex: auto; }
  .scene h2 { font-size: 21px; }
  .story-closing { padding-top: 32px; }
  .birthday-wish { font-size: 18px; }
}
