/* 心路尋光 課程成果網站 */
:root {
  --bg: #fdfaf4;
  --bg-soft: #f5eee1;
  --ink: #3a3630;
  --ink-light: #7a7264;
  --accent: #c98a3d;
  --accent-deep: #9a6626;
  --card: #ffffff;
  --line: #e8dfd0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.8;
}

/* 導覽列 */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 250, 244, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.6rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.nav-brand {
  font-weight: 700;
  color: var(--accent-deep);
  text-decoration: none;
  font-size: 1.05rem;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  list-style: none;
}
.nav-links a {
  display: block;
  padding: 0.35rem 0.7rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: background 0.2s, color 0.2s;
}
.nav-links a:hover { background: var(--bg-soft); color: var(--accent-deep); }
.nav-links a.active { background: var(--accent); color: #fff; }

/* 頁首橫幅 */
header.hero {
  text-align: center;
  padding: 4.5rem 1.2rem 3.5rem;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(233, 196, 138, 0.35), transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(201, 138, 61, 0.18), transparent 55%),
    var(--bg-soft);
}
.hero .kicker {
  letter-spacing: 0.25em;
  color: var(--accent-deep);
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
}
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 0.6rem;
}
.hero .subtitle {
  color: var(--ink-light);
  font-size: clamp(0.85rem, 2vw, 1rem);
  max-width: 640px;
  margin: 0 auto;
}

/* 主要內容 */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.5rem 1.2rem 4rem;
}
section { margin-bottom: 3.5rem; }
h2.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.2rem;
  padding-left: 0.8rem;
  border-left: 5px solid var(--accent);
}
.prose { max-width: 760px; color: var(--ink); }
.prose p { margin-bottom: 1rem; }

/* 資訊卡片 */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(58, 54, 48, 0.05);
}
.card h3 {
  color: var(--accent-deep);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}
.card p { color: var(--ink-light); font-size: 0.95rem; }

/* 各組成果卡片 */
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}
.group-card {
  display: block;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.group-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 22px rgba(58, 54, 48, 0.12);
}
.group-card .thumb {
  height: 120px;
  background: linear-gradient(135deg, #e9c48a, #c98a3d);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
}
.group-card .body { padding: 1rem 1.2rem; }
.group-card .body h3 { color: var(--ink); font-size: 1.1rem; }
.group-card .body p { color: var(--ink-light); font-size: 0.9rem; }

/* 課程資訊表 */
.info-table { width: 100%; border-collapse: collapse; max-width: 760px; }
.info-table th, .info-table td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.info-table th { width: 8.5em; color: var(--accent-deep); white-space: nowrap; }

/* 影片與照片佔位 */
.video-wrap {
  position: relative;
  width: 100%;
  max-width: 760px;
  aspect-ratio: 16 / 9;
  background: var(--bg-soft);
  border: 2px dashed var(--line);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-light);
}
.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 14px;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.photo-grid .photo {
  aspect-ratio: 4 / 3;
  background: var(--bg-soft);
  border: 2px dashed var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-light);
  font-size: 0.9rem;
  overflow: hidden;
}
.photo-grid .photo img { width: 100%; height: 100%; object-fit: cover; }

.placeholder-note {
  display: inline-block;
  background: #fff7e8;
  border: 1px solid #eeddb8;
  color: #8a6a2f;
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* 頁尾 */
footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  text-align: center;
  padding: 2rem 1.2rem;
  color: var(--ink-light);
  font-size: 0.9rem;
}
footer .maker { margin-top: 0.3rem; }

/* 上下組導覽 */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
}
.pager a {
  color: var(--accent-deep);
  text-decoration: none;
  font-weight: 700;
  padding: 0.6rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.pager a:hover { background: var(--bg-soft); }

/* ===== 進階視覺效果（各組成果頁）===== */

/* 捲動淡入 */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* 主題色帶 hero（情緒由冷轉暖）*/
header.hero.story {
  background:
    radial-gradient(ellipse at 15% -10%, rgba(120, 140, 180, 0.30), transparent 55%),
    radial-gradient(ellipse at 90% 120%, rgba(233, 196, 138, 0.45), transparent 55%),
    linear-gradient(120deg, #eef1f6 0%, #f5eee1 60%, #f3e2c8 100%);
  position: relative;
  overflow: hidden;
}
header.hero.story .theme-tag {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
  color: var(--accent-deep);
  font-size: 0.85rem;
}

/* 故事時間軸 */
.timeline { position: relative; max-width: 820px; margin: 0 auto; padding-left: 0; }
.timeline::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: linear-gradient(to bottom, #8a9bbf, #c98a3d);
  border-radius: 3px;
}
.tl-item { position: relative; padding: 0 0 1.8rem 3.4rem; }
.tl-item::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(201,138,61,0.15);
}
.tl-item h3 { color: var(--accent-deep); font-size: 1.15rem; margin-bottom: 0.3rem; }
.tl-item .stage { font-size: 0.8rem; letter-spacing: 0.15em; color: var(--ink-light); }
.tl-item p { color: var(--ink); margin-top: 0.3rem; }

/* 反思提問手風琴 */
.qa { max-width: 820px; margin: 0 auto; }
.qa details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 0.8rem;
  overflow: hidden;
}
.qa summary {
  cursor: pointer;
  padding: 1rem 1.2rem;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::before {
  content: "?";
  flex: 0 0 auto;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  border-radius: 50%; font-size: 0.9rem;
}
.qa details[open] summary { color: var(--accent-deep); }
.qa .answer { padding: 0 1.2rem 1.1rem 3.2rem; color: var(--ink-light); }

/* 設計概念小卡 */
.concept-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 1.2rem; }
.concept { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.4rem; }
.concept .ic { font-size: 1.6rem; }
.concept h3 { color: var(--accent-deep); margin: 0.4rem 0; font-size: 1.05rem; }
.concept p { color: var(--ink-light); font-size: 0.92rem; }

/* 團隊名條 */
.members { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.members span {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.95rem;
  color: var(--ink);
}

/* 金句 */
.pullquote {
  max-width: 760px; margin: 1rem auto;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 700; line-height: 1.7;
  color: var(--accent-deep);
  text-align: center;
  padding: 1.5rem;
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
}

/* 尊重使用者的減少動態偏好設定 */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .group-card { transition: none; }
}

/* ===== 繪本畫廊 + 燈箱 ===== */
.booklet-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.booklet-gallery figure {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: zoom-in;
  transition: transform 0.2s, box-shadow 0.2s;
}
.booklet-gallery figure:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(58,54,48,0.15); }
.booklet-gallery img { width: 100%; height: auto; display: block; }
.booklet-gallery figcaption {
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
  color: var(--ink-light);
  border-top: 1px solid var(--line);
}

/* 燈箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(28, 24, 20, 0.92);
  display: none; align-items: center; justify-content: center;
  padding: 2vh 1vw;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.lightbox .lb-close, .lightbox .lb-prev, .lightbox .lb-next {
  position: absolute; background: rgba(255,255,255,0.14); color: #fff;
  border: none; cursor: pointer; font-size: 1.6rem;
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; transition: background 0.2s;
}
.lightbox .lb-close:hover, .lightbox .lb-prev:hover, .lightbox .lb-next:hover { background: rgba(255,255,255,0.3); }
.lightbox .lb-close { top: 3vh; right: 3vw; }
.lightbox .lb-prev { left: 2vw; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 2vw; top: 50%; transform: translateY(-50%); }
.lightbox .lb-counter { position: absolute; bottom: 3vh; left: 50%; transform: translateX(-50%); color: #fff; font-size: 0.9rem; letter-spacing: 0.1em; }

/* 繪本封面大圖 */
.booklet-cover {
  max-width: 900px; margin: 0 auto 2rem; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 12px 34px rgba(58,54,48,0.16);
}
.booklet-cover img { width: 100%; display: block; }

/* ===== 首頁美化 ===== */
/* 動態光暈 hero */
header.hero.home {
  position: relative;
  overflow: hidden;
  padding: 5.5rem 1.2rem 4.5rem;
}
header.hero.home::before,
header.hero.home::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  z-index: 0;
  animation: float 14s ease-in-out infinite;
}
header.hero.home::before {
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(233,196,138,0.9), transparent 70%);
  top: -80px; left: -60px;
}
header.hero.home::after {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(201,138,61,0.55), transparent 70%);
  bottom: -90px; right: -50px;
  animation-delay: -7s;
}
@keyframes float {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(30px,-24px) scale(1.08); }
}
header.hero.home > * { position: relative; z-index: 1; }
header.hero.home h1 { animation: rise 0.9s ease both; }
header.hero.home .kicker { animation: rise 0.7s ease both; }
header.hero.home .subtitle { animation: rise 1.1s ease both; }
@keyframes rise { from { opacity:0; transform: translateY(20px);} to {opacity:1; transform:none;} }

/* 作者徽章 */
.author-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.6rem;
  padding: 0.5rem 1.1rem;
  background: rgba(255,255,255,0.75);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--ink);
  animation: rise 1.3s ease both;
}
.author-badge .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #e9c48a, #c98a3d);
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 0.9rem;
}
.author-badge b { color: var(--accent-deep); }

/* 首頁區塊標題置中大氣一點 */
.home-section-head { text-align: center; margin-bottom: 1.8rem; }
.home-section-head .eyebrow { letter-spacing: 0.25em; color: var(--accent); font-size: 0.8rem; }
.home-section-head h2 { font-size: 1.8rem; font-weight: 800; margin-top: 0.3rem; }
.home-section-head .rule { width: 54px; height: 4px; background: var(--accent); border-radius: 4px; margin: 0.8rem auto 0; }

/* 各組卡片：staggered 進場 + 更精緻 */
.group-grid.featured { gap: 1.4rem; }
.group-grid.featured .group-card .thumb {
  height: 140px;
  position: relative;
  background: linear-gradient(135deg, #e9c48a, #c98a3d);
}
.group-grid.featured .group-card .thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(255,255,255,0.35), transparent 60%);
}
.stagger > * { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.stagger.in > * { opacity: 1; transform: none; }
.stagger.in > *:nth-child(1){ transition-delay:.05s;}
.stagger.in > *:nth-child(2){ transition-delay:.12s;}
.stagger.in > *:nth-child(3){ transition-delay:.19s;}
.stagger.in > *:nth-child(4){ transition-delay:.26s;}
.stagger.in > *:nth-child(5){ transition-delay:.33s;}
.stagger.in > *:nth-child(6){ transition-delay:.40s;}

/* 次要資訊區塊：淡底分隔 */
.secondary { background: var(--bg-soft); border-radius: 20px; padding: 2.5rem 1.5rem; margin-top: 1rem; }
@media (prefers-reduced-motion: reduce) {
  header.hero.home::before, header.hero.home::after { animation: none; }
  header.hero.home h1, header.hero.home .kicker, header.hero.home .subtitle, .author-badge { animation: none; }
  .stagger > * { opacity: 1; transform: none; }
}

/* 作者徽章：兩行文字對齊 */
.author-badge .author-lines { text-align: left; line-height: 1.5; }

/* 各組成果：固定每排三張（兩排） */
.group-grid.featured { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .group-grid.featured { grid-template-columns: 1fr; } }
/* 卡片封面圖 */
.group-card .thumb.cover { padding: 0; overflow: hidden; }
.group-card .thumb.cover img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
