/* =============================================
   クリニック個別ページ用CSS（完全修正版）
   女性向けクリーンデザイン - スマホ完全対応
   ============================================= */

/* =============================================
   カラー変数定義
   ============================================= */
:root {
  --primary-color: #E91E63;
  --primary-light: #FCE4EC;
  --primary-dark: #C2185B;
  --secondary-color: #9C27B0;
  --secondary-light: #F3E5F5;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-light: #999999;
  --white: #FFFFFF;
  --background: #F8F9FA;
  --border-color: #E0E0E0;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --warning: #FF9800;
  
  /* 診療時間テーブル用カラー */
  --schedule-primary: #2196F3;
  --schedule-primary-light: #E3F2FD;
  --schedule-primary-dark: #1976D2;
  --schedule-accent: #03A9F4;
  --schedule-bg: #F5F9FF;
  --schedule-border: #B3D4FC;
  --schedule-text: #0D47A1;
  --schedule-available: #4CAF50;
  --schedule-unavailable: #E0E0E0;
}

/* =============================================
   基本レイアウト
   ============================================= */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}

.hospital-detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 20px;
}

/* クリニックヘッダー */
.hospital-detail .hospital-header {
  background: var(--white);
  padding: 20px 16px;
  margin: 0 -16px 16px;
  border-radius: 0;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.hospital-detail .hospital-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* =============================================
   基本情報セクション
   ============================================= */
.basic-info {
  background: var(--white);
  padding: 20px 16px;
  margin: 0 -16px 16px;
  border-radius: 0;
  box-shadow: var(--shadow-sm);
}

.basic-info h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 16px 0;
  padding-left: 12px;
  border-left: 4px solid var(--primary-color);
  line-height: 1.4;
}

.description-text,
.afterpill-section {
  margin-bottom: 24px;
}

.description-text p {
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.8;
  margin: 0;
}

/* 情報リスト */
.info-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.info-list dt {
  display: block;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0 0 6px 0;
  padding: 12px 0 0 0;
  border-top: 1px solid var(--border-color);
}

.info-list dt:first-of-type {
  border-top: none;
  padding-top: 0;
}

.info-list dd {
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 16px 0;
  padding: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.info-list dd:last-child {
  margin-bottom: 0;
}

/* 診療時間専用のdd */
.schedule-dd {
  margin: 0 -16px 16px !important;
  padding: 0 !important;
}

.schedule-text {
  padding: 0 16px;
  font-size: 14px;
  line-height: 1.8;
}

/* =============================================
   診療時間テーブル - コンパクト表示CSS（JS不要版）
   複数行を小さく表示してスクロール可能にする
   ============================================= */

/* 診療時間テーブルコンテナ */
.schedule-wrapper {
  width: calc(100% + 32px);
  margin-left: -16px;
  margin-right: -16px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  background: var(--white);
  padding: 12px 16px 8px;
  border-top: 1px solid var(--schedule-border);
  border-bottom: 1px solid var(--schedule-border);
  position: relative;
  max-height: 280px; /* 高さ制限 */
  scrollbar-width: thin;
  scrollbar-color: var(--schedule-primary-light) var(--background);
}

.schedule-wrapper::-webkit-scrollbar {
  height: 6px;
}

.schedule-wrapper::-webkit-scrollbar-track {
  background: var(--background);
}

.schedule-wrapper::-webkit-scrollbar-thumb {
  background: var(--schedule-primary-light);
  border-radius: 3px;
}

/* スクロールヒント */
.schedule-wrapper::before {
  content: "← 横スクロール可 →";
  display: block;
  text-align: center;
  font-size: 10px;
  color: var(--schedule-primary);
  background: var(--schedule-primary-light);
  padding: 3px 8px;
  border-radius: 4px;
  margin: 0 auto 8px;
  width: fit-content;
  font-weight: 500;
}

/* テーブル本体 */
.hour_table {
  width: auto;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 10px;
  background: var(--white);
  border: 1px solid var(--schedule-border);
  border-radius: 4px;
  overflow: hidden;
  margin: 0;
  table-layout: auto;
}

/* ヘッダー行 */
.hour_table thead tr {
  background: var(--schedule-primary);
}

.hour_table thead th,
.hour_table thead td {
  padding: 6px 3px;
  text-align: center;
  font-weight: 600;
  color: var(--white);
  font-size: 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  white-space: nowrap;
  vertical-align: middle;
  box-sizing: border-box;
}

.hour_table thead th {
  background: var(--schedule-primary-dark);
  width: 75px;
  min-width: 75px;
  max-width: 75px;
  text-align: left;
  padding-left: 6px;
  padding-right: 3px;
}

.hour_table thead td {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
}

.hour_table thead th:last-child,
.hour_table thead td:last-child {
  border-right: none;
}

/* 土曜日 */
.hour_table thead td.hour_sat {
  background: var(--schedule-accent);
}

/* 日曜・祝日 */
.hour_table thead td.hour_sun,
.hour_table thead td.hour_hol {
  background: #FF5252;
}

/* ボディ行 - コンパクト化 */
.hour_table tbody th {
  background: var(--schedule-bg);
  padding: 4px 3px 4px 6px;
  text-align: left;
  font-weight: 600;
  color: var(--schedule-text);
  font-size: 8px;
  border-right: 2px solid var(--schedule-border);
  border-bottom: 1px solid var(--schedule-border);
  white-space: nowrap;
  width: 75px;
  min-width: 75px;
  max-width: 75px;
  vertical-align: middle;
  box-sizing: border-box;
  line-height: 1.2;
  word-break: keep-all;
}

.hour_table tbody tr:last-child th {
  border-bottom: none;
}

/* データセル - 小型化 */
.hour_table tbody td {
  padding: 0;
  margin: 0;
  text-align: center;
  background: var(--white);
  border-right: 1px solid var(--schedule-border);
  border-bottom: 1px solid var(--schedule-border);
  position: relative;
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  height: 24px;
  min-height: 24px;
  vertical-align: middle;
  box-sizing: border-box;
  overflow: hidden;
}

.hour_table tbody tr:last-child td {
  border-bottom: none;
}

.hour_table tbody td:last-child {
  border-right: none;
}

/* 診療可能マーク */
.hour_mark_normal {
  background: var(--schedule-available) !important;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.hour_mark_normal::before {
  content: "○";
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: inline-block;
}

/* 診療不可 */
.hour_mark_none {
  background: var(--schedule-unavailable) !important;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.hour_mark_none::before {
  content: "×";
  color: #999;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  display: inline-block;
}

/* 土曜日の列 */
.hour_table tbody td.hour_sat {
  background: #E1F5FE;
}

.hour_table tbody td.hour_sat.hour_mark_normal {
  background: var(--schedule-available) !important;
}

.hour_table tbody td.hour_sat.hour_mark_none {
  background: #F5F5F5 !important;
}

/* 日曜・祝日の列 */
.hour_table tbody td.hour_sun,
.hour_table tbody td.hour_hol {
  background: #FFEBEE;
}

.hour_table tbody td.hour_sun.hour_mark_normal,
.hour_table tbody td.hour_hol.hour_mark_normal {
  background: var(--schedule-available) !important;
}

.hour_table tbody td.hour_sun.hour_mark_none,
.hour_table tbody td.hour_hol.hour_mark_none {
  background: #F5F5F5 !important;
}

/* =============================================
   タブレット以上での表示調整
   ============================================= */
@media (min-width: 768px) {
  .schedule-wrapper {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    border-radius: 8px;
    border: 1px solid var(--schedule-border);
    padding: 16px;
    max-height: 350px;
  }

  .schedule-wrapper::before {
    display: none;
  }

  .hour_table {
    font-size: 11px;
  }

  .hour_table thead th {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    padding: 8px 4px 8px 10px;
    font-size: 11px;
  }

  .hour_table thead td {
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    padding: 8px 4px;
    font-size: 11px;
  }

  .hour_table tbody th {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    padding: 6px 4px 6px 10px;
    font-size: 9px;
  }

  .hour_table tbody td {
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    height: 28px;
    min-height: 28px;
  }

  .hour_mark_normal::before {
    font-size: 13px;
  }

  .hour_mark_none::before {
    font-size: 11px;
  }
}

/* =============================================
   デスクトップでの表示
   ============================================= */
@media (min-width: 1024px) {
  .schedule-wrapper {
    max-height: 400px;
    padding: 20px;
  }

  .hour_table {
    font-size: 12px;
  }

  .hour_table thead th {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    padding: 10px 6px 10px 12px;
    font-size: 12px;
  }

  .hour_table thead td {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    padding: 10px 6px;
    font-size: 12px;
  }

  .hour_table tbody th {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    padding: 7px 6px 7px 12px;
    font-size: 10px;
  }

  .hour_table tbody td {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    height: 30px;
    min-height: 30px;
  }

  .hour_mark_normal::before {
    font-size: 14px;
  }

  .hour_mark_none::before {
    font-size: 12px;
  }
}

/* =============================================
   印刷用
   ============================================= */
@media print {
  .schedule-wrapper {
    max-height: none;
    overflow: visible;
    border: 1px solid #000;
    page-break-inside: avoid;
  }

  .schedule-wrapper::before {
    display: none;
  }

  .hour_table {
    border: 2px solid #000;
  }

  .hour_table thead tr {
    background: #E3F2FD !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .hour_table thead th,
  .hour_table thead td {
    color: #000 !important;
    border: 1px solid #000;
  }

  .hour_mark_normal {
    background: #4CAF50 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .hour_mark_normal::before,
  .hour_mark_none::before {
    color: #000;
  }
}

/* =============================================
   アフターピル情報
   ============================================= */
.highlight-dt {
  background: var(--primary-light);
  padding: 10px 12px;
  margin: 0 0 8px 0;
  border-radius: 6px;
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 14px;
}

.highlight-dd {
  background: rgba(233, 30, 99, 0.05);
  padding: 14px 12px;
  margin: 0 0 20px 0;
  border-radius: 6px;
  border: 1px solid var(--primary-light);
}

.afterpill-info {
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.6;
}

.afterpill-info:last-child {
  margin-bottom: 0;
}

.afterpill-info strong {
  color: var(--primary-dark);
  margin-right: 6px;
  font-weight: 600;
}

.price-highlight {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
}

/* =============================================
   リンクボタン
   ============================================= */
.official-link-wrapper,
.detail-link-wrapper {
  margin-top: 16px;
  text-align: center;
}

.official-link,
.detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  background: var(--primary-color);
  color: var(--white);
  text-decoration: none;
  border-radius: 24px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s;
  min-height: 44px;
}

.official-link:hover,
.detail-link:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(233, 30, 99, 0.3);
}

.official-link::after {
  content: "🔗";
  font-size: 14px;
}

/* 駅リンク */
.station-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dashed var(--primary-color);
  transition: all 0.2s;
}

.station-link:hover {
  color: var(--primary-dark);
  border-bottom-style: solid;
}

/* =============================================
   特徴セクション
   ============================================= */
.features {
  background: var(--white);
  padding: 20px 16px;
  margin: 0 -16px 16px;
  box-shadow: var(--shadow-sm);
}

.features h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 16px 0;
  padding-left: 12px;
  border-left: 4px solid var(--secondary-color);
}

.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-tag {
  display: inline-block;
  padding: 8px 14px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 18px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

/* 特徴タグのバリエーション */
.feature-female-doctor {
  background: #FCE4EC;
  color: #C2185B;
}

.feature-online {
  background: #E3F2FD;
  color: #1976D2;
}

.feature-holiday {
  background: #FFF3E0;
  color: #F57C00;
}

.feature-card {
  background: #F3E5F5;
  color: #7B1FA2;
}

.feature-english {
  background: #E8F5E9;
  color: #388E3C;
}

/* =============================================
   エリア情報
   ============================================= */
.area-info {
  background: var(--white);
  padding: 20px 16px;
  margin: 0 -16px 16px;
  box-shadow: var(--shadow-sm);
}

.area-info h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px 0;
  padding-left: 12px;
  border-left: 4px solid var(--secondary-color);
}

.area-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.area-tags li {
  margin: 0;
  padding: 0;
}

.area-tags li a {
  display: inline-block;
  padding: 8px 16px;
  background: var(--secondary-light);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 18px;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.2s;
  min-height: 36px;
  line-height: 1.4;
}

.area-tags li a:hover {
  background: var(--secondary-color);
  color: var(--white);
}

/* =============================================
   口コミセクション
   ============================================= */
.reviews {
  background: var(--white);
  padding: 20px 16px;
  margin: 0 -16px 16px;
  box-shadow: var(--shadow-sm);
}

.reviews h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 16px 0;
  padding-left: 12px;
  border-left: 4px solid var(--primary-color);
}

.rating-summary {
  background: var(--primary-light);
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  margin-bottom: 20px;
}

.rating-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-dark);
  display: block;
  margin-bottom: 8px;
}

.rating-stars {
  display: flex;
  gap: 3px;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 8px;
}

.star {
  color: #ddd;
}

.star.filled {
  color: #FFB800;
}

.total-reviews {
  color: var(--text-secondary);
  font-size: 12px;
}

.review-item {
  background: var(--background);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.review-header {
  margin-bottom: 12px;
}

.reviewer-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  display: block;
  margin-bottom: 4px;
}

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

.review-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.review-rating {
  display: flex;
  gap: 2px;
  font-size: 13px;
}

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

.review-text {
  line-height: 1.7;
  color: var(--text-primary);
  font-size: 14px;
  margin: 8px 0 0 0;
}

.no-reviews {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* =============================================
   関連病院
   ============================================= */
.related-hospitals {
  background: var(--background);
  padding: 24px 16px;
  margin: 0 -16px 0;
}

.related-hospitals h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 16px 0;
  text-align: center;
}

.related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.related-list li {
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.related-list li:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.related-list a {
  display: block;
  padding: 14px;
  text-decoration: none;
  color: var(--text-primary);
}

.related-list h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: var(--primary-color);
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
}

.related-list .address {
  font-size: 13px;
  color: var(--text-secondary);
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.5;
}

/* =============================================
   タブレット以上
   ============================================= */
@media (min-width: 768px) {
  .hospital-detail {
    padding: 0 24px 30px;
  }

  .hospital-detail .hospital-header,
  .basic-info,
  .features,
  .area-info,
  .reviews,
  .related-hospitals {
    margin-left: 0;
    margin-right: 0;
    border-radius: 12px;
  }

  .hospital-detail .hospital-header {
    padding: 28px 32px;
    margin-bottom: 24px;
  }

  .hospital-detail .hospital-title {
    font-size: 28px;
  }

  .basic-info,
  .features,
  .area-info,
  .reviews {
    padding: 28px 32px;
    margin-bottom: 24px;
  }

  .related-hospitals {
    padding: 32px;
    margin-bottom: 0;
  }

  .schedule-dd {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .schedule-wrapper {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    border-radius: 8px;
    border: 1px solid var(--schedule-border);
    padding: 20px;
  }

  .schedule-wrapper::before {
    display: none;
  }

  .hour_table {
    font-size: 12px;
  }

  .hour_table thead th {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    padding-left: 12px;
  }

  .hour_table thead td {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    padding: 12px 6px;
    font-size: 12px;
  }

  .hour_table tbody th {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    padding: 10px 6px 10px 12px;
    font-size: 11px;
  }

  .hour_table tbody td {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    height: 38px;
    min-height: 38px;
  }

  .hour_mark_normal::before {
    font-size: 15px;
  }

  .hour_mark_none::before {
    font-size: 13px;
  }

  .related-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .official-link-wrapper,
  .detail-link-wrapper {
    text-align: left;
  }
}

/* =============================================
   デスクトップ
   ============================================= */
@media (min-width: 1024px) {
  .hospital-detail {
    max-width: 1000px;
  }

  .related-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .hour_table {
    font-size: 13px;
  }

  .hour_table thead th {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
  }

  .hour_table thead td {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    font-size: 13px;
  }

  .hour_table tbody th {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
    font-size: 12px;
  }

  .hour_table tbody td {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    height: 42px;
    min-height: 42px;
  }

  .hour_mark_normal::before {
    font-size: 16px;
  }

  .hour_mark_none::before {
    font-size: 14px;
  }
}

/* =============================================
   印刷用
   ============================================= */
@media print {
  .reviews,
  .related-hospitals {
    display: none;
  }

  .hospital-detail {
    padding: 0;
  }

  * {
    box-shadow: none !important;
  }

  .schedule-wrapper::before {
    display: none;
  }
}