/* =====================================================
   In Between Letters · base.css
   從 style-guides/web_ui_style_guide.md 抄 — 通用基底
   專案客製值在 ibl.css 覆寫
   ===================================================== */

/* ---------- fonts (字重 100 900 範圍宣告防合成加粗，見 web_ui_style_guide §9 坑 1) ---------- */
@font-face {
  font-family: 'Lebi';
  src: url('../fonts/lebifont-proportional.ttf') format('truetype');
  font-weight: 100 900; font-display: swap;
}
@font-face {
  font-family: 'JFLatte';
  src: url('../fonts/jf-jinxuanlatte-2.0-medium.otf') format('opentype');
  font-weight: 100 900; font-display: swap;
}
@font-face {
  font-family: 'ChenYuluoyan';
  src: url('../fonts/ChenYuluoyan-Thin.ttf') format('truetype');
  font-weight: 100 900; font-display: swap;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { font: inherit; }

/* ---------- body ---------- */
body {
  font-family: 'JFLatte', 'Noto Sans TC', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

h1, h2, h3 { font-family: 'ChenYuluoyan', 'Noto Serif TC', serif; font-weight: normal; }

/* ---------- shared button ---------- */
.btn {
  display: inline-block;
  background: var(--accent); color: white; border: none;
  border-radius: 40px; padding: 12px 28px;
  font-family: 'JFLatte', sans-serif; font-size: 13px;
  letter-spacing: 0.10em; cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn:hover { background: var(--accent-deep); }
.btn:active { transform: scale(0.98); }
.btn.secondary {
  background: transparent; color: var(--accent-deep);
  border: 1px solid var(--accent);
}
.btn.secondary:hover { background: var(--accent); color: white; }

/* ---------- shared section title (handwritten + horizontal divider line) ---------- */
.section-title {
  display: flex; align-items: center; gap: 20px;
  max-width: 880px; margin: 0 auto 36px; padding: 0 24px;
  font-family: 'ChenYuluoyan', serif; font-size: 42px; letter-spacing: 0.06em;
  color: var(--accent-deep);
}
.section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
@media (max-width: 640px) { .section-title { font-size: 32px; } }

/* ---------- top nav (sticky) ---------- */
nav.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 40px;
  border-bottom: 1px solid var(--border);
  background: rgba(250, 246, 239, 0.92); backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 10;
}
nav.top .brand {
  font-family: 'ChenYuluoyan', serif; font-size: 26px; letter-spacing: 0.04em;
  color: var(--accent-deep);
}
nav.top .nav-link {
  font-family: 'JFLatte', sans-serif; font-size: 13px; letter-spacing: 0.08em;
  color: var(--text-light); transition: color 0.2s;
}
nav.top .nav-link:hover { color: var(--accent-deep); }

/* hamburger button (mobile) */
nav.top .hamburger {
  display: none;
  width: 28px; height: 28px;
  background: none; border: none; cursor: pointer; padding: 0;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
nav.top .hamburger span {
  display: block; width: 22px; height: 1.5px;
  background: var(--accent-deep);
  transition: transform 0.25s, opacity 0.2s;
}
nav.top .hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
nav.top .hamburger.open span:nth-child(2) { opacity: 0; }
nav.top .hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-menu {
  display: none;
  position: fixed; top: 60px; right: 16px; z-index: 20;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  min-width: 180px;
}
.nav-menu.open { display: block; }
.nav-menu a {
  display: block; padding: 10px 16px;
  font-family: 'JFLatte', sans-serif; font-size: 13px; letter-spacing: 0.08em;
  color: var(--text); border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.nav-menu a:hover { background: var(--soft); color: var(--accent-deep); }

@media (max-width: 640px) {
  nav.top { padding: 14px 20px; }
  nav.top .brand { font-size: 22px; }
  nav.top .nav-link { display: none; }
  nav.top .hamburger { display: flex; }
}

/* ---------- shared footer ---------- */
footer.bottom {
  text-align: center; padding: 32px;
  border-top: 1px solid var(--border);
  font-family: 'JFLatte', sans-serif; font-size: 12px;
  letter-spacing: 0.06em; color: var(--text-light);
  margin-top: 80px;
}
footer.bottom .sep { margin: 0 12px; color: var(--muted); }
footer.bottom a { transition: color 0.2s; }
footer.bottom a:hover { color: var(--accent-deep); }
@media (max-width: 640px) {
  footer.bottom {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px; padding: 20px 16px;
  }
  footer.bottom .sep { display: none; }
}

/* ---------- body text 標準 (site-wide，見 SPEC §3.6) ---------- */
.body-text {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 15px; line-height: 2.2;
  letter-spacing: 0.06em;
  color: var(--text);
}
.body-text p { margin-bottom: 1.4em; }
