/* ══════════════════════════════════════════════
   無極中天玉皇聖殿 ── 共用樣式表
   style.css
══════════════════════════════════════════════ */

:root {
  --gold: #c8963e;
  --gold-light: #f0c060;
  --gold-dark: #8b6420;
  --red: #8b1a1a;
  --red-dark: #5c0e0e;
  --bg-dark: #0d0805;
  --bg-mid: #1a100a;
  --text-light: #f5e8c8;
  --text-gold: #e8c878;
  /* 可複用文字色（供 inline style 使用 var() 呼叫）*/
  --body-text:    rgba(245,232,200,0.88);
  --body-text-sm: rgba(245,232,200,0.85);
  --dim-text:     rgba(245,232,200,0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 17px; }

body {
  font-family: 'Noto Serif TC', serif;
  background: var(--bg-dark);
  color: var(--text-light);
  overflow-x: hidden;
}

/* ── PROGRESS BAR ── */
#progress-bar {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0%;
  background: linear-gradient(to right, var(--red), var(--gold), var(--gold-light));
  z-index: 99999; transition: width 0.1s linear;
}

/* ── NAV ── */
#navbar {
  position: fixed; top: 3px; left: 0; right: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 40px;
  transition: background 0.4s, backdrop-filter 0.4s, box-shadow 0.4s;
}
#navbar.scrolled {
  background: rgba(13,8,5,0.93); backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(200,150,62,0.25);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.95rem; font-weight: 700;
  color: var(--gold-light); letter-spacing: 0.15em;
  opacity: 0; transition: opacity 0.4s; text-decoration: none;
}
.nav-logo {
  width: 38px; height: 38px; border-radius: 50%;
  object-fit: contain; object-position: center; border: 1.5px solid var(--gold); flex-shrink: 0;
  padding: 3px; background: #f6eddc;
}
#navbar.scrolled .nav-brand { opacity: 1; }

/* 子頁面：品牌與 navbar 常駐顯示 */
body.subpage .nav-brand { opacity: 1; }
body.subpage #navbar {
  background: rgba(13,8,5,0.93); backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(200,150,62,0.25);
}

.nav-links { display: flex; gap: 4px; }
.nav-link {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.25em;
  color: rgba(245,232,200,0.6); padding: 6px 14px;
  cursor: pointer; border-bottom: 1px solid transparent;
  transition: color 0.3s, border-color 0.3s;
  white-space: nowrap; text-decoration: none;
  background: none; border-top: none; border-left: none; border-right: none;
  font-family: inherit; display: inline-block;
}
.nav-link:hover, .nav-link.active {
  color: var(--gold-light); border-bottom-color: var(--gold);
}

@media (min-width: 769px) and (max-width: 1500px) {
  #navbar { padding-left: 18px; padding-right: 18px; gap: 8px; }
  .nav-brand { flex: 0 1 205px; min-width: 0; gap: 8px; }
  .nav-brand-text {
    max-width: 158px;
    font-size: 0.72rem;
    line-height: 1.35;
    letter-spacing: 0.04em;
  }
  .nav-links { flex: 1 1 auto; min-width: 0; justify-content: center; gap: 0; }
  .nav-link { padding: 6px 7px; font-size: 0.7rem; letter-spacing: 0.1em; }
  .lang-switcher, #theme-toggle { flex: 0 0 auto; }
}

@media (min-width: 769px) and (max-width: 1180px) {
  .nav-brand { flex-basis: 40px; }
  .nav-brand-text { display: none; }
  .nav-link { padding-left: 5px; padding-right: 5px; font-size: 0.66rem; letter-spacing: 0.06em; }
}

/* ── MUSIC BUTTON ── */
#music-btn {
  position: fixed; bottom: 88px; right: 28px;
  width: 46px; height: 46px; border: 1px solid var(--gold-dark);
  background: rgba(13,8,5,0.85);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  cursor: pointer; z-index: 8000; backdrop-filter: blur(6px);
  transition: background 0.3s, border-color 0.3s;
}
#music-btn:hover { background: rgba(139,26,26,0.7); border-color: var(--gold); }
#music-label { font-size: 0.95rem; color: var(--gold); line-height: 1; transition: color 0.3s; }
#music-btn:hover #music-label { color: var(--gold-light); }
.music-bars { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.music-bars span { display: block; width: 3px; background: var(--gold); border-radius: 2px; transform-origin: bottom; }
.music-bars span:nth-child(1) { height: 6px; }
.music-bars span:nth-child(2) { height: 12px; }
.music-bars span:nth-child(3) { height: 9px; }
.music-bars span:nth-child(4) { height: 14px; }
#music-btn.playing .music-bars span:nth-child(1) { animation: bar 0.8s ease-in-out infinite alternate; }
#music-btn.playing .music-bars span:nth-child(2) { animation: bar 0.6s ease-in-out 0.1s infinite alternate; }
#music-btn.playing .music-bars span:nth-child(3) { animation: bar 0.7s ease-in-out 0.2s infinite alternate; }
#music-btn.playing .music-bars span:nth-child(4) { animation: bar 0.5s ease-in-out 0.15s infinite alternate; }
@keyframes bar { from { transform: scaleY(0.3); } to { transform: scaleY(1.1); } }


/* ── BACK TO TOP ── */
#back-top {
  position: fixed; bottom: 30px; right: 28px;
  width: 46px; height: 46px; border: 1px solid var(--gold-dark);
  background: rgba(13,8,5,0.85); color: var(--gold); font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 8000; opacity: 0; transform: translateY(16px);
  transition: opacity 0.3s, transform 0.3s, background 0.3s; backdrop-filter: blur(6px);
}
#back-top.show { opacity: 1; transform: translateY(0); }
#back-top:hover { background: rgba(139,26,26,0.7); color: var(--gold-light); }

/* ── HERO ── */
.hero {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 80px 20px;
  background:
    radial-gradient(ellipse at center top, rgba(139,26,26,0.55) 0%, transparent 55%),
    radial-gradient(ellipse at center, rgba(200,150,62,0.08) 0%, transparent 70%),
    radial-gradient(ellipse at center 88%, rgba(200,150,62,0.18) 0%, rgba(200,150,62,0.08) 26%, transparent 58%),
    linear-gradient(rgba(10,5,2,0.82), rgba(10,5,2,0.82)),
    url('images/logo-display.png') center/cover no-repeat;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 60px, rgba(200,150,62,0.035) 60px, rgba(200,150,62,0.035) 61px),
    repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(200,150,62,0.035) 60px, rgba(200,150,62,0.035) 61px);
  pointer-events: none;
  z-index: 0;
}
.hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34vh;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 48% 68%, rgba(232,184,109,0.32) 0 5px, transparent 6px),
    radial-gradient(circle at 52% 72%, rgba(232,184,109,0.24) 0 8px, transparent 9px),
    radial-gradient(circle at 44% 82%, rgba(200,150,62,0.22) 0 4px, transparent 5px),
    radial-gradient(circle at 56% 84%, rgba(200,150,62,0.20) 0 6px, transparent 7px),
    radial-gradient(circle at 50% 92%, rgba(232,184,109,0.26) 0 4px, transparent 5px),
    radial-gradient(ellipse at center 82%, rgba(200,150,62,0.16) 0%, rgba(200,150,62,0.08) 30%, transparent 68%);
}
.hero > * {
  position: relative;
  z-index: 2;
}
#particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 1;
}
.hero-logo-frame {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; z-index: 1;
  width: 198px; height: 198px;
  padding: 0;
  background: transparent;
  transform: translateY(-3px);
  filter:
    drop-shadow(0 12px 16px rgba(0,0,0,0.62))
    drop-shadow(0 0 12px rgba(255,214,128,0.82))
    drop-shadow(0 0 26px rgba(200,150,62,0.58))
    drop-shadow(0 0 48px rgba(200,150,62,0.30));
  margin-bottom: 16px;
}
.hero-logo-frame::before,
.hero-logo-frame::after {
  content: '';
  position: absolute;
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  pointer-events: none;
}
.hero-logo-frame::before {
  inset: 2px;
  z-index: 0;
  background: linear-gradient(135deg, #ffe3a2 0%, #c8963e 46%, #f0c060 100%);
  box-shadow:
    0 8px 18px rgba(0,0,0,0.42),
    0 0 12px rgba(255,214,128,0.72),
    0 0 26px rgba(200,150,62,0.42);
}
.hero-logo-frame::after {
  inset: 10px;
  z-index: 1;
  background:
    radial-gradient(circle at 42% 32%, rgba(255,255,255,0.98), rgba(246,237,220,0.96) 68%, rgba(226,207,168,0.92));
  box-shadow:
    inset 0 0 20px rgba(255,255,255,0.85),
    inset 0 -10px 20px rgba(122,72,0,0.12);
}
.hero-logo {
  display: block;
  position: absolute;
  inset: 10px;
  z-index: 2;
  width: calc(100% - 20px); height: calc(100% - 20px);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  object-fit: cover; object-position: center 46%;
  background: transparent;
}
.hero-badge {
  font-family: 'Shippori Mincho B1', 'Noto Serif TC', serif;
  display: inline-block; border: 1px solid rgba(200,150,62,0.5);
  color: var(--gold); padding: 5px 24px;
  font-size: 0.78rem; letter-spacing: 0.5em; margin-bottom: 1.8rem;
  animation: fadeInUp 1.5s ease 0.2s both;
}
.hero-title {
  font-family: 'Shippori Mincho B1', 'Noto Serif TC', serif;
  font-size: clamp(2.1rem, 6.3vw, 5rem); font-weight: 900; line-height: 1.08;
  color: var(--text-light); text-shadow: 0 0 50px rgba(200,150,62,0.5), 0 3px 6px rgba(0,0,0,0.9);
  animation: fadeInUp 1.5s ease 0.5s both; letter-spacing: 0.05em;
}
.hero-title .highlight { color: var(--gold-light); }
.hero-divider {
  width: 240px; height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  margin: 1.8rem auto; animation: fadeInUp 1.5s ease 0.8s both;
}
.hero-sub {
  font-size: clamp(0.95rem, 2.5vw, 1.2rem); color: var(--text-gold);
  letter-spacing: 0.4em; line-height: 2.2; animation: fadeInUp 1.5s ease 1s both;
}
.hero-cta {
  margin-top: 2.5rem; display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
  animation: fadeInUp 1.5s ease 1.3s both;
}
.scroll-hint {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  color: var(--gold); font-size: 0.78rem; letter-spacing: 0.3em; animation: bounce 2.2s infinite;
}
.scroll-hint::after { content: '▼'; display: block; text-align: center; margin-top: 4px; }

/* ── PAGE BANNER（子頁面用）── */
.page-banner {
  min-height: 280px; padding: 140px 20px 60px;
  background:
    radial-gradient(ellipse at center top, rgba(139,26,26,0.45) 0%, transparent 60%),
    linear-gradient(rgba(10,5,2,0.88), rgba(10,5,2,0.85)),
    url('images/logo-display.png') center/cover no-repeat;
  text-align: center; position: relative;
}
.page-banner::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}
.page-banner-label { font-size: 0.72rem; letter-spacing: 0.6em; color: var(--gold); margin-bottom: 14px; }
.page-banner-title {
  font-family: 'Shippori Mincho B1', 'Noto Serif TC', serif;
  font-size: clamp(1.8rem, 5vw, 3.2rem); font-weight: 700; color: var(--text-light);
  text-shadow: 0 0 40px rgba(200,150,62,0.4); letter-spacing: 0.1em; margin-bottom: 14px;
}
.page-banner-sub { font-size: 0.85rem; letter-spacing: 0.35em; color: rgba(245,232,200,0.5); }

/* ── BUTTONS ── */
.btn {
  padding: 12px 34px; font-family: 'Noto Serif TC', serif;
  font-size: 0.88rem; letter-spacing: 0.3em;
  cursor: pointer; border: none; transition: all 0.3s;
  display: inline-block; text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: var(--gold-light); border: 1px solid var(--gold-dark);
  box-shadow: 0 0 20px rgba(139,26,26,0.4);
}
.btn-primary:hover { box-shadow: 0 0 30px rgba(200,150,62,0.35); transform: translateY(-2px); }
.btn-outline {
  background: transparent; color: var(--gold); border: 1px solid var(--gold);
}
.btn-outline:hover { background: rgba(200,150,62,0.1); box-shadow: 0 0 20px rgba(200,150,62,0.2); transform: translateY(-2px); }

/* ── SECTION MORE（查看更多連結）── */
.section-more { text-align: center; margin-top: 40px; }

/* ── SECTION ── */
section { padding: 80px 20px; }
.section-header { text-align: center; margin-bottom: 50px; }
.section-label { font-size: 0.78rem; letter-spacing: 0.5em; color: var(--gold); margin-bottom: 10px; }
.section-title {
  font-family: 'Shippori Mincho B1', 'Noto Serif TC', serif;
  font-size: clamp(1.5rem, 4vw, 2.4rem); font-weight: 700; color: var(--text-light); display: inline-block;
}
.section-title::after {
  content: ''; display: block; width: 60%; height: 2px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  margin: 10px auto 0;
}

/* ── SCROLL REVEAL ── */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── ABOUT ── */
.about { background: var(--bg-mid); }
.about-grid { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.about-text h3 { font-size: 1.4rem; color: var(--gold-light); letter-spacing: 0.2em; margin-bottom: 18px; }
.about-text p { font-size: 1rem; line-height: 2.2; color: rgba(245,232,200,0.85); margin-bottom: 14px; }
.about-img-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; overflow: hidden; }
.about-img-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; filter: brightness(0.85) sepia(0.15); transition: filter 0.4s, transform 0.4s; }
.about-img-grid img:hover { filter: brightness(1) sepia(0); transform: scale(1.03); z-index: 1; position: relative; }
.about-img-grid img:first-child { grid-column: span 2; aspect-ratio: 16/7; }

/* ── DEITY ── */
.deity { background: var(--bg-dark); }
.deity-grid { max-width: 900px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; }
.deity-card {
  border: 1px solid rgba(200,150,62,0.25); background: rgba(200,150,62,0.04);
  padding: 32px 20px; text-align: center;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  position: relative; overflow: hidden; cursor: pointer;
}
.deity-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(to right, transparent, var(--gold), transparent); }
.deity-card:hover { transform: translateY(-6px); border-color: rgba(200,150,62,0.55); box-shadow: 0 14px 40px rgba(200,150,62,0.1); }
.deity-card:hover img { filter: brightness(1) sepia(0) !important; }
.deity-icon { font-size: 2.8rem; margin-bottom: 14px; }
.deity-title { font-size: 0.72rem; letter-spacing: 0.4em; color: var(--gold); margin-bottom: 8px; }
.deity-name { font-family: 'Shippori Mincho B1', 'Noto Serif TC', serif; font-size: 1.15rem; font-weight: 700; color: var(--text-light); line-height: 1.6; }

/* ── FEATURES ── */
.features { background: var(--bg-mid); }
.features-grid { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.feature-card { border: 1px solid rgba(200,150,62,0.2); padding: 28px 22px; background: rgba(0,0,0,0.2); transition: border-color 0.3s, transform 0.3s; position: relative; }
.feature-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: linear-gradient(to bottom, var(--gold), transparent); }
.feature-card:hover { border-color: rgba(200,150,62,0.5); transform: translateY(-5px); }
.feature-icon { font-size: 1.8rem; margin-bottom: 12px; }
.feature-label { font-size: 0.7rem; letter-spacing: 0.4em; color: var(--gold); margin-bottom: 8px; }
.feature-text { font-size: 1rem; line-height: 1.9; color: var(--text-light); }

/* ── EVENTS ── */
.event-section { background: var(--bg-dark); }
.events-list { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.event-card {
  border: 1px solid rgba(200,150,62,0.4);
  background: linear-gradient(135deg, rgba(139,26,26,0.2) 0%, rgba(200,150,62,0.06) 100%);
  display: grid; grid-template-columns: auto 1fr;
  overflow: hidden; position: relative; transition: box-shadow 0.3s, border-color 0.3s;
}
.event-card:hover { box-shadow: 0 0 40px rgba(200,150,62,0.15); border-color: rgba(200,150,62,0.6); }
.event-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(to right, transparent, var(--gold), transparent); }
.event-card-accent { width: 6px; background: linear-gradient(to bottom, var(--gold), var(--red), transparent); }
.event-card-body { padding: 36px 40px; }
.event-new-badge { display: inline-block; background: var(--red); color: var(--gold-light); font-size: 0.68rem; letter-spacing: 0.3em; padding: 3px 12px; margin-bottom: 14px; }
.event-card-date { font-size: 0.78rem; letter-spacing: 0.4em; color: var(--gold); margin-bottom: 10px; }
.event-card-title { font-family: 'Shippori Mincho B1', 'Noto Serif TC', serif; font-size: clamp(1.3rem, 3.5vw, 2rem); font-weight: 700; color: var(--text-light); line-height: 1.4; margin-bottom: 14px; }
.event-card-title span { color: var(--gold-light); }
.event-card-desc { font-size: 0.95rem; line-height: 2; color: rgba(245,232,200,0.75); margin-bottom: 24px; }
.event-card-stats { display: flex; flex-direction: row; align-items: flex-start; gap: 28px; }
.event-stat { text-align: center; transition: opacity 0.2s; }
a.event-stat:hover { opacity: 0.75; }
.event-stat-num { font-size: 1.6rem; font-weight: 900; color: var(--gold-light); }
.event-stat-label { font-size: 0.7rem; letter-spacing: 0.3em; color: var(--gold); margin-top: 2px; }
.event-scroll-btn {
  margin-top: 24px; display: inline-block;
  border: 1px solid var(--gold); color: var(--gold); font-size: 0.82rem;
  letter-spacing: 0.3em; padding: 10px 28px;
  cursor: pointer; transition: all 0.3s;
  font-family: 'Noto Serif TC', serif; background: transparent; text-decoration: none;
}
.event-scroll-btn:hover { background: rgba(200,150,62,0.12); box-shadow: 0 0 20px rgba(200,150,62,0.2); }

/* ── GALLERY ── */
.gallery { background: var(--bg-mid); }
.filter-tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 40px; flex-wrap: wrap; }
.filter-btn { font-family: 'Noto Serif TC', serif; font-size: 0.78rem; letter-spacing: 0.3em; padding: 8px 22px; border: 1px solid rgba(200,150,62,0.3); background: transparent; color: rgba(245,232,200,0.55); cursor: pointer; transition: all 0.3s; }
.filter-btn:hover { border-color: var(--gold); color: var(--gold-light); }
.filter-btn.active { background: rgba(200,150,62,0.13); border-color: var(--gold); color: var(--gold-light); box-shadow: 0 0 14px rgba(200,150,62,0.18); }
.gallery-grid { max-width: 1400px; margin: 0 auto; columns: 4 250px; column-gap: 12px; }
.gallery-item { break-inside: avoid; margin-bottom: 12px; overflow: hidden; cursor: pointer; position: relative; transition: opacity 0.4s; }
.gallery-item.hidden,
.video-event-block.hidden,
.videos-event-block.hidden { display: none; }
.gallery-item img { width: 100%; display: block; transition: transform 0.4s ease, filter 0.4s ease; filter: brightness(0.88) sepia(0.1); }
.gallery-item:hover img { transform: scale(1.05); filter: brightness(1.05) sepia(0); }
.gallery-item-overlay { position: absolute; inset: 0; background: rgba(139,26,26,0); display: flex; align-items: center; justify-content: center; transition: background 0.3s; }
.gallery-item:hover .gallery-item-overlay { background: rgba(139,26,26,0.28); }
.gallery-item-overlay span { font-size: 2rem; opacity: 0; transform: scale(0.5); transition: opacity 0.3s, transform 0.3s; }
.gallery-item:hover .gallery-item-overlay span { opacity: 0.9; transform: scale(1); }

/* ── LIGHTBOX ── */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.96); z-index: 9999; align-items: center; justify-content: center; flex-direction: column; padding: 58px 72px 18px; overflow: hidden; }
.lightbox.active { display: flex; }
.lightbox button { appearance: none; -webkit-appearance: none; font-family: inherit; }
.lightbox-stage { width: min(1400px, calc(100vw - 144px)); flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-in; touch-action: pan-y; }
.lightbox-stage.is-zoomed { cursor: grab; touch-action: none; }
.lightbox-stage.is-dragging { cursor: grabbing; }
.lightbox-stage > img { max-width: 100%; max-height: 100%; object-fit: contain; border: 1px solid rgba(200,150,62,0.3); box-shadow: 0 0 80px rgba(0,0,0,0.8); user-select: none; -webkit-user-drag: none; transform-origin: center center; will-change: transform; transition: opacity 0.2s, transform 0.18s ease; }
.lightbox-stage.is-dragging > img { transition: opacity 0.2s; }
.lightbox-stage > img.fading { opacity: 0; }
.lightbox-close { position: fixed; top: 14px; right: 18px; width: 46px; height: 46px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(200,150,62,0.45); background: rgba(0,0,0,0.58); font-size: 2rem; line-height: 1; cursor: pointer; color: var(--gold); z-index: 10000; transition: color 0.2s, transform 0.2s, border-color 0.2s; }
.lightbox-close:hover { color: var(--gold-light); transform: scale(1.2); }
.lightbox-nav { position: fixed; top: 50%; transform: translateY(-50%); border: 0; background: transparent; font-size: 3rem; cursor: pointer; color: rgba(200,150,62,0.6); padding: 14px 18px; user-select: none; z-index: 10000; transition: color 0.2s, background 0.2s; border-radius: 4px; }
.lightbox-nav:hover { color: var(--gold-light); background: rgba(200,150,62,0.1); }
.lightbox-nav.prev { left: 8px; }
.lightbox-nav.next { right: 8px; }
.lightbox-bottom { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.lightbox-counter { font-size: 0.82rem; color: var(--gold); letter-spacing: 0.2em; }
.lightbox-zoom { width: 34px; height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(200,150,62,0.45); background: rgba(200,150,62,0.08); color: var(--gold-light); font-size: 1.25rem; line-height: 1; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.lightbox-zoom:hover, .lightbox-zoom.active { border-color: var(--gold); background: rgba(200,150,62,0.2); }
.lightbox-thumb-strip { display: flex; gap: 5px; max-width: 80vw; overflow: hidden; justify-content: center; }
.lightbox-thumb { width: 42px; height: 30px; object-fit: cover; opacity: 0.35; cursor: pointer; border: 1px solid transparent; transition: opacity 0.2s, border-color 0.2s; flex-shrink: 0; }
.lightbox-thumb.active-thumb { opacity: 1; border-color: var(--gold); }

/* ── VIDEOS ── */
.videos { background: var(--bg-dark); }
.video-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.video-card { border: 1px solid rgba(200,150,62,0.2); background: rgba(0,0,0,0.3); overflow: hidden; cursor: pointer; position: relative; transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s; }
.video-card:hover { border-color: rgba(200,150,62,0.55); box-shadow: 0 8px 30px rgba(200,150,62,0.1); transform: translateY(-4px); }
.video-card video { width: 100%; display: block; max-height: 220px; object-fit: cover; background: #000; pointer-events: none; }
.video-play-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 36px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0); transition: background 0.3s; }
.video-card:hover .video-play-overlay { background: rgba(139,26,26,0.22); }
.video-play-icon { width: 52px; height: 52px; border-radius: 50%; background: rgba(200,150,62,0.8); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; opacity: 0; transform: scale(0.6); transition: opacity 0.3s, transform 0.3s; }
.video-card:hover .video-play-icon { opacity: 1; transform: scale(1); }
.video-card-label { padding: 10px 16px; font-size: 0.78rem; color: var(--gold); letter-spacing: 0.2em; border-top: 1px solid rgba(200,150,62,0.15); }

/* ── VIDEO MODAL ── */
#video-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.97); z-index: 9999; align-items: center; justify-content: center; flex-direction: column; }
#video-modal.active { display: flex; }
#video-modal video { max-width: 92vw; max-height: 88vh; border: 1px solid rgba(200,150,62,0.3); }
.modal-close { position: fixed; top: 18px; right: 24px; font-size: 2.5rem; cursor: pointer; color: var(--gold); z-index: 10000; transition: color 0.2s, transform 0.2s; }
.modal-close:hover { color: var(--gold-light); transform: scale(1.2); }
.modal-label { margin-top: 12px; font-size: 0.85rem; color: var(--gold); letter-spacing: 0.25em; }

/* ── CONTACT ── */
.contact { background: var(--bg-mid); }
.contact-inner { max-width: 900px; margin: 0 auto; }
.contact-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.map-wrap { position: relative; border: 1px solid rgba(200,150,62,0.35); overflow: hidden; }
.map-wrap::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(to right, transparent, var(--gold), transparent); z-index: 1; }
.map-wrap iframe { width: 100%; height: 360px; display: block; border: none; filter: grayscale(0.3) sepia(0.15); }
.map-label { padding: 10px 16px; font-size: 0.78rem; letter-spacing: 0.25em; color: var(--gold); border-top: 1px solid rgba(200,150,62,0.2); display: flex; align-items: center; gap: 8px; }
.contact-block h3 { font-size: 0.78rem; letter-spacing: 0.4em; color: var(--gold); margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid rgba(200,150,62,0.25); }
.contact-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.contact-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.contact-text { font-size: 0.95rem; line-height: 1.9; color: rgba(245,232,200,0.8); }
.contact-text a { color: var(--gold); text-decoration: none; }
.contact-text a:hover { color: var(--gold-light); }

/* ── FOOTER ── */
footer { background: var(--red-dark); text-align: center; padding: 44px 20px; border-top: 2px solid var(--gold-dark); }
.footer-title { font-family: 'Shippori Mincho B1', 'Noto Serif TC', serif; font-size: 1.25rem; color: var(--gold-light); letter-spacing: 0.3em; margin-bottom: 6px; }
.footer-sub-title { font-size: 0.82rem; color: rgba(245,232,200,0.5); letter-spacing: 0.3em; margin-bottom: 16px; }
.footer-ornament { font-size: 1.4rem; color: var(--gold); margin: 14px 0; opacity: 0.55; }
.footer-copy { font-size: 0.75rem; color: rgba(245,232,200,0.4); letter-spacing: 0.15em; margin-top: 10px; }
.footer-fb { margin-top: 20px; }
.footer-fb a { font-size: 0.82rem; color: var(--gold-dark); letter-spacing: 0.2em; text-decoration: none; border: 1px solid rgba(200,150,62,0.25); padding: 7px 20px; transition: color 0.2s, border-color 0.2s; display: inline-block; }
.footer-fb a:hover { color: var(--gold-light); border-color: var(--gold); }
.footer-credit { font-size: 0.7rem; color: rgba(245,232,200,0.25); letter-spacing: 0.1em; margin-top: 18px; border-top: 1px solid rgba(200,150,62,0.1); padding-top: 14px; }

/* ── CURSOR GLOW ── */
#cursor-glow { position: fixed; width: 620px; height: 620px; border-radius: 50%; background: radial-gradient(circle, rgba(200,150,62,0.085) 0%, rgba(200,150,62,0.045) 32%, transparent 72%); pointer-events: none; z-index: 1; transform: translate(-50%,-50%); transition: opacity 0.6s; opacity: 0; }

/* ── HAMBURGER ── */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; background: none; border: none; flex-shrink: 0; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--gold); border-radius: 2px; transition: transform 0.35s, opacity 0.25s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MENU OVERLAY ── */
.menu-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 8998; }
.menu-overlay.open { display: block; }

/* ── ANIMATIONS ── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bounce { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .about-grid        { grid-template-columns: 1fr; }
  .contact-inner     { grid-template-columns: 1fr; }
  .event-card        { grid-template-columns: 1fr; }
  .event-card-accent { display: none; }
  #navbar            { padding: 10px 12px; gap: 6px; justify-content: flex-start; }
  .nav-brand         { font-size: 0.78rem; opacity: 1; }
  .nav-brand-text {
    display: inline-block;
    width: min(150px, calc(100vw - 240px));
    overflow: hidden;
    color: var(--gold-light);
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    line-height: 1.28;
    white-space: normal;
  }
  .nav-brand-text > span {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    max-width: 100%;
    max-height: 3.9em;
    overflow: hidden;
    white-space: normal;
    word-break: break-word;
  }
  .lang-zh .nav-brand-text .i18n-zh,
  .lang-en .nav-brand-text .i18n-en,
  .lang-ja .nav-brand-text .i18n-ja {
    display: inline-block !important;
  }
  .hamburger         { display: flex; }
  .nav-links {
    position: fixed; top: 0; right: -100%;
    width: 72%; max-width: 300px; height: 100vh;
    background: rgba(10,5,2,0.97); backdrop-filter: blur(24px);
    flex-direction: column; align-items: center; justify-content: flex-start;
    gap: 10px; transition: right 0.4s cubic-bezier(0.4,0,0.2,1);
    border-left: 1px solid rgba(200,150,62,0.18); z-index: 9999;
    padding: 88px 22px 34px;
    box-sizing: border-box;
  }
  .nav-links.open { right: 0; }
  .nav-link { font-size: 1.1rem; padding: 14px 28px; letter-spacing: 0.3em; }
  .lang-switcher {
    position: absolute;
    top: 50%;
    right: 90px;
    transform: translateY(-50%);
    width: auto;
    justify-content: flex-end;
    margin-left: 0;
    padding-top: 0;
    border-top: none;
    gap: 3px;
    z-index: 10001;
  }
  .lang-btn {
    min-width: 27px;
    height: 28px;
    padding: 2px 6px;
    font-size: 0.66rem;
    letter-spacing: 0;
    line-height: 1;
  }
  #theme-toggle {
    position: absolute;
    top: 50%;
    right: 52px;
    transform: translateY(-50%);
    width: 30px;
    height: 28px;
    margin: 0;
    z-index: 10001;
    transition: border-color 0.25s, color 0.25s, background 0.25s;
  }
  .hamburger {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    z-index: 10001;
    padding: 7px;
  }
}
@media (max-width: 390px) {
  #navbar { padding-left: 9px; padding-right: 9px; gap: 4px; }
  .nav-logo { width: 34px; height: 34px; }
  .nav-brand { gap: 7px; }
  .nav-brand-text {
    width: min(120px, calc(100vw - 226px));
    font-size: 0.56rem;
    letter-spacing: 0.02em;
    line-height: 1.22;
  }
  .nav-brand-text > span { max-height: 3.7em; }
  .lang-switcher { right: 84px; gap: 2px; }
  .lang-btn {
    min-width: 24px;
    height: 26px;
    padding: 1px 5px;
    font-size: 0.62rem;
  }
  #theme-toggle {
    right: 49px;
    width: 28px;
    height: 26px;
    font-size: 0.86rem;
  }
  .hamburger { right: 9px; padding: 6px; }
  .hamburger span { width: 22px; }
}
@media (max-width: 600px) {
  .gallery-grid    { columns: 2 140px; }
  .video-grid      { grid-template-columns: 1fr; }
  .lightbox         { padding: 62px 44px 14px; }
  .lightbox-stage   { width: calc(100vw - 88px); }
  .lightbox-close   { top: 10px; right: 10px; width: 44px; height: 44px; }
  .lightbox-nav     { font-size: 2.2rem; padding: 10px 12px; }
  .lightbox-nav.prev { left: 0; }
  .lightbox-nav.next { right: 0; }
  .lightbox-thumb-strip { max-width: calc(100vw - 24px); }
  .contact-cols    { grid-template-columns: 1fr; }
  .event-card-body { padding: 24px 20px; }
}

/* ── DEITY AVATAR RING (首頁主祀圓環) ── */
.deity-avatar-ring {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  overflow: hidden;
  margin: -16px auto 26px;
  border: 3px solid rgba(200,150,62,0.7);
  box-shadow:
    0 0 0 8px rgba(200,150,62,0.10),
    0 0 0 12px rgba(200,150,62,0.05),
    0 0 48px rgba(200,150,62,0.28);
  flex-shrink: 0;
}
.deity-avatar-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: brightness(0.88) sepia(0.08);
  transition: filter 0.4s, transform 0.5s;
}
.deity-card:hover .deity-avatar-ring img {
  filter: brightness(1) sepia(0);
  transform: scale(1.06);
}

/* ══════════════════════════════════════════════
   多語言切換 i18n
══════════════════════════════════════════════ */

/* 語言切換按鈕 */
.lang-switcher {
  display: flex;
  gap: 2px;
  margin-left: 10px;
  flex-shrink: 0;
  align-items: center;
}
.lang-btn {
  background: transparent;
  border: 1px solid rgba(200,150,62,0.3);
  color: rgba(200,150,62,0.6);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  padding: 3px 7px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  font-family: inherit;
  line-height: 1.4;
}
.lang-btn:hover {
  border-color: rgba(200,150,62,0.7);
  color: var(--gold);
}
.lang-btn.active {
  background: rgba(200,150,62,0.15);
  border-color: var(--gold);
  color: var(--gold-light);
}

/* 預設：隱藏非中文版本 */
.i18n-en, .i18n-ja { display: none; }

/* ══════════════════════════════════════════════
   日夜模式切換按鈕
══════════════════════════════════════════════ */

#theme-toggle {
  background: transparent;
  border: 1px solid rgba(200,150,62,0.3);
  color: rgba(200,150,62,0.75);
  font-size: 0.95rem;
  width: 30px; height: 26px;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  margin-left: 4px;
  line-height: 1;
}
#theme-toggle:hover {
  border-color: rgba(200,150,62,0.75);
  color: var(--gold);
  background: rgba(200,150,62,0.08);
}

/* ══════════════════════════════════════════════
   白天（LIGHT）主題
══════════════════════════════════════════════ */

html[data-theme="light"] {
  font-size: 17px; /* 基準字型放大（16→17px），所有 rem 等比放大約 6%）*/
  --bg-dark:   #faf4e8;
  --bg-mid:    #f0e4ca;
  --text-light: #2a1508;
  --text-gold:  #7a4a10;
  /* 淺金色在米白背景對比度不足，換成深金棕色 */
  --gold-light: #8a5c10;
  --gold:       #7a4800;
  --gold-dark:  #5c3400;
  /* inline style 使用的文字色變數（深色模式覆寫）*/
  --body-text:    rgba(42,21,8,0.85);
  --body-text-sm: rgba(42,21,8,0.85);
  --dim-text:     rgba(42,21,8,0.5);
}

/* Footer（深紅底）還原原始淺金色 */
html[data-theme="light"] footer {
  --gold-light: #f0c060;
  --gold:       #c8963e;
  --gold-dark:  #8b6420;
}

/* ── body ── */
html[data-theme="light"] body {
  background: var(--bg-dark);
  color: var(--text-light);
}

/* ── Navbar ── */
html[data-theme="light"] #navbar.scrolled {
  background: rgba(250,244,232,0.96);
  box-shadow: 0 1px 0 rgba(200,150,62,0.3);
}
html[data-theme="light"] body.subpage #navbar {
  background: rgba(250,244,232,0.97);
  box-shadow: 0 1px 0 rgba(200,150,62,0.3);
}
/* 白天模式 Hero 已是米白背景 → 未捲動 nav 也需深色文字 */
html[data-theme="light"] #navbar:not(.scrolled) {
  background: rgba(250,242,225,0.72);
  backdrop-filter: blur(10px);
}
html[data-theme="light"] #navbar:not(.scrolled) .nav-link {
  color: rgba(42,21,8,0.65);
}
html[data-theme="light"] #navbar:not(.scrolled) .nav-link:hover,
html[data-theme="light"] #navbar:not(.scrolled) .nav-link.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
/* 捲動後 nav 有奶油色背景 → 改為深色文字 */
html[data-theme="light"] #navbar.scrolled .nav-link,
html[data-theme="light"] body.subpage .nav-link {
  color: rgba(42,21,8,0.6);
}
html[data-theme="light"] #navbar.scrolled .nav-link:hover,
html[data-theme="light"] #navbar.scrolled .nav-link.active,
html[data-theme="light"] body.subpage .nav-link:hover,
html[data-theme="light"] body.subpage .nav-link.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
html[data-theme="light"] .nav-brand { color: var(--gold-dark); }
@media (max-width: 768px) {
  html[data-theme="light"] .nav-links {
    background: rgba(250,244,232,0.98);
    border-left-color: rgba(200,150,62,0.25);
  }
}
/* 未捲動：白天 Hero 是米白背景 → lang-btn / theme-toggle 改深色 */
html[data-theme="light"] #navbar:not(.scrolled) .lang-btn {
  color: rgba(42,21,8,0.6);
  border-color: rgba(42,21,8,0.25);
}
html[data-theme="light"] #navbar:not(.scrolled) .lang-btn.active {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(42,21,8,0.06);
}
html[data-theme="light"] #navbar:not(.scrolled) #theme-toggle {
  color: rgba(42,21,8,0.65);
  border-color: rgba(42,21,8,0.25);
}
/* 捲動後：奶油色背景，改為深色 */
html[data-theme="light"] #navbar.scrolled .lang-btn,
html[data-theme="light"] body.subpage .lang-btn {
  color: rgba(42,21,8,0.55);
  border-color: rgba(200,150,62,0.3);
}
html[data-theme="light"] #navbar.scrolled .lang-btn:hover,
html[data-theme="light"] body.subpage .lang-btn:hover {
  color: var(--gold-dark);
  border-color: rgba(200,150,62,0.6);
}
html[data-theme="light"] #navbar.scrolled .lang-btn.active,
html[data-theme="light"] body.subpage .lang-btn.active {
  color: var(--gold-dark);
  border-color: var(--gold);
  background: rgba(200,150,62,0.12);
}
html[data-theme="light"] #navbar.scrolled #theme-toggle,
html[data-theme="light"] body.subpage #theme-toggle {
  color: rgba(42,21,8,0.6);
  border-color: rgba(200,150,62,0.3);
}
html[data-theme="light"] #navbar.scrolled #theme-toggle:hover,
html[data-theme="light"] body.subpage #theme-toggle:hover {
  color: var(--gold-dark);
  border-color: var(--gold);
  background: rgba(200,150,62,0.1);
}

/* ── 浮動按鈕 ── */
html[data-theme="light"] #music-btn,
html[data-theme="light"] #back-top {
  background: rgba(250,244,232,0.9);
  border-color: rgba(200,150,62,0.45);
  color: var(--gold-dark);
}
html[data-theme="light"] #music-btn:hover,
html[data-theme="light"] #back-top:hover {
  background: rgba(200,150,62,0.12);
  border-color: var(--gold);
  color: var(--gold);
}
html[data-theme="light"] #music-label { color: var(--gold-dark); }
html[data-theme="light"] .music-bars span { background: var(--gold-dark); }

/* ── Section 背景 ── */
html[data-theme="light"] .about         { background: var(--bg-mid); }
html[data-theme="light"] .deity         { background: var(--bg-dark); }
html[data-theme="light"] .features      { background: var(--bg-mid); }
html[data-theme="light"] .event-section { background: var(--bg-dark); }
html[data-theme="light"] .contact       { background: var(--bg-mid); }
html[data-theme="light"] .gallery       { background: var(--bg-mid); }
html[data-theme="light"] .videos        { background: var(--bg-dark); }

/* ── 各頁面子頁 page-banner ── */
html[data-theme="light"] .page-banner {
  background:
    radial-gradient(ellipse at center top, rgba(139,26,26,0.2) 0%, transparent 60%),
    linear-gradient(rgba(250,244,232,0.82), rgba(240,228,202,0.88)),
    url('images/logo-display.png') center/cover no-repeat;
}
html[data-theme="light"] .page-banner-title {
  color: var(--text-light);
  text-shadow: 0 0 40px rgba(200,150,62,0.25);
}
html[data-theme="light"] .page-banner-sub { color: rgba(42,21,8,0.5); }

/* ── Section 標題 ── */
html[data-theme="light"] .section-title { color: var(--text-light); }

/* ── 卡片 ── */
html[data-theme="light"] .deity-card {
  background: rgba(255,255,255,0.65);
  border-color: rgba(200,150,62,0.35);
}
html[data-theme="light"] .deity-card:hover {
  border-color: rgba(200,150,62,0.65);
  box-shadow: 0 14px 40px rgba(200,150,62,0.12);
}
html[data-theme="light"] .deity-name  { color: var(--text-light); }
html[data-theme="light"] .deity-title { color: var(--red) !important; }

html[data-theme="light"] .feature-card {
  background: rgba(255,255,255,0.6);
  border-color: rgba(200,150,62,0.3);
}
html[data-theme="light"] .feature-text { color: rgba(42,21,8,0.85); }

html[data-theme="light"] .event-card {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.72) 0%, rgba(244,232,205,0.74) 100%);
  border-color: rgba(139,92,32,0.42);
  box-shadow: 0 14px 34px rgba(92,48,0,0.08);
}
html[data-theme="light"] .event-card:hover {
  border-color: rgba(139,92,32,0.68);
  box-shadow: 0 18px 42px rgba(92,48,0,0.12);
}
html[data-theme="light"] .event-card-title {
  color: #241006;
  text-shadow: none;
}
html[data-theme="light"] .event-card-title span {
  color: #8a5209;
}
html[data-theme="light"] .event-card-desc  { color: rgba(42,21,8,0.86); }

html[data-theme="light"] .video-card {
  background: rgba(255,255,255,0.65);
  border-color: rgba(200,150,62,0.25);
}
html[data-theme="light"] .video-card-label { color: var(--gold-dark); }

/* ── About section 內文（含 inline style 的 p 標籤）── */
html[data-theme="light"] .about p,
html[data-theme="light"] .about div > p,
html[data-theme="light"] [class^="about"] p {
  color: rgba(42,21,8,0.85) !important;
}

/* ── Contact ── */
html[data-theme="light"] .contact-block h3 {
  color: var(--gold);
  border-bottom-color: rgba(200,150,62,0.3);
}
html[data-theme="light"] .contact-text {
  color: rgba(42,21,8,0.8);
}
html[data-theme="light"] .contact-text small {
  color: rgba(42,21,8,0.45) !important;
}
html[data-theme="light"] .contact-text a { color: var(--gold-dark); }
html[data-theme="light"] .contact-text a:hover { color: var(--gold); }
html[data-theme="light"] .map-label { color: var(--gold-dark); }

/* ── Gallery filter ── */
html[data-theme="light"] .filter-btn {
  color: rgba(42,21,8,0.55);
  border-color: rgba(200,150,62,0.3);
}
html[data-theme="light"] .filter-btn:hover,
html[data-theme="light"] .filter-btn.active {
  color: var(--gold-dark);
  border-color: var(--gold);
}

/* ── Footer ── */
html[data-theme="light"] footer {
  background: var(--red-dark);
  border-top-color: var(--gold-dark);
}
/* footer text 保持深色（紅底）不變 */

/* ── 小標籤類文字：白天改用深紅 + 額外放大（最小字級從 0.68rem 補至 0.88rem）── */
html[data-theme="light"] .section-label,
html[data-theme="light"] .about-chapter-label,
html[data-theme="light"] .page-banner-label {
  color: var(--red) !important;
  font-size: 0.88rem;
  letter-spacing: 0.45em;
}
html[data-theme="light"] .deity-title {
  color: var(--red) !important;
  font-size: 0.84rem;
}
html[data-theme="light"] .feature-label {
  color: var(--red) !important;
  font-size: 0.82rem;
}
html[data-theme="light"] .event-card-date {
  color: #5f170f !important;
  font-size: 0.9rem;
  letter-spacing: 0.22em;
  font-weight: 600;
}
html[data-theme="light"] .event-stat-label {
  color: #6f1a12 !important;
  font-size: 0.78rem;
}
html[data-theme="light"] .event-new-badge {
  background: #7d1714;
  color: #fff2cf;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
}
html[data-theme="light"] .video-card-label {
  color: var(--red) !important;
  font-size: 0.84rem;
}
html[data-theme="light"] .breadcrumb {
  font-size: 0.80rem;
}
html[data-theme="light"] .nav-link {
  font-size: 0.86rem;
}
html[data-theme="light"] .hero-badge {
  font-size: 0.84rem;
}

/* ── 通用文字覆寫（inline rgba(245,232,200,...) → 深色）── */
/* hero 文字由上方 hero 專屬區塊控制 */

/* ── Hero 白天模式：米白覆蓋層 78% → 圖案退為淡淡水墨，文字改深色 ── */
html[data-theme="light"] .hero {
  background:
    radial-gradient(ellipse at center 88%, rgba(139,26,26,0.12) 0%, rgba(200,150,62,0.12) 30%, transparent 60%),
    linear-gradient(rgba(250,242,225,0.91), rgba(242,228,198,0.93)),
    url('images/logo-display.png') center/cover no-repeat;
}
html[data-theme="light"] .hero-badge {
  color: #8b1a1a;
  border-color: rgba(139,26,26,0.45);
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
}
html[data-theme="light"] .hero-badge .i18n-zh,
html[data-theme="light"] .hero-badge .i18n-ja {
  white-space: nowrap;
}
html[data-theme="light"] .hero-title {
  color: #1a0802;
  text-shadow: 0 1px 3px rgba(255,255,255,0.6);
}
html[data-theme="light"] .hero-title .highlight { color: #8b1a1a; }
html[data-theme="light"] .hero-sub    { color: rgba(42,21,8,0.88); letter-spacing: 0.4em; }
html[data-theme="light"] .hero .btn-primary { color: #f5e8c8; }
html[data-theme="light"] .hero .btn-outline {
  color: #5c3000;
  border-color: rgba(92,48,0,0.6);
}
html[data-theme="light"] .hero .btn-outline:hover {
  background: rgba(92,48,0,0.08);
  box-shadow: 0 0 16px rgba(92,48,0,0.15);
}
html[data-theme="light"] .scroll-hint { color: #8b1a1a; }

@media (max-width: 480px) {
  .hero-logo-frame {
    width: 164px;
    height: 164px;
    margin-bottom: 14px;
  }
  .hero-logo-frame::after,
  .hero-logo {
    inset: 9px;
  }
  .hero-logo {
    width: calc(100% - 18px);
    height: calc(100% - 18px);
  }
  .hero-title {
    font-size: clamp(2rem, 10.6vw, 3.25rem);
    line-height: 1.12;
  }
  html[data-theme="light"] .hero-badge {
    padding-left: 12px;
    padding-right: 12px;
  }
  html[data-theme="light"] .hero-badge .i18n-zh,
  html[data-theme="light"] .hero-badge .i18n-ja {
    font-size: clamp(0.62rem, 3.15vw, 0.78rem);
    letter-spacing: 0.18em;
  }
}

/* Scroll reveal 不受影響 */
html[data-theme="light"] .reveal { color: inherit; }

/* ── 開放時間 small 標籤 ── */
html[data-theme="light"] small[style*="rgba(245,232,200"] {
  color: rgba(42,21,8,0.45) !important;
}

/* ── Menu overlay ── */
html[data-theme="light"] .menu-overlay { background: rgba(250,244,232,0.35); }

/* ── 各子頁面 <style> 區塊內的硬編碼文字色覆寫 ── */

/* Breadcrumb（deity / events / gallery / videos / shop 共用） */
html[data-theme="light"] .breadcrumb       { color: rgba(42,21,8,0.45) !important; }

/* Deity 頁面 */
html[data-theme="light"] .deity-featured-desc { color: rgba(42,21,8,0.82) !important; }
html[data-theme="light"] .deity-desc          { color: rgba(42,21,8,0.65) !important; }

/* Events 頁面 */
html[data-theme="light"] .events-empty        { color: rgba(42,21,8,0.35) !important; }

/* Shop 頁面 */
html[data-theme="light"] .shop-coming-soon-text { color: rgba(42,21,8,0.5) !important; }

/* ── 子頁面 page-banner（各頁面 <style> 內硬編碼背景覆寫）── */
html[data-theme="light"] .page-banner {
  background:
    radial-gradient(ellipse at center top, rgba(139,26,26,0.15) 0%, transparent 60%),
    linear-gradient(rgba(250,244,232,0.88), rgba(240,228,202,0.92)),
    url('images/logo-display.png') center/cover no-repeat !important;
}

/* ── About 頁面專屬文字 ── */
html[data-theme="light"] .about-prose p   { color: rgba(42,21,8,0.85) !important; }
html[data-theme="light"] .about-full      { background: var(--bg-mid) !important; }
html[data-theme="light"] .mission-text    { color: rgba(42,21,8,0.8) !important; }
html[data-theme="light"] .mission-card    { background: rgba(255,255,255,0.55) !important; }
html[data-theme="light"] .transport-text  { color: rgba(42,21,8,0.8) !important; }

/* ── Deity 頁面 ── */
html[data-theme="light"] .deity-full      { background: var(--bg-dark) !important; }
html[data-theme="light"] .deity-detail-text { color: rgba(42,21,8,0.85) !important; }
html[data-theme="light"] .deity-detail-card { background: rgba(255,255,255,0.6) !important; }
html[data-theme="light"] .deity-page-section { background: #faf4e8 !important; }
html[data-theme="light"] .deity-featured-card {
  background:
    linear-gradient(135deg, rgba(255,252,244,0.92), rgba(238,222,193,0.86)) !important;
  border-color: rgba(122,72,0,0.42) !important;
  box-shadow: 0 14px 34px rgba(92,48,0,0.10);
}
html[data-theme="light"] .deity-featured-name {
  color: #241006 !important;
  text-shadow: none !important;
}
html[data-theme="light"] .deity-featured-subtitle {
  color: #6f1a12 !important;
  font-weight: 700;
}
html[data-theme="light"] .deity-featured-badge {
  color: #6f1a12 !important;
  border-color: rgba(111,26,18,0.35) !important;
  background: rgba(255,246,225,0.82);
}
html[data-theme="light"] .deity-featured-tag {
  background: #fff5df;
  border-color: rgba(122,72,0,0.52);
  color: #5b2505;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

/* ── Events 頁面 ── */
html[data-theme="light"] .events-full     { background: var(--bg-dark) !important; }

/* ── Shop 頁面 ── */
html[data-theme="light"] .shop-section    { background: var(--bg-dark) !important; }
html[data-theme="light"] .shop-card       { background: rgba(255,255,255,0.65) !important; }
html[data-theme="light"] .shop-text       { color: rgba(42,21,8,0.8) !important; }

/* ── 日夜切換過渡動畫（只加背景/文字，不覆蓋卡片的 transform 過渡）── */
body,
.about, .deity, .features, .event-section,
.contact, .gallery, .videos,
#navbar, .nav-link, .lang-btn,
#music-btn, #back-top {
  transition: background 0.35s ease, color 0.35s ease,
              border-color 0.35s ease, box-shadow 0.35s ease;
}

/* 英文模式 */
.lang-en .i18n-zh { display: none !important; }
.lang-en .i18n-ja { display: none !important; }
.lang-en .i18n-en { display: block !important; }
.lang-en span.i18n-en { display: inline !important; }

/* 日文模式 */
.lang-ja .i18n-zh { display: none !important; }
.lang-ja .i18n-en { display: none !important; }
.lang-ja .i18n-ja { display: block !important; }
.lang-ja span.i18n-ja { display: inline !important; }

.lang-zh .deity-featured-tags.i18n-zh,
.lang-en .deity-featured-tags.i18n-en,
.lang-ja .deity-featured-tags.i18n-ja,
.lang-zh .deity-directory-tags.i18n-zh,
.lang-en .deity-directory-tags.i18n-en,
.lang-ja .deity-directory-tags.i18n-ja {
  display: flex !important;
}

/* Keep the hero bubbles as free-moving canvas particles. */
#particles-canvas {
  z-index: 3;
  opacity: 1;
}

.hero > :not(#particles-canvas) {
  z-index: 4;
}

.hero::after,
.scroll-hint::before {
  display: none !important;
}
