/* Thư Viện Lời Chúa — giao diện đọc */
:root {
  --bg: #faf7f0;
  --surface: #ffffff;
  --text: #2b2620;
  --muted: #8a8073;
  --accent: #8a5a2b;
  --accent-soft: #f3e8d8;
  --border: #e7ddcd;
  --radius: 10px;
}
[data-theme="dark"] {
  --bg: #1c1915;
  --surface: #26211c;
  --text: #e9e2d6;
  --muted: #a89c88;
  --accent: #d9a45b;
  --accent-soft: #3a2f22;
  --border: #3d352a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.main-nav { display: flex; gap: 14px; align-items: center; }
.main-nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.main-nav a:hover { color: var(--accent); }
.icon-btn {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 1rem; cursor: pointer; padding: 4px 9px;
}

/* hero */
.hero { text-align: center; padding: 48px 0 30px; }
.hero h1 { font-size: 2.1rem; margin: 0 0 8px; }
.tagline { color: var(--muted); margin: 0 0 22px; }
.hero-search { display: flex; gap: 8px; max-width: 520px; margin: 0 auto; }
.hero-search input, .search-box input {
  flex: 1; padding: 11px 14px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
button, .btn {
  padding: 11px 20px; font-size: 1rem; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.hero-search button, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }

/* sections & cards */
section { margin: 34px 0; }
h2 { font-size: 1.3rem; margin-bottom: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--text);
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--accent); }
.card-meta { margin: 0; color: var(--muted); font-size: .9rem; }

/* article rows */
.article-list { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  text-decoration: none; color: var(--text);
}
.row:hover { border-color: var(--accent); }
.row h3 { margin: 0 0 4px; font-size: 1.05rem; }
.row-meta { margin: 0; color: var(--muted); font-size: .85rem; }
.row-excerpt { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.row-tags { display: flex; gap: 6px; flex-wrap: wrap; align-content: flex-start; }
.tag {
  font-size: .78rem; background: var(--accent-soft); color: var(--accent);
  border-radius: 20px; padding: 2px 10px; white-space: nowrap;
}

/* breadcrumb */
.breadcrumb { margin: 22px 0 6px; font-size: .9rem; color: var(--muted); }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb .sep { margin: 0 6px; }

/* reading */
.reading { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 34px 38px; margin: 14px 0 20px; }
.reading h1 { font-size: 1.7rem; margin: 0 0 8px; line-height: 1.35; }
.reading .meta { color: var(--muted); font-size: .9rem; margin-bottom: 24px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.reading .content { font-family: Georgia, "Noto Serif", "Times New Roman", serif; font-size: 1.12rem; line-height: 1.85; }
.reading .content p { margin: 0 0 1.1em; }
.reading .content ul { margin: 0 0 1.1em; padding-left: 1.4em; }
.reading .content li { margin-bottom: .5em; }

/* prev / next */
.prevnext { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 40px; }
.pn {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  text-decoration: none; color: var(--text); font-size: .95rem;
}
.pn:hover { border-color: var(--accent); }
.pn.next { text-align: right; }

/* search */
.search-box { margin: 18px 0 8px; }
.search-box input { width: 100%; }
.muted { color: var(--muted); font-size: .9rem; }
#results .row h3 mark, .row-excerpt mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 2px; }

/* admin */
.admin-gate { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; max-width: 420px; }
.admin-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; margin-bottom: 30px; }
.admin-form label { display: flex; flex-direction: column; gap: 6px; font-size: .92rem; font-weight: 600; }
.admin-form input, .admin-form textarea {
  font-weight: 400; padding: 10px 12px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); font-family: inherit;
}
.admin-form textarea { resize: vertical; line-height: 1.6; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.msg { font-size: .9rem; color: var(--muted); }
.msg.ok { color: #2e7d32; }
.msg.err { color: #c62828; }
[data-theme="dark"] .msg.ok { color: #81c784; }
[data-theme="dark"] .msg.err { color: #e57373; }
.row .row-actions { display: flex; gap: 8px; align-items: flex-start; }
.row .row-actions button { padding: 6px 12px; font-size: .85rem; }

.site-footer { border-top: 1px solid var(--border); margin-top: 50px; padding: 22px 0; color: var(--muted); font-size: .88rem; text-align: center; }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.6rem; }
  .reading { padding: 22px 20px; }
  .reading .content { font-size: 1.05rem; }
  .grid2 { grid-template-columns: 1fr; }
  .prevnext { flex-direction: column; }
  .row { flex-direction: column; }
}
