/* 七股天元靈母宮 lingmu.tw */
:root {
  --red: #a8322d;
  --red-dark: #7d221e;
  --gold: #e3b23c;
  --gold-soft: #f6e3a8;
  --paper: #fbf6ec;
  --paper-2: #f3ead7;
  --ink: #2b2523;
  --ink-2: #5d524d;
  --line: #e2d6bd;
  --radius: 10px;
  --wrap: 1120px;
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.8;
  color: var(--ink);
  background: var(--paper);
  padding-bottom: 72px; /* room for mobile action bar */
}
@media (min-width: 900px) { body { padding-bottom: 0; } }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); }
a:hover { color: var(--red-dark); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.35; color: var(--red-dark); }
h2 { font-size: 1.75rem; margin: 0 0 .6em; }
h3 { font-size: 1.25rem; margin: 0 0 .4em; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 100; }

/* ---------- header ---------- */
.site-header {
  background: var(--red);
  color: #fff;
  border-bottom: 4px solid var(--gold);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { width: 44px; height: 44px; flex: none; }
.brand-name { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; letter-spacing: .12em; line-height: 1.2; }
.brand-sub { display: block; font-family: var(--sans); font-size: .78rem; font-weight: 400; letter-spacing: .08em; opacity: .85; }

.nav-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 48px; padding: 0 16px;
  font: inherit; font-size: 1rem; color: var(--red-dark);
  background: var(--gold-soft); border: 0; border-radius: 8px; cursor: pointer;
}
.site-nav { display: none; }
.site-nav.open {
  display: block; position: absolute; left: 0; right: 0; top: 100%;
  background: var(--red-dark); border-bottom: 4px solid var(--gold);
}
.site-nav ul { list-style: none; margin: 0; padding: 8px 20px 16px; }
.site-nav a {
  display: block; padding: 12px 8px; min-height: 48px;
  color: #fff; text-decoration: none; font-size: 1.1rem; border-bottom: 1px solid rgba(255,255,255,.15);
}
.site-nav a[aria-current="page"] { color: var(--gold); font-weight: 700; }
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav, .site-nav.open { display: block; position: static; background: none; border: 0; }
  .site-nav ul { display: flex; gap: 4px; padding: 0; }
  .site-nav a { border: 0; padding: 10px 14px; min-height: 0; border-radius: 6px; font-size: 1.02rem; }
  .site-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
}

/* ---------- hero ---------- */
.hero { position: relative; color: #fff; background: #3a1a12; overflow: hidden; }
.hero img { width: 100%; height: 62vh; min-height: 380px; max-height: 640px; object-fit: cover; opacity: .62; }
.hero-text {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 20px;
  background: linear-gradient(180deg, rgba(40,12,8,.15) 0%, rgba(40,12,8,.55) 100%);
}
.hero h1 {
  color: #fff; font-size: clamp(2.2rem, 7vw, 4.2rem); letter-spacing: .25em; margin: 0 0 .2em;
  text-shadow: 0 2px 14px rgba(0,0,0,.5); padding-left: .25em;
}
.hero .tagline { font-family: var(--serif); font-size: clamp(1.1rem, 3vw, 1.5rem); letter-spacing: .3em; color: var(--gold-soft); margin: 0 0 1.4em; padding-left: .3em; }
.hero .loc { font-size: 1rem; opacity: .9; margin: 0; }

.page-hero { background: var(--red-dark); color: #fff; padding: 40px 0 32px; border-bottom: 4px solid var(--gold); }
.page-hero h1 { color: #fff; margin: 0; font-size: clamp(1.9rem, 5vw, 2.6rem); letter-spacing: .15em; }
.page-hero p { margin: .4em 0 0; color: var(--gold-soft); }

/* ---------- buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px; border-radius: 999px;
  font-size: 1.08rem; font-weight: 700; text-decoration: none;
  background: var(--gold); color: var(--red-dark); border: 2px solid var(--gold);
}
.btn:hover { background: #f0c552; color: var(--red-dark); }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.8); }
.btn.ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn.red { background: var(--red); color: #fff; border-color: var(--red); }
.btn.red:hover { background: var(--red-dark); color: #fff; }
.btn svg { width: 22px; height: 22px; }

/* ---------- sections ---------- */
section { padding: 56px 0; }
section.alt { background: var(--paper-2); }
.section-head { text-align: center; margin-bottom: 32px; }
.section-head h2 { display: inline-block; position: relative; padding: 0 1.2em; }
.section-head h2::before, .section-head h2::after {
  content: ""; position: absolute; top: 50%; width: .8em; height: 2px; background: var(--gold);
}
.section-head h2::before { left: 0; }
.section-head h2::after { right: 0; }
.section-head p { color: var(--ink-2); margin: 0; }

.grid-2 { display: grid; gap: 32px; align-items: center; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.figure { margin: 0; }
.figure img { border-radius: var(--radius); box-shadow: 0 6px 20px rgba(60,30,10,.15); }
.figure figcaption { font-size: .9rem; color: var(--ink-2); margin-top: 8px; }

/* next festival */
.next-fest {
  background: #fff; border: 2px solid var(--gold); border-radius: var(--radius);
  padding: 24px; text-align: center; max-width: 640px; margin: -48px auto 0; position: relative; z-index: 2;
  box-shadow: 0 10px 30px rgba(60,30,10,.12);
}
.next-fest .label { color: var(--ink-2); font-size: .95rem; letter-spacing: .1em; }
.next-fest .name { font-family: var(--serif); font-size: 1.6rem; color: var(--red-dark); font-weight: 700; margin: 4px 0; }
.next-fest .date { font-size: 1.15rem; }
.next-fest .days { display: inline-block; margin-top: 10px; background: var(--red); color: #fff; border-radius: 999px; padding: 4px 18px; font-weight: 700; }

/* cards */
.cards { display: grid; gap: 20px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .cards.three { grid-template-columns: repeat(3, 1fr); } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { margin-top: 0; }
.card .meta { color: var(--ink-2); font-size: .95rem; }

/* festival table */
.fest-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; }
.fest-table th, .fest-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.fest-table th { background: var(--red); color: #fff; font-weight: 700; }
.fest-table td:first-child { white-space: nowrap; font-weight: 700; color: var(--red-dark); }
@media (max-width: 640px) {
  .fest-table thead { display: none; }
  .fest-table, .fest-table tbody, .fest-table tr, .fest-table td { display: block; width: 100%; }
  .fest-table tr { border-bottom: 2px solid var(--gold); padding: 8px 0; }
  .fest-table td { border: 0; padding: 4px 16px; }
}

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: var(--gold); }
.timeline li { position: relative; padding: 0 0 26px 44px; }
.timeline li::before {
  content: ""; position: absolute; left: 2px; top: 7px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--paper); border: 4px solid var(--red);
}
.timeline .when { font-family: var(--serif); font-weight: 700; color: var(--red-dark); font-size: 1.15rem; }

/* deities */
.deity { display: flex; gap: 16px; align-items: flex-start; }
.deity .seal {
  flex: none; width: 56px; height: 56px; border-radius: 50%; background: var(--red); color: var(--gold-soft);
  font-family: var(--serif); font-size: 1.5rem; font-weight: 700; display: grid; place-items: center;
}
.deity.main { border: 2px solid var(--gold); }

/* edict */
.edict {
  background: #ffe94d; color: #b0261c; border-radius: var(--radius); padding: 28px 20px;
  font-family: var(--serif); box-shadow: inset 0 0 0 6px #fff3a6, 0 6px 20px rgba(60,30,10,.15);
}
.edict h3 { color: #b0261c; text-align: center; font-size: 1.7rem; letter-spacing: .5em; padding-left: .5em; margin: 0 0 18px; }
.edict ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.edict li { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 18px; font-size: 1.08rem; letter-spacing: .12em; text-align: center; }
@media (min-width: 860px) { .edict li { grid-template-columns: repeat(4, 1fr); font-size: 1.15rem; } }
.edict li + li { border-top: 1px dashed rgba(176,38,28,.3); padding-top: 6px; }

/* gallery */
.gallery { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 860px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery a { display: block; border-radius: var(--radius); overflow: hidden; position: relative; background: #ddd; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s; }
.gallery a:hover img { transform: scale(1.04); }
.gallery span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; font-size: .9rem; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
}

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(15,8,5,.92); display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px; flex-direction: column; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 82vh; width: auto; border-radius: 6px; }
.lightbox p { color: #fff; margin: 12px 0 0; text-align: center; }
.lightbox button { position: absolute; top: 12px; right: 12px; min-width: 52px; min-height: 52px; font-size: 1.8rem; background: none; border: 0; color: #fff; cursor: pointer; }

/* videos */
.video-list { display: grid; gap: 14px; }
@media (min-width: 640px) { .video-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .video-list { grid-template-columns: repeat(3, 1fr); } }
.video-item {
  display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); min-height: 76px;
}
.video-item:hover { border-color: var(--gold); color: var(--ink); }
.video-item .play { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--red); display: grid; place-items: center; }
.video-item .play::after { content: ""; border-left: 14px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; margin-left: 4px; }
.video-item strong { display: block; line-height: 1.4; }
.video-item small { color: var(--ink-2); }
.embed-frame { background: #000; border-radius: var(--radius); overflow: hidden; max-width: 760px; margin: 0 auto; }
.embed-frame iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }
.embed-ph { aspect-ratio: 16 / 9; display: grid; place-items: center; color: #fff; text-align: center; padding: 20px; cursor: pointer; background: #2a1510 center / cover no-repeat; position: relative; }
.embed-ph::before { content: ""; position: absolute; inset: 0; background: rgba(30,10,5,.55); }
.embed-ph > * { position: relative; }
.embed-ph .play { width: 76px; height: 76px; border-radius: 50%; background: var(--red); display: grid; place-items: center; margin: 0 auto 12px; border: 3px solid var(--gold); }
.embed-ph .play::after { content: ""; border-left: 24px solid #fff; border-top: 15px solid transparent; border-bottom: 15px solid transparent; margin-left: 6px; }

/* fb box */
.fb-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; justify-content: center; }
.fb-box iframe { border: 0; width: 100%; max-width: 500px; height: 620px; }

/* map / contact */
.map-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #e8e1d2; }
.map-frame iframe { width: 100%; height: 380px; border: 0; display: block; }
.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.info-list li strong { flex: none; width: 4.5em; color: var(--red-dark); }
.tel-big { font-size: 1.6rem; font-weight: 700; color: var(--red); text-decoration: none; letter-spacing: .04em; }

.note { background: var(--gold-soft); border-left: 5px solid var(--gold); padding: 14px 18px; border-radius: 6px; font-size: .98rem; }
.lead { font-size: 1.12rem; }
.center { text-align: center; }
.mt { margin-top: 28px; }

/* ---------- footer ---------- */
.site-footer { background: #2e1a14; color: #e9dcc6; padding: 40px 0 28px; font-size: .98rem; }
.site-footer a { color: var(--gold); }
.site-footer .wrap { display: grid; gap: 24px; }
@media (min-width: 860px) { .site-footer .wrap { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h2 { color: var(--gold); font-size: 1.3rem; margin-bottom: .4em; letter-spacing: .12em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 3px 0; }
.copyright { text-align: center; margin-top: 28px; font-size: .85rem; opacity: .7; }

/* ---------- mobile action bar ---------- */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--red-dark); border-top: 3px solid var(--gold);
}
.action-bar a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 64px; color: #fff; text-decoration: none; font-size: .95rem; gap: 2px; }
.action-bar a + a { border-left: 1px solid rgba(255,255,255,.18); }
.action-bar svg { width: 24px; height: 24px; }
@media (min-width: 900px) { .action-bar { display: none; } }
