/* ===== 靈糧閱讀頁 共用樣式（牧師的話 / 靈修筆記） ===== */
:root {
  --gold: #C8A35F;
  --gold-light: #E8D5A8;
  --gold-soft: #F3E9D4;
  --dark: #1A1A2E;
  --dark-blue: #16213E;
  --navy: #0F3460;
  --white: #FFFFFF;
  --off-white: #F5F1EB;
  --paper: #FBF8F2;
  --text: #333333;
  --text-light: #6b6b6b;
  --line: #e6ddcc;
}

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

body {
  font-family: 'Noto Sans SC', 'Noto Sans TC', 'Noto Sans JP', sans-serif;
  color: var(--text);
  line-height: 1.85;
  background: var(--off-white);
  -webkit-font-smoothing: antialiased;
}
body.lang-ja { font-family: 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans TC', sans-serif; }

a { color: inherit; }

/* ===== Navigation（與首頁一致） ===== */
nav {
  position: fixed; top: 0; width: 100%; z-index: 1000;
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  padding: 0 2rem; transition: box-shadow 0.3s ease;
}
nav .nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; height: 64px;
}
nav .logo {
  color: var(--gold); font-family: 'Noto Serif SC', 'Noto Serif TC', 'Noto Serif JP', serif;
  font-size: 1.1rem; font-weight: 600; text-decoration: none;
}
nav ul { list-style: none; display: flex; gap: 1.5rem; align-items: center; }
nav ul li a {
  color: var(--white); text-decoration: none; font-size: 0.9rem;
  opacity: 0.85; transition: opacity 0.2s, color 0.2s;
}
nav ul li a:hover, nav ul li a.current { opacity: 1; color: var(--gold); }
.menu-toggle {
  display: none; flex-direction: column; cursor: pointer; gap: 5px;
  background: none; border: none; padding: 4px;
}
.menu-toggle span { width: 24px; height: 2px; background: var(--white); transition: 0.3s; }

.lang-switcher {
  display: flex; gap: 0.3rem; margin-left: 1rem;
  border-left: 1px solid rgba(255,255,255,0.2); padding-left: 1rem;
}
.lang-switcher button {
  background: none; border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.6); padding: 0.2rem 0.5rem; font-size: 0.75rem;
  cursor: pointer; transition: all 0.2s; border-radius: 3px;
}
.lang-switcher button:hover { border-color: var(--gold); color: var(--gold); }
.lang-switcher button.active { background: var(--gold); border-color: var(--gold); color: var(--dark); }

/* ===== Hero band ===== */
.lib-hero {
  position: relative; padding: 8rem 2rem 3.5rem; text-align: center; overflow: hidden;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-blue) 45%, var(--navy) 100%);
  color: var(--white);
}
.lib-hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 18% 40%, rgba(200,163,95,0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(15,52,96,0.35) 0%, transparent 55%);
}
.lib-hero .inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.lib-hero .crumb { font-size: 0.8rem; color: rgba(255,255,255,0.55); margin-bottom: 1rem; }
.lib-hero .crumb a { color: var(--gold-light); text-decoration: none; }
.lib-hero .crumb a:hover { color: var(--gold); }
.lib-hero .mark { font-size: 2.2rem; color: var(--gold); opacity: 0.9; margin-bottom: 0.8rem; }
.lib-hero h1 {
  font-family: 'Noto Serif SC', 'Noto Serif TC', 'Noto Serif JP', serif;
  font-size: 2.4rem; font-weight: 700; letter-spacing: 0.12em; margin-bottom: 0.4rem;
}
.lib-hero .en { font-size: 0.8rem; color: var(--gold-light); letter-spacing: 0.3em; text-transform: uppercase; }
.lib-hero .lede {
  max-width: 600px; margin: 1.4rem auto 0; font-size: 0.98rem;
  color: rgba(255,255,255,0.72); line-height: 1.95; font-style: italic;
}
.lib-hero .count { margin-top: 1.3rem; font-size: 0.82rem; color: rgba(255,255,255,0.55); letter-spacing: 0.05em; }

/* ===== Toolbar ===== */
.toolbar {
  position: sticky; top: 64px; z-index: 500;
  background: rgba(245,241,235,0.96); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: 1rem 2rem;
}
.toolbar .tools-inner { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 0.9rem; }
.search-box { position: relative; max-width: 460px; width: 100%; margin: 0 auto; }
.search-box input {
  width: 100%; padding: 0.7rem 1rem 0.7rem 2.4rem; font-size: 0.95rem; font-family: inherit;
  border: 1px solid var(--line); border-radius: 30px; background: var(--white); color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,163,95,0.15); }
.search-box .ico { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--gold); font-size: 0.95rem; }
.year-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.year-pills button {
  border: 1px solid var(--line); background: var(--white); color: var(--text-light);
  font-family: inherit; font-size: 0.82rem; padding: 0.32rem 0.85rem; border-radius: 20px;
  cursor: pointer; transition: all 0.2s;
}
.year-pills button:hover { border-color: var(--gold); color: var(--gold); }
.year-pills button.active { background: var(--gold); border-color: var(--gold); color: var(--dark); font-weight: 500; }

/* ===== List ===== */
.list-wrap { max-width: 1080px; margin: 0 auto; padding: 2.5rem 2rem 4rem; }
.result-meta { text-align: center; color: var(--text-light); font-size: 0.85rem; margin-bottom: 1.6rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.2rem; }

.entry-card {
  position: relative; background: var(--paper); border: 1px solid var(--line);
  border-left: 3px solid var(--gold); border-radius: 6px; padding: 1.3rem 1.4rem;
  cursor: pointer; transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  display: flex; flex-direction: column; min-height: 150px;
}
.entry-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(26,26,46,0.10); }
.entry-card .meta-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
.entry-card .date { font-size: 0.78rem; color: var(--text-light); letter-spacing: 0.04em; }
.entry-card .chip {
  font-size: 0.72rem; color: var(--navy); background: var(--gold-soft);
  border-radius: 12px; padding: 0.1rem 0.6rem; white-space: nowrap;
}
.entry-card h3 {
  font-family: 'Noto Serif SC', 'Noto Serif TC', 'Noto Serif JP', serif; font-size: 1.12rem; color: var(--dark);
  line-height: 1.5; margin-bottom: 0.5rem;
}
.entry-card .excerpt { font-size: 0.86rem; color: var(--text-light); line-height: 1.75; flex: 1; }
.entry-card .more { margin-top: 0.7rem; font-size: 0.78rem; color: var(--gold); letter-spacing: 0.05em; }

#sentinel { height: 1px; }
.loading-row { text-align: center; padding: 2rem; color: var(--text-light); font-size: 0.85rem; }
.empty-row { text-align: center; padding: 4rem 1rem; color: var(--text-light); }

/* ===== Article view ===== */
.article-view { display: none; }
body.reading .list-section { display: none; }
body.reading .article-view { display: block; }

.article {
  max-width: 720px; margin: 0 auto; padding: 7.5rem 2rem 4rem;
}
.article .back {
  display: inline-flex; align-items: center; gap: 0.4rem; background: none; border: none;
  color: var(--gold); font-family: inherit; font-size: 0.88rem; cursor: pointer; padding: 0.3rem 0;
  margin-bottom: 1.8rem; transition: opacity 0.2s;
}
.article .back:hover { opacity: 0.7; }
.article-head { text-align: center; border-bottom: 1px solid var(--line); padding-bottom: 1.8rem; margin-bottom: 2.2rem; }
.article-head .date { font-size: 0.82rem; color: var(--text-light); letter-spacing: 0.12em; margin-bottom: 0.7rem; }
.article-head .scripture-ref {
  display: inline-block; font-size: 0.8rem; color: var(--navy); background: var(--gold-soft);
  border-radius: 14px; padding: 0.22rem 0.9rem; margin-bottom: 1rem;
}
.article-head h1 {
  font-family: 'Noto Serif SC', 'Noto Serif TC', 'Noto Serif JP', serif; font-size: 1.9rem; color: var(--dark);
  line-height: 1.45; font-weight: 700;
}
.article-head .deco { color: var(--gold); font-size: 1.1rem; margin-bottom: 1rem; }

.article-body { font-size: 1.04rem; color: #2b2b2b; line-height: 2.05; }
.article-body p { margin-bottom: 1.25rem; text-align: justify; }
.article-body .subhead {
  font-family: 'Noto Serif SC', 'Noto Serif TC', 'Noto Serif JP', serif; font-weight: 600; color: var(--navy);
  font-size: 1.05rem; margin: 2rem 0 0.9rem; padding-left: 0.7rem; border-left: 3px solid var(--gold);
}
.article-body .scripture {
  background: linear-gradient(0deg, var(--paper), var(--paper));
  border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 4px; padding: 1rem 1.2rem; margin-bottom: 1.4rem;
  font-size: 0.98rem; color: #3a3a3a; line-height: 1.9;
}
.article-body .scripture .ref { color: var(--navy); font-weight: 600; }
.article-body .prayer-block {
  background: rgba(200,163,95,0.07); border-radius: 6px; padding: 1.2rem 1.3rem; margin: 1.8rem 0 1.2rem;
}
.article-body .prayer-block .subhead { margin-top: 0; border: none; padding-left: 0; color: var(--gold); }
.article-body .prayer-block .subhead::before { content: '🙏 '; }
.article-sign {
  text-align: right; margin-top: 2.5rem; padding-top: 1.4rem; border-top: 1px solid var(--line);
  font-family: 'Noto Serif SC', 'Noto Serif TC', 'Noto Serif JP', serif; color: var(--text-light); font-size: 0.95rem;
}
.article-sign .by { color: var(--gold); }

.article-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; }
.article-nav button {
  flex: 1; background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
  padding: 0.9rem 1rem; cursor: pointer; font-family: inherit; color: var(--text);
  transition: all 0.2s; text-align: left; min-width: 0;
}
.article-nav button:hover:not(:disabled) { border-color: var(--gold); box-shadow: 0 4px 16px rgba(26,26,46,0.07); }
.article-nav button:disabled { opacity: 0.4; cursor: default; }
.article-nav button.next { text-align: right; }
.article-nav .dir { font-size: 0.72rem; color: var(--gold); letter-spacing: 0.08em; display: block; margin-bottom: 0.2rem; }
.article-nav .ttl { font-size: 0.88rem; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Footer ===== */
footer {
  background: #111122; text-align: center; padding: 2rem; color: rgba(255,255,255,0.4); font-size: 0.8rem;
}
footer .church-name {
  color: var(--gold); font-family: 'Noto Serif SC', 'Noto Serif TC', 'Noto Serif JP', serif; font-size: 0.9rem; margin-bottom: 0.3rem;
}
footer a { color: var(--gold); text-decoration: none; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  nav { padding: 0 1.2rem; }
  nav ul {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: rgba(26,26,46,0.98); flex-direction: column; padding: 1rem 1.5rem; gap: 0;
  }
  nav ul.active { display: flex; }
  nav ul li { width: 100%; }
  nav ul li a { display: block; padding: 0.8rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
  .lang-switcher { border-left: none; margin-left: 0; padding-left: 0; padding-top: 0.5rem; }
  .menu-toggle { display: flex; }
  .lib-hero { padding: 7rem 1.5rem 2.8rem; }
  .lib-hero h1 { font-size: 1.8rem; }
  .toolbar { padding: 0.9rem 1.2rem; }
  .list-wrap { padding: 2rem 1.2rem 3rem; }
  .card-grid { grid-template-columns: 1fr; }
  .article { padding: 6.5rem 1.4rem 3rem; }
  .article-head h1 { font-size: 1.5rem; }
  .article-body { font-size: 1rem; }
}
