/* =============================
   スライドショー全体
============================= */
.slideshow-container {
  position: relative;
  max-width: 600px;
  aspect-ratio: 16 / 9;
  margin: 10px auto 40px;
  overflow: hidden;
  border: 10px #C41E3A;
  border-radius: 10px;
  background: #000;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

/* =============================
   スライド画像
============================= */
.slideshow-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(90%) sepia(10%) saturate(90%);
  transition: opacity 1.5s ease-in-out;
  border-radius: 4px;
}

/* =============================
   フェードアニメーション
============================= */
.fade {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.fade.active {
  opacity: 1;
  z-index: 1;
}

/* =============================
   キャプション（背景付き・日本語＋英語）
============================= */
.caption {
  position: absolute;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  max-width: 90%;          /* 長文対応 */
  padding: 8px 12px;       /* 背景内余白 */
  text-align: center;
  color: #fff;
  opacity: 0;
  transition: all 1.2s ease-out;
  font-family: "Meiryo", "Meiryo UI", sans-serif;
  font-weight: bold;
  line-height: 1.1;
  background: rgba(255, 255, 255, 0.1); /* 半透明パネル */
  backdrop-filter: blur(4px);
  border-radius: 6px;
  word-break: break-word;   /* 長文折返し対応 */
}

/* 日本語 */
.caption .jp {
  font-size: 1.1rem;/*1.1rem;*/
  margin-bottom: 4px;
  letter-spacing: 1px;
  line-height: 1.1;
  color: #fff;
  -webkit-text-stroke: none; /* 枠を外す */
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

/* 英語（遅延フェードイン用） */
.caption .en {
  font-size: 0.95rem;
  opacity: 0; /* 初期は非表示 */
  font-family: "Georgia", serif;
  transition: opacity 1s ease-in-out 1.2s; /* 1.2秒遅延でフェードイン */
}

/* 表示中のスライドにだけ「ふわっと浮かぶ」 */
.fade.active .caption {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 英語部分の遅延フェードイン */
.fade.active .caption .en {
  opacity: 1;
}

/* 和風の柔らかい影を文字に */
.caption p {
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* =============================
   キャプション方向アニメーション
============================= */
.caption-up {
  transform: translateX(-50%) translateY(25px);
  transition: all 0.9s ease-out;
}
.fade.active .caption-up {
  transform: translateX(-50%) translateY(0);
}

.caption-down {
  transform: translateX(-50%) translateY(-25px);
  transition: all 1.4s ease-out;
}
.fade.active .caption-down {
  transform: translateX(-50%) translateY(0);
}

.caption-left {
  transform: translateX(-70%) translateY(0);
  transition: all 1.1s ease-out;
}
.fade.active .caption-left {
  transform: translateX(-50%) translateY(0);
}

.caption-right {
  transform: translateX(-30%) translateY(0);
  transition: all 1.6s ease-out;
}
.fade.active .caption-right {
  transform: translateX(-50%) translateY(0);
}

/* =============================
   アニメーション定義
============================= */
@keyframes fadeShow {
  0% { opacity: 0; }
  5% { opacity: 1; }
  25% { opacity: 1; }
  30% { opacity: 0; }
  100% { opacity: 0; }
}

/* 各スライドの開始時間をずらす */
.fade:nth-child(1) { animation-delay: 0s; }
.fade:nth-child(2) { animation-delay: 5s; }
.fade:nth-child(3) { animation-delay: 10s; }
.fade:nth-child(4) { animation-delay: 15s; }

/* =============================
   和風の雰囲気：背景
============================= */
body {
  background: radial-gradient(#fffbe8, #e7dcc2);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
}

/* =============================
   コントロールボタン配置
============================= */
.controls {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 10px;
  z-index: 10;
  white-space: nowrap;
}

.controls button {
  background-color: rgba(255, 255, 255, 0.55);
  color: #000;
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 8px 18px;
  min-width: 90px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: bold;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(3px);
  line-height: 1.2;
}

.controls button:hover {
  background-color: rgba(255, 255, 255, 0.7);
  transform: translateY(-2px);
}

/* =============================
   タブレット対応
============================= */
@media (max-width: 768px) {
  .slideshow-container { max-width: 90%; border-width: 4px; }

  .controls { bottom: 6px; gap: 8px; }
  .controls button { padding: 6px 12px; font-size: 0.9rem; min-width: 70px; }

  .caption { max-width: 95%; bottom: 12%; }
  .caption .jp { font-size: 1rem; }
  .caption .en { font-size: 0.8rem; transition-delay: 1s; }
}

/* =============================
   スマホ対応
============================= */
@media (max-width: 480px) {
  .slideshow-container { max-width: 95%; border-width: 3px; }

  .controls { gap: 6px; }
  .controls button { padding: 4px 10px; font-size: 0.8rem; min-width: 60px; }

  .caption { bottom: 10%; }
  .caption .jp { font-size: 0.95rem; }
  .caption .en { font-size: 0.75rem; transition-delay: 0.8s; }
}
