/* Global Styles */
body {
  margin: 0;
  background-color: #000;
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

/* Header */
header {
  text-align: center;
  margin: 10px 0 10px 0; /* ヘッダーとトップ画像の間に10pxの隙間 */
  padding: 0;
}

/* ロゴと免責はピッタリ */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 0;
}

.logo img {
  margin: 0;
  padding: 0;
  border: 0;
  display: block;
}

/* Top Movie */
.intro {
  width: 100%;
  margin: 0;
  padding: 0;
}

.top-movie {
  position: relative;
  display: block;
  width: 800px;
  height: 450px;
  max-width: 100%;
  margin: 0 auto 10px;
  padding: 0;
  line-height: 0;
  background-color: #000;
  overflow: hidden;
}

.top-movie iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  margin: 0;
  padding: 0;
  border: 0;
}

/* Content Links Layout */
.content-links {
  display: flex;
  justify-content: space-between;
  max-width: 800px;
  margin: 0px auto;
  gap: 20px;
}

.content-left,
.content-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.content-left img,
.content-right img {
  display: block;
  margin: 0 auto;
}

/* Grid Buttons */
.grid-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  justify-content: center;
}

.grid-buttons img {
  display: block;
  width: auto;
  height: auto;
}

/* Hover Animation */
.content-links img {
  transition: filter 0.3s ease, transform 0.3s ease;
}

.content-links img:hover {
  filter: brightness(1.5);
  transform: scale(1.02);
}

/* Back Number */
.backnumber {
  max-width: 800px;
  margin: 74px auto 0;
  text-align: center;
}

.backnumber-title {
  margin: 0;
  line-height: 0;
}

.backnumber-title img {
  display: block;
  width: 410px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.book-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, 185px);
  justify-content: center;
  gap: 0 20px;
  margin-top: 32px;
}

.book-card {
  width: 185px;
  margin: 0;
}

.book-cover {
  display: block;
  width: 185px;
  height: auto;
  margin: 0 auto;
}

.book-store-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px; /* アイコン同士の余白を6pxで等間隔に固定 */
  margin-top: 6px;
}

.book-store-link {
  display: inline-flex;
  width: 45px;
  height: 45px;
  line-height: 0;
  transition: filter 0.3s ease, transform 0.3s ease;
}

.book-store-link img {
  display: block;
  width: 45px;
  height: 45px;
  object-fit: contain;
}

.book-store-link:hover {
  filter: brightness(1.18);
  transform: translateY(-1px);
}

.book-meta {
  margin: 6px 0 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.book-title {
  color: #FFF;
}

.book-volume {
  color: #FFF;
  margin-left: 6px;
}

.book-sns-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 30px;
}

.book-sns-link {
  display: inline-flex;
  width: 45px;
  height: 45px;
  line-height: 0;
  transition: filter 0.3s ease, transform 0.3s ease;
}

.book-sns-link img {
  display: block;
  width: 45px;
  height: 45px;
  object-fit: contain;
}

.book-sns-link:hover {
  filter: brightness(1.18);
  transform: translateY(-1px);
}

/* A8.net Ads */
.a8-ads {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  margin: 30px auto 0;
}

.a8-ad {
  flex: 0 0 300px;
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  height: 250px;
  line-height: 0;
  text-align: center;
  overflow: hidden;
}

/* A8.netがJavaScriptで生成する300×250素材を原寸表示する */
.a8-ad iframe,
.a8-ad > a,
.a8-ad > a > img {
  width: 300px !important;
  min-width: 300px !important;
  max-width: 300px !important;
}

.a8-ad iframe,
.a8-ad > a > img {
  height: 250px !important;
}

/* Responsive (max-width: 768px) */
@media (max-width: 768px) {
  .content-links {
    flex-direction: column;
    align-items: center;
    max-width: 300px;
    gap: 10px;
  }

  .top-movie {
    width: 300px;
    height: 168.75px;
    max-width: calc(100vw - 20px);
    margin: 0 auto 10px;
  }

  .content-left img,
  .content-right img {
    max-width: 300px;
    height: auto;
  }

  .logo {
    flex-direction: column;
    gap: 0; /* スマホでもピッタリ */
  }

  .logo img:nth-child(2) {
    max-width: 300px;
    width: 300px;
    height: auto;
  }

  .grid-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    justify-content: center;
  }

  .grid-buttons img {
    max-width: 148px;
    height: auto;
  }

  .content-links img {
    transition: none;
  }

  .content-links img:hover {
    filter: none;
    transform: none;
  }

  .backnumber {
    max-width: 300px;
    margin-top: 74px;
  }

  .backnumber-title img {
    width: 250px;
  }

  .book-list {
    grid-template-columns: repeat(auto-fit, 130px);
    gap: 32px 20px;
    margin-top: 30px;
  }

  .book-card {
    width: 130px;
  }

  .book-cover {
    width: 130px;
  }

  .book-store-links {
    gap: 6px; /* レスポンシブ時もアイコン間を6pxに固定 */
    margin-top: 6px;
  }

  .book-store-link,
  .book-store-link img {
    width: 30px;
    height: 30px;
  }

  .book-store-link {
    transition: none;
  }

  .book-store-link:hover {
    filter: none;
    transform: none;
  }

  .book-sns-links {
    gap: 6px;
    margin-top: 30px;
  }

  .book-sns-link {
    transition: none;
  }

  .book-sns-link:hover {
    filter: none;
    transform: none;
  }

  .book-meta {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.25;
  }

  .book-volume {
    margin-left: 4px;
  }

  .a8-ads {
    flex-direction: column;
    align-items: center;
    gap: 10px;          /* モバイル版：広告1枚目 ↔ 2枚目を10pxに固定 */
    row-gap: 10px;
    margin-top: 30px;
  }

  .a8-ad {
    flex: 0 0 250px;
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    height: 250px;      /* A8側の計測タグ・余白に引っ張られないよう広告枠を固定 */
    min-height: 250px;
    max-height: 250px;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    font-size: 0;
    line-height: 0;
  }

  .a8-ad + .a8-ad {
    margin-top: 0 !important;
  }

  .a8-ad > *,
  .a8-ad a,
  .a8-ad iframe,
  .a8-ad img {
    margin: 0 !important;
    padding: 0 !important;
  }

  .a8-ad iframe,
  .a8-ad a,
  .a8-ad a > img,
  .a8-ad img[width="300"],
  .a8-ad img[height="250"] {
    display: block !important;
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
    height: 250px !important;
    min-height: 250px !important;
    max-height: 250px !important;
  }

}

/* Footer */
footer {
  text-align: center;
  margin-top: 30px;      /* SNSボタン ↔ フッター の間を30px */
  padding-bottom: 10px;  /* ← 追加：フッダー文字 ↔ 画面下 を 10px 空ける */
}

footer p {
  margin: 0;
  color: #ffa200;
  font-size: 15px;
}

/* Footer link（「最果の扉 公式」だけ白く＆下線なし） */
.footer-link,
.footer-link:visited {
  color: #FFF;
  text-decoration: none;
}

.footer-link:hover,
.footer-link:active,
.footer-link:focus {
  color: #FFF;
  text-decoration: none;
  outline: none;
}

@media (max-width: 768px) {
  footer {
    margin-top: 30px;
  }
}

@media (max-width: 330px) {
  .top-movie {
    width: calc(100vw - 20px);
    height: calc((100vw - 20px) * 0.5625);
  }
}
