/* =====================================================================
   NAJD ROLEPLAY — v3: cinematic / tactical
   Black, sharp edges, hairlines, one gold accent. No rounded shapes.
   The HTML the admin panel generates (sidebar links, home cards, rule
   items) is left untouched and restyled from here.
   ===================================================================== */

:root {
  --bg: #0a0a0b;
  --bg-2: #101011;
  --panel: #131314;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.2);
  --text: #eceae4;
  --muted: #9b9891;
  --dim: #63615c;
  --gold: #e2a528;
  --gold-2: #f6c758;
  --red: #e5484d;
  --green: #3ddc84;
  --head: 'Cairo', system-ui, sans-serif;
  --body: 'IBM Plex Sans Arabic', 'Cairo', system-ui, sans-serif;
  --mono: 'Rajdhani', 'Cairo', system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --hero-img: url('https://i.ibb.co/1GPrvbr0/130429-3840x2160-desktop-4k-grand-theft-auto-5-background.jpg');
  --cut: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

html { scroll-behavior: smooth; scroll-padding-top: 96px; overflow-x: clip; }
body.nj {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
.nj ::selection { background: var(--gold); color: #000; }
.nj a { color: inherit; text-decoration: none; }
.nj :focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.nj [hidden] { display: none !important; }
.nj-container { width: min(1280px, 100% - 40px); margin-inline: auto; }
.nj-main { flex: 1; overflow-x: clip; }
.nj-gold { color: var(--gold); }

/* small technical label */
.nj-tag { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); direction: ltr; }
.nj-tag::before { content: ''; width: 28px; height: 1px; background: var(--gold); }

/* ---------------------------------------------------------------- buttons */
.nj-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 46px; padding: 0 22px; border: 1px solid var(--line-2); border-radius: 0; background: transparent; color: var(--text); font-family: var(--head); font-size: 14.5px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: background-color 0.2s, color 0.2s, border-color 0.2s; }
.nj-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.nj-btn:hover { background: #fff; border-color: #fff; color: #000; }
.nj-btn--lg { height: 58px; padding: 0 30px; font-size: 16px; }
.nj-btn--gold { border: 0; background: var(--gold); color: #000 !important; clip-path: var(--cut); }
.nj-btn--gold:hover { background: #fff; }

/* ---------------------------------------------------------------- header */
.nj-header { position: sticky; top: 0; z-index: 60; border-bottom: 1px solid transparent; transition: background-color 0.3s, border-color 0.3s; }
.nj-header.is-stuck, .nj-header.is-open, .nj-header--solid { background: rgba(10, 10, 11, 0.9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.nj-header__bar { display: flex; align-items: center; gap: 36px; height: 72px; }
.nj-brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nj-brand img { width: 42px; height: 42px; border-radius: 50%; }
.nj-brand b { display: block; font-family: var(--head); font-size: 19px; font-weight: 900; line-height: 1.15; color: #fff; }
.nj-brand small { display: block; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.3em; line-height: 1.3; color: var(--gold); direction: ltr; text-align: right; }
.nj-nav { display: flex; align-self: stretch; gap: 4px; }
.nj-nav a { position: relative; display: flex; align-items: center; padding: 0 16px; font-family: var(--head); font-size: 14.5px; font-weight: 600; color: var(--muted); transition: color 0.2s; }
.nj-nav a:hover { color: #fff; }
.nj-nav a.is-active { color: #fff; }
.nj-nav a.is-active::after { content: ''; position: absolute; inset-inline: 16px; bottom: -1px; height: 2px; background: var(--gold); }
.nj-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.nj-actions .nj-btn { height: 42px; padding: 0 18px; font-size: 14px; }
.nj-burger { display: none; width: 44px; height: 44px; border: 1px solid var(--line-2); background: transparent; color: #fff; cursor: pointer; align-items: center; justify-content: center; }
.nj-burger svg { width: 20px; height: 20px; }
.nj-mobile { display: none; padding: 8px 0 18px; border-top: 1px solid var(--line); }
.nj-mobile a.nj-mobile__link { display: block; padding: 14px 2px; border-bottom: 1px solid var(--line); font-family: var(--head); font-weight: 700; font-size: 17px; color: var(--muted); }
.nj-mobile a.nj-mobile__link.is-active { color: var(--gold); }
.nj-mobile__cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.nj-header.is-open .nj-mobile { display: block; }
@media (max-width: 940px) { .nj-nav, .nj-actions .nj-btn { display: none; } .nj-burger { display: inline-flex; } }

/* ---------------------------------------------------------------- hero */
.nj-hero > .nj-container { flex: 1; display: flex; align-items: center; }
.nj-hero { position: relative; margin-top: -73px; min-height: clamp(600px, 100vh, 780px); display: flex; flex-direction: column; overflow: hidden; isolation: isolate; background: #000; }
.nj-hero__bg { position: absolute; inset: -3%; z-index: -3; background: var(--hero-img) center 35% / cover no-repeat; filter: grayscale(0.55) contrast(1.15) brightness(0.62); animation: njDrift 30s ease-in-out infinite alternate; }
@keyframes njDrift { to { transform: scale(1.08) translateX(-1.5%); } }
.nj-hero::before { content: ''; position: absolute; inset: 0; z-index: -2; background: linear-gradient(to top, var(--bg) 0%, rgba(10, 10, 11, 0.7) 26%, rgba(10, 10, 11, 0.15) 58%, rgba(10, 10, 11, 0.6) 100%), linear-gradient(to left, rgba(10, 10, 11, 0.85), transparent 62%), linear-gradient(rgba(226, 165, 40, 0.1), rgba(226, 165, 40, 0.1)); }
/* scanlines */
.nj-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(0, 0, 0, 0.16) 3px 4px); pointer-events: none; }
.nj-hero__side { position: absolute; top: 50%; left: 22px; z-index: 1; display: flex; align-items: center; gap: 14px; font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.34em; color: rgba(255, 255, 255, 0.55); writing-mode: vertical-rl; rotate: 180deg; translate: 0 -50%; direction: ltr; }
.nj-hero__side::before, .nj-hero__side::after { content: ''; width: 1px; height: 70px; background: rgba(255, 255, 255, 0.3); }
.nj-hero__inner { padding: 104px 0 32px; max-width: 760px; }
.nj-live { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 20px; font-family: var(--head); font-size: 14px; font-weight: 600; color: #fff; }
.nj-live i { position: relative; width: 8px; height: 8px; background: var(--green); box-shadow: 0 0 12px var(--green); animation: njBlink 1.6s steps(2) infinite; }
@keyframes njBlink { 50% { opacity: 0.25; } }
.nj-live span { padding-inline-start: 12px; border-inline-start: 1px solid var(--line-2); font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.24em; color: var(--gold); direction: ltr; }
.nj-hero h1 { margin: 0 0 18px; font-family: var(--head); font-weight: 900; color: #fff; }
.nj-hero h1 small { display: block; font-size: clamp(1.15rem, 2.2vw, 1.7rem); font-weight: 600; line-height: 1.6; color: var(--muted); }
.nj-hero h1 strong { display: block; font-weight: 900; font-size: clamp(3.4rem, min(9vw, 14vh), 7rem); line-height: 1.15; white-space: nowrap; letter-spacing: -0.02em; text-shadow: 0 10px 60px rgba(0, 0, 0, 0.6); }
.nj-hero h1 em { display: block; font-style: normal; font-size: clamp(1.5rem, min(3.6vw, 5.5vh), 2.8rem); font-weight: 700; line-height: 1.3; color: var(--gold); }
.nj-hero p.nj-lead { margin: 0 0 30px; max-width: 560px; padding-inline-start: 18px; border-inline-start: 2px solid var(--gold); font-size: clamp(0.98rem, 1.4vw, 1.1rem); line-height: 2; color: #cfccc4; }
.nj-hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* three-cell bar at the bottom of the hero */
.nj-bar { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line-2); background: rgba(10, 10, 11, 0.55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.nj-bar a { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 22px clamp(16px, 2.4vw, 34px); border-inline-end: 1px solid var(--line-2); transition: background-color 0.25s, color 0.25s; }
.nj-bar a:last-child { border-inline-end: 0; }
.nj-bar a > i { font-family: var(--mono); font-style: normal; font-size: 34px; font-weight: 500; line-height: 1; color: var(--gold); transition: color 0.25s; }
.nj-bar a b { display: block; font-family: var(--head); font-size: 18px; font-weight: 800; line-height: 1.5; color: #fff; transition: color 0.25s; }
.nj-bar a span { display: block; font-size: 13.5px; line-height: 1.6; color: var(--muted); transition: color 0.25s; }
.nj-bar a svg { width: 22px; height: 22px; color: var(--dim); transition: color 0.25s, translate 0.3s var(--ease); }
.nj-bar a:hover { background: var(--gold); }
.nj-bar a:hover > i, .nj-bar a:hover b, .nj-bar a:hover span, .nj-bar a:hover svg { color: #000; }
.nj-bar a:hover svg { translate: -6px 0; }
@media (max-width: 820px) { .nj-bar { grid-template-columns: 1fr; } .nj-bar a { border-inline-end: 0; border-bottom: 1px solid var(--line-2); padding-block: 16px; } .nj-bar a:last-child { border-bottom: 0; } }

/* ticker */
.nj-ticker { border-bottom: 1px solid var(--line); overflow: hidden; direction: ltr; }
.nj-ticker__track { display: flex; width: max-content; animation: njTicker 60s linear infinite; }
.nj-ticker span { display: inline-flex; align-items: center; gap: 28px; padding: 12px 14px; font-family: var(--head); font-size: 13.5px; font-weight: 600; color: var(--dim); white-space: nowrap; direction: rtl; }
.nj-ticker span::after { content: '/'; color: var(--gold); }
@keyframes njTicker { to { transform: translateX(-50%); } }

/* ---------------------------------------------------------------- sections */
.nj-section { padding: 96px 0; }
.nj-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 26px; margin-bottom: 40px; }
.nj-head h2 { margin: 10px 0 8px; font-family: var(--head); font-size: clamp(2.2rem, 5.4vw, 4.2rem); font-weight: 900; line-height: 1.25; color: #fff; }
.nj-head p { margin: 0; max-width: 540px; color: var(--muted); }

/* search field */
.nj-search { position: relative; display: flex; align-items: center; width: 100%; max-width: 420px; }
.nj-search svg { position: absolute; inset-inline-start: 16px; width: 18px; height: 18px; color: var(--dim); pointer-events: none; transition: color 0.2s; }
.nj-search input { width: 100%; height: 52px; padding-inline: 46px 52px; border: 1px solid var(--line-2); border-radius: 0; background: rgba(255, 255, 255, 0.03); color: #fff; font-family: var(--body); font-size: 15px; outline: none; transition: border-color 0.2s, background-color 0.2s; }
.nj-search input::placeholder { color: var(--dim); }
.nj-search input::-webkit-search-cancel-button { display: none; }
.nj-search input:focus { border-color: var(--gold); background: rgba(226, 165, 40, 0.05); }
.nj-search:focus-within svg { color: var(--gold); }
.nj-search kbd { position: absolute; inset-inline-end: 14px; padding: 0 8px; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 13px; line-height: 22px; color: var(--dim); direction: ltr; }
.nj-search--xl { max-width: none; }
.nj-search--xl input { height: 72px; font-size: 20px; padding-inline: 60px 24px; border-width: 0 0 2px; border-color: var(--line-2); background: transparent; }
.nj-search--xl input:focus { background: transparent; }
.nj-search--xl svg { inset-inline-start: 6px; width: 26px; height: 26px; }

/* rule index (home) — markup comes from the admin panel */
.nj-cards > div { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 1px !important; counter-reset: njcard; }
@media (max-width: 1000px) { .nj-cards > div { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 620px) { .nj-cards > div { grid-template-columns: minmax(0, 1fr) !important; } }
.nj-cards a.card-hover { counter-increment: njcard; position: relative; display: flex !important; flex-direction: column; align-items: stretch !important; gap: 0 !important; min-height: 230px; padding: 28px !important; border: 0 !important; border-radius: 0 !important; background: var(--bg) !important; box-shadow: 0 0 0 1px var(--line) !important; overflow: hidden; transform: none !important; transition: background-color 0.25s, opacity 0.7s var(--ease), translate 0.7s var(--ease) !important; }
.nj-cards a.card-hover::before { content: counter(njcard, decimal-leading-zero); position: absolute; top: 24px; inset-inline-start: 28px; font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: 0.1em; color: var(--gold); transition: color 0.25s; }
.nj-cards a.card-hover::after { content: ''; position: absolute; bottom: 28px; inset-inline-end: 28px; width: 26px; height: 12px; background: var(--dim); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 12' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath d='M26 6H1M6 1 1 6l5 5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 12' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath d='M26 6H1M6 1 1 6l5 5'/%3E%3C/svg%3E") center / contain no-repeat; transition: background-color 0.25s, translate 0.3s var(--ease); }
.nj-cards a.card-hover > div:first-of-type { align-self: flex-end; padding: 0 !important; border-radius: 0 !important; background: transparent !important; }
.nj-cards a.card-hover svg { width: 34px !important; height: 34px !important; color: var(--dim) !important; transition: color 0.25s !important; }
.nj-cards a.card-hover > div:last-of-type { margin-top: auto; padding-top: 40px; padding-inline-end: 44px; }
.nj-cards a.card-hover h3 { margin: 0 0 4px !important; font-family: var(--head); font-size: 23px !important; font-weight: 800 !important; line-height: 1.5 !important; color: #fff !important; transition: color 0.25s !important; }
.nj-cards a.card-hover p { margin: 0; font-size: 14px !important; line-height: 1.8; color: var(--muted) !important; transition: color 0.25s; }
.nj-cards a.card-hover:hover { background: var(--gold) !important; }
.nj-cards a.card-hover:hover::before, .nj-cards a.card-hover:hover h3, .nj-cards a.card-hover:hover p, .nj-cards a.card-hover:hover svg { color: #000 !important; }
.nj-cards a.card-hover:hover::after { background: #000; translate: -8px 0; }

/* call to action */
.nj-cta { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 30px; padding: clamp(40px, 8vw, 110px) clamp(22px, 5vw, 70px); border: 1px solid var(--line-2); overflow: hidden; isolation: isolate; }
.nj-cta::before { content: ''; position: absolute; inset: 0; z-index: -2; background: var(--hero-img) center 70% / cover no-repeat; filter: grayscale(0.7) contrast(1.2) brightness(0.4); }
.nj-cta::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to left, rgba(10, 10, 11, 0.9), rgba(10, 10, 11, 0.3)), repeating-linear-gradient(to bottom, transparent 0 3px, rgba(0, 0, 0, 0.16) 3px 4px); }
.nj-cta h2 { margin: 10px 0 6px; font-family: var(--head); font-size: clamp(2.2rem, 6vw, 4.8rem); font-weight: 900; line-height: 1.2; color: #fff; }
.nj-cta p { margin: 0; color: #cfccc4; }
.nj-cta__btns { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 860px) { .nj-cta { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- footer */
.nj-footer { margin-top: 90px; border-top: 1px solid var(--line); }
.nj-footer__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 36px; padding: 50px 0 40px; }
.nj-footer__about { max-width: 380px; }
.nj-footer__about p { margin: 16px 0 0; font-size: 14.5px; color: var(--muted); }
.nj-footer__cols { display: flex; flex-wrap: wrap; gap: 72px; }
.nj-footer h4 { margin: 0 0 14px; font-family: var(--mono); font-size: 12.5px; font-weight: 600; letter-spacing: 0.24em; color: var(--dim); direction: ltr; text-align: right; }
.nj-footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.nj-footer ul a { font-size: 15px; color: var(--text); transition: color 0.2s; }
.nj-footer ul a:hover { color: var(--gold); }
.nj-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 18px 0 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); }
.nj-footer__bottom span:last-child { font-family: var(--mono); letter-spacing: 0.24em; direction: ltr; }

/* ---------------------------------------------------------------- rule pages */
.nj-banner { position: relative; margin-top: -73px; padding: 150px 0 44px; border-bottom: 1px solid var(--line-2); overflow: hidden; isolation: isolate; }
.nj-banner::before { content: ''; position: absolute; inset: 0; z-index: -2; background: var(--hero-img) center 30% / cover no-repeat; filter: grayscale(0.75) contrast(1.2) brightness(0.36); }
.nj-banner::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, var(--bg) 0%, rgba(10, 10, 11, 0.55) 70%, rgba(10, 10, 11, 0.8)), linear-gradient(to left, rgba(10, 10, 11, 0.85), transparent 75%), repeating-linear-gradient(to bottom, transparent 0 3px, rgba(0, 0, 0, 0.16) 3px 4px); }
.nj-banner__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 28px; }
.nj-banner__icon { display: none; }
.nj-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-family: var(--head); font-size: 13.5px; font-weight: 600; color: var(--muted); }
.nj-crumb a:hover { color: var(--gold); }
.nj-crumb b { font-weight: 700; color: var(--gold); }
.nj-crumb i { font-style: normal; color: var(--dim); }
.nj-banner h1 { margin: 10px 0 8px; font-family: var(--head); font-size: clamp(2.6rem, 7vw, 5.6rem); font-weight: 900; line-height: 1.2; letter-spacing: -0.01em; color: #fff; }
.nj-banner__sub { margin: 0; max-width: 720px; font-size: 16px; line-height: 1.95; color: #cfccc4; }
.nj-banner__sub:empty { display: none; }
.nj-meta { display: flex; flex-wrap: wrap; margin-top: 22px; }
.nj-meta:empty { display: none; }
.nj-meta span { display: inline-flex; align-items: baseline; gap: 8px; padding-inline: 0 22px; margin-inline-end: 22px; border-inline-end: 1px solid var(--line-2); font-family: var(--head); font-size: 14px; font-weight: 600; color: var(--muted); }
.nj-meta span:last-child { border: 0; }
.nj-meta span b { font-family: var(--mono); font-size: 34px; font-weight: 600; line-height: 1; color: #fff; }

.nj-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 56px; align-items: start; padding: 44px 0 30px; }
.nj-layout.has-toc { grid-template-columns: 260px minmax(0, 1fr) 200px; gap: 48px; }
.nj-side, .nj-toc { position: sticky; top: 96px; max-height: calc(100vh - 116px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.nj-side__label, .nj-toc p { margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); font-family: var(--mono); font-size: 12.5px; font-weight: 600; letter-spacing: 0.24em; color: var(--dim); direction: ltr; text-align: right; }

#ruleNav { display: grid; gap: 0; counter-reset: njnav; }
#ruleNav > a { counter-increment: njnav; position: relative; display: flex !important; align-items: center; gap: 12px !important; margin: 0 !important; padding: 11px 0 !important; padding-inline: 14px 8px !important; border: 0 !important; border-inline-start: 2px solid transparent !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; color: var(--muted) !important; transform: none !important; transition: color 0.2s, background-color 0.2s, border-color 0.2s !important; }
#ruleNav > a::before { content: counter(njnav, decimal-leading-zero); font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--dim); transition: color 0.2s; }
#ruleNav > a span { flex: 1; font-family: var(--head); font-size: 15px; font-weight: 600 !important; line-height: 1.6; }
#ruleNav > a svg { order: 3; width: 18px !important; height: 18px !important; color: var(--dim) !important; opacity: 0.7; transition: color 0.2s; }
#ruleNav > a:hover { color: #fff !important; background: rgba(255, 255, 255, 0.04) !important; }
#ruleNav > a.border-amber-400 { color: #fff !important; border-inline-start-color: var(--gold) !important; background: linear-gradient(to left, rgba(226, 165, 40, 0.14), transparent) !important; }
#ruleNav > a.border-amber-400::before, #ruleNav > a.border-amber-400 svg { color: var(--gold) !important; opacity: 1; }
#ruleNav > a.border-amber-400 span { font-weight: 800 !important; }

.nj-toc a { display: block; padding: 6px 0; padding-inline-start: 12px; border-inline-start: 1px solid var(--line); font-size: 13.5px; line-height: 1.7; color: var(--dim); transition: color 0.2s, border-color 0.2s; }
.nj-toc a:hover { color: #fff; }
.nj-toc a.is-on { color: var(--gold); border-inline-start-color: var(--gold); }
@media (max-width: 1240px) { .nj-layout.has-toc { grid-template-columns: 260px minmax(0, 1fr); } .nj-toc { display: none; } }

/* rule content */
.nj-doc { min-width: 0; }
.nj-doc .animate-slide-in-right { counter-reset: njsec; animation: njRise 0.6s var(--ease) both; }
@keyframes njRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* title + intro are shown in the page header instead */
.nj-doc .animate-slide-in-right > h2, .nj-doc .animate-slide-in-right > h2 + p.mb-8 { display: none; }

.nj-doc h3 { counter-increment: njsec; display: flex; align-items: baseline; gap: 16px; margin: 44px 0 0 !important; padding: 20px 0 14px !important; border: 0 !important; border-top: 1px solid var(--line-2) !important; font-family: var(--head); font-size: clamp(1.4rem, 2.8vw, 1.9rem) !important; font-weight: 800 !important; line-height: 1.5; color: #fff !important; }
.nj-doc h3::before { content: '§ ' counter(njsec, decimal-leading-zero); flex-shrink: 0; font-family: var(--mono); font-size: 14px; font-weight: 600; letter-spacing: 0.12em; color: var(--gold); direction: ltr; unicode-bidi: isolate; }

.nj-doc ol { list-style: none !important; margin: 0 !important; padding: 0 !important; counter-reset: njrule; border-top: 1px solid var(--line); }
.nj-doc ol > li { counter-increment: njrule; position: relative; margin: 0 !important; padding-block: 18px !important; padding-inline: 64px 44px !important; border: 0 !important; border-bottom: 1px solid var(--line) !important; border-inline-start: 2px solid transparent !important; border-radius: 0 !important; background: transparent !important; color: #dcd9d1 !important; font-size: 16.5px; font-weight: 400 !important; line-height: 2 !important; transition: background-color 0.2s; }
.nj-doc ol > li::before { content: counter(njrule, decimal-leading-zero); position: absolute; inset-inline-start: 16px; top: 22px; font-family: var(--mono); font-size: 17px; font-weight: 600; line-height: 1.5; color: var(--dim); transition: color 0.2s; }
.nj-doc ol > li:hover { background: rgba(255, 255, 255, 0.035) !important; }
.nj-doc ol > li:hover::before { color: var(--gold); }

/* important + warning */
.nj-doc ol > li.border-amber-400 { border-inline-start-color: var(--gold) !important; background: linear-gradient(to left, rgba(226, 165, 40, 0.1), transparent 70%) !important; color: #f3dfb0 !important; }
.nj-doc ol > li.border-red-500 { border-inline-start-color: var(--red) !important; background: linear-gradient(to left, rgba(229, 72, 77, 0.12), transparent 70%) !important; color: #f6cfd0 !important; font-weight: 500 !important; }
.nj-doc ol > li.border-amber-400::before { color: var(--gold); }
.nj-doc ol > li.border-red-500::before { color: var(--red); }
.nj-doc ol > li.border-amber-400::after, .nj-doc ol > li.border-red-500::after { display: block; width: fit-content; margin-top: 6px; padding: 0 8px; font-family: var(--head); font-size: 11.5px; font-weight: 700; line-height: 20px; }
.nj-doc ol > li.border-amber-400::after { content: 'مهم'; background: var(--gold); color: #000; }
.nj-doc ol > li.border-red-500::after { content: 'تحذير'; background: var(--red); color: #fff; }

/* stand-alone notes (outside lists) */
.nj-doc .nj-note { position: relative; margin: 18px 0 !important; padding: 16px 20px !important; border: 1px solid var(--line-2) !important; border-inline-start: 2px solid var(--muted) !important; border-radius: 0 !important; background: rgba(255, 255, 255, 0.03) !important; color: #dcd9d1 !important; font-weight: 500 !important; line-height: 2 !important; }
.nj-doc .nj-note.border-amber-400, .nj-doc .nj-note.border-amber-500 { border-color: rgba(226, 165, 40, 0.35) !important; border-inline-start-color: var(--gold) !important; background: rgba(226, 165, 40, 0.07) !important; color: #f3dfb0 !important; }
.nj-doc .nj-note.border-red-500 { border-color: rgba(229, 72, 77, 0.4) !important; border-inline-start-color: var(--red) !important; background: rgba(229, 72, 77, 0.08) !important; color: #f6cfd0 !important; }
.nj-doc ul { list-style: none !important; margin: 0; padding: 10px 0 0 !important; }
.nj-doc ul > li { position: relative; padding-inline-start: 22px; color: #dcd9d1; }
.nj-doc ul > li::before { content: ''; position: absolute; inset-inline-start: 2px; top: 0.95em; width: 8px; height: 1px; background: var(--gold); }

.nj-doc ol > li.is-target { border-inline-start-color: var(--gold) !important; background: rgba(226, 165, 40, 0.18) !important; animation: njFlash 1.2s ease-in-out 3; }
@keyframes njFlash { 50% { background-color: rgba(226, 165, 40, 0.32); } }

.nj-copy { position: absolute; inset-inline-end: 6px; top: 18px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; background: transparent; color: var(--dim); cursor: pointer; opacity: 0; transition: opacity 0.2s, color 0.2s; }
.nj-copy svg { width: 16px; height: 16px; }
.nj-doc ol > li:hover .nj-copy, .nj-copy:focus-visible { opacity: 1; }
.nj-copy:hover { color: var(--gold); }

/* previous / next */
.nj-pager { display: grid; grid-template-columns: 1fr 1fr; margin-top: 64px; border: 1px solid var(--line-2); }
.nj-pager a { display: block; padding: 24px 28px; transition: background-color 0.25s; }
.nj-pager a + a { border-inline-start: 1px solid var(--line-2); }
.nj-pager small { display: block; font-family: var(--head); font-size: 12.5px; font-weight: 600; color: var(--gold); transition: color 0.25s; }
.nj-pager b { font-family: var(--head); font-size: 22px; font-weight: 800; line-height: 1.5; color: #fff; transition: color 0.25s; }
.nj-pager a:hover { background: var(--gold); }
.nj-pager a:hover small, .nj-pager a:hover b { color: #000; }
.nj-pager a.is-next { text-align: end; grid-column: 2; }

@media (max-width: 960px) {
  .nj-layout, .nj-layout.has-toc { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 0; }
  .nj-side { top: 72px; z-index: 30; max-height: none; margin-inline: -20px; padding: 0 20px; background: rgba(10, 10, 11, 0.94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-2); }
  .nj-side__label { display: none; }
  #ruleNav { display: flex; overflow-x: auto; scrollbar-width: none; }
  #ruleNav::-webkit-scrollbar { display: none; }
  #ruleNav > a { flex: 0 0 auto; width: auto !important; padding: 14px 14px !important; border: 0 !important; border-bottom: 2px solid transparent !important; background: transparent !important; }
  #ruleNav > a svg { display: none; }
  #ruleNav > a span { white-space: nowrap; font-size: 14.5px; }
  #ruleNav > a.border-amber-400 { border-bottom-color: var(--gold) !important; }
  .nj-search { max-width: none; }
  .nj-search kbd { display: none; }
}
@media (max-width: 640px) {
  .nj-hero__side { display: none; }
  .nj-hero__inner { padding-bottom: 36px; }
  .nj-hero__cta .nj-btn { flex: 1 1 100%; }
  .nj-section { padding: 64px 0; }
  .nj-banner { padding-top: 120px; }
  .nj-doc ol > li { padding-inline: 46px 8px !important; font-size: 16px; }
  .nj-doc ol > li::before { inset-inline-start: 8px; font-size: 15px; top: 24px; }
  .nj-copy { display: none; }
  .nj-pager { grid-template-columns: 1fr; }
  .nj-pager a + a { border-inline-start: 0; border-top: 1px solid var(--line-2); }
  .nj-pager a.is-next { grid-column: auto; }
}

/* ---------------------------------------------------------------- search page */
.nj-searchpage { padding-bottom: 40px; }
.nj-searchhero .nj-search { margin-top: 30px; }
.nj-narrow { width: min(920px, 100%); padding-top: 14px; }
.nj-stats { margin: 26px 0 8px; font-family: var(--head); font-size: 14.5px; font-weight: 600; color: var(--muted); }
.nj-stats b { font-family: var(--mono); font-size: 22px; font-weight: 600; color: var(--gold); }
.nj-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1px; margin-top: 18px; }
.nj-chips a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; box-shadow: 0 0 0 1px var(--line); font-family: var(--head); font-size: 15.5px; font-weight: 700; color: var(--text); transition: background-color 0.2s, color 0.2s; }
.nj-chips em { font-family: var(--mono); font-style: normal; font-size: 16px; font-weight: 600; color: var(--gold); transition: color 0.2s; }
.nj-chips a:hover { background: var(--gold); color: #000; }
.nj-chips a:hover em { color: #000; }
.nj-group { margin-top: 38px; animation: njRise 0.4s var(--ease) both; }
.nj-group__head { display: flex; align-items: baseline; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.nj-group__head a { font-family: var(--head); font-size: 24px; font-weight: 800; line-height: 1.4; color: #fff; }
.nj-group__head a:hover { color: var(--gold); }
.nj-group__head em { font-family: var(--mono); font-style: normal; font-size: 16px; font-weight: 600; color: var(--gold); }
.nj-hit { display: block; padding: 16px 16px; border-bottom: 1px solid var(--line); border-inline-start: 2px solid transparent; font-size: 16px; line-height: 1.95; color: #dcd9d1 !important; transition: background-color 0.2s, border-color 0.2s; }
.nj-hit:hover { background: rgba(255, 255, 255, 0.04); border-inline-start-color: var(--gold); }
.nj mark { padding: 0 4px; background: var(--gold); color: #000; font-weight: 600; }
.nj-empty { padding: 34px 0 10px; color: var(--muted); }
.nj-empty > svg { display: none; }
.nj-empty > p { margin: 0; font-family: var(--mono); font-size: 12.5px; font-weight: 600; letter-spacing: 0.24em; color: var(--dim); }
#emptyState > p { font-family: var(--head); font-size: 20px; font-weight: 700; letter-spacing: 0; color: #fff; }

/* ---------------------------------------------------------------- shared bits */
.nj-progress { position: fixed; top: 0; inset-inline: 0; z-index: 80; height: 2px; pointer-events: none; }
.nj-progress i { display: block; height: 100%; transform: scaleX(0); transform-origin: right; background: var(--gold); }
.nj-top { position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 55; display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line-2); background: rgba(10, 10, 11, 0.9); color: #fff; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity 0.3s, background-color 0.2s, color 0.2s, border-color 0.2s; }
.nj-top svg { width: 18px; height: 18px; }
.nj-top.is-on { opacity: 1; pointer-events: auto; }
.nj-top:hover { background: var(--gold); border-color: var(--gold); color: #000; }
.nj-toast { position: fixed; bottom: 26px; left: 50%; z-index: 90; padding: 10px 22px; background: var(--gold); color: #000; font-family: var(--head); font-size: 14px; font-weight: 700; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity 0.25s, transform 0.3s var(--ease); }
.nj-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.js .nj-reveal { opacity: 0; translate: 0 22px; transition: opacity 0.7s var(--ease), translate 0.7s var(--ease); transition-delay: var(--d, 0s); }
.js .nj-cards a.card-hover.nj-reveal { opacity: 0; translate: 0 22px; }
.js .nj-reveal.is-in, .js .nj-cards a.card-hover.nj-reveal.is-in { opacity: 1; translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nj *, .nj *::before, .nj *::after { animation: none !important; transition: none !important; }
  .js .nj-reveal, .js .nj-cards a.card-hover.nj-reveal { opacity: 1; translate: 0 0; }
}

/* ---------------------------------------------------------------- v3.1: simpler, faster rule pages
   Compact page header so the section list and the rules are on screen
   immediately, like the old site. No image, no entrance animation. */
.nj-banner { margin-top: 0; padding: 26px 0 22px; border-bottom: 1px solid var(--line); }
.nj-banner::before, .nj-banner::after { display: none; }
.nj-banner__row { align-items: center; }
.nj-banner__row > div:first-child { flex: 1; min-width: 260px; }
.nj-banner h1 { margin: 4px 0 0; font-size: clamp(1.9rem, 3.6vw, 2.7rem); line-height: 1.35; }
.nj-banner__sub { max-width: 780px; font-size: 14.5px; line-height: 1.8; color: var(--muted); }
.nj-meta { margin-top: 10px; }
.nj-meta span { padding-inline: 0 14px; margin-inline-end: 14px; font-size: 13px; }
.nj-meta span b { font-size: 20px; }
.nj-layout { padding-top: 26px; }
.nj-doc .animate-slide-in-right { animation: none; }
.nj-doc h3:first-child, .nj-doc .animate-slide-in-right > div > h3:first-child { margin-top: 0 !important; border-top: 0 !important; padding-top: 0 !important; }
.nj-searchhero { padding: 44px 0 30px; }
.nj-searchhero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
@media (max-width: 640px) { .nj-banner { padding-top: 18px; } }

/* ---------------------------------------------------------------- v3.2: easier on the eyes
   Softer background, familiar reading font (Tajawal, as on the old site),
   bigger text, and each rule in its own soft box so the eye can separate them. */
:root {
  --bg: #111113;
  --panel: #19191c;
  --text: #e9e6df;
  --muted: #a7a49c;
  --dim: #77746e;
  --body: 'Tajawal', 'Cairo', system-ui, sans-serif;
}
body.nj { font-size: 17px; }
.nj-header.is-stuck, .nj-header.is-open { background: rgba(17, 17, 19, 0.92); }

/* no third column: sections list + rules only */
.nj-toc { display: none !important; }
.nj-layout, .nj-layout.has-toc { grid-template-columns: 290px minmax(0, 1fr); gap: 44px; }
.nj-doc { max-width: 900px; }

/* sidebar: larger, brighter */
#ruleNav > a { padding-block: 13px !important; color: #c9c6be !important; }
#ruleNav > a span { font-size: 16px; }

/* rules as separate soft boxes */
.nj-doc ol { border-top: 0; padding-top: 6px !important; }
.nj-doc ol > li {
  margin: 0 0 10px !important;
  padding-block: 16px !important;
  padding-inline: 62px 44px !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-inline-start: 3px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 6px !important;
  background: #19191c !important;
  color: #ebe8e1 !important;
  font-size: 18px;
  font-weight: 500 !important;
  line-height: 1.95 !important;
}
.nj-doc ol > li::before { inset-inline-start: 18px; top: 18px; font-size: 18px; color: var(--gold); }
.nj-doc ol > li:hover { background: #1f1f23 !important; }
.nj-doc ol > li.border-amber-400 { border-color: rgba(226, 165, 40, 0.22) !important; border-inline-start-color: var(--gold) !important; background: #211c11 !important; color: #f4e2b6 !important; }
.nj-doc ol > li.border-red-500 { border-color: rgba(229, 72, 77, 0.25) !important; border-inline-start-color: var(--red) !important; background: #231416 !important; color: #f7d6d7 !important; }
.nj-doc ol > li.is-target { background: #3a2c0c !important; border-color: var(--gold) !important; }
.nj-doc .nj-note { border-radius: 6px !important; font-size: 17.5px; }
.nj-doc h3 { margin-top: 34px !important; border-top: 0 !important; padding-top: 6px !important; }
.nj-banner__sub { font-size: 16px; }
@media (max-width: 960px) { .nj-layout, .nj-layout.has-toc { grid-template-columns: minmax(0, 1fr); gap: 18px; } }
@media (max-width: 640px) { .nj-doc ol > li { padding-inline: 46px 12px !important; font-size: 17px; } .nj-doc ol > li::before { inset-inline-start: 12px; font-size: 16px; top: 19px; } }

/* ---------------------------------------------------------------- v3.3: image back on rule pages
   Same city image behind the page title, but as a short strip so the
   section list and the rules still start high on the screen. */
.nj-banner { margin-top: -73px; padding: 104px 0 24px; border-bottom: 1px solid var(--line-2); }
.nj-banner::before { display: block; filter: grayscale(0.6) contrast(1.15) brightness(0.5); background-position: center 38%; }
.nj-banner::after { display: block; background: linear-gradient(to top, var(--bg) 0%, rgba(17, 17, 19, 0.55) 55%, rgba(17, 17, 19, 0.75) 100%), linear-gradient(to left, rgba(17, 17, 19, 0.88), rgba(17, 17, 19, 0.15) 80%); }
.nj-banner__sub { color: #d3d0c8; }
.nj-searchhero { padding: 120px 0 30px; }
@media (max-width: 640px) { .nj-banner { padding-top: 92px; } }
