/* ═══════════════════════════════════════════════════════════════
   tareeq.css — القالب الموحد لموقع «على الطريق»
   المرحلة ٣ من إعادة التصميم (2026-07-17)
   مستخرج من الرئيسية المنشورة v26 — هوية المصحف المعتمدة (سامي 2026-07-03):
   ورق الصفحات + ذهبي التذهيب + أخضر الأغلفة · Amiri للقرآن والعناوين · Cairo للواجهة · RTL
   الخطوط تُحمَّل من كل صفحة عبر وسم <link> (Google Fonts: Amiri + Cairo)
   أي صفحة جديدة: اربط هذا الملف ثم أضف CSS الصفحة الخاص بها فقط بعده
   ═══════════════════════════════════════════════════════════════ */

/* ═══ ١) هوية المصحف — المتغيرات الحاكمة ═══ */
:root {
  --paper: #F8F3E4;
  --paper-dark: #F4EDD8;
  --paper-card: #F6F0DD;
  --paper-bright: #FFFEF6;
  --paper-frame: #FBF7EA;
  --paper-box: #F1E8CF;
  --gold: #C9A24B;
  --gold-deep: #A98435;
  --gold-soft: #DCC98E;
  --gold-line: #E2D6B4;
  --gold-border: #D8CBA6;
  --green: #175C48;
  --green-dark: #1F4536;
  --green-tint: #E3EFE7;
  --ink: #33291A;
  --ink-soft: #5C513A;
  --ink-mute: #6B5C3B;
  --ink-dim: #8A7748;
  --ink-faint: #9C8B60;
}

/* ═══ ٢) الأساس ═══ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Cairo', sans-serif;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ═══ ٣) الهيدر الموحد — الشكل الكامل (.nav) للفهارس والرئيسية ═══ */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 5vw;
  background: var(--paper-dark);
  border-bottom: 1px solid var(--gold-line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Amiri', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
}
.brand img { width: 38px; height: 38px; display: block; }
.nav-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.9rem;
}
.nav-links a {
  color: var(--ink-mute);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: color 0.3s;
}
.nav-links a.active {
  color: var(--green);
  font-weight: 600;
  border-bottom-color: var(--gold);
}
.nav-links a:hover { color: var(--green); }
.nav-links .soon-tag {
  font-size: 0.7rem;
  color: var(--ink-dim);
  border: 1px solid var(--gold-soft);
  border-radius: 10px;
  padding: 0 7px;
  margin-inline-start: 4px;
  vertical-align: 2px;
}

/* ═══ ٤) الهيدر الموحد — الشكل المدمج (.topbar) لصفحات المحتوى ═══ */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 5vw; border-bottom: 1px solid var(--gold-line); background: var(--paper-dark); }
.topbar a { font-family: 'Amiri', serif; font-size: 1.05rem; font-weight: 700; color: var(--green); text-decoration: none; display: flex; align-items: center; gap: 7px; }
.topbar a img { width: 26px; height: 26px; }
.topbar .lbl { font-size: 11px; color: var(--ink-dim); }

/* ═══ ٥) الأزرار الموحدة ═══ */
.btn-start {
  display: inline-block;
  background: var(--green);
  color: var(--paper-bright);
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 30px;
  padding: 12px 34px;
  transition: background 0.3s, transform 0.2s;
}
.btn-start:hover { background: var(--green-dark); transform: translateY(-2px); }
.p-go { display: inline-block; background: var(--green); color: var(--paper); font-weight: 600; border-radius: 22px; padding: 8px 28px; font-size: 13px; text-decoration: none; }
.p-soon { display: inline-block; font-size: 12px; color: var(--ink-dim); border: 1px solid var(--gold-soft); border-radius: 22px; padding: 6px 22px; }
.cta { display: inline-block; background: var(--green); color: var(--paper); font-weight: 600; border-radius: 24px; padding: 11px 32px; font-size: 14px; text-decoration: none; margin-top: 44px; }
.cta-note { font-size: 11.5px; color: var(--ink-dim); margin-top: 8px; }
.backhome { display: inline-block; margin-top: 20px; font-size: 13px; color: var(--green); text-decoration: none; border: 1px solid var(--gold-soft); border-radius: 24px; padding: 9px 26px; transition: .25s; }
.backhome:hover { background: var(--paper-box); }

/* ═══ ٦) إطار الآية المذهّب (إطار مزدوج بنمط المصحف) ═══ */
.ayah-frame {
  border: 1.5px solid var(--gold);
  border-radius: 12px;
  background: var(--paper-frame);
  padding: 30px 24px;
  position: relative;
  text-align: center;
}
.ayah-frame::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  pointer-events: none;
}
.ayah { font-family: 'Amiri', serif; font-size: 1.5rem; line-height: 2.4; color: var(--green-dark); }
.ayah-ref { font-size: 11.5px; color: var(--ink-dim); margin-top: 10px; }

/* ═══ ٧) الفهرس بنمط فهارس المصاحف (صفحتا دقيقة وجلسة) ═══ */
.wrap { max-width: 640px; margin: 0 auto; padding: 44px 22px 50px; }
.kick { text-align: center; font-size: 11px; letter-spacing: 5px; color: var(--gold-deep); }
.wrap > h1 { text-align: center; font-family: 'Amiri', serif; font-size: 2.2rem; font-weight: 700; color: var(--green); margin-top: 6px; }
.sub { text-align: center; font-size: 13px; color: var(--ink-dim); margin-top: 6px; line-height: 1.9; }
.fihris { margin-top: 38px; }
.surah-head { display: flex; align-items: center; gap: 14px; margin: 34px 0 6px; }
.surah-head:first-child { margin-top: 0; }
.surah-head .name { font-family: 'Amiri', serif; font-size: 1.15rem; font-weight: 700; color: var(--gold-deep); white-space: nowrap; }
.surah-head::before, .surah-head::after { content: ''; height: 1px; background: var(--gold-line); flex: 1; }
.surah-head::before { max-width: 26px; flex: 0 0 26px; }
.fentry { border-bottom: none; }
.fentry summary { list-style: none; cursor: pointer; padding: 15px 4px 13px; display: block; }
.fentry summary::-webkit-details-marker { display: none; }
.fentry .row { display: flex; align-items: baseline; gap: 10px; }
.fentry .e-title { font-family: 'Amiri', serif; font-size: 1.22rem; font-weight: 700; color: var(--green-dark); line-height: 1.7; transition: color .25s; }
.fentry summary:hover .e-title { color: var(--gold-deep); }
.fentry .e-dots { flex: 1; min-width: 24px; border-bottom: 1.5px dotted var(--gold-soft); transform: translateY(-4px); }
.fentry .e-ref { font-size: 12px; color: var(--ink-dim); white-space: nowrap; }
.fentry.soon .e-title { color: var(--ink-mute); font-weight: 400; }
.fentry.soon .e-dots { border-bottom-color: var(--gold-line); }
.e-tag { font-size: 10px; color: var(--ink-dim); border: 1px solid var(--gold-soft); border-radius: 10px; padding: 1px 9px; white-space: nowrap; align-self: center; }
.e-hint { display: inline-block; font-size: 10.5px; color: var(--gold-deep); margin-top: 3px; }
.fentry[open] .e-hint { visibility: hidden; }
.e-prev { background: var(--paper-frame); border: 1px solid var(--gold-soft); border-radius: 12px; padding: 18px 18px 16px; margin: 0 2px 16px; text-align: center; }
.p-ayah { font-family: 'Amiri', serif; font-size: 1.18rem; line-height: 2.25; color: var(--green-dark); }
.p-ref { font-size: 11px; color: var(--ink-dim); margin: 6px 0 10px; }
.p-note { font-size: 11.5px; color: var(--ink-mute); margin-bottom: 12px; }

/* ═══ ٨) الفانِل الموحد (روابط بقية الطريق أسفل الصفحة) ═══ */
.next { text-align: center; margin-top: 52px; }
.next .lead { font-family: 'Amiri', serif; font-size: 1.15rem; color: var(--ink-soft); margin-bottom: 16px; }
.next a { display: inline-block; background: var(--green); color: var(--paper); font-weight: 600; border-radius: 24px; padding: 11px 32px; font-size: 14px; text-decoration: none; }
.next .note { font-size: 11.5px; color: var(--ink-dim); margin-top: 8px; }
.next a.alt { background: transparent; color: var(--green); border: 1px solid var(--gold-soft); padding: 9px 26px; font-size: 13px; margin-top: 18px; }

/* ═══ ٩) الفوتر الموحد ═══ */
footer {
  text-align: center;
  padding: 26px 6vw;
  background: var(--paper-dark);
  border-top: 1px solid var(--gold-line);
}
footer .path-line {
  font-family: 'Amiri', serif;
  font-size: 1.05rem;
  color: var(--green);
}
footer .doc-line {
  font-size: 0.8rem;
  color: var(--ink-dim);
  line-height: 2;
  margin-top: 6px;
}

/* ═══ ١٠) قشرة العرض الموحدة (زر أَ — حجم الخط والخلفية) ═══ */
.qishra-btn { position: fixed; bottom: 16px; inset-inline-start: 16px; z-index: 90; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--gold-soft); background: var(--paper-frame); color: var(--green); font-family: 'Amiri', serif; font-size: 1.3rem; font-weight: 700; cursor: pointer; box-shadow: 0 2px 10px rgba(36,29,15,.18); }
.qishra-panel { position: fixed; bottom: 70px; inset-inline-start: 16px; z-index: 90; background: var(--paper-frame); border: 1px solid var(--gold-soft); border-radius: 14px; padding: 14px 16px; width: 224px; box-shadow: 0 6px 24px rgba(36,29,15,.2); display: none; }
.qishra-panel.open { display: block; }
.qishra-panel .t { font-size: 11px; color: var(--ink-dim); letter-spacing: 2px; margin-bottom: 8px; }
.qishra-row { display: flex; gap: 7px; margin-bottom: 14px; }
.qishra-row:last-child { margin-bottom: 2px; }
.qishra-row button { flex: 1; border: 1px solid var(--gold-line); background: var(--paper); color: var(--ink-soft); border-radius: 8px; padding: 6px 0; cursor: pointer; font-family: 'Cairo', sans-serif; font-size: 12px; }
.qishra-row button.on { border-color: var(--gold-deep); color: var(--gold-deep); font-weight: 700; }

/* تكبير الخط لعناصر الفهرس (صفحتا الفهرس) — صفحات الجلسات تضيف قواعدها الخاصة */
html.fs-2 .fentry .e-title { font-size: 1.4rem !important; }
html.fs-3 .fentry .e-title { font-size: 1.55rem !important; }
html.fs-2 .fentry .e-ref { font-size: 13.5px !important; }
html.fs-3 .fentry .e-ref { font-size: 15px !important; }
html.fs-2 .p-ayah { font-size: 1.4rem !important; }
html.fs-3 .p-ayah { font-size: 1.6rem !important; }
html.fs-2 .p-note, html.fs-2 .e-hint { font-size: 12.5px !important; }
html.fs-3 .p-note, html.fs-3 .e-hint { font-size: 14px !important; }
html.fs-2 .surah-head .name { font-size: 1.3rem !important; }
html.fs-3 .surah-head .name { font-size: 1.42rem !important; }
html.fs-2 .sub { font-size: 14.5px !important; }
html.fs-3 .sub { font-size: 16px !important; }
html.fs-2 .next .lead { font-size: 1.3rem !important; }
html.fs-3 .next .lead { font-size: 1.42rem !important; }

/* خلفيات قشرة العرض */
html.bg-light { --paper:#FCF9F1; --paper-dark:#F8F3E6; --paper-frame:#FFFDF6; --paper-box:#F6EFDC; }
html.bg-deep { --paper:#EFE5C9; --paper-dark:#E9DDBB; --paper-frame:#F4ECD4; --paper-box:#E7D9B4; }
html.bg-night { --paper:#22392E; --paper-dark:#1D3227; --paper-frame:#294435; --paper-box:#2F4E3D; --ink:#EFE8D2; --ink-soft:#DBCFAC; --ink-mute:#CCBF97; --ink-dim:#A99C72; --green:#A7D4BE; --green-dark:#D9EBDF; --gold-line:#41604F; --gold-soft:#8A7A45; }
html.bg-night img { opacity: .9; }

/* ═══ ١١) استجابة الشاشات وتقليل الحركة ═══ */
@media (max-width: 640px) {
  .nav { justify-content: center; text-align: center; }
  .nav-links { justify-content: center; gap: 12px; font-size: 0.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
