/* ═══════════════════════════════════════════════
   沐光牙醫診所 — 牙醫模板
   視覺參考:Tend / Grand Street Dental
   (奶油白 + navy、Serif 標題 + Sans 內文的精品質感)
   ═══════════════════════════════════════════════ */

:root {
  --primary: #1e3a5f;          /* deep navy */
  --primary-dark: #14283f;
  --primary-light: #eaf0f6;
  --accent: #b99a6b;           /* 精品金棕點綴 */
  --ink: #2b2b2b;              /* Grand Street 近黑 */
  --ink-soft: #6b7280;
  --bg: #faf8f5;               /* 奶油白 */
  --bg-alt: #f1ede7;
  --line-green: #06c755;
  --radius: 10px;
  --shadow: 0 8px 28px rgba(30, 58, 95, .10);
  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-serif: "Noto Serif TC", "PMingLiU", serif;   /* Tend 式 serif 標題 */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { font-family: var(--font-sans); color: var(--ink); background: var(--bg); line-height: 1.8; font-size: 16px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
h1, h2, .logo { font-family: var(--font-serif); }

.container { width: min(1200px, 92%); margin: 0 auto; }
.container-narrow { width: min(760px, 92%); }

/* ── 按鈕 ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px; border-radius: 6px;
  font-weight: 700; font-size: 15px; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { border: 1.5px solid var(--primary); color: var(--primary); background: transparent; }
.btn-line { background: var(--line-green); color: #fff; }
.btn-lg { padding: 14px 30px; font-size: 17px; }
.btn-block { width: 100%; justify-content: center; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,248,245,.96); backdrop-filter: blur(8px);
  border-bottom: 1px solid #e7e1d8;
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 76px; }
.logo { font-size: 24px; font-weight: 900; color: var(--primary); display: flex; align-items: baseline; gap: 8px; }
.logo-sub { font-family: var(--font-sans); font-size: 11px; letter-spacing: .2em; color: var(--accent); font-weight: 500; }
.main-nav { display: flex; gap: 2px; margin-left: auto; }
.main-nav a { color: var(--ink); font-weight: 500; padding: 8px 11px; border-radius: 6px; font-size: 15px; }
.main-nav a:hover { background: var(--primary-light); color: var(--primary); }
.header-cta { display: flex; gap: 8px; }
.nav-toggle { display: none; }

/* ── Hero ── */
.hero { padding: 84px 0; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 60px; align-items: center; }
.hero-eyebrow { color: var(--accent); font-weight: 700; letter-spacing: .18em; margin-bottom: 14px; font-size: 14px; }
.hero h1 { font-size: clamp(30px, 4.4vw, 48px); font-weight: 900; line-height: 1.4; margin-bottom: 20px; color: var(--primary); }
.hero-sub { color: var(--ink-soft); font-size: 17px; margin-bottom: 22px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.badge {
  background: #fff; border: 1px solid #e7e1d8; border-radius: 999px;
  padding: 6px 14px; font-size: 14px; font-weight: 500;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-img img { border-radius: 4px; box-shadow: var(--shadow); }

/* ── 信任數字 ── */
.stats { background: var(--primary); color: #fff; padding: 38px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stat strong { font-family: var(--font-serif); font-size: 36px; font-weight: 900; display: block; line-height: 1.2; color: #e8d9bd; }
.stat strong span { font-size: 18px; margin-left: 2px; }
.stat p { font-size: 14px; opacity: .9; }

/* ── 區塊通用 ── */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--primary); }
.section-dark .section-title, .section-dark .section-sub { color: #fff; }
.section-title { font-size: clamp(26px, 3.2vw, 38px); font-weight: 900; text-align: center; margin-bottom: 12px; color: var(--primary); }
.section-sub { text-align: center; color: var(--ink-soft); margin-bottom: 50px; }
.section-dark .section-sub { color: #c6d2df; }

/* ── 診療項目卡 ── */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: #fff; border-radius: var(--radius); padding: 34px 28px;
  border-top: 3px solid transparent;
  box-shadow: 0 2px 12px rgba(30,58,95,.05);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-top-color: var(--accent); }
.card-icon { font-size: 34px; margin-bottom: 16px; }
.card h3 { font-size: 19px; font-weight: 700; margin-bottom: 8px; color: var(--primary); }
.card p { color: var(--ink-soft); font-size: 15px; }

/* ── 醫師卡片 ── */
.doctor-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.doctor-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 12px rgba(30,58,95,.06); }
.doctor-card img { aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.doctor-info { padding: 22px 22px 26px; }
.doctor-info h3 { font-size: 20px; font-weight: 700; color: var(--primary); }
.doctor-info h3 span { font-family: var(--font-sans); font-size: 13px; color: var(--accent); font-weight: 700; margin-left: 6px; }
.doctor-title { font-size: 13.5px; color: var(--ink-soft); margin: 4px 0 12px; }
.cert-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cert-badges span {
  background: var(--primary-light); color: var(--primary);
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.doctor-info > p:last-child { font-size: 14.5px; color: var(--ink-soft); }

/* ── 案例與環境 ── */
.case-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 20px; }
.case-item img { border-radius: var(--radius); aspect-ratio: 8/5; object-fit: cover; width: 100%; }
.case-item figcaption { text-align: center; font-size: 14px; color: var(--ink-soft); margin-top: 10px; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gallery-grid img { border-radius: var(--radius); aspect-ratio: 4/3; object-fit: cover; transition: transform .25s ease; }
.gallery-grid img:hover { transform: scale(1.03); }

/* ── 評論 ── */
.review-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.review { background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: 0 2px 12px rgba(30,58,95,.05); }
.review-stars { color: #d9a441; letter-spacing: 3px; margin-bottom: 10px; font-size: 15px; }
.review p { font-size: 15.5px; }
.review footer { margin-top: 12px; font-size: 13.5px; color: var(--ink-soft); }
.review-more { text-align: center; margin-top: 30px; font-weight: 700; }

/* ── 門診時間 ── */
.hours-wrap { max-width: 820px; margin: 0 auto; }
.hours-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hours-table th, .hours-table td { padding: 14px 10px; text-align: center; border-bottom: 1px solid #efe9e0; font-size: 15px; }
.hours-table thead th { background: var(--primary); color: #fff; font-weight: 700; }
.hours-table tbody th { background: var(--primary-light); font-weight: 700; color: var(--primary); white-space: nowrap; }
.hours-table td { color: var(--accent); font-weight: 700; }
.hours-note { margin-top: 14px; font-size: 14px; color: var(--ink-soft); text-align: center; }

/* ── 預約表單 ── */
.booking-form { background: #fff; border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.booking-form label { display: block; font-weight: 700; font-size: 14.5px; margin-bottom: 18px; color: var(--primary); }
.booking-form input, .booking-form select, .booking-form textarea {
  width: 100%; margin-top: 6px; padding: 12px 14px;
  border: 1.5px solid #dcd4c8; border-radius: 6px;
  font-family: var(--font-sans); font-size: 15px; color: var(--ink); background: #fff;
}
.booking-form input:focus, .booking-form select:focus, .booking-form textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-hint { margin-top: 14px; text-align: center; font-size: 14px; color: var(--ink-soft); font-weight: 400; }
.form-success { text-align: center; color: #fff; font-size: 17px; font-weight: 700; margin-top: 20px; }

/* ── FAQ ── */
.faq-item { background: #fff; border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; box-shadow: 0 1px 8px rgba(30,58,95,.05); }
.faq-item summary { cursor: pointer; list-style: none; padding: 18px 22px; font-weight: 700; font-size: 16.5px; position: relative; user-select: none; color: var(--primary); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 22px; color: var(--accent); font-size: 22px; transition: transform .2s ease; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 22px 18px; color: var(--ink-soft); font-size: 15px; }

/* ── 聯絡/地圖 ── */
.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: start; }
.contact-grid .section-title { text-align: left; }
.contact-list { list-style: none; margin: 20px 0 26px; }
.contact-list li { display: flex; gap: 14px; padding: 11px 0; border-bottom: 1px solid #e7e1d8; font-size: 15.5px; }
.contact-list strong { color: var(--accent); flex-shrink: 0; min-width: 44px; }
.map-embed iframe { width: 100%; height: 420px; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ── Footer ── */
.site-footer { background: var(--primary-dark); color: #b7c4d2; padding: 42px 0; text-align: center; }
.footer-brand { font-family: var(--font-serif); font-size: 22px; font-weight: 900; color: #fff; margin-bottom: 8px; }
.site-footer a { color: #e8d9bd; }
.footer-copy { margin-top: 12px; font-size: 13px; opacity: .7; }

/* ── 浮動 LINE 鈕 ── */
.line-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: flex; align-items: center; gap: 8px;
  background: var(--line-green); color: #fff;
  padding: 12px 18px; border-radius: 999px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(6,199,85,.4);
  animation: float-pulse 2.4s ease-in-out infinite;
}
@keyframes float-pulse { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* ── 捲動顯示動畫 ── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .line-float { animation: none; }
}

/* ═══ RWD:平板 ═══ */
@media (max-width: 1120px) {
  .main-nav { display: none; }
  .header-cta .btn-ghost { display: none; }
  .card-grid, .doctor-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-img { order: -1; }
  .nav-toggle {
    display: flex; flex-direction: column; gap: 5px; justify-content: center;
    width: 44px; height: 44px; padding: 10px;
    background: none; border: 0; cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2.5px; background: var(--primary); border-radius: 2px; transition: transform .25s, opacity .25s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
  .main-nav.is-open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: 76px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid #e7e1d8; box-shadow: var(--shadow);
    padding: 12px 4%;
  }
  .main-nav.is-open a { padding: 14px 12px; border-bottom: 1px solid #efe9e0; font-size: 16px; }
}

/* ═══ RWD:手機 ═══ */
@media (max-width: 640px) {
  .header-inner { gap: 10px; }
  .header-cta { margin-left: auto; }
  .header-cta .btn-line { display: none; }   /* 手機 header 只留「線上預約」,LINE 走浮動鈕 */
  .header-cta .btn-primary { padding: 8px 14px; font-size: 14px; }
  .logo { font-size: 19px; }
  .logo-sub { display: none; }
  .hero { padding: 44px 0; }
  .section { padding: 58px 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; }
  .card-grid, .doctor-grid, .review-grid, .case-grid, .form-row { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid img:last-child { grid-column: span 2; }
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .map-embed iframe { height: 320px; }
  .hours-table { font-size: 13px; }
  .hours-table th, .hours-table td { padding: 10px 4px; }
  .booking-form { padding: 24px 18px; }
  .form-row { gap: 0; }
  .hero-cta .btn { flex: 1; justify-content: center; }
  .line-float span { display: none; }
  .line-float { padding: 14px; }
}
