/* ==========================================================
   行者生活・課程資源網站  視覺系統
   白底 + 奶茶棕／大地色，對齊行者生活品牌調性
   ========================================================== */

:root {
  --bg-white: #FFFFFF;
  --bg-warm: #FAF6F1;
  --bg-card: #FFFFFF;
  --text-main: #2B1F14;
  --text-secondary: #5C4A3A;
  --text-muted: #8C7A6A;
  --brown-logo: #6B4423;
  --brown-dark: #4A2F18;
  --terracotta: #A85D3A;
  --sage: #8A9B7E;
  --gold: #C9A878;
  --divider: #D9CFC2;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 6px 24px rgba(74, 47, 24, 0.08);
  --shadow-hover: 0 12px 32px rgba(74, 47, 24, 0.14);
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-white);
  color: var(--text-main);
  font-family: "Noto Sans TC", "Noto Sans CJK TC", -apple-system, sans-serif;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Noto Serif TC", "Noto Serif CJK TC", serif;
  color: var(--text-main);
  font-weight: 700;
  margin: 0 0 0.5em;
  letter-spacing: 0.02em;
}

p { margin: 0 0 1em; color: var(--text-secondary); }

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--divider);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img { height: 34px; width: auto; }

.main-nav {
  display: flex;
  gap: 32px;
}

.main-nav a {
  font-size: 15px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--terracotta);
  border-color: var(--terracotta);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--brown-dark);
  cursor: pointer;
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(180deg, var(--bg-warm) 0%, var(--bg-white) 100%);
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--divider);
}

.hero .eyebrow {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.28em;
  color: var(--terracotta);
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  max-width: 720px;
  margin-bottom: 20px;
}

.hero p.lead {
  max-width: 560px;
  font-size: 17px;
  color: var(--text-secondary);
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 15px;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn-primary {
  background: var(--terracotta);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brown-dark);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border-color: var(--divider);
  color: var(--text-main);
}

.btn-ghost:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
}

/* ---------- Section headings ---------- */

.section {
  padding: 64px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--divider);
  padding-bottom: 18px;
}

.section-head h2 { font-size: 26px; margin-bottom: 4px; }
.section-head .sub { color: var(--text-muted); font-size: 14px; }

/* ---------- Course grid ---------- */

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.course-cover {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--gold) 0%, var(--terracotta) 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.course-cover img { width: 100%; height: 100%; object-fit: cover; }

.course-cover .badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(43, 31, 20, 0.72);
  color: #fff;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

.course-body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.course-body h3 { font-size: 19px; margin-bottom: 2px; }

.course-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 14px;
}

.course-body .desc {
  font-size: 14px;
  color: var(--text-secondary);
  flex: 1;
}

.course-body .btn { align-self: flex-start; margin-top: 4px; }

/* ---------- Course detail ---------- */

.course-hero {
  background: var(--bg-warm);
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--divider);
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.breadcrumb a { color: var(--terracotta); }

.course-hero h1 { font-size: clamp(24px, 3.6vw, 34px); margin-bottom: 12px; }

.course-hero .desc { max-width: 640px; color: var(--text-secondary); }

.course-stats {
  display: flex;
  gap: 28px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.course-stats .stat {
  font-size: 13px;
  color: var(--text-muted);
}

.course-stats .stat strong {
  display: block;
  font-size: 20px;
  color: var(--brown-dark);
  font-family: "Noto Serif TC", serif;
}

/* Topic / clip list */

.topic-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topic-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.topic-thumb {
  position: relative;
  background: var(--bg-warm);
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topic-thumb img { width: 100%; height: 100%; object-fit: cover; }

.topic-thumb .play {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  color: var(--terracotta);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.topic-thumb .duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(43, 31, 20, 0.75);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}

.topic-info {
  padding: 18px 20px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.topic-info .tag {
  font-size: 12px;
  color: var(--sage);
  letter-spacing: 0.06em;
}

.topic-info h3 { font-size: 18px; margin-bottom: 0; }

.topic-info p { font-size: 14px; margin-bottom: 6px; }

.topic-info .actions { display: flex; gap: 10px; margin-top: auto; }

.topic-info .actions .btn { padding: 8px 18px; font-size: 13px; }

/* ---------- Video modal ---------- */

.video-modal {
  position: fixed;
  inset: 0;
  background: rgba(43, 31, 20, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.video-modal.open { display: flex; }

.video-modal .modal-inner {
  background: #000;
  width: min(920px, 100%);
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.video-modal video,
.video-modal iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-modal .close {
  position: absolute;
  top: -44px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

/* ---------- Copy panel (文案) ---------- */

.copy-panel {
  background: var(--bg-warm);
  border: 1px dashed var(--divider);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
  display: none;
  white-space: pre-wrap;
}

.copy-panel.open { display: block; }

/* ---------- About / footer sections ---------- */

.about-block {
  background: var(--bg-warm);
  border-radius: var(--radius-lg);
  padding: 48px;
}

.about-block .quote {
  font-family: "Noto Serif TC", serif;
  font-size: 22px;
  color: var(--brown-dark);
  border-left: 3px solid var(--terracotta);
  padding-left: 20px;
  margin: 24px 0;
}

.site-footer {
  background: var(--brown-dark);
  color: #EFE6D8;
  padding: 56px 0 28px;
  margin-top: 40px;
}

.site-footer .wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.site-footer .footer-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
}

.site-footer img.footer-logo { height: 28px; filter: brightness(0) invert(1); opacity: 0.9; }

.site-footer .cols {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.site-footer h4 {
  color: #EFE6D8;
  font-size: 14px;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.site-footer a {
  color: #C9BBA6;
  font-size: 13px;
  display: block;
  margin-bottom: 8px;
}

.site-footer a:hover { color: #fff; }

.footer-line-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #06C755;
  color: #fff !important;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  margin-top: 2px;
  transition: background 0.2s, transform 0.15s;
}

.footer-line-btn:hover {
  background: #05a648;
  transform: translateY(-1px);
  color: #fff !important;
}

.footer-line-btn svg { width: 18px !important; height: 18px !important; flex-shrink: 0; }

.site-footer .bottom {
  border-top: 1px solid rgba(239, 230, 216, 0.15);
  padding-top: 20px;
  font-size: 12px;
  color: #A89680;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Empty state ---------- */

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .main-nav { display: none; }
  .nav-toggle { display: block; }
  .main-nav.open {
    display: flex;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 16px 24px;
    border-bottom: 1px solid var(--divider);
    gap: 16px;
  }
  .topic-card { grid-template-columns: 1fr; }
  .topic-info { padding: 4px 16px 16px; }
  .about-block { padding: 28px; }
  .site-footer .footer-top { flex-direction: column; }
}
