/* 我的主力版型 v3：v2 的排版與特效＋單元 04 的 Bootstrap 與 jQuery（在最下面）。每一段都來自學過的配方 */

/* 1. 主題層：顏色、字體、圓角、陰影、版心。換題時主要改這一段 */
:root {
  --color-bg: #f4f1e8;
  --color-surface: #ffffff;
  --color-section: #e7efe9;
  --color-text: #17352e;
  --color-muted: #61716b;
  --color-primary: #2f7667;
  --color-accent: #e86f51;
  --color-line: #bac8c1;
  --font-body: "Microsoft JhengHei", "PingFang TC", sans-serif;
  --font-heading: "Microsoft JhengHei", "PingFang TC", sans-serif;
  --radius: 16px;
  --shadow: 0 12px 32px rgb(23 53 46 / 0.08);
  /* 左右留白：至少 24px；螢幕很寬時，內容最多 1200px 寬並置中（先照抄） */
  --gutter: max(24px, calc((100% - 1200px) / 2));
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.7;
}

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

h1,
h2 {
  font-family: var(--font-heading);
  line-height: 1.2;
}

h1 {
  margin: 0 0 20px;
  font-size: 2.4rem;
}

/* 2. 每個區塊上下 64px、左右用版心留白；區塊底色深淺交錯 */
.hero,
.about,
.highlights,
.cta {
  padding: 64px var(--gutter);
}

.about {
  background: var(--color-section);
}

/* 3. 頁首：v3 改用 Bootstrap 導覽列（第 15 段），原本的頁首 CSS 刪掉 */

/* 4. 主視覺：手機上下排，768px 起左文右圖（Flexbox 圖文配方） */
.hero {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero-copy,
.hero-visual {
  min-width: 0;
}

.hero-visual { margin: 0; }

.hero-visual img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}

.label {
  color: var(--color-primary);
  font-weight: 800;
}

@media (min-width: 768px) {
  .hero {
    align-items: center;
    flex-direction: row;
  }

  .hero-copy { flex: 1 1 480px; }
  .hero-visual { flex: 1 1 420px; }
}

/* 5. 按鈕：全站只有這一種按鈕外觀 */
.button {
  display: inline-block;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--color-accent);
  color: #24130e;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

/* 6. 三張卡片：手機一欄，768px 起三欄（Grid 卡片） */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  padding: 28px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* 7. 行動呼籲與頁尾 */
.cta {
  background: var(--color-primary);
  color: #ffffff;
  text-align: center;
}

.site-footer {
  padding: 24px var(--gutter);
  color: var(--color-muted);
  text-align: center;
}

/* ===== v2 新增：特效（單元 03） ===== */

/* 8. 按鈕三種狀態＋轉場（互動狀態、transition） */
.button {
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgb(23 53 46 / 0.18);
}

.button:focus-visible {
  outline: 3px solid var(--color-text);
  outline-offset: 4px;
}

/* 行動呼籲是深色底，外框改白色才看得清楚 */
.cta .button:focus-visible {
  outline-color: #ffffff;
}

.button:active {
  transform: translateY(1px);
}

/* 9. 導覽底線展開（導覽底線配方） */
.site-nav a {
  position: relative;
  text-decoration: none;
}

.site-nav a::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -5px;
  left: 0;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 200ms ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* 10. 主視覺圖片放大（圖片放大配方） */
.hero-visual {
  overflow: hidden;
  border-radius: var(--radius);
}

.hero-visual img {
  transition: transform 320ms ease;
}

.hero-visual:hover img {
  transform: scale(1.06);
}

/* 11. 卡片浮起（transform） */
.card {
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgb(23 53 46 / 0.16);
}

/* 12. 主題母題：每個區塊標題下面一條短線（偽元素）。換題時換成符合主題的形狀或顏色 */
h2::after {
  content: '';
  display: block;
  width: 48px;
  height: 4px;
  margin-top: 12px;
  border-radius: 4px;
  background: var(--color-accent);
}

.cta h2::after {
  margin-inline: auto;
}

/* 13. 主視覺文字進場一次（keyframes） */
@keyframes rise {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

.hero-copy {
  animation: rise 480ms ease both;
}

/* 14. 減少動態：所有效果都直接停在結果 */
@media (prefers-reduced-motion: reduce) {
  .button,
  .site-nav a::after,
  .hero-visual img,
  .card {
    transition: none;
  }

  .button:hover,
  .button:focus-visible,
  .hero-visual:hover img,
  .card:hover {
    transform: none;
  }

  .hero-copy { animation: none; }
}

/* ===== v3 新增：Bootstrap 與 jQuery（單元 04） ===== */

/* 15. 導覽列（Bootstrap Navbar＋Scrollspy）：左右用版心留白；跳到區塊時，標題不要被固定的導覽列蓋住 */
.site-navbar {
  background: var(--color-surface);
  box-shadow: var(--shadow);
}

.site-navbar .container-fluid {
  padding-inline: var(--gutter);
}

.brand {
  color: var(--color-text);
  font-weight: 800;
  text-decoration: none;
}

.site-nav .nav-link {
  color: var(--color-text);
}

.site-nav .nav-link.active {
  color: var(--color-primary);
  font-weight: 800;
}

.about,
.highlights,
.faq,
.cta {
  scroll-margin-top: 80px;
}

/* 16. Bootstrap 元件換成自己的主題：頁籤、常見問題、卡片裡的小按鈕 */
.faq {
  padding: 64px var(--gutter);
  background: var(--color-section);
}

.nav-tabs .nav-link {
  color: var(--color-muted);
}

.nav-tabs .nav-link.active {
  color: var(--color-primary);
  font-weight: 800;
}

.tab-content {
  padding-top: 12px;
}

.accordion {
  --bs-accordion-active-bg: var(--color-surface);
  --bs-accordion-active-color: var(--color-primary);
  --bs-accordion-border-radius: var(--radius);
  --bs-accordion-inner-border-radius: var(--radius);
  --bs-accordion-btn-focus-box-shadow: 0 0 0 3px var(--color-accent);
}

.button-small {
  align-self: flex-start;
  padding: 6px 14px;
  font-size: 0.9rem;
}

/* 17. jQuery 題目工具：要淡入、展開的元素，一開始用 display: none 藏起來（不要用 hidden 屬性） */
.join-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 24px;
  margin-bottom: 16px;
}

.join-message,
.notice {
  display: none;
}

.join-message {
  font-weight: 800;
}

.notice {
  max-width: 560px;
  margin: 16px auto 0;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
}
