:root {
  --bg: #faf8f4;
  --bg-alt: #f1ece3;
  --ink: #2f2a24;
  --ink-soft: #6b6358;
  --gold: #b08d4f;
  --gold-dark: #8c6d36;
  --line: #e3dbcd;
  --white: #ffffff;
  --shadow: 0 6px 24px rgba(60, 48, 28, 0.08);
  --radius: 14px;
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --sans: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
}

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

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container { width: min(1120px, 92%); margin: 0 auto; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .02em; }

a { color: var(--gold-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 248, 244, .9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 1.25rem; font-weight: 700; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo-cross { color: var(--gold); font-size: 1.1em; }
.main-nav { display: flex; gap: 26px; }
.main-nav a { color: var(--ink-soft); font-size: .95rem; }
.main-nav a:hover, .main-nav a.active { color: var(--gold-dark); text-decoration: none; }

/* Buttons */
.btn {
  display: inline-block; padding: 12px 26px; border-radius: 999px;
  font-size: .98rem; font-weight: 600; cursor: pointer; border: none;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
  text-align: center;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--gold); color: #fff; box-shadow: 0 4px 14px rgba(176,141,79,.35); }
.btn-primary:hover { background: var(--gold-dark); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-dark); }
.btn-block { display: block; width: 100%; }
.btn-small { padding: 9px 18px; font-size: .9rem; }

/* Hero */
.hero {
  background:
    linear-gradient(rgba(45,38,28,.55), rgba(45,38,28,.55)),
    url('https://images.unsplash.com/photo-1507692049790-de58290a4334?w=1600&q=80') center/cover;
  color: #fff; text-align: center; padding: 110px 0 120px;
}
.hero-verse { font-style: italic; opacity: .9; margin-bottom: 22px; font-size: .98rem; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.25; color: #fff; }
.hero-sub { margin: 22px auto 34px; max-width: 620px; opacity: .92; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; color: #fff; }

/* Features */
.features { padding: 70px 0; background: var(--white); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.feature-card { text-align: center; padding: 30px 22px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); }
.feature-icon { font-size: 2.4rem; margin-bottom: 12px; }
.feature-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.feature-card p { color: var(--ink-soft); font-size: .95rem; }

/* Sections */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; margin-bottom: 46px; }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); }
.section-sub { color: var(--ink-soft); margin-top: 8px; }

/* Memorial grid */
.memorial-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 28px; }
.memorial-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line); color: var(--ink);
  transition: transform .15s ease, box-shadow .2s ease;
}
.memorial-card:hover { text-decoration: none; transform: translateY(-4px); box-shadow: 0 14px 34px rgba(60,48,28,.14); }
.memorial-photo { height: 200px; background-size: cover; background-position: center; filter: saturate(.9); }
.memorial-card-body { padding: 22px; }
.memorial-card-body h3 { font-size: 1.3rem; }
.memorial-dates { color: var(--gold-dark); font-family: var(--serif); margin: 4px 0 10px; }
.memorial-snippet { color: var(--ink-soft); font-size: .95rem; margin-bottom: 16px; }
.memorial-status { display: inline-block; font-size: .82rem; padding: 5px 12px; border-radius: 999px; }
.status-upcoming { background: #eef5ea; color: #4e7a3a; }
.status-done { background: #f0ece4; color: var(--ink-soft); }

/* Booking form */
.booking-form { max-width: 760px; margin: 0 auto; background: var(--white); padding: 36px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { margin-bottom: 18px; }
label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 7px; color: var(--ink); }
input, select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px;
  font-family: inherit; font-size: .95rem; background: var(--bg); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176,141,79,.15); }
textarea { resize: vertical; }
.form-note { font-size: .82rem; color: var(--ink-soft); text-align: center; margin-top: 12px; }

/* About */
.about-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.about-inner h2 { font-size: 2rem; margin-bottom: 20px; }
.about-inner p { color: var(--ink-soft); margin-bottom: 16px; }
.verse-block { margin-top: 30px; font-family: var(--serif); font-size: 1.15rem; font-style: italic; color: var(--gold-dark); line-height: 1.9; }
.verse-block cite { display: block; font-size: .9rem; margin-top: 8px; color: var(--ink-soft); }

/* Footer */
.site-footer { background: #2b2620; color: #cfc6b6; padding: 50px 0 30px; margin-top: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.site-footer strong { color: #fff; margin-left: 6px; }
.site-footer p { font-size: .9rem; margin-top: 6px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: #cfc6b6; font-size: .92rem; }
.footer-copy { width: 100%; border-top: 1px solid #463f34; padding-top: 18px; margin-top: 14px; font-size: .82rem; color: #8c8275; opacity: .8; }

/* ===== Memorial detail page ===== */
.m-hero {
  position: relative; text-align: center; color: #fff; padding: 80px 0 70px;
  background: linear-gradient(135deg, #3a3226, #5a4d36);
}
.m-hero-overlay { position: absolute; inset: 0; background: radial-gradient(circle at top, rgba(255,255,255,.08), transparent 60%); }
.m-hero-inner { position: relative; }
.m-portrait {
  width: 150px; height: 150px; margin: 0 auto 20px; border-radius: 50%;
  background-size: cover; background-position: center;
  border: 4px solid rgba(255,255,255,.85); box-shadow: 0 8px 30px rgba(0,0,0,.3);
  background-color: #cabfa6;
}
.m-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); color: #fff; }
.m-dates { font-family: var(--serif); font-size: 1.2rem; color: #e8dcc0; margin: 8px 0 18px; }
.m-verse { font-style: italic; opacity: .9; max-width: 560px; margin: 0 auto; font-size: .98rem; }

.m-layout { display: grid; grid-template-columns: 1fr 340px; gap: 34px; padding: 50px 0 70px; align-items: start; }
.m-main { display: flex; flex-direction: column; gap: 26px; }
.m-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.m-card h2 { font-size: 1.4rem; margin-bottom: 16px; }
.m-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.m-card-head h2 { margin-bottom: 0; }
#mBio { color: var(--ink-soft); white-space: pre-line; }

/* Photo wall */
.photo-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo-wall img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; cursor: pointer; transition: transform .15s ease; }
.photo-wall img:hover { transform: scale(1.04); }
.empty-hint { color: var(--ink-soft); font-size: .92rem; grid-column: 1 / -1; }

/* Tributes */
.tribute-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.tribute-list { display: flex; flex-direction: column; gap: 16px; }
.tribute {
  background: var(--bg); border-radius: 10px; padding: 16px 18px; border-left: 3px solid var(--gold);
}
.tribute-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.tribute-name { font-weight: 700; }
.tribute-time { font-size: .78rem; color: var(--ink-soft); }
.tribute-text { color: var(--ink-soft); white-space: pre-line; }

/* Sidebar */
.m-sidebar { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 88px; }
.info-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.info-card h3 { font-size: 1.2rem; margin-bottom: 16px; color: var(--gold-dark); }
.info-list { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.info-list li { display: flex; flex-direction: column; gap: 2px; font-size: .95rem; }
.info-label { font-size: .82rem; color: var(--ink-soft); font-weight: 600; }
.info-host { font-size: .85rem; color: var(--ink-soft); margin-top: 14px; text-align: center; }

.map-embed { border-radius: 10px; overflow: hidden; }
.map-placeholder { height: 160px; display: flex; align-items: center; justify-content: center; background: var(--bg-alt); color: var(--ink-soft); font-size: .95rem; }

.program-list { padding-left: 20px; color: var(--ink-soft); font-size: .95rem; display: flex; flex-direction: column; gap: 7px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(20,16,10,.88); display: none; align-items: center; justify-content: center; z-index: 100; padding: 30px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92%; max-height: 88%; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }

/* Responsive */
@media (max-width: 880px) {
  .m-layout { grid-template-columns: 1fr; }
  .m-sidebar { position: static; }
  .form-row { grid-template-columns: 1fr; }
  .main-nav { gap: 16px; font-size: .9rem; }
}
@media (max-width: 560px) {
  .main-nav { display: none; }
  .hero { padding: 80px 0; }
}
