.top-img {
  width: 100%; max-width: 960px; aspect-ratio: 16/9;
  background-size: cover; background-position: center; margin: 0 auto 16px;
  border: 1px solid #cfd8dc; border-radius: 8px;
}
.contents-inner { max-width: 960px; margin: 0 auto; }
.contents-message { margin: 12px 0 20px; line-height: 1.7; }
.contents-img {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.thumb {
  position: relative;
  width: 100%; aspect-ratio: 16/9;
  border: 1px solid #cfd8dc; border-radius: 8px; overflow: hidden;
  background: #f5f5f5;
  cursor: pointer;
}
.thumb .thumb-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.thumb .badge {
  position: absolute; right: 8px; bottom: 8px;
  font-size: 12px; background: rgba(0,0,0,0.6); color: #fff;
  padding: 2px 6px; border-radius: 4px;
}

/* --- viewer全体レイアウト --- */
.viewer {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8);
  display: none; align-items: center; justify-content: center; z-index: 9999;
}
.viewer.is-open { display: flex; }

.viewer-inner {
  position: relative;
  width: min(95vw, 1280px);
  max-height: 90vh;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- 中身全体を中央寄せに --- */
.viewer-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- 画像は自然サイズでcontain表示 --- */
.viewer-content img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* --- 16:9系コンテンツ（動画・PDF・YouTube） --- */
.r16x9 {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9比率 */
  background: #000;
}
.r16x9 > iframe,
.r16x9 > video,
.r16x9 > object {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.viewer-close {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.55); color: #fff; border: 0; border-radius: 6px;
  padding: 6px 10px; cursor: pointer; z-index: 2;
}
.r16x9 { position: relative; width: 100%; padding-top: 56.25%; background:#000; }
.r16x9 > iframe, .r16x9 > video, .r16x9 > img {
  position:absolute; inset:0; width:100%; height:100%; border:0; display:block; object-fit:contain;
}
@media (max-width: 640px) {
  .contents-img { grid-template-columns: 1fr; }
}
/* 音声プレイヤー用*/
.audio-box{
  width: min(90vw, 800px);
  max-width: 800px;
  padding: 16px 20px;
  background: #0b0b0b;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.audio-player{
  width: 100%;
  height: 40px;
}
.audio-title{
  color: #ddd;
  font-size: 14px;
  text-align: center;
  opacity: .9;
}
