/* css/style.css - 玉旨聖后宮 豪華宮廷金碧風格 */

/* ===== CSS 變數 ===== */
:root {
  --bg-base:         #0C0400;
  --bg-card:         #1A0A08;
  --bg-card-alt:     #220D0D;
  --gold-primary:    #D4AF37;
  --gold-bright:     #FFD700;
  --gold-light:      #F5DEB3;
  --crimson:         #8B0000;
  --crimson-mid:     #A10000;
  --text-cream:      #FFF8DC;
  --text-gold:       #D4AF37;
  --text-muted:      #9E7B3A;
  --border-gold:     rgba(212,175,55,0.45);
  --shadow-gold:     rgba(212,175,55,0.25);
  --shadow-dark:     rgba(0,0,0,0.6);
}

/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans TC', sans-serif;
  color: var(--text-cream);
  background-color: var(--bg-base);
  line-height: 1.8;
  font-size: 16px;
  position: relative;
  overflow-x: hidden;
}

/* 祥雲背景紋路（極淡） */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image: url('../img/Auspicious_Clouds.png');
  background-repeat: repeat;
  background-size: 200px;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===== Typography ===== */
h1, h2, h3 {
  font-family: 'Noto Serif TC', serif;
  font-weight: 700;
}

h2 {
  font-size: 2.8rem;
  color: var(--gold-bright);
  text-shadow: 0 0 20px rgba(255,215,0,0.4);
  letter-spacing: 0.15em;
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 8px;
  height: 2.6rem;
  background: var(--gold-primary);
  border-radius: 2px;
}

.h2-ornament {
  display: block;
  font-size: 0.9rem;
  color: var(--gold-primary);
  opacity: 0.75;
  letter-spacing: 0.3em;
  margin-bottom: 2rem;
  padding-left: 1.5rem;
  font-family: 'Noto Serif TC', serif;
}

h3 {
  font-size: 1.6rem;
  color: var(--gold-light);
  margin-bottom: 1rem;
  letter-spacing: 0.08em;
}

p, ul {
  font-size: 1.05rem;
  color: var(--text-cream);
  margin-bottom: 1.4rem;
  opacity: 0.92;
}

.history-container article p {
  text-indent: 2em;
}

a {
  color: var(--gold-primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--gold-bright);
}

/* ===== Text Size Controls ===== */
.text-size-controls {
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
}

.text-size-controls button {
  background: linear-gradient(135deg, var(--crimson), var(--crimson-mid));
  color: var(--gold-bright);
  border: 1px solid var(--border-gold);
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.text-size-controls button:hover {
  background: var(--gold-primary);
  color: var(--bg-base);
}

/* ===== Header 頂欄裝飾條 ===== */
.header-topbar {
  background: linear-gradient(90deg, rgba(80,0,0,0.6), rgba(120,0,0,0.75), rgba(80,0,0,0.6));
  border-bottom: 1px solid rgba(212,175,55,0.25);
  padding: 0.28rem 0;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.5em;
  font-family: 'Noto Serif TC', serif;
  user-select: none;
}

.header-topbar-orn {
  color: var(--gold-primary);
  opacity: 0.8;
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(12,4,0,0.93);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--gold-primary);
  box-shadow: 0 0 24px rgba(212,175,55,0.28), 0 4px 24px rgba(0,0,0,0.55);
  z-index: 1000;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 2rem;
}

/* Logo — 匾額風格 */
.logo {
  color: var(--gold-bright);
  font-family: 'Noto Serif TC', serif;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-shadow: 0 0 18px rgba(255,215,0,0.55), 0 2px 4px rgba(0,0,0,0.9);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  /* 左右裝飾線 */
  position: relative;
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 4px;
  background: rgba(212,175,55,0.05);
}

.logo::before,
.logo::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 60%;
  background: rgba(212,175,55,0.4);
}
.logo::before { left: -18px; }
.logo::after  { right: -18px; }

.logo-icon {
  font-size: 1.2rem;
  opacity: 0.85;
  line-height: 1;
}

.logo:hover {
  text-shadow: 0 0 28px rgba(255,215,0,0.9), 0 2px 4px rgba(0,0,0,0.9);
  color: var(--gold-bright);
  border-color: rgba(212,175,55,0.65);
  background: rgba(212,175,55,0.1);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle .hamburger {
  width: 28px;
  height: 2px;
  background: var(--gold-primary);
  position: relative;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after {
  content: '';
  width: 28px;
  height: 2px;
  background: var(--gold-primary);
  position: absolute;
  left: 0;
  transition: transform 0.3s ease;
  border-radius: 2px;
}

.nav-toggle .hamburger::before { top: -8px; }
.nav-toggle .hamburger::after  { top:  8px; }

.nav-toggle.active .hamburger { background: transparent; }
.nav-toggle.active .hamburger::before { transform: translateY(8px) rotate(45deg); }
.nav-toggle.active .hamburger::after  { transform: translateY(-8px) rotate(-45deg); }

.nav-list {
  display: flex;
  list-style: none;
}

.nav-list > li {
  position: relative;
  margin: 0;
}

/* Nav 連結 / 標題 — 底線懸停風格 */
.nav-list > li > a,
.nav-list > li > .nav-title {
  display: block;
  padding: 0.6rem 1.1rem;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: 'Noto Serif TC', serif;
  letter-spacing: 0.08em;
  transition: color 0.25s ease;
  position: relative;
  cursor: pointer;
  user-select: none;
}

.nav-list > li > a {
  color: var(--gold-light);
}

.nav-list > li > .nav-title {
  color: #A0522D;
}

.nav-list > li > a::after,
.nav-list > li > .nav-title::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 1.1rem;
  right: 1.1rem;
  height: 1px;
  background: var(--gold-primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

.nav-list > li > a:hover,
.nav-list > li > .nav-title:hover {
  color: var(--gold-bright);
}

.nav-list > li > a:hover::after,
.nav-list > li > .nav-title:hover::after {
  transform: scaleX(1);
}

/* Dropdown 子選單連結仍用原本樣式 */
.nav-list a,
.nav-list .nav-title {
  color: var(--gold-light);
  font-family: 'Noto Serif TC', serif;
  transition: color 0.25s ease;
}

/* Dropdown */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #1A0A08;
  list-style: none;
  min-width: 220px;
  display: none;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6), 0 0 0 1px var(--border-gold);
  border: 1px solid var(--border-gold);
  padding: 0.4rem 0;
  z-index: 100;
}

.dropdown:hover > .dropdown-menu,
.dropdown.open > .dropdown-menu {
  display: block;
}

.dropdown-menu li a {
  padding: 0.7rem 1.4rem;
  color: var(--gold-light);
  font-size: 1rem;
  display: block;
  border-radius: 0;
}

.dropdown-menu li a:hover {
  background: rgba(212,175,55,0.12);
  color: var(--gold-bright);
}

/* ===== Hero Section ===== */
.hero {
  height: 100vh;
  min-height: 600px;
  /* 圖片居中，文字已在底部故不遮臉 */
  background: url('../img/IMG_20230508_133856.jpg') center center / cover no-repeat;
  position: relative;
  display: flex;
  align-items: flex-end;   /* 文字區塊靠底部 */
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  /* 上方幾乎透明，下方深暗，避免遮住神像臉部 */
  background: linear-gradient(
    180deg,
    rgba(12,4,0,0.10) 0%,
    rgba(12,4,0,0.08) 30%,
    rgba(12,4,0,0.45) 60%,
    rgba(12,4,0,0.88) 82%,
    rgba(12,4,0,0.96) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  /* 靠底顯示，底部留出捲動提示空間 */
  padding: 0 2rem 5.5rem;
  max-width: 900px;
  width: 100%;
}

.hero-sub-top {
  font-size: 1.1rem;
  color: var(--gold-light);
  letter-spacing: 0.4em;
  margin-bottom: 1.2rem;
  opacity: 0.9;
  font-family: 'Noto Serif TC', serif;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}

.hero-title {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  color: var(--gold-bright);
  text-shadow: 0 0 40px rgba(255,215,0,0.7), 0 0 80px rgba(255,215,0,0.3), 2px 2px 8px rgba(0,0,0,0.9);
  letter-spacing: 0.3em;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.hero-tagline {
  font-size: 1.2rem;
  color: var(--gold-light);
  letter-spacing: 0.35em;
  margin-bottom: 2.5rem;
  opacity: 0.88;
  font-family: 'Noto Serif TC', serif;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}

.hero-cta {
  display: inline-block;
  border: 2px solid var(--gold-primary);
  color: var(--gold-bright) !important;
  padding: 1rem 3rem;
  background: rgba(139,0,0,0.45);
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  transition: all 0.3s ease;
  text-shadow: none;
  box-shadow: 0 0 20px rgba(139,0,0,0.4), inset 0 0 20px rgba(0,0,0,0.2);
}

.hero-cta:hover {
  background: var(--gold-primary);
  color: var(--bg-base) !important;
  box-shadow: 0 0 30px rgba(212,175,55,0.6);
  transform: translateY(-2px);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold-primary);
  font-size: 1.8rem;
  opacity: 0.7;
  animation: bounceDown 2s infinite;
  z-index: 2;
  cursor: pointer;
}

@keyframes bounceDown {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* ===== Main Content ===== */
.content {
  /* 6.5rem = 頂欄(~26px) + navbar(~57px) + 緩衝 */
  padding: 6.5rem 0 5rem;
  animation: fadeInUp 0.8s ease-in;
}

/* Hero 後的 content 不需 header offset（hero 已佔滿視窗） */
.hero + .content {
  padding-top: 4rem;
}

/* ===== Section Card — 豪華雙層金邊 ===== */
.section-card {
  position: relative;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-card-alt));
  padding: 3rem;
  margin-bottom: 3rem;
  border-radius: 16px;
  border: 1px solid var(--border-gold);
  box-shadow:
    0 0 0 4px rgba(212,175,55,0.08),
    0 15px 40px var(--shadow-dark),
    inset 0 0 40px rgba(0,0,0,0.3);
  color: var(--text-cream);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 內層裝飾邊框 */
.section-card::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(212,175,55,0.22);
  border-radius: 12px;
  pointer-events: none;
}

.section-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 0 0 4px rgba(212,175,55,0.15),
    0 20px 50px rgba(0,0,0,0.7),
    inset 0 0 40px rgba(0,0,0,0.3);
}

.section-card ul {
  list-style: none;
  padding-left: 2rem;
}

.section-card ul li {
  position: relative;
  margin-bottom: 0.8rem;
  color: var(--text-cream);
  opacity: 0.92;
}

.section-card ul li::before {
  content: '✦';
  position: absolute;
  left: -2rem;
  color: var(--gold-primary);
  font-size: 1rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--crimson), var(--crimson-mid));
  color: var(--gold-bright);
  border: 2px solid var(--gold-primary);
  border-radius: 6px;
  padding: 0.75rem 2rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(139,0,0,0.5);
  text-decoration: none;
}

.btn:hover {
  background: var(--gold-primary);
  color: var(--bg-base);
  box-shadow: 0 6px 25px rgba(212,175,55,0.4);
  transform: translateY(-2px);
}

/* ===== Footer — 三欄佈局 ===== */
.footer {
  background: #080200;
  border-top: 3px solid var(--gold-primary);
  box-shadow: 0 -8px 30px rgba(212,175,55,0.15);
  overflow: hidden;
}

/* 頂部裝飾 — flexbox 方式，不用 Unicode 破折號，不會溢出 */
.footer-top-ornament {
  display: flex;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(212,175,55,0.18);
}

.footer-orn-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,0.4), transparent);
}

.footer-orn-text {
  padding: 0 1.2rem;
  color: var(--gold-primary);
  font-family: 'Noto Serif TC', serif;
  font-size: 0.82rem;
  letter-spacing: 0.4em;
  opacity: 0.8;
  white-space: nowrap;   /* 文字不換行；flex 已處理兩側線條 */
}

/* 三欄網格 — 獨立於 .container，避免 padding 互相覆蓋 */
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  padding: 3rem 0;    /* 僅控制上下間距，水平由 .container 的 padding 負責 */
}

.footer-col h4 {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.1rem;
  color: var(--gold-bright);
  margin-bottom: 1rem;
  letter-spacing: 0.12em;
  text-shadow: 0 0 10px rgba(255,215,0,0.3);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(212,175,55,0.28);
}

.footer-col p {
  color: var(--gold-light);
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
  opacity: 0.82;
  line-height: 1.6;
}

.footer-col p a {
  color: var(--gold-light);
  opacity: 0.82;
}

.footer-col p a:hover {
  color: var(--gold-bright);
  opacity: 1;
}

.footer-links,
.social-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li,
.social-links li {
  margin-bottom: 0.5rem;
}

.footer-links a,
.social-links a {
  color: var(--gold-light);
  font-size: 0.92rem;
  opacity: 0.8;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-links a::before,
.social-links a::before {
  content: '›';
  color: var(--gold-primary);
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.7;
  transition: transform 0.25s ease;
}

.footer-links a:hover,
.social-links a:hover {
  color: var(--gold-bright);
  opacity: 1;
}

.footer-links a:hover::before,
.social-links a:hover::before {
  transform: translateX(3px);
  opacity: 1;
}

.footer-bottom {
  text-align: center;
  padding: 1rem 2rem;
  border-top: 1px solid rgba(212,175,55,0.15);
}

.footer-bottom p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

/* ===== History Page ===== */
.history-container article {
  margin-bottom: 2.5rem;
}

.history-container article h3 {
  position: relative;
  padding-bottom: 0.6rem;
  margin-bottom: 1.2rem;
}

.history-container article + article::before {
  content: '❖ ─────── ❖ ─────── ❖';
  display: block;
  text-align: center;
  color: var(--gold-primary);
  opacity: 0.5;
  font-size: 1rem;
  margin-bottom: 2.5rem;
  letter-spacing: 0.2em;
}

.history-container footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(212,175,55,0.3);
  color: var(--text-muted);
  font-size: 0.92rem;
}

.history-container footer p {
  color: var(--text-muted);
  font-size: 0.92rem;
  opacity: 0.85;
  margin-bottom: 0;
  text-indent: 0;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ===== Responsive — Mobile ===== */
@media (max-width: 768px) {
  /* 手機版隱藏頂欄節省空間 */
  .header-topbar {
    display: none;
  }

  /* Logo 裝飾豎線在手機版隱藏，避免溢出 flex 容器 */
  .logo::before,
  .logo::after {
    display: none;
  }

  .logo {
    font-size: 1.25rem;
    padding: 0.25rem 0.6rem;
    letter-spacing: 0.12em;
  }

  .nav-toggle {
    display: block;
  }

  .nav-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(12,4,0,0.97);
    flex-direction: column;
    display: none;
    width: 100%;
    padding: 1rem 0;
    border-top: 1px solid var(--border-gold);
    box-shadow: 0 8px 20px rgba(0,0,0,0.7);
  }

  .nav-list.show {
    display: flex;
    animation: slideIn 0.35s ease-out;
  }

  .nav-list > li {
    margin: 0;
    border-bottom: 1px solid rgba(212,175,55,0.1);
  }

  .nav-list a,
  .nav-list .nav-title {
    padding: 1rem 2rem;
    font-size: 1.15rem;
    border-radius: 0;
  }

  /* 手機版：隱藏桌面底線效果 */
  .nav-list > li > a::after,
  .nav-list > li > .nav-title::after {
    display: none;
  }

  /* 手機版：dropdown 箭頭用更具體選擇器重新套用 */
  .nav-list > li.dropdown > .nav-title::after {
    display: block;
    content: '▾';
    position: static;
    float: right;
    transform: none;
    background: none;
    height: auto;
    color: var(--gold-primary);
    font-size: 1.1rem;
    opacity: 1;
  }

  .dropdown-menu {
    position: static;
    background: rgba(26,10,8,0.95);
    box-shadow: none;
    border: none;
    border-radius: 0;
    display: none !important;
    margin: 0;
    padding: 0;
    border-top: 1px solid rgba(212,175,55,0.1);
  }

  .dropdown.open > .dropdown-menu {
    display: flex !important;
    flex-direction: column;
  }

  .dropdown-menu li a {
    padding: 0.85rem 3.5rem;
    font-size: 1.05rem;
    color: var(--gold-light);
  }

  .hero-title {
    font-size: clamp(2.4rem, 10vw, 4rem);
    letter-spacing: 0.18em;
  }

  .hero-sub-top,
  .hero-tagline {
    letter-spacing: 0.2em;
  }

  .hero-cta {
    padding: 0.85rem 2.2rem;
    font-size: 1rem;
  }

  .hero-content {
    padding-bottom: 4.5rem;
  }

  .content {
    padding: 5.5rem 0 4rem;
  }

  .hero + .content {
    padding-top: 3rem;
  }

  .section-card {
    padding: 2rem 1.5rem;
  }

  h2 {
    font-size: 2.2rem;
  }

  h3 {
    font-size: 1.4rem;
  }

  /* Footer 手機版：單欄，col 之間加分隔線 */
  .footer-top-ornament {
    padding: 0.8rem 1.5rem;
  }

  .footer-orn-text {
    letter-spacing: 0.2em;
    font-size: 0.75rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }

  .footer-col {
    padding: 1.8rem 0;
    border-bottom: 1px solid rgba(212,175,55,0.1);
  }

  .footer-col:last-child {
    border-bottom: none;
  }

  .text-size-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .text-size-controls button {
    width: 100%;
    text-align: center;
  }
}
