:root {
  --paper: #f6f1e7;
  --ink: #262019;
  --ink-soft: #5c5347;
  --accent: #7a4a21;
  --rule: #d8cdb8;
}

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

html { font-size: 18px; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Amiri", "Noto Naskh Arabic", serif;
  line-height: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
  flex: 1;
}

/* الترويسة */
.site-header {
  text-align: center;
  padding: 2.5rem 1.25rem 1.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}

.site-logo {
  display: block;
  width: 5rem;
  height: auto;
  margin: 0 auto 1rem;
}

.site-name {
  font-family: "Aref Ruqaa", "Amiri", serif;
  font-size: 1.9rem;
  color: var(--ink);
  text-decoration: none;
}

.site-tagline {
  color: var(--ink-soft);
  font-size: 1rem;
  margin-top: 0.25rem;
}

/* الصفحة الرئيسية */
.intro {
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin-bottom: 2.5rem;
}

.pieces { list-style: none; }

.pieces li {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}

.pieces .series {
  display: block;
  font-size: 0.9rem;
  color: var(--accent);
}

.pieces a.piece-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.pieces a.piece-title:hover { color: var(--accent); }

.pieces .date {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 0.15rem;
}

/* صفحة النص */
.piece-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.piece-header .series {
  color: var(--accent);
  font-size: 1rem;
}

.piece-header h1 {
  font-family: "Aref Ruqaa", "Amiri", serif;
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0.25rem 0 0.5rem;
}

.piece-header .meta {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.piece-body { font-size: 1.3rem; }

.piece-body p { margin-bottom: 1.4rem; }

.back-link {
  display: inline-block;
  margin-top: 2rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 1rem;
}

.back-link:hover { text-decoration: underline; }

/* التذييل */
.site-footer {
  border-top: 1px solid var(--rule);
  text-align: center;
  padding: 1.25rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

/* واجهة الكتاب: البطل والأزرار الكبيرة */
.hero {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

.book-title {
  font-family: "Aref Ruqaa", "Amiri", serif;
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.big-button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: "Amiri", serif;
  padding: 0.9rem 2.4rem;
  border-radius: 14px;
  margin: 0.35rem;
  transition: opacity 0.15s ease;
}

.big-button:hover { opacity: 0.88; }

.big-button.secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.center { text-align: center; margin: 2.5rem 0 1rem; }

.center-text { text-align: center; }

.piece-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

/* محوّل اللغات */
.langs {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.langs a {
  color: var(--ink-soft);
  text-decoration: none;
  margin: 0 0.5rem;
}

.langs a:hover { color: var(--accent); }

.langs a[aria-current] {
  color: var(--accent);
  font-weight: 700;
}

/* خطوط اللغات المترجمة */
html[lang="en"] body,
html[lang="es"] body {
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  line-height: 1.8;
}

html[lang="zh"] body {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  line-height: 2;
}

html[lang="en"] .site-name, html[lang="es"] .site-name,
html[lang="en"] .piece-header h1, html[lang="es"] .piece-header h1,
html[lang="en"] .book-title, html[lang="es"] .book-title,
html[lang="en"] .big-button, html[lang="es"] .big-button {
  font-family: "EB Garamond", Georgia, serif;
}

html[lang="zh"] .site-name,
html[lang="zh"] .piece-header h1,
html[lang="zh"] .book-title,
html[lang="zh"] .big-button {
  font-family: "Noto Serif SC", "Songti SC", serif;
}

/* التفاعل: مشاركة وتعليقات واشتراك */
.interact {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

.interact-title {
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}

.interact-note {
  color: var(--ink-soft);
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.comment-form,
.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 30rem;
  margin: 0 auto 1rem;
}

.comment-form input,
.comment-form textarea,
.subscribe-form input {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.6rem 0.9rem;
  background: #fffdf7;
  border: 1px solid var(--rule);
  border-radius: 10px;
  color: var(--ink);
}

.comment-form input:focus,
.comment-form textarea:focus,
.subscribe-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

.comment-form button,
.subscribe-form button {
  align-self: center;
  border: 0;
  cursor: pointer;
}

.botcheck { display: none; }

.subscribe {
  margin: 2.5rem 0;
  padding: 1.5rem 1rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 14px;
}
