/**
 * Photo Carousel Styles
 * ブイ写真カルーセルのスタイル
 */

 /* カルーセル本体を中央に配置 */
#buoy-photo-carousel {
  order: 2;
  flex: 1;
  /* max-width: 800px; */
  max-width: 100%;
}

#image-display {
  position: relative;
  width: 100%;
  /* height: 400px; */
  height: 60vh;
  max-height: 600px;
  overflow: hidden;
}

#image-display .caption {
  position: absolute;
  top: 40%;
  left: 3px;
  color: white; 
  padding: .5rem 1rem; 
  font-size: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  border-bottom: 4px solid rgba(0,0,0,0.3);
}
@media (max-width: 768px) {
  #image-display .caption {
    position: absolute;
    top: 5%;
    left: 3px;
    color: white; 
    padding: .5rem 1rem; 
    font-size: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    border-bottom: 4px solid rgba(0,0,0,0.3);
  }
}


/*
.photo-carousel {
  position: relative;
  width: 100%;

  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  background: var(--card-background);
} */
/*
.carousel-inner {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
} */

.carousel-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-item.active {
  opacity: 1;
  z-index: 2;
}

.carousel-item img.buoy-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  border: none;
  box-shadow: none;
  transition: transform 0.3s ease;
}

.carousel-item:hover img.buoy-photo {
  transform: scale(1.05);
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  padding: 2rem 1.5rem 1rem;
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.carousel-item:hover .carousel-caption {
  transform: translateY(0);
}

.carousel-caption p {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* 矢印ボタン - 非表示 */
.carousel-arrow {
  display: none;
}

.carousel-arrow:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.carousel-arrow i {
  font-size: 1.2rem;
  color: var(--primary-color);
}

/* ボタンを左右に配置 */
.carousel-prev {
  position: static;
  transform: none;
  order: 1;
}

.carousel-next {
  position: static;
  transform: none;
  order: 3;
}


/* ダークモード対応 */
[data-theme="dark"] .carousel-arrow {
  background: rgba(30, 30, 30, 0.9);
  color: var(--text-color);
}

[data-theme="dark"] .carousel-arrow:hover {
  background: rgba(30, 30, 30, 1);
}

[data-theme="dark"] .carousel-arrow i {
  color: var(--primary-color);
}

/* ドットナビゲーション */
.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.carousel-dot:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.2);
}

.carousel-dot.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(0, 102, 204, 0.5);
}

/* カウンター */
.carousel-counter {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .carousel-inner {
    height: 300px;
  }
  #buoy-photo-carousel {
    width: 100%;
  }

  .carousel-arrow {
    width: 40px;
    height: 40px;
  }

  .carousel-arrow i {
    font-size: 1rem;
  }

  .buoy-photos-container {
    gap: 0.5rem;
  }

  .carousel-caption {
    padding: 1.5rem 1rem 0.5rem;
  }

  .carousel-caption p {
    font-size: 0.9rem;
  }

  .carousel-counter {
    top: 10px;
    right: 10px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .carousel-dots {
    bottom: 15px;
  }

  .carousel-dot {
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 480px) {
  .carousel-inner {
    height: 250px;
  }

  .photo-carousel {
    border-radius: 15px;
  }

  .buoy-photos-container {
    flex-direction: column;
    gap: 1rem;
  }

  .carousel-prev,
  .carousel-next {
    position: static;
    order: initial;
  }

  .carousel-arrow {
    width: 35px;
    height: 35px;
  }

  .carousel-arrow i {
    font-size: 0.9rem;
  }

  /* モバイルでは下部に矢印を配置 */
  .mobile-carousel-controls {
    display: flex;
    justify-content: center;
    gap: 2rem;
    order: 4;
  }
}

/* アニメーション効果 */
.carousel-item {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ローディング状態 */
.carousel-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 400px;
  background: var(--card-background);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.carousel-loading::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* エラー状態 */
.carousel-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 400px;
  background: var(--card-background);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
  padding: 2rem;
}

.carousel-error p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0;
}

.carousel-error::before {
  content: '📷';
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* タッチデバイス用の改善 */
@media (hover: none) and (pointer: coarse) {
  .carousel-caption {
    transform: translateY(0);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  }

  .carousel-arrow {
    opacity: 0.8;
  }

  .carousel-item:hover img.buoy-photo {
    transform: none;
  }
}