/* クリニックカルーセル専用CSS */

/* Glideのコアスタイル（CDNが使えない場合用） */
.glide {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.glide * {
  box-sizing: inherit;
}

.glide__track {
  overflow: hidden;
  border-radius: 8px;
}

.glide__slides {
  position: relative;
  width: 100%;
  list-style: none;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  touch-action: pan-Y;
  overflow: hidden;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  display: flex;
  flex-wrap: nowrap;
  will-change: transform;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.glide__slide {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  white-space: normal;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

/* メイン画像セクション */
.kl-main-image-section {
  display: block;
  margin-bottom: 0.5rem;
}

.kl-main-carousel {
  flex: 1;
  max-width: 100%;
  height: 480px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
  padding: 0 0.5rem;
}

.kl-main-carousel .glide__track {
  width: 100%;
  overflow: hidden;
}

.kl-main-carousel .glide__slides {
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  will-change: transform;
}

.kl-main-carousel .glide__slide {
  width: 100%;
  height: 480px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}


.kl-main-carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kl-basic-info {
  padding: 1rem 1.5rem;
}

/* カルーセルセクション */
.kl-carousel-section {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: #fafafa;
  border-radius: 8px;
}

.kl-carousel-title {
  margin: 0 0 1rem 0;
  color: #333;
  font-size: 1.1rem;
  font-weight: 600;
}

.kl-carousel-wrapper {
  position: relative;
}

/* カルーセルコンテナ */
.kl-carousel-wrapper .glide__slide {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 4px;
}

.kl-carousel-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}

/* 矢印ナビゲーション */
.glide__arrow {
  position: absolute;
  display: block;
  top: 50%;
  z-index: 2;
  color: white;
  background: rgba(82, 191, 255, 0.8);
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.glide__arrow:hover {
  background: rgba(82, 191, 255, 1);
  transform: translateY(-50%) scale(1.1);
}

.glide__arrow--left {
  left: 10px;
}

.glide__arrow--right {
  right: 10px;
}

.glide__arrow:disabled {
  opacity: 0.33;
  cursor: default;
}

/* ドットインジケーター */
.glide__bullets {
  position: absolute;
  z-index: 2;
  bottom: 10px;
  left: 50%;
  display: inline-flex;
  list-style: none;
  transform: translateX(-50%);
  gap: 5px;
}

.glide__bullet {
  background-color: rgba(255, 255, 255, 0.5);
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(82, 191, 255, 0.5);
  transition: all 0.3s ease;
  cursor: pointer;
}

.glide__bullet:hover,
.glide__bullet:focus {
  background-color: rgba(255, 255, 255, 0.8);
  border-color: var(--clinic-primary-color);
}

.glide__bullet--active {
  background-color: var(--clinic-primary-color);
  border-color: var(--clinic-primary-color);
}

/* 画像タイプバッジ */
.image-type-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(82, 191, 255, 0.9);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: bold;
  z-index: 1;
}

/* タグセクション */
.kl-tags {
  padding: 0.5rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.kl-tag {
  display: inline-block;
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  color: #333;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 1rem;
  font-weight: 500;
  border: 1px solid #90CAF9;
}

/* 電話番号ラベル */
.kl-phone-label::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2352BFFF' viewBox='0 0 24 24'%3E%3Cpath d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z'/%3E%3C/svg%3E");
}

/* Google Mapセクション */
.kl-map {
  padding: 1rem 1.5rem;
  background: #f9f9f9;
}

.kl-map iframe {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .kl-main-image-section {
    display: block;
    margin-bottom: 0.5rem;
  }
  
  .kl-main-carousel {
    height: 220px;
  }
  
  .kl-main-carousel .glide__slide {
    height: 220px;
  }
  
  .kl-carousel-section {
    padding: 0.75rem 1rem;
  }
  
  .kl-carousel-wrapper .glide__slide {
    height: 180px;
  }
  
  .glide__arrow {
    width: 35px;
    height: 35px;
    font-size: 20px;
  }
  
  .glide__arrow--left {
    left: 5px;
  }
  
  .glide__arrow--right {
    right: 5px;
  }
}

/* アニメーション */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.kl-carousel-container {
  animation: slideIn 0.5s ease;
}

/* ローディング状態 */
.kl-carousel-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  background: #f5f5f5;
  border-radius: 8px;
}

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

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