/* ===== 溪洲國小 38周年校慶（背景意象模糊化版） ===== */
:root {
  --bg-cream: #fdf8f0;
  --purple-main: #6b4c9a;
  --purple-dark: #4f3577;
  --purple-soft: #f2ecfa;
  --festive-red: #c53d2f;
  --festive-soft: #fdecea;
  --leaf-green: #3b6e4c;
  --leaf-soft: #eaf4ed;
  --text-main: #2d2420;
  --text-muted: #554840;
  --border-warm: rgba(233, 223, 209, 0.85);
  --glass-bg: rgba(255, 252, 247, 0.82);
  --shadow-soft: 0 14px 36px rgba(45, 36, 32, 0.12);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-cream);
  line-height: 1.75;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ===== 全螢幕模糊意象背景層 ===== */
.bg-impression {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url("poster.jpg");
  background-size: cover;
  background-position: center 35%;
  background-repeat: no-repeat;
  filter: blur(12px) saturate(1.12);
  transform: scale(1.08); /* 避免模糊後四邊露出白邊 */
}

/* 柔光遮罩層：保留苦楝紫與暖色意象，同時確保前景文字清晰易讀 */
.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(253, 248, 240, 0.72) 0%,
    rgba(253, 248, 240, 0.62) 45%,
    rgba(253, 248, 240, 0.80) 100%
  );
}

/* ===== 頂部導覽列 ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 248, 240, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-warm);
}

.topbar-inner {
  max-width: 1020px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--purple-dark);
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-main), var(--festive-red));
  flex-shrink: 0;
}

.skip-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--purple-main);
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.skip-link:hover {
  background: var(--purple-dark);
  transform: translateY(-1px);
}

/* ===== 主容器 ===== */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}

/* ===== 主視覺區塊（置中毛玻璃卡片，透出後方模糊意象） ===== */
.hero {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 26px;
  padding: 48px 36px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  margin-bottom: 52px;
  animation: fadeUp 0.8s ease-out both;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.badge {
  display: inline-block;
  padding: 5px 15px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge-purple {
  background: var(--purple-soft);
  color: var(--purple-dark);
}

.badge-green {
  background: var(--leaf-soft);
  color: var(--leaf-green);
}

.hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 1.28;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 18px;
}

.hero h1 span {
  color: var(--purple-main);
}

.event-time-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--festive-soft);
  border: 1px solid rgba(197, 61, 47, 0.22);
  color: var(--festive-red);
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.hero-lead {
  max-width: 720px;
  margin: 0 auto 30px;
  font-size: 1.08rem;
  color: var(--text-muted);
}

.hero-lead strong {
  color: var(--text-main);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  font-size: 1.02rem;
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple-main), #845ec2);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(107, 76, 154, 0.32);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(107, 76, 154, 0.42);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--purple-dark);
  border: 1.5px solid var(--purple-main);
}

.btn-secondary:hover {
  background: var(--purple-soft);
  transform: translateY(-2px);
}

/* ===== 區塊標題 ===== */
.section-header {
  text-align: center;
  margin-bottom: 28px;
}

.section-header h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* ===== 20年時空膠囊時間軸 ===== */
.timeline-section {
  margin-bottom: 48px;
}

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.timeline-card {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  padding: 26px 22px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease;
}

.timeline-card:hover {
  transform: translateY(-4px);
}

.timeline-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
}

.timeline-card.step-1::before { background: var(--leaf-green); }
.timeline-card.step-2::before { background: var(--purple-main); }
.timeline-card.step-3::before { background: var(--festive-red); }

.timeline-date {
  display: inline-block;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.step-1 .timeline-date { background: var(--leaf-soft); color: var(--leaf-green); }
.step-2 .timeline-date { background: var(--purple-soft); color: var(--purple-dark); }
.step-3 .timeline-date { background: var(--festive-soft); color: var(--festive-red); }

.timeline-card h3 {
  font-size: 1.16rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-main);
}

.timeline-card p {
  font-size: 0.96rem;
  color: var(--text-muted);
}

/* ===== 完整邀請函卡片 ===== */
.letter-card {
  background: rgba(255, 253, 249, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  padding: 40px 36px;
  box-shadow: var(--shadow-soft);
  position: relative;
  margin-bottom: 44px;
}

.letter-card::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  bottom: 14px;
  border: 1px dashed rgba(107, 76, 154, 0.25);
  border-radius: 14px;
  pointer-events: none;
}

.letter-title {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--purple-dark);
  margin-bottom: 22px;
}

.letter-body {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.05rem;
  color: var(--text-main);
}

.letter-body p {
  margin-bottom: 16px;
}

.letter-body p:last-child {
  margin-bottom: 0;
}

.highlight-callout {
  background: var(--purple-soft);
  border-left: 4px solid var(--purple-main);
  padding: 16px 20px;
  border-radius: 0 12px 12px 0;
  margin: 22px 0;
  font-weight: 600;
  color: var(--purple-dark);
}

/* ===== 底部與頁尾 ===== */
.bottom-cta {
  text-align: center;
  padding: 8px 0 20px;
}

footer {
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid var(--border-warm);
  color: var(--text-muted);
  font-size: 0.9rem;
  background: rgba(253, 248, 240, 0.78);
  backdrop-filter: blur(8px);
}

/* ===== 完整海報燈箱 (Lightbox) ===== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 16, 26, 0.86);
  padding: 24px;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== RWD 手機與平板調整 ===== */
@media (max-width: 820px) {
  .timeline-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar-inner {
    padding: 10px 14px;
  }

  .brand-label {
    font-size: 0.92rem;
  }

  .skip-link {
    padding: 7px 14px;
    font-size: 0.84rem;
  }

  .container {
    padding: 28px 16px 48px;
  }

  .hero {
    padding: 32px 20px;
  }

  .letter-card {
    padding: 28px 20px;
  }

  .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
