/* ==========================================================================
   NANMOW — معرفة article layer (single posts only). No JavaScript.
   Tokens: --nm-* (nm-layout / Elementor Kit). Logical properties (RTL-first).
   Reading column ≈ 40em; headings clear the sticky header when reached by anchor.
   ========================================================================== */

.nm-art {
	--nm-art-measure: 42rem;
	--nm-art-gutter: clamp(16px, 4vw, 32px);
	--nm-art-anchor: calc(var(--nm-header-h, 80px) + 24px);
	font-family: var(--nm-font-ar, 'IBM Plex Sans Arabic'), sans-serif;
	color: var(--nm-ink-950, #071f25);
	background: #fff;
}
.admin-bar .nm-art { --nm-art-anchor: calc(var(--nm-header-h, 80px) + 56px); }
/* Hello Elementor caps .site-main (500/600/800/1140px + 10px side padding on phones);
   the article controls its own measure and full-bleed bands. */
main.nm-art.site-main { max-inline-size: none; inline-size: auto; margin-inline: 0; padding-inline: 0; }
.nm-art__wrap { max-inline-size: calc(var(--nm-art-measure) + 2 * var(--nm-art-gutter)); margin-inline: auto; padding-inline: var(--nm-art-gutter); }

/* ---------- Head ---------- */
.nm-art__head { padding-block: clamp(28px, 5vw, 64px) clamp(24px, 4vw, 40px); background: var(--nm-neutral-50, #f4f7f7); border-block-end: 1px solid var(--nm-neutral-200, #e3eaeb); }
.nm-art__crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin: 0 0 20px; padding: 0; list-style: none; font-size: 15px; line-height: 1.5; }
.nm-art__crumbs li { display: inline-flex; align-items: center; }
.nm-art__crumbs li + li::before { content: ""; inline-size: 6px; block-size: 6px; margin-inline: 10px; border: solid var(--nm-neutral-400, #9fb4b8); border-width: 0 0 1.5px 1.5px; transform: rotate(45deg); }
[dir="ltr"] .nm-art__crumbs li + li::before { transform: rotate(-135deg); }
.nm-art__crumbs a { display: inline-flex; align-items: center; min-block-size: 32px; color: var(--nm-neutral-600, #4a6266); text-decoration: none; }
.nm-art__crumbs a:hover { color: var(--nm-teal-900, #0b3f4a); text-decoration: underline; text-underline-offset: 4px; }
.nm-art__cluster { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font-size: 15px; font-weight: 700; color: var(--nm-orange-700, #b93d0c); }
.nm-art-glyph { flex: none; inline-size: 36px; block-size: auto; }
.nm-art-glyph rect { fill: var(--nm-neutral-200, #e3eaeb); }
.nm-art-glyph rect.is-on { fill: var(--e-global-color-accent, #ff5a1f); }
.nm-art__title { margin: 0; max-inline-size: 22em; font-size: clamp(1.625rem, 1.15rem + 2.1vw, 2.625rem); line-height: 1.35; font-weight: 700; color: var(--nm-teal-900, #0b3f4a); text-wrap: balance; overflow-wrap: anywhere; }
.nm-art__deck { margin: 16px 0 0; font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem); line-height: 1.8; color: var(--nm-neutral-600, #4a6266); }
.nm-art__meta { display: flex; flex-wrap: wrap; gap: 6px 0; margin: 20px 0 0; font-size: 15px; line-height: 1.6; color: var(--nm-neutral-600, #4a6266); }
.nm-art__meta span + span::before { content: "·"; margin-inline: 10px; color: var(--nm-neutral-400, #9fb4b8); }
.nm-art__meta span:first-child { font-weight: 700; color: var(--nm-teal-900, #0b3f4a); }

/* ---------- Layout: body + contents ---------- */
.nm-art__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; max-inline-size: calc(var(--nm-art-measure) + 2 * var(--nm-art-gutter)); margin-inline: auto; padding: clamp(28px, 4vw, 48px) var(--nm-art-gutter) clamp(40px, 6vw, 72px); }
@media (min-width: 1180px) {
	.nm-art__layout.has-toc { grid-template-columns: minmax(0, var(--nm-art-measure)) 256px; justify-content: center; gap: 64px; max-inline-size: none; }
	.nm-art__layout.has-toc .nm-art__toc { grid-column: 2; grid-row: 1; align-self: start; position: sticky; inset-block-start: var(--nm-art-anchor); }
	.nm-art__layout.has-toc .nm-art__body { grid-column: 1; grid-row: 1; }
	.nm-art__toc summary { pointer-events: none; }
}

/* Contents */
.nm-art__toc { border: 1px solid var(--nm-neutral-200, #e3eaeb); border-radius: 14px; padding: 4px 18px 12px; background: #fff; }
.nm-art__toc summary { display: flex; align-items: center; min-block-size: 48px; font-size: 15px; font-weight: 700; color: var(--nm-teal-900, #0b3f4a); list-style: none; cursor: pointer; }
.nm-art__toc summary::-webkit-details-marker { display: none; }
.nm-art__toc summary::after { content: ""; margin-inline-start: auto; inline-size: 8px; block-size: 8px; border: solid var(--nm-teal-900, #0b3f4a); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.nm-art__toc[open] summary::after { transform: rotate(-135deg); }
@media (min-width: 1180px) { .nm-art__toc summary::after { content: none; } }
.nm-art__toc ol { margin: 0; padding: 0; list-style: none; border-inline-start: 2px solid var(--nm-neutral-200, #e3eaeb); }
.nm-art__toc a { display: flex; align-items: center; min-block-size: 40px; padding: 6px 14px; margin-inline-start: -2px; border-inline-start: 2px solid transparent; font-size: 15px; line-height: 1.5; color: var(--nm-neutral-600, #4a6266); text-decoration: none; }
.nm-art__toc a:hover, .nm-art__toc a:focus-visible { color: var(--nm-teal-900, #0b3f4a); border-inline-start-color: var(--e-global-color-accent, #ff5a1f); }

/* ---------- Body typography ---------- */
.nm-art__body { min-inline-size: 0; font-size: 18px; line-height: 1.95; overflow-wrap: break-word; }
.nm-art__body > :first-child { margin-block-start: 0; }
.nm-art__body p { margin: 0 0 1.1em; }
.nm-art__body h2 { margin: 2.1em 0 .6em; font-size: clamp(1.375rem, 1.2rem + .8vw, 1.75rem); line-height: 1.45; font-weight: 700; color: var(--nm-teal-900, #0b3f4a); scroll-margin-block-start: var(--nm-art-anchor); text-wrap: balance; }
.nm-art__body h3 { margin: 1.7em 0 .5em; font-size: clamp(1.1875rem, 1.1rem + .35vw, 1.3125rem); line-height: 1.5; font-weight: 700; color: var(--nm-ink-950, #071f25); scroll-margin-block-start: var(--nm-art-anchor); }
.nm-art__body ul, .nm-art__body ol { margin: 0 0 1.2em; padding-inline-start: 1.4em; }
.nm-art__body li { margin-block-end: .45em; padding-inline-start: .2em; }
.nm-art__body li::marker { color: var(--nm-teal-900, #0b3f4a); font-weight: 700; }
.nm-art__body strong { font-weight: 700; color: var(--nm-ink-950, #071f25); }
.nm-art__body a { color: var(--nm-teal-900, #0b3f4a); font-weight: 600; text-decoration: underline; text-decoration-color: rgb(11 63 74 / .35); text-underline-offset: 5px; text-decoration-thickness: 1.5px; }
.nm-art__body a:hover { text-decoration-color: var(--e-global-color-accent, #ff5a1f); }
.nm-art__body blockquote { margin: 1.6em 0; padding: 4px 20px; border-inline-start: 3px solid var(--e-global-color-accent, #ff5a1f); font-size: 1.05em; color: var(--nm-teal-900, #0b3f4a); }
.nm-art__body blockquote p:last-child { margin-block-end: 0; }
.nm-art__body code { direction: ltr; unicode-bidi: isolate; padding: 1px 6px; border-radius: 6px; background: var(--nm-neutral-50, #f4f7f7); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; color: var(--nm-teal-900, #0b3f4a); }
.nm-art__body hr { margin: 2.4em 0; border: 0; border-block-start: 1px solid var(--nm-neutral-200, #e3eaeb); }

/* Callout: practical note / decision point */
.nm-art__body .nm-note { margin: 1.8em 0; padding: 18px 22px; border-radius: 14px; background: var(--nm-neutral-50, #f4f7f7); border-inline-start: 4px solid var(--nm-teal-900, #0b3f4a); }
.nm-art__body .nm-note > :last-child { margin-block-end: 0; }
.nm-art__body .nm-note__label { display: block; margin-block-end: 4px; font-size: 15px; font-weight: 700; color: var(--nm-orange-700, #b93d0c); }
.nm-art__body .nm-note p { font-size: 17px; line-height: 1.85; }

/* Steps / checklist */
.nm-art__body ol.nm-steps { counter-reset: nm-step; list-style: none; padding-inline-start: 0; }
.nm-art__body ol.nm-steps > li { counter-increment: nm-step; position: relative; padding-inline-start: 48px; margin-block-end: 1em; }
.nm-art__body ol.nm-steps > li::before { content: counter(nm-step); position: absolute; inset-inline-start: 0; inset-block-start: .2em; display: grid; place-items: center; inline-size: 32px; block-size: 32px; border-radius: 50%; background: var(--nm-teal-900, #0b3f4a); color: #fff; font-size: 15px; font-weight: 700; line-height: 1; }

/* Tables: scroll inside their own box on narrow screens */
.nm-art__body .nm-table { margin: 1.6em 0; overflow-x: auto; border: 1px solid var(--nm-neutral-200, #e3eaeb); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.nm-art__body .nm-table:focus-visible { outline: 3px solid var(--e-global-color-accent, #ff5a1f); outline-offset: 2px; }
.nm-art__body table { inline-size: 100%; min-inline-size: 520px; border-collapse: collapse; font-size: 16px; line-height: 1.7; }
.nm-art__body th, .nm-art__body td { padding: 12px 16px; text-align: start; vertical-align: top; border-block-end: 1px solid var(--nm-neutral-200, #e3eaeb); }
.nm-art__body thead th { background: var(--nm-neutral-50, #f4f7f7); font-weight: 700; color: var(--nm-teal-900, #0b3f4a); }
.nm-art__body tbody tr:last-child td { border-block-end: 0; }

/* ---------- Related reading ---------- */
.nm-art__related { padding-block: clamp(36px, 5vw, 56px); border-block-start: 1px solid var(--nm-neutral-200, #e3eaeb); }
.nm-art__related h2, .nm-art__cta h2 { margin: 0 0 16px; font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); line-height: 1.45; font-weight: 700; color: var(--nm-teal-900, #0b3f4a); }
.nm-art__related ul { margin: 0; padding: 0; list-style: none; border-block-start: 1px solid var(--nm-neutral-200, #e3eaeb); }
.nm-art__related li { border-block-end: 1px solid var(--nm-neutral-200, #e3eaeb); }
.nm-art__related li a { display: flex; flex-direction: column; gap: 2px; padding: 16px 0; min-block-size: 44px; text-decoration: none; }
.nm-art__related-cluster { font-size: 14px; font-weight: 600; color: var(--nm-orange-700, #b93d0c); }
.nm-art__related-title { font-size: 18px; font-weight: 700; line-height: 1.55; color: var(--nm-teal-900, #0b3f4a); }
.nm-art__related li a:hover .nm-art__related-title { text-decoration: underline; text-underline-offset: 5px; }
.nm-art__related-all { margin: 18px 0 0; }
.nm-art__related-all a { display: inline-flex; align-items: center; min-block-size: 44px; font-weight: 700; color: var(--nm-teal-900, #0b3f4a); text-underline-offset: 5px; }

/* ---------- Closing invitation (restrained) ---------- */
.nm-art__cta { padding-block: clamp(40px, 6vw, 64px); background: var(--nm-neutral-50, #f4f7f7); }
.nm-art__cta p { margin: 0 0 22px; font-size: 18px; line-height: 1.85; color: var(--nm-neutral-600, #4a6266); }
.nm-art__cta-row { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.nm-art .nm-art__btn { display: inline-flex; align-items: center; justify-content: center; min-block-size: 52px; padding: 12px 28px; border: 2px solid var(--nm-teal-900, #0b3f4a); border-radius: 12px; color: var(--nm-teal-900, #0b3f4a); font-size: 17px; font-weight: 700; text-decoration: none; transition: background-color .25s ease, color .25s ease, border-color .25s ease; }
.nm-art .nm-art__btn:hover, .nm-art .nm-art__btn:focus-visible { background: var(--nm-teal-900, #0b3f4a); color: #fff; }
.nm-art .nm-art__btn--primary { background: var(--e-global-color-accent, #ff5a1f); border-color: var(--e-global-color-accent, #ff5a1f); color: var(--nm-ink-950, #071f25); }
.nm-art .nm-art__btn--primary:hover, .nm-art .nm-art__btn--primary:focus-visible { background: var(--nm-orange-700, #b93d0c); border-color: var(--nm-orange-700, #b93d0c); color: #fff; }

/* Focus */
.nm-art a:focus-visible, .nm-art summary:focus-visible { outline: 3px solid var(--e-global-color-accent, #ff5a1f); outline-offset: 3px; border-radius: 4px; }

/* English (LTR): Latin text reads best a little tighter than Arabic. */
html[lang^="en"] .nm-art__body { line-height: 1.75; }
html[lang^="en"] .nm-art__title { line-height: 1.2; letter-spacing: -.01em; }
html[lang^="en"] .nm-art__crumbs li + li::before { transform: rotate(-135deg); }

/* ---------- Phones ---------- */
@media (max-width: 767px) {
	.nm-art__body { font-size: 17px; line-height: 1.9; }
	.nm-art__body .nm-note { padding: 16px 18px; }
	.nm-art__body ol.nm-steps > li { padding-inline-start: 42px; }
	.nm-art__related-title { font-size: 17px; }
	.nm-art__cta-row { flex-direction: column; }
	.nm-art .nm-art__btn { inline-size: 100%; min-block-size: 56px; }
}
@media (max-width: 380px) {
	.nm-art__crumbs ol, .nm-art__meta { font-size: 14px; }
}

/* Forced colours: keep structure visible */
@media (forced-colors: active) {
	.nm-art__body .nm-note, .nm-art__toc { border: 1px solid CanvasText; }
	.nm-art-glyph rect.is-on { fill: Highlight; }
	.nm-art .nm-art__btn { border-color: ButtonText; }
}
@media print {
	.nm-art__toc, .nm-art__related, .nm-art__cta, .nm-art__crumbs { display: none; }
	.nm-art__body a { text-decoration: none; }
}
