@charset "UTF-8";
@import url("https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css");

/* modern.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Helvetica Neue', sans-serif;
  background-color: #fff;
  color: #333;
  line-height: 1.6;
}

/* ======================== */
/* 🔝 ヘッダー周り */
/* ======================== */

.header-wrapper {
  background: #e8e8e8;
  position: sticky;
  top: 0;
  z-index: 1000;
}

header {
  max-width: 1000px;
  margin: 0 auto;
  padding: 15px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-direction: row-reverse;
  flex-wrap: wrap;
}

header .logo img {
  height: 40px;
  vertical-align: middle;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  padding: 0;
  margin: 0;
}

nav a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
}

nav a:hover {
  opacity: 0.7;
}

/* ======================== */
/* 🎴 トップ画像とロゴ */
/* ======================== */

#top-img {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 30px;
}

#top-img h1 {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
}

#top-img h1 img {
  width: 80%;
  height: auto;
  max-width: 100%;
  max-height: 80%;
}

#main-image {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: block;
  height: auto;
  border: 5px solid #000;
}

/* ======================== */
/* 📖 本文・話リスト */
/* ======================== */

#story {
  max-width: 1000px;
  margin: 20px auto;
  padding: 0 20px;
  clear: both;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#story h2 {
  text-align: center;
  margin: 40px auto 20px;
  font-size: 1.5rem;
  max-width: 600px;
  width: 100%;
}

.story ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 10px;
  row-gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 900px;
  width: 100%;
}

.story li a {
  display: block;
  padding: 12px;
  background: #f4f4f4;
  border: 1px solid #ccc;
  text-align: center;
  text-decoration: none;
  color: #333;
  border-radius: 4px;
  transition: background 0.3s;
}

.story li a:hover {
  background: #e0e0e0;
}

/* ======================== */
/* 💬 コメント欄 */
/* ======================== */

footer {
  background: #e8e8e8;
  padding: 20px;
  text-align: center;
  margin: 40px auto;
  max-width: 600px;
}

footer form {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

footer input[type="text"] {
  padding: 8px;
  width: 60%;
  max-width: 300px;
}

footer input[type="submit"] {
  padding: 8px 12px;
}

/* ======================== */
/* ⬆️ ページトップボタン */
/* ======================== */

#backtop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(255,255,255,0.8);
  padding: 10px;
  border-radius: 50%;
  display: none;
  font-size: 24px;
}

#backtop.visible {
  display: block;
}

/* ======================== */
/* 📱 スマホ対応 */
/* ======================== */

@media screen and (max-width: 600px) {
  header {
    flex-direction: column;
    gap: 0.5rem;
  }

  nav ul {
    gap: 1rem;
  }

  #top-img h1 {
    top: 40%;
    transform: translate(-50%, -40%);
  }

  #top-img h1 img {
    width: 70%;
    max-height: 60%;
  }

  .story ul {
    grid-template-columns: 1fr;
    row-gap: 16px;
  }

  footer form {
    flex-direction: column;
    align-items: center;
  }

  footer input[type="text"] {
    width: 90%;
  }

  footer input[type="submit"] {
    margin-left: 0;
  }
}
/* ======================== */
/* 💬 フッターの背景色全幅化 */
/* ======================== */

footer {
  background: #e8e8e8;
  padding: 20px;
  text-align: center;
  margin: 0 auto; /* 上下の余白をなくして、中央に配置 */
  max-width: 100%;
  }
  
  footer form {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
  }
  
  footer input[type="text"] {
    padding: 8px;
    width: 60%;
    max-width: 300px;
  }
  
  footer input[type="submit"] {
    padding: 8px 12px;
  }
  
  /* ======================== */
  /* 🌟 フッター下の余白調整 */
  /* ======================== */
  body {
    margin-bottom: 0;
  }