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

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* 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,
.top-movie-facade {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  margin: 0;
  padding: 0;
  border: 0;
}

.top-movie-facade {
  appearance: none;
  color: #fff;
  background: #000;
  cursor: pointer;
  overflow: hidden;
}

.top-movie-poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-movie-poster[hidden] {
  display: none;
}

.top-movie-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 48px;
  border-radius: 14px;
  background: #f00;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  transform: translate(-50%, -50%);
  transition: filter 0.2s ease, transform 0.2s ease;
}

.top-movie-play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 17px solid #fff;
  transform: translate(-42%, -50%);
}

.top-movie-facade:hover .top-movie-play,
.top-movie-facade:focus-visible .top-movie-play {
  filter: brightness(1.12);
  transform: translate(-50%, -50%) scale(1.04);
}

/* 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-ad-frame {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
}

/* 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;
  }

  .top-movie-play {
    width: 56px;
    height: 40px;
    border-radius: 12px;
  }

  .top-movie-play::before {
    border-top-width: 8px;
    border-bottom-width: 8px;
    border-left-width: 14px;
  }

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

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

  .logo picture:last-child img {
    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: #FFF;
  font-size: 15px;
}

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

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


/* Accessibility: keyboard focus */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid #ffa200;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}


/* Mobile/PageSpeed safe image wrappers */
picture {
  display: contents;
}
.logo picture,
.content-links picture,
.backnumber-title picture,
.book-card picture,
.book-store-link picture,
.book-sns-link picture {
  line-height: 0;
}
