/* =============================================
   病院詳細ページ専用CSS - 改善版
   business-portal.cssのデザインシステムを継承
   ============================================= */

/* =============================================
   詳細ページレイアウト
   ============================================= */
.clinic-detail {
  max-width: 1000px;
  margin: 0 auto;
  padding-bottom: 3rem;
	width: 100%;
  overflow-x: hidden;
}

/* =============================================
   メインビジュアルエリア
   ============================================= */
.detail-main-visual {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  border-top: 4px solid var(--primary-color);
}

.detail-header {
  text-align: center;
  margin-bottom: 2rem;
}

.detail-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.3;
}

/* バッジ */
.detail-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
}

.detail-badge {
  padding: 0.375rem 0.875rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bg-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1;
}

.detail-badge.certification {
  background: var(--badge-certification);
}

.detail-badge.online {
  background: var(--badge-online);
}

.detail-badge.today {
  background: var(--badge-today);
}

.detail-badge.night {
  background: var(--badge-night);
}

.detail-badge.weekend {
  background: var(--badge-weekend);
}

/* アクションボタン */
.detail-actions {
  display: flex;
  gap: 1rem;
  flex-direction: column;
}

.detail-action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  position: relative;
	 max-width: 100%;
  word-break: break-word;
}

.detail-action-button.primary {
  background: var(--primary-color);
  color: var(--bg-primary);
}

.detail-action-button.primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 160, 233, 0.3);
}

.detail-action-button.secondary {
  background: var(--bg-primary);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.detail-action-button.secondary:hover {
  background: var(--primary-light);
}

.action-icon {
  font-size: 1.25rem;
}

.action-text {
  font-size: 0.875rem;
}

.action-number {
  font-size: 1.125rem;
  font-weight: 700;
}

/* =============================================
   詳細カード共通
   ============================================= */
.detail-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
	 max-width: 100%;
  overflow: hidden;
}

.detail-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-color);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* =============================================
   基本情報
   ============================================= */
.clinic-introduction {
  background: var(--bg-secondary);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  border-left: 3px solid var(--primary-color);
}

.clinic-introduction p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
  margin: 0;
}

.detail-info-grid {
  display: grid;
  gap: 1.5rem;
}

.detail-info-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  align-items: flex-start;
}

.info-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-label::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 50%;
}

.info-value {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.6;
}

/* 診療科目タグ */
.department-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.department-tag {
  padding: 0.25rem 0.75rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 4px;
  font-size: 0.8125rem;
  border: 1px solid var(--border-color);
  font-weight: 500;
}

/* 費用表示 */
.cost-value {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cost-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
}

.cost-note {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* 駅名 */
.station-name {
  color: var(--primary-color);
  font-weight: 500;
}

.station-separator {
  margin: 0 0.5rem;
  color: var(--text-light);
}

/* 待ち時間表示 */
.wait-time-value {
  font-weight: 600;
  color: var(--primary-color);
}

/* 予約の取りやすさ表示 */
.booking-rating {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.booking-stars {
  display: inline-flex;
  gap: 0.0625rem;
}

.booking-stars .star {
  color: var(--star-empty);
  font-size: 1rem;
}

.booking-stars .star.filled {
  color: var(--star-color);
}

.booking-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* =============================================
   診療時間
   ============================================= */
.schedule-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 既存の診療時間テーブルスタイルを継承・調整 */
.schedule-table-wrapper .hour_table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.schedule-table-wrapper .hour_table thead tr {
  background: var(--bg-secondary);
}

.schedule-table-wrapper .hour_table thead th,
.schedule-table-wrapper .hour_table thead td {
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-color);
}

.schedule-table-wrapper .hour_table thead th:first-child {
  background: var(--text-secondary);
  color: var(--bg-primary);
}

.schedule-table-wrapper .hour_table tbody th {
  background: var(--bg-secondary);
  padding: 0.625rem 0.75rem;
  text-align: left;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-light);
}

.schedule-table-wrapper .hour_table tbody td {
  padding: 0.5rem;
  text-align: center;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  position: relative;
  height: 40px;
}

/* 診療時間の備考 */
.schedule-note {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.note-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.note-value {
  color: var(--text-primary);
  font-size: 0.875rem;
}

.schedule-remark {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

/* =============================================
   特徴セクション
   ============================================= */
.clinic-philosophy,
.clinic-features {
  margin-bottom: 2rem;
}

.clinic-philosophy:last-child,
.clinic-features:last-child {
  margin-bottom: 0;
}

.philosophy-title,
.features-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--primary-color);
}

.philosophy-content {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.8;
  white-space: pre-wrap;
}

.philosophy-content p {
  margin-bottom: 1rem;
}

.philosophy-content p:last-child {
  margin-bottom: 0;
}

.feature-list {
  display: grid;
  gap: 0.75rem;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.feature-icon {
  color: var(--primary-color);
  font-weight: 700;
  flex-shrink: 0;
}

.feature-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* =============================================
   アクセス
   ============================================= */
.access-info {
  margin-bottom: 1.5rem;
}

.access-address,
.access-stations {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.access-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.access-text {
  color: var(--text-primary);
  font-size: 0.875rem;
  line-height: 1.6;
}

.map-container {
  width: 100%;
  height: 350px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid var(--border-light);
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.map-link {
  text-align: center;
}

.map-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  background: var(--bg-primary);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.map-button:hover {
  background: var(--primary-light);
}

.map-button::after {
  content: "↗";
  font-size: 0.75rem;
}

/* =============================================
   医師・スタッフ
   ============================================= */
.doctor-info {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.8;
  white-space: pre-wrap;
}

/* =============================================
   口コミ・評価セクション
   ============================================= */
.reviews-section {
  background: var(--bg-primary);
}

/* 平均評価表示 */
.average-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 400;
  margin-left: auto;
}

.rating-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
}

.rating-stars {
  display: inline-flex;
  gap: 0.0625rem;
}

.rating-stars .star {
  color: var(--star-empty);
  font-size: 1rem;
}

.rating-stars .star.filled {
  color: var(--star-color);
}

.rating-stars .star.half {
  color: var(--star-color);
  position: relative;
}

.rating-stars .star.half::before {
  content: '★';
  position: absolute;
  overflow: hidden;
  width: 50%;
  color: var(--star-empty);
}

.review-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* 口コミリスト */
.reviews-list {
  display: grid;
  gap: 1.5rem;
}

.review-item {
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.reviewer-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reviewer-name {
  font-weight: 600;
  color: var(--text-primary);
}

.reviewer-details {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.review-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.review-rating {
  display: inline-flex;
  gap: 0.0625rem;
}

.review-rating .star {
  color: var(--star-empty);
  font-size: 0.875rem;
}

.review-rating .star.filled {
  color: var(--star-color);
}

.review-date {
  font-size: 0.75rem;
  color: var(--text-light);
}

.review-content {
  margin-bottom: 1rem;
}

.review-content p {
  color: var(--text-primary);
  font-size: 0.875rem;
  line-height: 1.7;
  margin: 0;
}

.review-details {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.detail-item {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
}

.reviews-more {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.more-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0;
}

/* =============================================
   関連クリニック
   ============================================= */
.related-section {
  background: var(--bg-secondary);
}

.related-grid {
  display: grid;
  gap: 1rem;
}

.related-card {
  background: var(--bg-primary);
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.related-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.related-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.related-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.related-title a:hover {
  color: var(--primary-color);
}

.related-station,
.related-departments {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.related-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.75rem;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: var(--transition);
}

.related-link:hover {
  gap: 0.5rem;
}

/* =============================================
   レスポンシブ - タブレット
   ============================================= */
@media (min-width: 768px) {
  .detail-main-visual {
    padding: 2.5rem 2rem;
  }
  
  .detail-title {
    font-size: 2rem;
  }
  
  .detail-actions {
    flex-direction: row;
    justify-content: center;
  }
  
  .detail-action-button {
    min-width: 250px;
  }
  
  .detail-card {
    padding: 2.5rem 2rem;
  }
  
  .detail-section-title {
    font-size: 1.375rem;
  }
  
  .detail-info-item {
    grid-template-columns: 160px 1fr;
  }
  
  .info-label {
    font-size: 0.9375rem;
  }
  
  .clinic-introduction {
    padding: 1.25rem 1.5rem;
  }
  
  .clinic-introduction p {
    font-size: 0.9375rem;
  }
  
  .feature-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .map-container {
    height: 400px;
  }
  
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* 診療時間テーブルの調整 */
  .schedule-table-wrapper {
    margin: 0;
    padding: 0;
  }
  
  .schedule-table-wrapper .hour_table {
    font-size: 0.9375rem;
  }
  
  .schedule-table-wrapper .hour_table thead th,
  .schedule-table-wrapper .hour_table thead td {
    padding: 0.875rem 0.75rem;
    font-size: 0.875rem;
  }
  
  .schedule-table-wrapper .hour_table tbody th {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
  
  .schedule-table-wrapper .hour_table tbody td {
    padding: 0.625rem;
    height: 44px;
  }
  
  /* 口コミセクション */
  .review-header {
    flex-wrap: nowrap;
  }
  
  .review-meta {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
}

/* =============================================
   レスポンシブ - デスクトップ
   ============================================= */
@media (min-width: 1024px) {
  .clinic-detail {
    max-width: 1100px;
  }
  
  .detail-main-visual {
    padding: 3rem 2.5rem;
  }
  
  .detail-title {
    font-size: 2.25rem;
  }
  
  .detail-info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 2rem;
  }
  
  .detail-info-item {
    grid-template-columns: 120px 1fr;
  }
  
  .related-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .reviews-list {
    gap: 2rem;
  }
  
  .review-item {
    padding: 2rem;
  }
}

/* =============================================
   アニメーション
   ============================================= */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-card {
  animation: slideInUp 0.4s ease-out;
}

.detail-card:nth-child(2) { animation-delay: 0.1s; }
.detail-card:nth-child(3) { animation-delay: 0.2s; }
.detail-card:nth-child(4) { animation-delay: 0.3s; }
.detail-card:nth-child(5) { animation-delay: 0.4s; }
.detail-card:nth-child(6) { animation-delay: 0.5s; }

/* =============================================
   印刷用スタイル
   ============================================= */
@media print {
  .detail-actions,
  .related-section,
  .map-link,
  .reviews-more {
    display: none !important;
  }
  
  .detail-main-visual {
    border-top: 2px solid #000;
    box-shadow: none;
  }
  
  .detail-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
    margin-bottom: 1rem;
  }
  
  .map-container {
    height: 300px;
    border: 2px solid #000;
  }
  
  .review-item {
    border: 1px solid #ddd;
  }
}


/* モバイル専用スタイルを追加 */
@media (max-width: 767px) {
  .detail-main-visual,
  .detail-card {
    padding: 1.5rem 1rem;
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
  }
  
  .detail-info-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .info-label {
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  
  /* テーブルのコンテナ幅を制限 */
  .schedule-table-wrapper {
    max-width: 100vw;
    margin: 0 -1rem;
    padding: 0 1rem;
  }
}

/* グローバルに追加 */
.clinic-detail * {
  word-wrap: break-word;
  word-break: break-word;
}

/* 特定の要素に追加 */
.detail-title,
.clinic-name,
.feature-text,
.access-text {
  overflow-wrap: break-word;
  hyphens: auto;
}