/* ===== 25thmap page PC styles ===== */

/* ===== Prevent page scroll ===== */
html,
body {
  overflow: hidden;
  height: 100%;
  background-color: #F0F1F1;
  margin-top: auto;
  margin-bottom: auto;
}

/* main {
  overflow: hidden;
  height: 100vh;
} */

main {
  width: 1400px;
  height: 900px;
  margin: 0 auto;
  background-color: #fff;
}

/* ===== Header customization (inside Swiper) ===== */
.main-header {
  position: relative;
  z-index: 100;
  padding: 24px 50px 0;
  width: 100%;
  box-sizing: border-box;
}

.main-header .header-inner {
  padding: 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.header-link {
  color: #307B53;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.header-link:hover {
  opacity: 0.75;
}

.header-separator {
  color: #307B53;
}

.header-lang {
  font-size: 14px;
}

.lang-link {
  color: #307B53;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.lang-link:hover {
  opacity: 0.75;
}

.lang-link .lang-en,
.lang-link .lang-jp {
  transition: text-decoration 0.2s ease;
}

.lang-link .lang-en.active,
.lang-link .lang-jp.active {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Episode00スライドでは言語オプションボタンを非表示 */
.artwork-carousel.is-episode00-slide .header-lang {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* 1枚目（イントロ）では左矢印を非表示 */
.artwork-carousel.is-intro-slide .swiper-button-prev {
  display: none;
}

/* 最後のスライド（Episode00）では右矢印を非表示 */
.artwork-carousel.is-last-slide .swiper-button-next {
  display: none;
}

/* ===== Swiper Carousel Container ===== */
.artwork-carousel {
  width: 1400px;
  height: 100vh;
  max-height: 990px;
  position: relative;
  margin: 0 auto;
  background-color: #fff;
  overflow: hidden;
}


.artwork-carousel .swiper-slide {
  width: 100%;
  min-height: 865px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  margin-top: 0;
  padding-top: 80px;
  padding-bottom: 80px;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
}

/* ===== Slide 1: Intro/Title Page ===== */
.slide-intro {
  background-color: #fff;
}

.slide-intro-content {
  text-align: left;
  max-width: 800px;
  padding: 0 24px;
  margin-top: 0;
  min-height: 865px;
}

.slide-intro-artist {
  margin: 0 0 24px;
  font-size: 18px;
  color: #307B53;
  font-weight: 700;
  font-size: 40px;
}

.slide-intro-title {
  margin: 0 0 16px;
  font-size: 66px;
  font-weight: 700;
  color: #307B53;
  line-height: 1.3;
}

.slide-intro-title-number {
  color: #307B53;
  font-family: 'FOT-Cezanne ProN', sans-serif;
  /*font-size: 77px;*/
  font-weight: 700;
  margin-right: 15px;
}

.slide-intro-subtitle {
  margin: 0 0 48px;
  font-size: 38px;
  color: #307B53;
  font-weight: 700;
}

.slide-intro-text {
  text-align: left;
  font-size: 27px;
  line-height: 1.8;
  color: #307B53;
  max-width: 800px;
  margin: 0 auto;
  font-weight: 700;
}

.slide-intro-text p {
  margin: 0 0 0;
}

.slide-intro-text p:last-child {
  margin-bottom: 0;
}

/* ===== Slide 2-N-1: Episode Slides ===== */
.slide-episode {
  background-color: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: auto;
  padding: 80px 0;
}

.slide-episode-wrapper {
  width: auto;
  max-width: 1090px;
  height: auto;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  box-sizing: border-box;
  min-height: 865px;
}

.slide-episode-image {
  width: 690px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 36px;
}

/* 複数画像の場合のラッパー */
.slide-episode-images-multiple {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 690px;
}

.slide-episode-image img {
  width: auto;
  height: auto;
  max-width: 690px;
  max-height: 690px;
  object-fit: contain;
  object-position: center center;
  display: block;
}

/* 複数画像の場合のサイズ調整 */
.slide-episode-images-multiple img {
  max-height: 400px;
  width: auto;
}

.slide-episode-content {
  width: 350px;
  min-height: auto;
  max-height: 850px;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
  overflow-y: auto;
  flex-shrink: 0;
}

.slide-episode-title {
  margin: 0 0 32px;
  font-size: 29px;
  font-weight: 700;
  color: #307B53;
  line-height: 1.3;
}

.slide-episode-title .episode-number {
  font-size: 29px;
  font-weight: 500;
}

.slide-episode-title .episode-total {
  font-size: 21px;
  font-weight: 400;
}

.slide-episode-title .episode-title-another-label {
  font-weight: 400;
  font-size: 21px;
}

.slide-episode-text {
  font-size: 16px;
  line-height: 1.8;
  color: #307B53;
}

.slide-episode-text p {
  margin: 0 0 0;
    text-align: justify;
}

.slide-episode-text p span{
    font-size: 14px;
    color: rgb(143, 139, 139);
}

.slide-episode-text p:last-child {
  margin-bottom: 0;
}

/* ===== Slide N: Episode00 ===== */
/* OverlayScrollbars用のスタイル */
.slide-episode00 {
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.slide-episode00-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.slide-episode00 .episode-section {
  padding: 0;
}

.slide-episode00 .episode-list {
  display: flex;
  flex-direction: column;
  max-width: 1000px;
  height: 446px;
  margin: 0 auto;
  background-color: #E8E8E8;
  position: relative;
  box-sizing: border-box;
  /* OverlayScrollbarsが管理するためoverflowは削除 */
}

.slide-episode00 .episode-list-inner {
  height: 100%;
  /* OverlayScrollbarsが管理するためoverflowは削除 */
  padding: 30px 0;
  box-sizing: border-box;
  background-color: #F0F1F1;
}

/* ===== OverlayScrollbars カスタムテーマ ===== */
.os-scrollbar.os-scrollbar-vertical.os-theme-oisix {
  width: 20px !important;
    margin-right: 8px;
}

.os-scrollbar.os-scrollbar-horizontal.os-theme-oisix {
  height: 20px !important;
}

.os-scrollbar.os-theme-oisix .os-scrollbar-track {
  background: #E8E8E8 !important;
  border-radius: 10px !important;
  width: 100% !important;
}

.os-scrollbar.os-theme-oisix .os-scrollbar-handle {
  background: #307B53 !important;
  border-radius: 10px !important;
  min-height: 30px !important;
  width: 100% !important;
}

.os-scrollbar.os-theme-oisix .os-scrollbar-handle:hover {
  background: #286045 !important;
}

.os-scrollbar.os-theme-oisix .os-scrollbar-handle:active {
  background: #1f4d35 !important;
}

/* OverlayScrollbars 要素 */
.slide-episode00 .episode-list-inner[data-overlayscrollbars-viewport] {
  overflow-x: hidden !important;
  overflow-y: scroll !important;
}

.slide-episode00 .episode-item {
  position: relative;
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 10px;
  width: 785px;
  margin: 0 auto 10px;
  border: 1px solid #307B53;
  transform: translateX(-10px);
}

.slide-episode00 .episode-text {
  margin: 10px 30px;
  font-size: 16px;
  color: #307B53;
}

.slide-episode00 .episode-author {
  display: block;
  margin-right: 10px;
  font-size: 16px;
  color: #307B53;
  text-align: right;
}

/* ===== Swiper Navigation Buttons ===== */
.artwork-carousel .swiper-button-next,
.artwork-carousel .swiper-button-prev {
  width: 30px;
  height: 111px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  outline: none;
  transition: opacity 0.3s ease;
  margin-top: 0;
  top: 55%;
  transform: translateY(-50%);
}

.artwork-carousel .swiper-button-next {
  right: 50px;
  background-image: url('../imgs/next.png');
}

.artwork-carousel .swiper-button-prev {
  left: 50px;
  background-image: url('../imgs/prev.png');
}

.artwork-carousel .swiper-button-next:hover,
.artwork-carousel .swiper-button-prev:hover {
  opacity: 0.75;
}

.artwork-carousel .swiper-button-next::after,
.artwork-carousel .swiper-button-prev::after {
  display: none;
}

.artwork-carousel .swiper-button-next {
  right: 50px;
}

.artwork-carousel .swiper-button-prev {
  left: 50px;
}

.artwork-carousel .swiper-button-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ===== Swiper Pagination ===== */
.artwork-carousel .swiper-pagination {
  display: none; /* デフォルトのページネーションを非表示 */
}

/* ===== Footer Progress Bar ===== */
.main-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0;
  background-color: transparent;
}

.progress-bar-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 50px 20px;
  box-sizing: border-box;
}

.progress-bar {
  width: 100%;
  height: 15px;
  background-color: #E8E8E8;
  position: relative;
  overflow: visible;
  cursor: pointer;
}

.progress-bar-indicator {
  width: 15px;
  height: 15px;
  background-color: #307B53;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  transition: left 0.3s ease;
}

/* ===== Swiper Progress Bar (inside carousel) ===== */
.swiper-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 0 50px;
  box-sizing: border-box;
  z-index: 10;
  background-color: #F0F1F1;
  /* border-bottom: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #fff; */
}

.swiper-progress-bar .progress-bar {
  width: 100%;
  height: 15px;
  background-color: #E8E8E8;
  position: relative;
  overflow: visible;
  cursor: pointer;
}

.swiper-progress-bar .progress-bar-indicator {
  width: 15px;
  height: 15px;
  background-color: #307B53;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  transition: left 0.3s ease;
}

/* ===== Image Modal ===== */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  background-color: rgba(232, 232, 232, 0.75);
}

.image-modal[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.image-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  cursor: pointer;
}

.image-modal-content {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  max-height: 733px;
}

.image-modal-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
  z-index: 10;
  transform: translate(50%, -50%);
}

.image-modal-close:hover {
  opacity: 0.75;
}

.image-modal-close img {
  width: 40px;
  height: 40px;
  display: block;
}

.image-modal-image-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.image-modal-image {
  display: block;
  max-width: 1100px;
  max-height: 733px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ===== Image Loading Animation ===== */
.image-loader-container {
  position: relative;
  display: inline-block;
  min-width: 200px;
  min-height: 200px;
}

.image-loader-container img {
  display: block;
  max-width: 100%;
  cursor: pointer;
}

.image-loader-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid #e0e0e0;
  border-top-color: #307B53;
  border-radius: 50%;
  animation: image-loader-spin 0.8s linear infinite;
  z-index: 1;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.image-loaded .image-loader-spinner,
.image-error .image-loader-spinner {
  opacity: 0;
}

.image-loaded img {
  opacity: 1 !important;
}

.image-error .image-loader-spinner::after {
  content: '✕';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  color: #e74c3c;
  animation: none;
}

@keyframes image-loader-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ===== Slide Animation Enhancement ===== */
.swiper-slide {
  opacity: 1;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ===== Episode Image Click Cursor ===== */
.slide-episode-image {
  cursor: pointer;
}

.slide-episode-image img {
  cursor: pointer;
}

/* ===== 中間幅（1399px〜769px）: 作品を縮小して右側（言語・矢印）を表示 ===== */
@media (max-width: 1360px) and (min-width: 769px) {
  main {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }

  .artwork-carousel {
    width: 100%;
    max-width: 100%;
  }

  .main-header {
    padding-left: 24px;
    padding-right: 24px;
  }

  .artwork-carousel .swiper-button-next {
    right: 24px;
  }

  .artwork-carousel .swiper-button-prev {
    left: 24px;
  }

  /* イントロスライド：左右矢印と重ならないよう余白確保 */
  .slide-intro-content {
    max-width: calc(100vw - 120px);
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
  }

  .slide-intro-text {
    max-width: 100%;
  }

  /* 作品エリア：左右矢印（各約60px）と重ならないよう余白確保 */
  .slide-episode-wrapper {
    max-width: calc(100vw - 120px);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0 8px;
    box-sizing: border-box;
  }

  .slide-episode-image {
    flex: 1 1 54%;
    min-width: 0;
    max-width: 690px;
    margin-right: 16px;
  }

  .slide-episode-image img {
    max-width: 100%;
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .slide-episode-images-multiple {
    flex: 1 1 54%;
    min-width: 0;
    max-width: 690px;
    margin-right: 16px;
  }

  .slide-episode-images-multiple img {
    max-width: 100%;
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .slide-episode-content {
    flex: 1 1 40%;
    min-width: 200px;
    max-width: 350px;
    width: auto;
  }

  /* Episode00 中間幅で幅を可変・矢印と重ならないよう余白確保 */
  .slide-episode00 .container {
    width: 100%;
    max-width: calc(100vw - 120px);
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
  }

  .slide-episode00 .episode-list {
    max-width: 100%;
  }

  .slide-episode00 .episode-item {
    box-sizing: border-box;
      max-width: 80%;
  }
}

/* ===== PC・高さ900px未満: プログレスバーを下部固定 ===== */
@media (min-width: 769px) and (max-height: 900px) {
  .swiper-progress-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1400px;
    z-index: 50;
    padding: 0 0 50px;
    box-sizing: border-box;
    background-color: #F0F1F1;
  }

  /* スライド高さをビューポート内に制限し、縦スクロールを有効にする（ベースの min-height: 865px を上書き） */
  .artwork-carousel .swiper-slide {
    min-height: 0 !important;
    max-height: 100vh;
    overflow-y: auto;
  }

  /* 高さ900px未満: 矢印をブラウザ高さの中央に配置 */
  .artwork-carousel .swiper-button-next,
  .artwork-carousel .swiper-button-prev {
    position: fixed !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-top: 0 !important;
  }
}
