/* مكتبة الموارد القرآنية — كل الأنماط تحت .rs */
.rs {
  --teal-900: #0A4F56; --teal-700: #116D76; --teal: #1A939E; --teal-300: #4FB8C0; --teal-50: #E8F4F5;
  --gold: #BAA213; --gold-300: #D7C14D; --gold-50: #FAF5DC;
  --ivory: #F7F5F1; --sand: #EEE8DF; --line: #E6E0D5;
  --ink: #1E2A30; --text: #3A4549; --muted: #6E7A7E;
  --radius: 22px; --shadow: 0 18px 44px rgba(10, 79, 86, .09);
}
.rs *, .rs *::before, .rs *::after { box-sizing: border-box; }
.rs h1, .rs h2, .rs h3, .rs p { margin: 0; }
.rs { font-family: "Tajawal", system-ui, sans-serif; background: var(--ivory); color: var(--text); line-height: 1.7; overflow-x: clip; }
.rs a { text-decoration: none; color: inherit; }
.rs button { font: inherit; }
.rs-wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.rs :focus-visible { outline: 3px solid var(--gold-300); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .rs *, .rs *::before, .rs *::after { transition: none !important; animation: none !important; } }

/* ---------- الواجهة ---------- */
.rs-hero { position: relative; color: #fff; padding: 64px 0 130px; isolation: isolate; overflow: hidden;
  background: radial-gradient(800px 420px at 85% 0%, rgba(79, 184, 192, .35), transparent 60%),
              radial-gradient(600px 400px at 0% 100%, rgba(186, 162, 19, .22), transparent 60%),
              linear-gradient(160deg, #06363B, #0A4F56 50%, #116D76); }
.rs-pattern { position: absolute; inset: 0; z-index: -1; opacity: .09; color: #fff; pointer-events: none; }
.rs-pattern svg { width: 100%; height: 100%; }
.rs-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.rs-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.05rem; }
.rs-brand img { height: 52px; width: auto; background: rgba(255,255,255,.92); border-radius: 14px; padding: 4px 8px; }
.rs-back { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; font-weight: 700;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .3); transition: background .2s ease; }
.rs-back:hover { background: rgba(255, 255, 255, .2); }
.rs-hero__body { text-align: center; max-width: 780px; margin: 0 auto; }
.rs-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px; background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2); font-weight: 700; font-size: .92rem; }
.rs-kicker i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-300); box-shadow: 0 0 0 5px rgba(215,193,77,.2); }
.rs-hero h1 { margin-top: 18px; font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 900; line-height: 1.35; }
.rs-hero h1 em { font-style: normal; color: var(--gold-300); }
.rs-hero p { margin-top: 14px; font-size: 1.12rem; line-height: 2; color: rgba(255, 255, 255, .86); }

/* ---------- البحث والتصنيفات ---------- */
.rs-tools { position: relative; z-index: 2; margin-top: -78px; padding-block: 0; }
.rs-tools__box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 30px 60px rgba(10, 79, 86, .14); padding: 22px; }
.rs-search { position: relative; }
.rs-search svg { position: absolute; inset-inline-start: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.rs-search input { width: 100%; height: 56px; border: 1.5px solid var(--line); border-radius: 16px; padding: 0 52px 0 18px; font: inherit; font-size: 1.02rem;
  background: var(--ivory); color: var(--ink); transition: border-color .2s ease, background .2s ease; }
.rs-search input:focus { outline: none; border-color: var(--teal); background: #fff; box-shadow: 0 0 0 4px rgba(26, 147, 158, .12); }
.rs-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.rs-chip { border: 1px solid var(--line); background: #fff; color: var(--text); padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: .92rem; cursor: pointer; transition: all .2s ease; }
.rs-chip:hover { border-color: var(--teal-300); color: var(--teal-700); }
.rs-chip.is-on { background: var(--teal-700); border-color: var(--teal-700); color: #fff; }
.rs-count { margin-top: 14px; font-size: .9rem; color: var(--muted); }

/* ---------- البطاقات ---------- */
.rs-sec { padding: 40px 0 90px; }
.rs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 1000px) { .rs-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .rs-grid { grid-template-columns: 1fr; } }
.rs-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease; }
.rs-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.rs-card[hidden] { display: none; }
.rs-cover { position: relative; height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #fff; overflow: hidden; isolation: isolate;
  background: linear-gradient(150deg, var(--c1), var(--c2)); }
.rs-cover::before { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(255,255,255,.28); border-radius: 14px; z-index: -1; }
.rs-cover::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.07); top: -90px; inset-inline-end: -70px; z-index: -1; }
.rs-cover__ic { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); color: var(--gold-300); }
.rs-cover__title { font-weight: 800; font-size: 1.05rem; padding-inline: 30px; text-align: center; line-height: 1.6; }
.rs-cover__pdf { position: absolute; top: 24px; inset-inline-start: 24px; font-size: .72rem; font-weight: 800; letter-spacing: .5px; padding: 3px 9px; border-radius: 6px; background: rgba(255,255,255,.92); color: var(--teal-900); }
.rs-cover--mushaf { --c1: #0A4F56; --c2: #116D76; }
.rs-cover--found { --c1: #116D76; --c2: #1A939E; }
.rs-cover--tajweed { --c1: #0D5D65; --c2: #2A8F87; }
.rs-cover--hifz { --c1: #17324D; --c2: #23557A; }
.rs-cover--tafseer { --c1: #6F5D08; --c2: #A68F12; }
.rs-cover--adab { --c1: #1F5F55; --c2: #1F7A6C; }
.rs-cover--adhkar { --c1: #3A2E5C; --c2: #57478A; }
.rs-cover--translate { --c1: #5B4227; --c2: #8A6A3E; }
.rs-body { display: flex; flex-direction: column; flex: 1; padding: 22px 22px 22px; }
.rs-tag { align-self: flex-start; font-size: .82rem; font-weight: 700; color: var(--teal-700); background: var(--teal-50); padding: 5px 12px; border-radius: 999px; }
.rs-body h3 { margin-top: 12px; font-size: 1.25rem; font-weight: 800; color: var(--ink); line-height: 1.6; }
.rs-body p { margin-top: 8px; font-size: .97rem; line-height: 1.95; color: var(--muted); flex: 1; }
.rs-actions { display: flex; gap: 10px; margin-top: 18px; }
.rs-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 14px; font-weight: 800; font-size: .98rem; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.rs-btn--main { border: 0; color: #fff; background: linear-gradient(135deg, var(--teal-700), var(--teal)); box-shadow: 0 10px 22px rgba(17, 109, 118, .24); }
.rs-btn--main:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(17, 109, 118, .3); }
.rs-btn--line { border: 1.5px solid var(--teal); color: var(--teal-700); background: #fff; }
.rs-btn--line:hover { background: var(--teal-50); }
.rs-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.rs-empty b { display: block; color: var(--ink); font-size: 1.15rem; margin-bottom: 6px; }
.rs-empty[hidden] { display: none; }

/* ---------- نافذة المعاينة ---------- */
.rs-modal { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(6, 30, 33, .72); backdrop-filter: blur(4px); }
.rs-modal[hidden] { display: none; }
.rs-modal__box { width: min(1100px, 100%); height: min(92vh, 960px); background: #fff; border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 40px 80px rgba(0,0,0,.35); }
.rs-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: linear-gradient(135deg, var(--teal-900), var(--teal-700)); color: #fff; }
.rs-modal__head h2 { font-size: 1.1rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-modal__acts { display: flex; gap: 8px; flex: none; }
.rs-mbtn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: #fff; font-weight: 700; font-size: .9rem; cursor: pointer; }
.rs-mbtn:hover { background: rgba(255,255,255,.2); }
.rs-mbtn--close { background: #fff; color: var(--teal-900); border-color: #fff; }
.rs-modal iframe { flex: 1; width: 100%; border: 0; background: var(--sand); }
@media (max-width: 640px) { .rs-mbtn span { display: none; } .rs-modal { padding: 0; } .rs-modal__box { height: 100%; border-radius: 0; } }

/* ---------- التذييل ---------- */
.rs-foot { background: var(--teal-900); color: rgba(255,255,255,.85); text-align: center; padding: 36px 16px; }
.rs-foot b { color: #fff; display: block; font-size: 1.05rem; margin-bottom: 4px; }
.rs-foot a { color: var(--gold-300); font-weight: 700; }

/* style.css يضيف padding لكل section */
.rs-sec { padding: 40px 0 90px !important; }
