/* 前台網頁樣式（Sneat／Bootstrap 5 之上） */

:root {
  --site-header-height: 72px;
}

body.site {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
  background-color: var(--site-bg, #fff);
  background-image: var(--site-bg-image, none);
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  color: #444;
}

html {
  scroll-behavior: smooth;
}

/* 固定頁首時，錨點跳轉不要被頁首遮住 */
.site-header-fixed {
  padding-top: var(--site-header-height);
}

.site-section,
.site-section-alias {
  scroll-margin-top: calc(var(--site-header-height) + 8px);
}

/* 設定自訂錨點名稱後保留的 s-UUID 錨點，位置與區塊頂端相同 */
.site-section {
  position: relative;
}

.site-section-alias {
  position: absolute;
  top: 0;
  left: 0;
}

/* ===== 頁首 ===== */
.site-header {
  background: linear-gradient(to right, var(--nav-start), var(--nav-end));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  z-index: 1030;
}

.site-header .navbar {
  min-height: var(--site-header-height);
}

.site-logo {
  max-height: 52px;
  max-width: 240px;
  width: auto;
}

.site-brand-text,
.site-header .navbar-toggler {
  color: var(--nav-text) !important;
}

/* 選單項目可個別設定文字顏色（--nav-item-color），未設定時使用頁首文字顏色 */
.site-header .nav-link {
  color: var(--nav-item-color, var(--nav-text)) !important;
}

.site-brand-text {
  font-weight: 700;
  font-size: 1.25rem;
}

.site-header .nav-link {
  font-size: 1rem;
  font-weight: 700;
  padding: 0.875rem !important;
  /* 選單文字不換行；選單項目多時整列折到下一排 */
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

/* 滑過時加深底色（疊加半透明黑色，任何頁首底色都適用） */
.site-header .nav-link:hover,
.site-header .nav-link:focus-visible {
  background-color: rgba(0, 0, 0, 0.035);
}

/* 手機版：選單直向排列，項目之間以橫線分隔 */
.site-header .nav-item + .nav-item {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

@media (min-width: 992px) {
  /* 選單與格線佔滿頁首高度 */
  .site-header .navbar {
    padding-top: 0;
    padding-bottom: 0;
    align-items: stretch;
  }

  .site-header .navbar-collapse {
    align-self: stretch;
  }

  .site-header .navbar-nav {
    flex-wrap: wrap;
    justify-content: center;
    align-self: stretch;
  }

  /* 桌機版：項目之間以直線分隔 */
  .site-header .nav-item + .nav-item {
    border-top: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
  }

  /* 單排時填滿頁首高度；折成多排時各排平分 */
  .site-header .nav-item {
    display: flex;
  }

  .site-header .nav-link {
    display: flex;
    align-items: center;
  }
}

.site-header .navbar-toggler {
  border: 0;
  font-size: 1.75rem;
  box-shadow: none;
}

.site-icons img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* 預覽提示列：固定在最上方，頁首與內容往下讓出提示列的高度 */
:root {
  --site-preview-bar-height: 36px;
}

.site-preview-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--site-preview-bar-height);
  line-height: var(--site-preview-bar-height);
  z-index: 1040;
  background: #ffab00;
  color: #fff;
  text-align: center;
  font-weight: 600;
  padding: 0 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-preview-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: 1px solid #fff;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.6;
  padding: 0 10px;
}

.site-preview-toggle:hover,
.site-preview-toggle[aria-pressed='true'] {
  background: #fff;
  color: #b37800;
}

/* 窄螢幕：提示文字靠左，避免與按鈕重疊 */
@media (max-width: 767.98px) {
  .site-preview-bar {
    text-align: left;
    padding-right: 120px;
  }
}

/* 顯示區塊底色：每個區塊疊上不同顏色的半透明底色，內容範圍以虛線標示 */
.site-preview-outline .site-section {
  position: relative;
  outline: 2px dashed var(--outline-color);
  outline-offset: -2px;
}

.site-preview-outline .site-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--outline-color);
  opacity: 0.18;
  pointer-events: none;
  z-index: 5;
}

.site-preview-outline .site-section::before {
  content: attr(data-preview-label);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  background: var(--outline-color);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.6;
  padding: 0 8px;
  border-bottom-right-radius: 4px;
  pointer-events: none;
}

.site-preview-outline .site-section > [class^='container'] {
  outline: 1px dashed var(--outline-color);
}

.site-preview-outline .site-section:nth-child(6n + 1) { --outline-color: #e53935; }
.site-preview-outline .site-section:nth-child(6n + 2) { --outline-color: #1e88e5; }
.site-preview-outline .site-section:nth-child(6n + 3) { --outline-color: #43a047; }
.site-preview-outline .site-section:nth-child(6n + 4) { --outline-color: #8e24aa; }
.site-preview-outline .site-section:nth-child(6n + 5) { --outline-color: #fb8c00; }
.site-preview-outline .site-section:nth-child(6n + 6) { --outline-color: #00897b; }

body.site-preview {
  padding-top: var(--site-preview-bar-height);
}

body.site-preview.site-header-fixed {
  padding-top: calc(var(--site-preview-bar-height) + var(--site-header-height));
}

.site-preview.site-header-fixed .site-header {
  top: var(--site-preview-bar-height);
}

.site-preview .site-section,
.site-preview .site-section-alias {
  scroll-margin-top: calc(var(--site-preview-bar-height) + var(--site-header-height) + 8px);
}

/* ===== 區塊 ===== */
/* 上下間距由後台設定並以 inline style 輸出，這裡是預設值 */
.site-section {
  padding: 15px 0;
}

.site-section.has-bg-image {
  background-size: cover;
  background-position: center;
}

.site-section-heading {
  margin-bottom: 32px;
}

.site-section-heading h2 {
  font-weight: 700;
  margin-bottom: 8px;
}

.site-subtitle {
  font-size: 1.15rem;
  margin-bottom: 0;
}

.site-section-footer {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 32px 0 0;
}

.site-richtext img {
  max-width: 100%;
  height: auto;
}

/* 文字內容中的嵌入影片：維持 16:9 並隨寬度縮放 */
.site-richtext iframe {
  display: block;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 0 auto;
  border: 0;
}

.site-richtext .ql-align-center {
  text-align: center;
}

.site-richtext .ql-align-right {
  text-align: right;
}

.site-richtext .ql-align-justify {
  text-align: justify;
}

/* 卡片（輪播、連結卡片） */
.site-card {
  background: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.site-card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.site-card-body {
  padding: 16px;
}

.site-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.site-card-text {
  margin-bottom: 8px;
  color: #666;
}

.site-swiper {
  padding: 8px 4px 48px;
}

.site-swiper .swiper-slide {
  height: auto;
}

.site-swiper .swiper-button-prev,
.site-swiper .swiper-button-next {
  color: #888;
}

.site-video {
  max-width: 960px;
}

.site-partner {
  max-height: 120px;
  object-fit: contain;
}

/* 聯絡表單的隱藏欄位 */
.site-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ===== 新增的區塊類型 ===== */
/* 未另外設定顏色的按鈕使用網站導覽列的顏色 */
.site-btn-theme {
  background-color: var(--nav-start);
  border-color: var(--nav-start);
  color: var(--nav-text, #fff);
}

.site-btn-theme:hover {
  filter: brightness(1.08);
  color: var(--nav-text, #fff);
}

/* 圖文並排 */
.site-media-text-row + .site-media-text-row {
  margin-top: 48px;
}

.site-media-text-img {
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.site-media-text-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.site-media-text-body {
  line-height: 1.8;
  margin-bottom: 20px;
}

/* 人物介紹 */
.site-person {
  background: #fff;
  border-radius: 0.75rem;
  padding: 28px 20px 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.site-person-photo {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 16px;
  border: 4px solid #fff;
  box-shadow: 0 0 0 3px var(--nav-start);
}

.site-person-photo.is-square {
  border-radius: 0.75rem;
}

.site-person-name {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.site-person-role {
  color: var(--nav-start);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.site-person-bio {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

.site-person-link {
  color: var(--nav-start);
  font-weight: 600;
  text-decoration: none;
}

/* 常見問題 */
.site-faq {
  max-width: 880px;
}

.site-faq-item {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  margin-bottom: 12px;
  overflow: hidden;
}

.site-faq-question {
  list-style: none;
  cursor: pointer;
  padding: 18px 56px 18px 20px;
  font-weight: 600;
  font-size: 1.05rem;
  position: relative;
}

.site-faq-question::-webkit-details-marker {
  display: none;
}

.site-faq-question::after {
  content: '+';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--nav-start);
  transition: transform 0.2s ease;
}

.site-faq-item[open] .site-faq-question::after {
  transform: translateY(-50%) rotate(45deg);
}

.site-faq-question:focus-visible {
  outline: 2px solid var(--nav-start);
  outline-offset: -2px;
}

.site-faq-answer {
  padding: 0 20px 20px;
  color: #555;
  line-height: 1.8;
}

/* 流程／時間軸 */
.site-timeline {
  max-width: 760px;
  list-style: none;
  padding: 0;
  margin-bottom: 0;
  position: relative;
}

.site-timeline-item {
  position: relative;
  padding: 0 0 28px 64px;
}

.site-timeline-item::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: rgba(0, 0, 0, 0.12);
}

.site-timeline-item:last-child {
  padding-bottom: 0;
}

.site-timeline-item:last-child::before {
  display: none;
}

.site-timeline-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--nav-start);
  color: var(--nav-text, #fff);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9);
}

.site-timeline-dot:empty::after {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--nav-text, #fff);
}

.site-timeline-label {
  color: var(--nav-start);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.site-timeline-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 8px 0 4px;
}

.site-timeline-label + .site-timeline-title {
  margin-top: 0;
}

.site-timeline-body {
  color: #666;
  line-height: 1.7;
  margin-bottom: 0;
}

/* 行動按鈕 */
.site-cta-body {
  font-size: 1.1rem;
  line-height: 1.8;
  max-width: 720px;
  margin: 0 auto 24px;
}

.site-cta-btn {
  min-width: 180px;
  border-radius: 999px;
  font-weight: 700;
}

.site-cta-btn.is-outline {
  background: transparent;
  border: 2px solid var(--nav-start);
  color: var(--nav-start);
}

/* 地圖 */
.site-map-frame {
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.site-map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.site-map-info {
  background: #fff;
  border-radius: 0.75rem;
  padding: 24px;
  line-height: 1.9;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.site-map-open {
  color: var(--nav-start);
  font-weight: 600;
  text-decoration: none;
}

/* 門診時間表 */
.site-schedule {
  max-width: 1080px;
}

.site-schedule-table {
  background: #fff;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  text-align: center;
  vertical-align: middle;
  min-width: 640px;
}

/* Bootstrap 表格以變數設定每格的底色與文字色，表頭改為透明並使用導覽列文字色，漸層放在整列 */
.site-schedule-table thead tr {
  background: linear-gradient(to right, var(--nav-start), var(--nav-end));
}

/* Sneat 的 .table:not(.table-dark) th 會指定文字色，這裡提高權重 */
.site-schedule .site-schedule-table thead th {
  --bs-table-bg: transparent;
  --bs-table-color: var(--nav-text, #fff);
  background: transparent;
  color: var(--nav-text, #fff);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: normal;
  text-transform: none;
  border: 0;
  padding: 14px 8px;
}

.site-schedule .site-schedule-table tbody th {
  font-size: 0.95rem;
  color: #444;
}

.site-schedule-table tbody th {
  background: rgba(0, 0, 0, 0.03);
  font-weight: 700;
  white-space: nowrap;
}

.site-schedule-table td,
.site-schedule-table tbody th {
  padding: 14px 8px;
  border-color: rgba(0, 0, 0, 0.06);
}

.site-schedule-time {
  color: #888;
  font-weight: 400;
}

.site-schedule-table td.is-closed {
  color: #aaa;
}

.site-schedule-note {
  color: #666;
  font-size: 0.95rem;
  margin: 12px 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .site-faq-question::after {
    transition: none;
  }
}

/* ===== 頁尾 ===== */
.site-footer {
  background: linear-gradient(to right, var(--nav-start), var(--nav-end));
  color: var(--nav-text);
  text-align: center;
  padding: 20px 0;
}

/* ===== 手機版 ===== */
@media (max-width: 991.98px) {
  .site-header .navbar-collapse {
    padding-bottom: 12px;
  }

  .site-icons {
    padding: 8px 1rem 0;
  }
}
