/* 思慕 Sìmù — 統一前台 CSS (從 includes/site_header.php 抽出)
   所有前台頁面 (含 lantern.php) 應引用此檔。
   維護時改這裡,然後同步到 site_header.php 的 <style> 區塊。 */

:root {
  --ink: #0E0907; --ink-soft: #1A0F0A; --ink-warm: #2A1810;
  --vermilion: #8B2018; --candle: #E8985A; --candle-bright: #FFC58A;
  --gold: #9C7E3F; --paper: #F5EFE3; --paper-warm: #E8DDC8; --bone: #D4C9B5;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }
body { font-family: 'Noto Sans TC', -apple-system, sans-serif; background: var(--paper); color: var(--ink); line-height: 1.5; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.kai { font-family: 'LXGW WenKai', 'Noto Serif TC', cursive, serif; }
.serif { font-family: 'Noto Serif TC', serif; }
.italic-en { font-family: 'Cormorant Garamond', serif; font-style: italic; }

/* === 導覽列 === */
.nav { position: sticky; top: 0; z-index: 100; background: rgba(14,9,7,0.96); backdrop-filter: blur(20px); padding: 18px 60px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(200,165,92,0.15); }
.nav .logo { font-family: 'Noto Serif TC', serif; font-weight: 200; font-size: 1.3rem; letter-spacing: 0.3em; color: var(--paper); }
.nav .logo .en { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 0.85rem; color: var(--candle); margin-left: 8px; letter-spacing: 0.2em; }
.nav .menu { display: flex; gap: 36px; font-size: 0.85rem; letter-spacing: 0.15em; align-items: center; }
.nav .menu a { color: var(--bone); transition: color 0.3s; position: relative; padding: 6px 0; }
.nav .menu a:hover, .nav .menu a.active { color: var(--candle-bright); }
.nav .menu a.active::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; background: var(--candle); border-radius: 50%; }
.nav .menu .btn-admin { color: var(--candle); border: 1px solid var(--candle); padding: 8px 18px; }
.nav .menu .btn-admin:hover { background: var(--candle); color: var(--ink); }
@media (max-width: 900px) { .nav { padding: 14px 24px; } .nav .menu { display: none; } }

/* === Hero (for inner pages) === */
.page-hero { background: var(--ink); color: var(--paper); padding: 120px 60px 100px; text-align: center; position: relative; overflow: hidden; }
.page-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center 30%, #1F100A 0%, var(--ink) 70%); }
.page-hero .container { position: relative; z-index: 2; max-width: 1100px; margin: 0 auto; }
.page-hero .pre { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 0.9rem; letter-spacing: 0.5em; color: var(--candle); text-transform: uppercase; margin-bottom: 24px; }
.page-hero h1 { font-family: 'Noto Serif TC', serif; font-weight: 200; font-size: clamp(2.5rem, 5vw, 4.5rem); line-height: 1.3; color: var(--paper); letter-spacing: 0.15em; margin-bottom: 24px; }
.page-hero h1 .accent { color: var(--candle-bright); }
.page-hero p { font-family: 'Noto Serif TC', serif; font-weight: 300; font-size: 1.1rem; line-height: 2; color: var(--bone); max-width: 700px; margin: 0 auto; }
@media (max-width: 768px) { .page-hero { padding: 80px 24px 60px; } }

/* === Filter bar === */
.filter-bar { background: var(--paper-warm); border: 1px solid rgba(156,126,63,0.2); padding: 24px 32px; margin: -50px auto 60px; max-width: 1200px; position: relative; z-index: 3; display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 16px; align-items: end; }
.filter-bar label { display: block; font-size: 11px; letter-spacing: 0.2em; color: #6B5A45; font-weight: 600; margin-bottom: 6px; text-transform: uppercase; }
.filter-bar input, .filter-bar select { width: 100%; padding: 10px 12px; border: 1px solid rgba(156,126,63,0.3); background: var(--paper); font-family: inherit; font-size: 14px; color: #1A0F0A; font-weight: 500; }
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--vermilion); }
.filter-bar .btn { padding: 11px 24px; background: var(--ink); color: var(--paper); border: none; cursor: pointer; font-family: inherit; font-size: 13px; letter-spacing: 0.2em; transition: background 0.3s; }
.filter-bar .btn:hover { background: var(--candle); }
@media (max-width: 768px) { .filter-bar { grid-template-columns: 1fr; margin: -30px 20px 40px; padding: 20px; } }

/* === Card grid === */
.grid-section { max-width: 1400px; margin: 0 auto; padding: 0 60px 100px; }
.grid-section h2 { font-family: 'Noto Serif TC', serif; font-weight: 200; font-size: 2rem; color: var(--ink); letter-spacing: 0.15em; margin-bottom: 50px; text-align: center; }
.grid-section h2 .accent { color: var(--vermilion); }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
@media (max-width: 1024px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .card-grid { grid-template-columns: 1fr; } .grid-section { padding: 0 24px 60px; } }

.card { background: var(--paper); border: 1px solid rgba(156,126,63,0.15); transition: all 0.3s; cursor: pointer; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(14,9,7,0.08); border-color: var(--vermilion); }
.card .cover { aspect-ratio: 4/3; background: var(--ink-warm); background-size: cover; background-position: center; filter: sepia(0.2) brightness(0.95); position: relative; }
.card .cover .tag-overlay { position: absolute; top: 16px; left: 16px; padding: 4px 10px; background: rgba(14,9,7,0.8); color: var(--candle); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; }
.card .body { padding: 24px 26px 30px; flex: 1; display: flex; flex-direction: column; }
.card .body .city { font-size: 11px; color: #6B5A45; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; margin-bottom: 10px; }
.card .body h3 { font-family: 'Noto Serif TC', serif; font-weight: 600; font-size: 1.3rem; color: #1A0F0A; margin-bottom: 10px; letter-spacing: 0.05em; line-height: 1.4; }
.card .body .deity { font-family: 'Noto Serif TC', serif; font-weight: 500; font-size: 0.95rem; color: #8B2018; margin-bottom: 14px; }
.card .body .address { font-size: 14px; color: #4A3A28; font-weight: 400; margin-bottom: 16px; line-height: 1.7; }
.card .body .meta { display: flex; gap: 16px; font-size: 13px; color: #2A1810; font-weight: 500; margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(156,126,63,0.2); }
.card .body .meta span { display: flex; align-items: center; gap: 4px; }

/* === Pagination === */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 60px; }
.pagination a, .pagination span { padding: 10px 16px; border: 1px solid rgba(156,126,63,0.3); font-size: 14px; color: var(--ink); transition: all 0.2s; }
.pagination a:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pagination .current { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* === Empty state === */
.empty-state { text-align: center; padding: 100px 20px; color: #6B5A45; }
.empty-state h3 { font-family: 'Noto Serif TC', serif; font-weight: 300; font-size: 1.8rem; color: #1A0F0A; margin-bottom: 16px; letter-spacing: 0.1em; }
.empty-state p { font-size: 1rem; color: #4A3A28; margin-bottom: 30px; }

/* === Result count === */
.result-count { text-align: center; color: #6B5A45; font-weight: 500; font-size: 14px; margin-bottom: 30px; letter-spacing: 0.1em; }

/* === Footer (新版 4-tier) === */
.footer {
  background: linear-gradient(180deg, var(--ink) 0%, #060302 100%);
  color: var(--bone);
  padding: 80px 60px 36px;
  margin-top: 100px;
  position: relative;
  border-top: 1px solid rgba(200, 165, 92, 0.2);
}
.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--candle) 50%, transparent 100%);
  opacity: 0.5;
}
.footer .container { max-width: 1400px; margin: 0 auto; }

/* 上半部:品牌 + 統計 + 聯絡 */
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 1.2fr;
  gap: 60px;
  padding-bottom: 50px;
  margin-bottom: 50px;
  border-bottom: 1px solid rgba(200, 165, 92, 0.12);
}
.footer-brand .brand-mark { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; }
.footer-brand .brand-mark .brand-zh { font-family: 'Noto Serif TC', serif; font-weight: 200; font-size: 2rem; letter-spacing: 0.3em; color: var(--paper); }
.footer-brand .brand-mark .brand-en { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 1.1rem; color: var(--candle); letter-spacing: 0.2em; }
.footer-brand .brand-desc { font-size: 13px; color: var(--bone); opacity: 0.7; line-height: 1.9; margin-bottom: 18px; }
.footer-brand .brand-tagline { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 0.9rem; color: var(--candle); letter-spacing: 0.18em; opacity: 0.85; }

.footer-stats { display: flex; gap: 12px; align-items: stretch; }
.footer-stats .stat-card {
  flex: 1;
  padding: 22px 18px;
  background: rgba(245, 239, 227, 0.03);
  border: 1px solid rgba(200, 165, 92, 0.12);
  text-align: center;
  transition: all 0.3s ease;
  text-decoration: none;
  color: var(--bone);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.footer-stats .stat-card:hover {
  background: rgba(232, 152, 90, 0.08);
  border-color: var(--candle);
  transform: translateY(-2px);
}
.footer-stats .stat-card .num {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 1.9rem;
  color: var(--candle-bright);
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.footer-stats .stat-card .lbl {
  font-family: 'Noto Serif TC', serif;
  font-weight: 300;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--bone);
  opacity: 0.75;
}

.footer-contact h5 { margin-bottom: 18px; }
.footer-contact ul { list-style: none; margin: 0 0 18px 0; padding: 0; }
.footer-contact ul li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  color: var(--bone);
}
.footer-contact ul li .ci {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: rgba(232, 152, 90, 0.1);
  border: 1px solid rgba(232, 152, 90, 0.25);
  color: var(--candle);
  font-size: 0.85rem;
  flex-shrink: 0;
}
.footer-contact ul li a { color: var(--paper); transition: color 0.3s; }
.footer-contact ul li a:hover { color: var(--candle-bright); }
.footer-contact .contact-cta a {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid var(--candle);
  color: var(--candle-bright);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  transition: all 0.3s;
  text-decoration: none;
}
.footer-contact .contact-cta a:hover { background: var(--candle); color: var(--ink); }

/* 中段 sitemap */
.footer h5 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  color: var(--candle);
  text-transform: uppercase;
  margin-bottom: 22px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  padding-bottom: 40px;
  margin-bottom: 36px;
  border-bottom: 1px solid rgba(200, 165, 92, 0.12);
}
.footer .col ul { list-style: none; margin: 0; padding: 0; }
.footer .col ul li { margin-bottom: 10px; font-size: 0.88rem; list-style: none; padding-left: 0; }
.footer ul li { list-style: none; padding-left: 0; }
.footer .col ul li a { color: var(--bone); transition: color 0.3s, padding-left 0.3s; display: inline-block; }
.footer .col ul li a:hover { color: var(--candle-bright); padding-left: 6px; }

/* 底欄 */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-size: 0.78rem;
  color: var(--bone);
  opacity: 0.7;
  flex-wrap: wrap;
}
.footer-bottom .copy-left { display: flex; align-items: center; gap: 14px; }
.footer-bottom .brand-mark-sm {
  font-family: 'Noto Serif TC', serif;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: var(--paper);
  padding-right: 14px;
  border-right: 1px solid rgba(200, 165, 92, 0.2);
}
.footer-bottom .copy-mid { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.footer-bottom .copy-mid a { color: var(--bone); transition: color 0.3s; }
.footer-bottom .copy-mid a:hover { color: var(--candle-bright); }
.footer-bottom .copy-mid .dot { color: rgba(200, 165, 92, 0.4); }
.footer-bottom .copy-right { font-family: 'Cormorant Garamond', serif; font-style: italic; letter-spacing: 0.15em; }

@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-stats { grid-column: 1 / -1; order: 3; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .footer { padding: 60px 24px 28px; }
  .footer-top { grid-template-columns: 1fr; gap: 32px; padding-bottom: 36px; margin-bottom: 36px; }
  .footer-stats { gap: 8px; }
  .footer-stats .stat-card .num { font-size: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-bottom .copy-mid { font-size: 0.72rem; }
}

/* === Animations ===
   預設完全可見(fail-safe),JS 可選擇性加進場動畫
*/
.fade-in { opacity: 1; transform: translateY(0); transition: opacity 0.5s ease, transform 0.5s ease; }
