/* =========================================================
   مشكاة القرآن — shadcn/ui design tokens (CSS خالص)
   ألوان الهوية مأخوذة من الشعار:
   الذهبي  #BE9069  ≈ hsl(27 40% 58%)
   الرمادي #4B4F5A  ≈ hsl(224 9% 32%)
   ========================================================= */
:root {
  /* الخلفية = رمادي الشعار #4B4F5A */
  --background: 224 9% 32%;
  --foreground: 30 20% 96%;
  --card: 224 9% 36%;
  --card-foreground: 30 20% 96%;
  --primary: 27 42% 62%;               /* ذهبي الشعار للأزرار */
  --primary-foreground: 224 14% 12%;
  --secondary: 224 8% 41%;
  --secondary-foreground: 30 20% 96%;
  --muted: 224 9% 29%;
  --muted-foreground: 224 10% 80%;
  --accent: 224 8% 40%;
  --accent-foreground: 30 20% 96%;
  --border: 224 8% 42%;
  --input: 224 8% 47%;
  --ring: 27 45% 66%;
  --brand: 27 50% 70%;                 /* ذهبي أفتح ليتباين مع الرمادي */
  --brand-soft: 27 22% 27%;
  --radius: 0.75rem;
  --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --font-quran: "Amiri", "Traditional Arabic", serif;
}

.dark {
  --background: 224 14% 8%;
  --foreground: 30 20% 95%;
  --card: 224 13% 11%;
  --card-foreground: 30 20% 95%;
  --primary: 27 42% 62%;               /* ذهبي في الوضع الداكن */
  --primary-foreground: 224 14% 10%;
  --secondary: 224 10% 17%;
  --secondary-foreground: 30 20% 95%;
  --muted: 224 10% 15%;
  --muted-foreground: 224 6% 65%;
  --accent: 224 10% 17%;
  --accent-foreground: 30 20% 95%;
  --border: 224 10% 18%;
  --input: 224 10% 22%;
  --ring: 27 42% 62%;
  --brand: 27 45% 66%;
  --brand-soft: 27 25% 18%;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; border-color: hsl(var(--border)); }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font);
  background: hsl(var(--background)); color: hsl(var(--foreground));
  line-height: 1.7; -webkit-font-smoothing: antialiased;
  transition: background-color .2s, color .2s;
  overflow-x: hidden;
}
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 600; }
p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }
svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 640px) { .container { padding-inline: 1.5rem; } }
.muted { color: hsl(var(--muted-foreground)); }
.text-brand { color: hsl(var(--brand)); }
.small { font-size: .875rem; }
.center { text-align: center; }
.skip-link {
  position: absolute; inset-inline-start: 1rem; top: -3rem; z-index: 100;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  padding: .5rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

/* ---------- Button ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 2.5rem; padding: 0 1rem; font: inherit; font-size: .875rem; font-weight: 500;
  white-space: nowrap; border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s, opacity .15s;
}
.btn:disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 1.1rem; height: 1.1rem; }
.btn-sm { height: 2.25rem; padding: 0 .85rem; }
.btn-lg { height: 2.85rem; padding: 0 1.75rem; font-size: 1rem; }
.btn-icon { width: 2.5rem; padding: 0; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-primary:hover { background: hsl(var(--primary) / .88); }
.btn-outline { background: hsl(var(--background)); border-color: hsl(var(--input)); color: hsl(var(--foreground)); }
.btn-outline:hover, .btn-ghost:hover { background: hsl(var(--accent)); }
.btn-ghost { background: transparent; color: hsl(var(--foreground)); }
.btn-invert { background: #fff; color: hsl(224 12% 18%); }
.btn-invert:hover { opacity: .9; }
.btn-outline-invert { background: transparent; color: #fff; border-color: rgb(255 255 255 / .35); }
.btn-outline-invert:hover { background: rgb(255 255 255 / .1); }

/* ---------- Badge / Card ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .4rem; border-radius: 999px;
  padding: .2rem .75rem; font-size: .78rem; font-weight: 600; border: 1px solid transparent;
}
.badge-brand { background: hsl(var(--brand-soft)); color: hsl(var(--brand)); border-color: hsl(var(--brand) / .25); }
.dot { width: .45rem; height: .45rem; border-radius: 50%; background: hsl(var(--brand)); }
.card {
  background: hsl(var(--card)); color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / .04);
}
.icon-box {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; flex-shrink: 0;
  border-radius: var(--radius); background: hsl(var(--brand-soft)); color: hsl(var(--brand));
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background) / .85);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; height: 4.25rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; }
.logo-tile {
  display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: var(--radius);
  background: #fff; border: 1px solid hsl(var(--border)); overflow: hidden;
}
.logo-tile img { width: 135%; height: 135%; object-fit: cover; object-position: 50% 32%; max-width: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.05rem; }
.brand-text small { font-size: .62rem; letter-spacing: .14em; color: hsl(var(--brand)); font-weight: 600; direction: ltr; text-align: end; }
.main-nav { display: flex; gap: .85rem; font-size: .9rem; white-space: nowrap; }
.main-nav a { color: hsl(var(--muted-foreground)); transition: color .15s; }
.main-nav a:hover, .main-nav a.active { color: hsl(var(--foreground)); }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: .4rem; }
.menu-btn { display: none; }
.icon-moon { display: none; }
.dark .icon-sun { display: none; }
.dark .icon-moon { display: block; }

@media (max-width: 1340px) {
  .menu-btn { display: inline-flex; }
  .main-nav {
    position: absolute; top: 4.25rem; inset-inline: 0; display: none;
    flex-direction: column; gap: 0; padding: .5rem 1rem 1rem;
    background: hsl(var(--background)); border-bottom: 1px solid hsl(var(--border));
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .75rem .5rem; border-radius: calc(var(--radius) - 2px); }
  .main-nav a:hover { background: hsl(var(--accent)); }
}
@media (max-width: 520px) { .hide-sm { display: none; } .brand-text small { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; padding: 4rem 0 2rem;
  background: radial-gradient(ellipse 80% 70% at 15% 40%, hsl(var(--brand) / .12), transparent 70%);
}
.hero-pattern {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  /* نقش هندسي إسلامي خفيف */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23be9069' stroke-opacity='.22' stroke-width='1'%3E%3Cpath d='M32 4l8 20 20 8-20 8-8 20-8-20-20-8 20-8z'/%3E%3Crect x='20' y='20' width='24' height='24' transform='rotate(45 32 32)'/%3E%3C/g%3E%3C/svg%3E");
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 90%);
}
.hero-inner { position: relative; display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .hero-inner { grid-template-columns: 1.3fr 1fr; min-height: 26rem; } }
.slides { display: grid; }
.slide {
  grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .5s, transform .5s, visibility .5s;
}
.slide.active { opacity: 1; visibility: visible; transform: none; }
.slide .badge { margin-bottom: 1.25rem; }
.lead { font-size: clamp(1rem, 2vw, 1.2rem); color: hsl(var(--muted-foreground)); max-width: 560px; margin: 1rem 0 2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-emblem {
  justify-self: center; width: min(320px, 70vw); aspect-ratio: 1; border-radius: 50%;
  background: #fff; border: 1px solid hsl(var(--border)); overflow: hidden;
  box-shadow: 0 30px 60px -30px hsl(var(--brand) / .5), 0 0 0 12px hsl(var(--brand) / .06);
  display: grid; place-items: center;
}
.hero-emblem img { width: 92%; height: 92%; object-fit: contain; }
@media (max-width: 899px) { .hero-emblem { display: none; } }
/* خلفية الإعلان — تظهر مع شريحة الإعلان فقط */
.hero-bg { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .8s ease; }
.hero.show-poster .hero-bg { opacity: 1; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; display: block; filter: blur(3px) saturate(.9); transform: scale(1.04); }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to left, hsl(var(--background) / .93) 0%, hsl(var(--background) / .84) 50%, hsl(var(--background) / .74) 100%);
}
@media (max-width: 899px) { .hero-bg::after { background: hsl(var(--background) / .86); } }
.slider-controls { position: relative; display: flex; align-items: center; gap: .75rem; margin-top: 2rem; }
.dots { display: flex; gap: .4rem; }
.dots button {
  width: .55rem; height: .55rem; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: hsl(var(--border)); transition: width .25s, background-color .25s;
}
.dots button[aria-selected="true"] { width: 1.6rem; background: hsl(var(--brand)); }

/* ---------- Sections ---------- */
.section { padding: 4.5rem 0; }
.section-tight { padding: 2rem 0; }
.section-muted { background: hsl(var(--muted) / .6); border-block: 1px solid hsl(var(--border)); }
.section-head { max-width: 640px; margin-bottom: 2.25rem; }
.section-head.center { margin-inline: auto; }
.section-head.row { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 600; color: hsl(var(--brand)); margin-bottom: .4rem; }

/* Portals */
.portals { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .portals { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .portals { grid-template-columns: repeat(5, 1fr); } }
.portal {
  display: flex; align-items: center; gap: .75rem; padding: 1rem;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.portal:hover { border-color: hsl(var(--brand) / .5); transform: translateY(-2px); box-shadow: 0 10px 24px -14px hsl(var(--brand) / .6); }
.portal .icon-box { width: 2.5rem; height: 2.5rem; }
.portal strong { display: block; font-size: .95rem; }
.portal small { display: block; font-size: .78rem; color: hsl(var(--muted-foreground)); }

/* Features */
.features { display: grid; gap: 1rem; }
@media (min-width: 768px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { padding: 1.5rem; display: flex; flex-direction: column; gap: .25rem; }
.feature .icon-box { margin-bottom: .75rem; }
.feature p { flex: 1; font-size: .93rem; }
.feature-wide {
  grid-column: 1 / -1; display: grid; gap: 2rem; align-items: center; padding: 2rem;
  background: linear-gradient(135deg, hsl(var(--brand-soft)), hsl(var(--card)) 70%);
}
@media (min-width: 768px) { .feature-wide { grid-template-columns: 1.2fr 1fr; } }
.feature-wide .badge { margin-bottom: .75rem; }
.feature-wide h3 { font-size: 1.4rem; }
.mini-progress { display: grid; gap: 1rem; padding: 1.25rem; border-radius: var(--radius); background: hsl(var(--card)); border: 1px solid hsl(var(--border)); }
.mp-row { display: grid; gap: .35rem; font-size: .85rem; font-weight: 500; }
.progress { height: .5rem; border-radius: 999px; background: hsl(var(--secondary)); overflow: hidden; }
.progress-bar { height: 100%; width: 0; border-radius: inherit; background: hsl(var(--brand)); transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.in-view .progress-bar { width: var(--v); }
.link-arrow { display: inline-flex; align-items: center; gap: .25rem; font-size: .875rem; font-weight: 600; color: hsl(var(--brand)); }
.link-arrow svg { width: 1rem; height: 1rem; transition: transform .15s; }
.link-arrow:hover svg { transform: translateX(-3px); }

/* Verses */
.verses {
  padding: 4rem 0 0; color: #fff; overflow: hidden;
  background: linear-gradient(160deg, hsl(224 12% 22%), hsl(224 14% 14%));
  position: relative;
}
.verses::before {
  content: ""; position: absolute; inset: 0; opacity: .35; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23be9069' stroke-opacity='.35' stroke-width='1'%3E%3Cpath d='M32 4l8 20 20 8-20 8-8 20-8-20-20-8 20-8z'/%3E%3C/g%3E%3C/svg%3E");
}
.verses .container { position: relative; }
.verses-title { color: hsl(27 45% 70%); font-size: 1.2rem; font-weight: 600; }
.ayah { font-family: var(--font-quran); font-size: clamp(1.5rem, 4vw, 2.4rem); line-height: 2; margin: .5rem auto .25rem; max-width: 900px; }
.ayah-ref { font-size: .85rem; opacity: .65; }
.marquee { position: relative; margin-top: 2.5rem; border-top: 1px solid rgb(255 255 255 / .1); padding: 1.1rem 0; overflow: hidden; direction: ltr; }
.marquee-track { display: flex; gap: 2rem; width: max-content; animation: marquee 40s linear infinite; direction: rtl; }
.marquee-track span { font-size: 1.1rem; white-space: nowrap; color: rgb(255 255 255 / .85); }
.marquee-track span:nth-child(even) { color: hsl(27 45% 65%); }
@keyframes marquee { from { transform: translateX(-50%); } to { transform: translateX(0); } }

/* Halaqat */
.filters { display: flex; gap: .75rem; flex-wrap: wrap; }
.field-inline { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: hsl(var(--muted-foreground)); }
.field-inline .input { width: auto; min-width: 9rem; }
.halaqat { display: grid; gap: 1rem; }
@media (min-width: 640px) { .halaqat { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .halaqat { grid-template-columns: repeat(3, 1fr); } }
.halaqa { padding: 1.25rem; display: grid; gap: .75rem; }
.halaqa-top { display: flex; justify-content: space-between; align-items: start; gap: .5rem; }
.halaqa h3 { margin: 0; font-size: 1.05rem; }
.halaqa-org { font-size: .85rem; color: hsl(var(--muted-foreground)); }
.halaqa-meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; padding: .2rem .6rem;
  border-radius: 999px; background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
}
.chip svg { width: .85rem; height: .85rem; }
.seats { font-size: .78rem; font-weight: 600; color: hsl(var(--brand)); white-space: nowrap; }
.empty { padding: 2rem 0; }

/* Stats */
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(5, 1fr); } }
.stats .stat:last-child { grid-column: 1 / -1; }
@media (min-width: 900px) { .stats .stat:last-child { grid-column: auto; } }
.stat { padding: 1.5rem 1rem; text-align: center; display: grid; gap: .25rem; }
.stat-value { font-size: clamp(1.8rem, 3.5vw, 2.4rem); font-weight: 700; color: hsl(var(--brand)); font-variant-numeric: tabular-nums; }
.stat-label { font-size: .85rem; color: hsl(var(--muted-foreground)); }

/* Reviews */
.carousel-nav { display: flex; gap: .5rem; }
.reviews {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 1rem;
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .75rem; scrollbar-width: thin;
}
@media (min-width: 900px) { .reviews { grid-auto-columns: calc((100% - 2rem) / 3); } }
.review { scroll-snap-align: start; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.review blockquote { margin: 0; flex: 1; font-size: .95rem; }
.review footer { display: flex; align-items: center; gap: .75rem; line-height: 1.35; }
.avatar {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; flex-shrink: 0;
  background: hsl(var(--brand-soft)); color: hsl(var(--brand)); font-weight: 700;
}
.stars { color: hsl(38 92% 50%); letter-spacing: .1em; font-size: .9rem; }
.stars .off { color: hsl(var(--border)); }
/* نظام المتابعة */
.system-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 960px) { .system-grid { grid-template-columns: 1fr 1.1fr; } }
.system-text h2 { margin-top: 0; }
.checks { list-style: none; padding: 0; margin: 1.25rem 0 1.75rem; display: grid; gap: .7rem; }
.checks li { position: relative; padding-inline-start: 1.9rem; line-height: 1.7; }
.checks li::before { content: ""; position: absolute; inset-inline-start: 0; top: .3rem; width: 1.2rem; height: 1.2rem; border-radius: 50%;
  background: hsl(var(--brand)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 70% no-repeat; }
.checks b { color: hsl(var(--brand)); }
.sys-mock { display: grid; grid-template-columns: 1fr 64px; direction: ltr; border-radius: 18px; overflow: hidden; background: #eef0f3; border: 1px solid hsl(var(--border)); box-shadow: 0 30px 60px -30px rgb(0 0 0 / .6); transform: perspective(1400px) rotateY(-6deg); max-width: 620px; justify-self: center; width: 100%; }
.sm-side { background: #fff; border-left: 1px solid #dfe2e8; padding: .6rem .5rem; display: flex; flex-direction: column; gap: .45rem; align-items: center; order: 2; }
.sm-brand { width: 44px; height: 44px; border-radius: 10px; background: #4b4f5a; display: grid; place-items: center; margin-bottom: .35rem; }
.sm-brand img { width: 28px; height: 28px; border-radius: 6px; background: #fff; }
.sm-brand span { display: none; }
.sm-side i { display: block; width: 40px; height: 9px; border-radius: 6px; background: #e3e5ea; }
.sm-side i.on { background: #4b4f5a; }
.sm-main { padding: .8rem; display: grid; gap: .65rem; direction: rtl; order: 1; }
.sm-summary { background: #4b4f5a; color: #fff; border-radius: 12px; padding: .65rem .75rem; }
.sm-summary b { font-size: .78rem; display: block; margin-bottom: .45rem; }
.sm-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; }
.sm-chips span { background: rgb(255 255 255 / .1); border-radius: 8px; padding: .3rem .4rem; font-size: .62rem; opacity: .95; }
.sm-chips em { display: block; font-style: normal; font-weight: 700; font-size: .95rem; }
.sm-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.sm-tiles span { border-radius: 10px; padding: .75rem .55rem; color: #fff; font-size: .7rem; font-weight: 700; min-height: 46px; display: flex; align-items: center; }
.sm-tiles .b { background: linear-gradient(135deg, #c49a6c, #a87d52); }
.sm-tiles .s { background: linear-gradient(135deg, #5a5f6b, #3c4049); }
@media (max-width: 520px) { .sys-mock { transform: none; } .sm-tiles span { font-size: .62rem; padding: .55rem .4rem; } }

/* الإعلانات */
.posts { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .posts { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .posts { grid-template-columns: repeat(3, 1fr); } }
.post { overflow: hidden; display: flex; flex-direction: column; }
.post-media { display: block; padding: 0; border: 0; background: hsl(var(--muted)); cursor: zoom-in; aspect-ratio: 4 / 5; overflow: hidden; }
.post-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.post-media:hover img, .post-media:focus-visible img { transform: scale(1.03); }
.post-body { padding: 1.25rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.post-body h3 { margin: 0; font-size: 1.1rem; line-height: 1.5; }
.post-body p { margin: 0; font-size: .92rem; flex: 1; }
.post-body .btn { align-self: flex-start; }
.post-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .8rem; color: hsl(var(--muted-foreground)); }
.lightbox { padding: 0; border: 0; background: transparent; max-width: min(92vw, 640px); max-height: 92vh; }
.lightbox::backdrop { background: rgb(0 0 0 / .75); }
.lightbox img { display: block; width: 100%; height: auto; max-height: 92vh; object-fit: contain; border-radius: var(--radius); }
.lightbox-close { position: absolute; top: .5rem; inset-inline-start: .5rem; width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 0; background: rgb(0 0 0 / .6); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }

.review-form-wrap { max-width: 720px; margin: 2.5rem auto 0; }
.form { padding: 1.5rem; display: grid; gap: 1rem; }
@media (min-width: 640px) { .form { padding: 2rem; } }
.form h3 { margin-bottom: .2rem; }
.form p { margin: 0; }
.field-row { display: grid; gap: 1rem; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: .45rem; }
.field label, .field .label { font-size: .875rem; font-weight: 500; }
.input {
  width: 100%; font: inherit; font-size: .925rem; min-height: 2.5rem; padding: .5rem .75rem;
  color: hsl(var(--foreground)); background: hsl(var(--background));
  border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 2px);
  transition: box-shadow .15s, border-color .15s;
}
.input:focus { outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / .18); }
.input[aria-invalid="true"] { border-color: hsl(0 72% 51%); }
textarea.input { resize: vertical; }
.stars-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: .15rem; }
.stars-input input { position: absolute; opacity: 0; pointer-events: none; }
.stars-input label { font-size: 1.6rem; line-height: 1; cursor: pointer; color: hsl(var(--border)); transition: color .1s; }
/* RTL + row-reverse: النجوم بترتيب ٥..١ في DOM، فالتلوين يشمل المختار وما بعده */
.stars-input input:checked ~ label,
.stars-input label:hover, .stars-input label:hover ~ label { color: hsl(38 92% 50%); }
.stars-input input:focus-visible + label { outline: 2px solid hsl(var(--ring)); border-radius: 4px; }
.form-note { min-height: 1.2rem; }

/* CTA */
.cta-card {
  position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 2rem;
  padding: 2.5rem; border-radius: calc(var(--radius) + 8px); color: #fff;
  background: linear-gradient(135deg, hsl(27 40% 50%), hsl(27 38% 40%));
}
.cta-card > div:first-of-type { flex: 1; min-width: 240px; position: relative; }
.cta-card h2 { margin-bottom: .25rem; }
.cta-card p { margin: 0; opacity: .9; }
.cta-actions { display: flex; flex-wrap: wrap; gap: .75rem; position: relative; }
.cta-emblem {
  position: absolute; inset-inline-end: -40px; bottom: -60px; width: 240px; opacity: .12;
  mix-blend-mode: luminosity; filter: grayscale(1) brightness(3); pointer-events: none;
}

/* Footer */
.site-footer { border-top: 1px solid hsl(var(--border)); padding-top: 3rem; margin-top: 2.5rem; background: hsl(var(--muted) / .4); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(2, 1fr); }
.footer-grid > div:first-child { grid-column: 1 / -1; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } .footer-grid > div:first-child { grid-column: auto; } }
.footer-grid h4 { font-size: .9rem; margin-bottom: .75rem; }
.footer-grid > div > a:not(.brand) { display: block; font-size: .875rem; color: hsl(var(--muted-foreground)); padding: .2rem 0; }
.footer-grid > div > a:not(.brand):hover { color: hsl(var(--brand)); }
.ltr-start { text-align: right; }
.footer-line { display: block; padding: .2rem 0; }
.footer-about { margin-top: .9rem; max-width: 360px; }
.footer-bottom { border-top: 1px solid hsl(var(--border)); margin-top: 2.5rem; padding-block: 1.5rem; }

/* Toast */
.toast {
  position: fixed; bottom: 1.5rem; inset-inline-start: 50%; transform: translate(50%, 150%); z-index: 100;
  max-width: calc(100% - 2rem); padding: .875rem 1.25rem; font-size: .9rem; font-weight: 500;
  background: hsl(var(--card)); color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  box-shadow: 0 10px 30px -10px rgb(0 0 0 / .3); opacity: 0; transition: transform .3s, opacity .3s; pointer-events: none;
}
.toast.show { transform: translate(50%, 0); opacity: 1; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s, transform .6s; }
.reveal.in-view { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ===== المحفّظ الذاتي: دخول الطالب ===== */
.hz-zone { display: grid; gap: 2rem; align-items: center; padding: 2rem; border-radius: calc(var(--radius) * 2); border: 1px solid hsl(var(--brand) / .35);
  background: radial-gradient(120% 140% at 100% 0%, hsl(var(--brand) / .16), transparent 60%), hsl(var(--card)); }
@media (min-width: 860px) { .hz-zone { grid-template-columns: 1.25fr 1fr; padding: 2.5rem; } }
.hz-text h2 { margin: .35rem 0 .75rem; }
.hz-steps { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .65rem; }
.hz-steps li { display: flex; align-items: center; gap: .75rem; }
.hz-steps b { flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.hz-card { padding: 1.5rem; display: grid; gap: .75rem; box-shadow: 0 20px 40px -24px rgb(0 0 0 / .5); }
.hz-card-head { display: flex; align-items: center; gap: .75rem; }
.hz-card-head strong { display: block; font-size: 1.15rem; }
.hz-card-head small { color: hsl(var(--muted-foreground)); }
.hz-form { display: grid; gap: .5rem; }
.hz-form label { font-weight: 600; font-size: .9rem; }
.hz-input { text-align: center; font-size: 1.35rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.hz-btn { width: 100%; justify-content: center; }
.hz-msg { margin: 0; color: hsl(0 75% 72%); font-size: .9rem; }
.hz-or { display: flex; align-items: center; gap: .75rem; color: hsl(var(--muted-foreground)); font-size: .85rem; }
.hz-or::before, .hz-or::after { content: ""; flex: 1; height: 1px; background: hsl(var(--border)); }
.hz-note { text-align: center; font-size: .8rem; }
.hz-more { border-top: 1px solid hsl(var(--border)); padding-top: .75rem; margin-top: .25rem; }
.hz-more summary { cursor: pointer; font-size: .9rem; color: hsl(var(--muted-foreground)); }
.hz-more[open] summary { margin-bottom: .6rem; }

/* ===== الصفحات الفرعية: المدونة والمنتدى ===== */
.main-nav a.nav-new { color: hsl(var(--brand)); font-weight: 600; }
.page-hero { padding: 3.5rem 0 2rem; background: radial-gradient(120% 120% at 100% 0%, hsl(var(--brand) / .14), transparent 60%); border-bottom: 1px solid hsl(var(--border)); }
.page-hero h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: .6rem 0 .5rem; }
.page-hero p { max-width: 46rem; font-size: 1.05rem; }
.blog-filters { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.blog-filters button { border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: inherit; font: inherit; font-weight: 600; font-size: .88rem; border-radius: 99px; padding: .35rem .95rem; cursor: pointer; }
.blog-filters button[aria-selected="true"] { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: transparent; }
.post-body h3 a { color: inherit; }
.post-ph { display: grid; place-items: center; height: 100%; min-height: 12rem; background: hsl(var(--brand-soft)); }
.post-ph img { width: 5rem; height: 5rem; object-fit: contain; opacity: .8; }
.blog-article { padding: 1.75rem; max-width: 52rem; margin-inline: auto; }
.blog-article h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: .6rem 0 1rem; }
.blog-article .back { display: inline-block; margin-bottom: 1rem; }
.blog-cover { width: 100%; max-height: 32rem; object-fit: contain; border-radius: var(--radius); background: hsl(var(--muted)); margin-bottom: 1.25rem; }
.blog-body p { font-size: 1.08rem; line-height: 2; margin: 0 0 1rem; }
.empty-state { padding: 2.5rem; text-align: center; grid-column: 1 / -1; }
.forum-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .forum-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .forum-grid { grid-template-columns: repeat(4, 1fr); } }
.forum-card { padding: 1.4rem; }
.forum-card h3 { margin: .9rem 0 .4rem; font-size: 1.1rem; }
.forum-cta { display: flex; gap: 1.25rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 1.75rem; border: 1px solid hsl(var(--brand) / .35); }
.forum-cta h3 { margin: 0 0 .3rem; }
.forum-cta p { margin: 0; }.blog-filters[hidden], #blog-list[hidden], .blog-article[hidden] { display: none !important; }
/* شعار منتدى مشكاة */
.main-nav a.nav-ic { display: inline-flex; align-items: center; gap: .35rem; }
.nav-ic img { width: 1.45rem; height: 1.45rem; border-radius: 6px; object-fit: contain; background: #faf6f0; flex: none; }
.forum-hero { display: grid; gap: 1.5rem 2.5rem; align-items: center; }
@media (min-width: 860px) { .forum-hero { grid-template-columns: auto 1fr; } }
.about { display: grid; gap: 1.5rem; }
.about-intro { max-width: 64rem; }
.about-intro h2 { margin: .4rem 0 .7rem; font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
.about-intro p { margin: 0 0 .7rem; line-height: 1.9; }
.about-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .about-grid { grid-template-columns: repeat(3, 1fr); } }
.about-card { padding: 1.3rem; border-top: 3px solid hsl(var(--brand)); }
.about-card h3 { margin: .8rem 0 .35rem; font-size: 1.1rem; }
.about-card p { margin: 0; line-height: 1.8; }
.maqraa-logo { margin: 0; justify-self: center; display: grid; justify-items: center; gap: .2rem; padding: 1.4rem 1.6rem 1.1rem; border-radius: 28px; background: #faf6f0; box-shadow: 0 20px 40px -24px rgb(0 0 0 / .45); }
.maqraa-logo img { width: min(180px, 46vw); height: auto; }
.maqraa-logo figcaption { font-family: var(--font-quran); font-size: clamp(1.6rem, 5vw, 2.1rem); font-weight: 700; color: #a87d52; line-height: 1.3; }
/* المحاضرة المباشرة */
.live-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.live-head h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin: .3rem 0; }
.live-head p { margin: 0; }
.live-pill { display: inline-flex; align-items: center; gap: .45rem; background: #c0392b; color: #fff; font-weight: 700; padding: .35rem .85rem; border-radius: 999px; font-size: .9rem; }
.live-pill[hidden], .live-cover[hidden], .live-bar[hidden], .live-count[hidden], #lv-join[hidden] { display: none !important; }
.live-dot { width: .6rem; height: .6rem; border-radius: 50%; background: #ff4d3d; display: inline-block; animation: livePulse 1.4s infinite; }
.live-pill .live-dot { background: #fff; }
@keyframes livePulse { 50% { opacity: .35; } }
.live-stage { position: relative; aspect-ratio: 16 / 9; background: #14161b; border-radius: calc(var(--radius) * 1.5); overflow: hidden; border: 1px solid hsl(var(--brand) / .35); }
.live-stage video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.live-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; text-align: center; padding: 1rem; color: #f5efe6;
  background: radial-gradient(90% 90% at 50% 30%, hsl(27 40% 30% / .55), #14161b 75%); }
.live-cover img { width: clamp(70px, 14vw, 120px); height: auto; border-radius: 22px; background: #faf6f0; }
.live-cover b { font-size: clamp(1.05rem, 2.6vw, 1.4rem); }
.live-cover .muted { color: #d9d2c7; }
.live-bar { position: absolute; inset-inline: 0; bottom: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .55rem .8rem; color: #fff;
  background: linear-gradient(transparent, rgb(0 0 0 / .75)); font-size: .92rem; }
.live-bar .grow { flex: 1; }
.live-bar .btn { color: #fff; border-color: rgb(255 255 255 / .35); }
.live-bar .muted { color: #e6e6e6; }
.live-stage:fullscreen { border-radius: 0; border: 0; }
.live-info { display: grid; gap: 1rem; margin-top: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 800px) { .live-info { grid-template-columns: repeat(3, 1fr); } }
.live-card { padding: 1.2rem 1.3rem; }
.live-card h3 { margin: 0 0 .4rem; font-size: 1.08rem; }
.live-card p { margin: 0 0 .6rem; }
@media (max-width: 600px) { .live-stage { aspect-ratio: 4 / 3; } .live-bar { font-size: .8rem; gap: .35rem; } .live-bar .btn { padding: .25rem .55rem; font-size: .78rem; } }
.forum-live-cta { display: flex; gap: 1.25rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 1.5rem 1.75rem; border: 1px solid hsl(var(--brand) / .45);
  background: linear-gradient(135deg, hsl(var(--brand) / .14), transparent 70%); }
.forum-live-cta h3 { margin: 0 0 .3rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.forum-live-cta p { margin: 0; }
.forum-live-cta .live-pill[hidden] { display: none !important; }
.forum-logo { width: min(240px, 60vw); height: auto; border-radius: 28px; background: #faf6f0; box-shadow: 0 20px 40px -24px rgb(0 0 0 / .45); justify-self: center; }

/* ===== الشريط الثاني: منصات مشكاة بأيقونات مربعة ===== */
.subbar { border-top: 1px solid hsl(var(--border)); background: hsl(var(--background) / .6); }
.subbar-inner { display: flex; gap: .6rem; justify-content: center; align-items: center; padding-block: .5rem; overflow-x: auto; scrollbar-width: none; }
.subbar-inner::-webkit-scrollbar { display: none; }
.sub-item { display: inline-flex; align-items: center; gap: .65rem; padding: .35rem 1rem .35rem .45rem; border-radius: 14px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--foreground)); font-weight: 600; font-size: 1rem; white-space: nowrap; flex: none; transition: border-color .15s, transform .15s; }
.sub-item:hover { border-color: hsl(var(--brand)); transform: translateY(-1px); }
.sub-item[aria-current="page"] { border-color: hsl(var(--brand)); background: hsl(var(--brand-soft)); }
.sq { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 11px; background: #faf6f0; border: 1px solid hsl(var(--border)); overflow: hidden; flex: none; }
.sq img { width: 135%; height: 135%; max-width: none; object-fit: cover; object-position: 50% 32%; }
.sq.sq-forum img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.sq.sq-text { font-family: var(--font-quran); font-size: 1.85rem; font-weight: 700; color: #a87d52; line-height: 1; padding-bottom: .2rem; }
@media (max-width: 640px) { .subbar-inner { gap: .35rem; padding-inline: .6rem; } .sub-item { font-size: .74rem; gap: .3rem; padding: .25rem .4rem .25rem .25rem; border-radius: 11px; } .sq { width: 2.35rem; height: 2.35rem; border-radius: 9px; } .sq.sq-text { font-size: 1.5rem; } }
@media (max-width: 520px) { .subbar-inner { gap: .3rem; padding-inline: .4rem; } .sub-item { flex: 1 1 0; min-width: 0; flex-direction: column; gap: .2rem; padding: .3rem .2rem; font-size: .7rem; text-align: center; white-space: normal; line-height: 1.25; } }
.arabic-mark { display: grid; place-items: center; width: min(200px, 50vw); aspect-ratio: 1; border-radius: 28px; background: #faf6f0; color: #a87d52; font-family: var(--font-quran); font-size: clamp(5rem, 14vw, 8rem); font-weight: 700; line-height: 1; padding-bottom: 1.5rem; justify-self: center; box-shadow: 0 20px 40px -24px rgb(0 0 0 / .45); }
