/* =====================================================================
   NŪR AL-ATHAR — Pages et articles publics du CMS, page de maintenance.
   Typographie de lecture soignée, arabe RTL natif, tokens du thème.
   ===================================================================== */
.cx-page, .cx-article { max-width: 1240px; margin: 0 auto; padding: 1.4rem 16px 3rem; }
.cx-article { max-width: 1080px; }
.cx-article.is-wide { max-width: 1320px; }
.cx-eyebrow { display: inline-flex; gap: .45rem; align-items: center; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--c-gold-light); }
.ar { font-family: var(--font-arabic); }

/* Bandeau */
.cx-hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding: 2.2rem 2.4rem; border-radius: var(--r-xl); border: 1px solid var(--c-gold); color: #fff; background: radial-gradient(ellipse at 85% 10%, rgba(200,155,94,.3), transparent 50%), linear-gradient(135deg, var(--c-navy-deep), var(--c-navy) 60%, var(--c-green-deep)); box-shadow: var(--shadow-md); margin-bottom: 1.2rem; }
.cx-hero::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(200,155,94,.45); border-radius: calc(var(--r-xl) - 5px); pointer-events: none; }
.cx-hero > div { position: relative; flex: 1; min-width: 0; }
.cx-hero h1 { color: #fff; font-size: clamp(2rem, 4vw, 3rem); margin: .4rem 0 .5rem; }
.cx-hero p { color: rgba(255,255,255,.85); max-width: 640px; }
.cx-hero-ar { position: relative; font-family: var(--font-arabic); font-size: clamp(3rem, 8vw, 6rem); color: var(--c-gold-light); opacity: .85; text-shadow: 0 0 40px rgba(200,155,94,.45); }
.cx-hero-page { min-height: 300px; background: linear-gradient(135deg, rgba(8,26,48,.9), rgba(11,58,41,.75)), var(--cx-cover, none) center / cover, var(--c-navy); }
.cx-search { display: flex; align-items: center; gap: .6rem; max-width: 520px; margin-top: 1rem; padding: 0 1rem; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(200,155,94,.45); }
.cx-search input { flex: 1; background: transparent; border: 0; color: #fff; padding: .75rem 0; outline: none; min-width: 0; }
.cx-search input::placeholder { color: rgba(255,255,255,.65); }
.cx-search:focus-within { background: rgba(255,255,255,.18); border-color: var(--c-gold-light); }

/* Catégories */
.cx-cats { display: flex; gap: .45rem; overflow-x: auto; padding: .2rem 0 1rem; scrollbar-width: none; }
.cx-cats::-webkit-scrollbar { display: none; }
.cx-cats a { white-space: nowrap; padding: .5rem 1rem; border-radius: 999px; background: var(--c-paper); border: 1px solid var(--c-border-soft); color: var(--c-ink); font-size: .86rem; font-weight: 600; text-decoration: none; }
.cx-cats a small { color: var(--c-muted); font-weight: 400; }
.cx-cats a:hover { border-color: var(--c-gold); color: var(--c-ink); }
.cx-cats a.on { background: var(--c-primary); color: var(--c-primary-ink); border-color: var(--c-primary); }
.cx-cats a.on small { color: inherit; opacity: .8; }

/* Cartes */
.cx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.1rem; }
.cx-card { display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; background: var(--c-paper); border: 1px solid var(--c-border-soft); color: var(--c-ink); text-decoration: none; box-shadow: var(--shadow-sm); transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); }
.cx-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-gold); border-color: var(--c-gold); color: var(--c-ink); }
.cx-card-img { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, rgba(200,155,94,.35), transparent 60%), linear-gradient(135deg, var(--c-navy), var(--c-green-deep)); color: var(--c-gold-light); font-size: 2.6rem; overflow: hidden; }
.cx-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.cx-card:hover .cx-card-img img { transform: scale(1.05); }
.cx-tag { position: absolute; top: .7rem; inset-inline-start: .7rem; padding: .2rem .65rem; border-radius: 999px; background: rgba(8,26,48,.75); color: var(--c-gold-light); font-size: .7rem; font-weight: 600; backdrop-filter: blur(4px); }
.cx-card-body { display: flex; flex-direction: column; gap: .4rem; padding: 1rem 1.1rem 1.1rem; flex: 1; }
.cx-card-body strong { font-family: var(--font-heading); font-size: 1.3rem; line-height: 1.25; color: var(--c-heading); }
.cx-card-body strong.ar { font-family: var(--font-arabic); font-size: 1.35rem; line-height: 1.6; }
.cx-card-body small { color: var(--c-muted); font-size: .86rem; line-height: 1.55; }
.cx-card-body em { margin-top: auto; font-style: normal; font-size: .74rem; color: var(--c-gold-text); display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.cx-card.is-featured { border-color: var(--c-gold); }
.cx-empty { text-align: center; padding: 3rem 1rem; color: var(--c-muted); border: 1px dashed var(--c-border); border-radius: var(--r-lg); }
.cx-empty i { font-size: 2.5rem; color: var(--c-gold-text); }
.cx-pager { display: flex; gap: 1rem; justify-content: center; align-items: center; margin-top: 1.6rem; }
.cx-pager a { display: inline-flex; gap: .3rem; align-items: center; padding: .55rem 1.1rem; border-radius: 999px; border: 1px solid var(--c-border); color: var(--c-ink); text-decoration: none; background: var(--c-paper); }
.cx-pager span { color: var(--c-muted); font-size: .86rem; }

/* Article */
.cx-head { text-align: center; max-width: 820px; margin: 1rem auto 1.4rem; }
.cx-crumb { display: flex; gap: .45rem; justify-content: center; align-items: center; font-size: .8rem; flex-wrap: wrap; }
.cx-crumb a { color: var(--c-gold-text); text-decoration: none; display: inline-flex; gap: .3rem; align-items: center; }
.cx-crumb .bi-chevron-right { color: var(--c-muted); font-size: .7rem; }
[dir="rtl"] .cx-crumb .bi-chevron-right { transform: scaleX(-1); }
.cx-head h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.15; color: var(--c-heading); margin: .8rem 0; }
.cx-head h1.ar { font-family: var(--font-arabic); line-height: 1.6; font-size: clamp(2rem, 4.5vw, 3rem); }
.cx-lead { font-size: 1.15rem; color: var(--c-ink); opacity: .85; line-height: 1.6; }
.cx-lead.ar { font-family: var(--font-arabic); font-size: 1.3rem; }
.cx-meta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; color: var(--c-muted); font-size: .84rem; margin: 0; }
.cx-meta span { display: inline-flex; gap: .35rem; align-items: center; }
.cx-src-chip { padding: .15rem .6rem; border-radius: 999px; background: rgba(15,77,55,.08); color: var(--c-green-text); }
.cx-notice { display: flex; gap: .5rem; align-items: center; justify-content: center; padding: .6rem 1rem; border-radius: 12px; background: var(--c-gold-soft); color: var(--c-gold-text); font-size: .86rem; max-width: 760px; margin: 0 auto 1rem; }
.cx-cover { margin: 0 auto 1.6rem; border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-md); max-height: 520px; }
.cx-cover img { width: 100%; max-height: 520px; object-fit: cover; display: block; }
.cx-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; justify-content: center; }
.has-toc .cx-layout { grid-template-columns: 240px minmax(0, 760px); }
.cx-toc { position: sticky; top: 130px; align-self: start; max-height: calc(100vh - 150px); overflow-y: auto; padding: 1rem; border-radius: var(--r-lg); background: var(--c-paper); border: 1px solid var(--c-border-soft); font-size: .84rem; }
.cx-toc strong { display: flex; gap: .4rem; align-items: center; font-family: var(--font-heading); font-size: 1.1rem; color: var(--c-heading); margin-bottom: .5rem; }
.cx-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.cx-toc li.sub { padding-inline-start: .9rem; }
.cx-toc a { display: block; padding: .3rem .5rem; border-radius: 8px; color: var(--c-muted); text-decoration: none; border-inline-start: 2px solid transparent; }
.cx-toc a:hover { color: var(--c-ink); background: var(--c-gold-soft); }
.cx-toc a.on { color: var(--c-heading); border-inline-start-color: var(--c-gold); background: var(--c-gold-soft); font-weight: 600; }

/* Typographie de lecture */
.prose { max-width: 760px; margin: 0 auto; width: 100%; font-size: 1.08rem; line-height: 1.85; color: var(--c-ink); overflow-wrap: anywhere; }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose h2 { font-family: var(--font-heading); font-size: 1.9rem; color: var(--c-heading); margin: 2.2rem 0 .6rem; scroll-margin-top: 140px; }
.prose h3 { font-family: var(--font-heading); font-size: 1.45rem; color: var(--c-heading); margin: 1.8rem 0 .4rem; scroll-margin-top: 140px; }
.prose h4 { font-size: 1.1rem; color: var(--c-heading); }
.prose a { color: var(--c-link); text-decoration: underline; text-decoration-color: var(--c-gold); text-underline-offset: 3px; }
.prose blockquote { margin: 1.6rem 0; padding: 1rem 1.3rem; border-inline-start: 4px solid var(--c-gold); background: var(--c-gold-soft); border-radius: 0 14px 14px 0; font-style: italic; }
[dir="rtl"] .prose blockquote, .prose.is-rtl blockquote { border-radius: 14px 0 0 14px; font-style: normal; }
.prose .ayah { font-family: var(--font-mushaf); font-size: 1.65rem; line-height: 2.2; text-align: center; padding: 1.2rem 1.4rem; border-radius: 16px; border: 1px solid var(--c-gold); background: radial-gradient(circle at 50% 0, var(--c-gold-soft), transparent 70%), var(--c-paper); color: var(--c-heading); }
.prose .ayah::before { content: "﴿ "; color: var(--c-gold); } .prose .ayah::after { content: " ﴾"; color: var(--c-gold); }
.prose .hadith { font-family: var(--font-arabic); font-size: 1.4rem; line-height: 2; padding: 1.1rem 1.3rem; border-radius: 16px; border: 1px solid rgba(15,77,55,.35); background: rgba(15,77,55,.05); }
.prose .note { padding: 1rem 1.2rem; border-radius: 14px; border-inline-start: 4px solid var(--c-info); background: rgba(42,90,130,.07); font-size: .98rem; }
.prose [dir="rtl"], .prose .ar { font-family: var(--font-arabic); font-size: 1.3rem; line-height: 2; }
.prose.is-rtl { font-family: var(--font-arabic); font-size: 1.3rem; line-height: 2.1; }
.prose.is-rtl h2, .prose.is-rtl h3 { font-family: var(--font-arabic); }
.prose ul, .prose ol { padding-inline-start: 1.5rem; }
.prose li + li { margin-top: .35em; }
.prose img { max-width: 100%; height: auto; border-radius: 14px; }
.prose figure { margin: 1.8rem 0; text-align: center; }
.prose figcaption { font-size: .84rem; color: var(--c-muted); margin-top: .4rem; }
.prose hr { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--c-gold), transparent); margin: 2.4rem 0; }
.prose hr::after { content: none; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--c-border-soft); padding: .55rem .75rem; text-align: start; }
.prose th { background: var(--c-paper-2); }
.prose audio, .prose video { width: 100%; border-radius: 12px; }
.prose code { background: var(--c-paper-2); padding: .1rem .35rem; border-radius: 5px; font-size: .9em; }

/* Source, partage, liés */
.cx-source { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; max-width: 760px; margin: 2.4rem auto 0; padding: 1.1rem 1.3rem; border-radius: var(--r-lg); border: 1px solid var(--c-gold); background: linear-gradient(135deg, var(--c-gold-soft), transparent), var(--c-paper); }
.cx-source > div { flex: 1; min-width: 220px; }
.cx-source strong { color: var(--c-heading); }
.cx-source p { margin: .2rem 0 0; font-size: .84rem; color: var(--c-muted); }
.cx-source-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; color: #fff; background: linear-gradient(135deg, var(--c-green), var(--c-navy)); flex: none; }
.cx-synced { color: var(--c-info) !important; display: flex; gap: .35rem; align-items: center; }
.cx-share { display: flex; gap: .5rem; align-items: center; justify-content: center; flex-wrap: wrap; margin: 1.6rem auto 0; color: var(--c-muted); font-size: .84rem; }
.cx-chip { display: inline-flex; gap: .35rem; align-items: center; padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--c-border); background: var(--c-paper); color: var(--c-ink); font-size: .82rem; text-decoration: none; cursor: pointer; }
.cx-chip:hover { border-color: var(--c-gold); color: var(--c-ink); }
.cx-related { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--c-border-soft); }
.cx-related h2 { text-align: center; color: var(--c-heading); margin-bottom: 1.2rem; }

/* Maintenance */
.cx-maint { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .6rem; padding: 2rem 16px; color: #fff; background: radial-gradient(ellipse at 50% 0%, rgba(200,155,94,.28), transparent 55%), linear-gradient(160deg, #081A30, #0B2545 60%, #0B3A29); }
.cx-maint-orb { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(200,155,94,.25), transparent 70%); animation: cx-breathe 4s ease-in-out infinite; }
@keyframes cx-breathe { 50% { transform: scale(1.06); filter: drop-shadow(0 0 30px rgba(200,155,94,.5)); } }
.cx-maint h1 { color: #fff; font-size: clamp(2rem, 6vw, 3.2rem); margin: .2rem 0; }
.cx-maint p { color: rgba(255,255,255,.85); max-width: 560px; font-size: 1.05rem; margin: 0; }
.cx-maint-until { color: #D6B486 !important; display: flex; gap: .4rem; align-items: center; }
.cx-maint-ar { font-family: var(--font-arabic); font-size: 1.6rem !important; color: #D6B486 !important; margin-top: .8rem !important; }
.cx-maint-langs { display: flex; gap: .4rem; margin-top: 1rem; }
.cx-maint-langs a { color: rgba(255,255,255,.75); padding: .35rem .8rem; border-radius: 999px; border: 1px solid rgba(200,155,94,.4); text-decoration: none; font-size: .84rem; }
.cx-maint-langs a.on { background: rgba(200,155,94,.2); color: #fff; }
.cx-maint-admin { margin-top: 1.4rem; color: rgba(255,255,255,.5); font-size: .78rem; text-decoration: none; display: inline-flex; gap: .3rem; }
@media (prefers-reduced-motion: reduce) { .cx-maint-orb { animation: none; } }

/* Adaptatif */
@media (max-width: 980px) { .has-toc .cx-layout { grid-template-columns: minmax(0, 1fr); } .cx-toc { position: static; max-height: none; } }
@media (max-width: 640px) {
  .cx-hero { padding: 1.5rem 1.2rem; } .cx-hero-ar { position: absolute; inset-inline-end: .8rem; top: .4rem; font-size: 3rem; opacity: .25; }
  .cx-grid { grid-template-columns: minmax(0, 1fr); }
  .prose { font-size: 1.02rem; } .prose h2 { font-size: 1.55rem; } .prose .ayah { font-size: 1.35rem; padding: 1rem; }
  .cx-source { flex-direction: column; align-items: flex-start; }
}
