/* =========================================================
   Qalam — public site styles
   Direction-agnostic (logical properties) for RTL + LTR
   ========================================================= */
:root {
  --bg: #f7f3ec;
  --surface: #ffffff;
  --surface-2: #f1ebe1;
  --ink: #1c1917;
  --ink-2: #44403c;
  --muted: #78716c;
  --line: #e7dfd3;
  --accent: #9b1b30;
  --accent-2: #7a1426;
  --indigo: #1e2a5a;
  --gold: #c8963e;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(28,25,23,.04), 0 8px 24px -12px rgba(28,25,23,.18);
  --shadow-lg: 0 24px 60px -24px rgba(28,25,23,.35);
  --container: 1240px;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-head: 'Fraunces', Georgia, serif;
  --lh: 1.7;
  --lh-head: 1.25;
  --ease: cubic-bezier(.2,.7,.2,1);
  --ajrak: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='16' viewBox='0 0 32 16'%3E%3Crect width='32' height='16' fill='%239b1b30'/%3E%3Cpath d='M8 1 15 8 8 15 1 8z' fill='%231e2a5a'/%3E%3Cpath d='M24 1 31 8 24 15 17 8z' fill='%23111'/%3E%3Ccircle cx='8' cy='8' r='2' fill='%23f5e9d3'/%3E%3Ccircle cx='24' cy='8' r='1.6' fill='%23f5e9d3'/%3E%3Ccircle cx='16' cy='1' r='1' fill='%23f5e9d3'/%3E%3Ccircle cx='16' cy='15' r='1' fill='%23f5e9d3'/%3E%3C/svg%3E");
}
html.dark {
  --bg: #11100e;
  --surface: #1b1916;
  --surface-2: #24211d;
  --ink: #f4eee5;
  --ink-2: #d6cfc4;
  --muted: #a39b90;
  --line: #2f2b26;
  --accent: #e0475f;
  --accent-2: #c73550;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}

/* Language typography */
html[data-lang="ur"] { --font-body: 'Noto Nastaliq Urdu', serif; --font-head: 'Noto Nastaliq Urdu', serif; --lh: 2.25; --lh-head: 1.9; }
html[data-lang="sd"] { --font-body: 'Noto Naskh Arabic', serif; --font-head: 'Noto Naskh Arabic', serif; --lh: 1.95; --lh-head: 1.55; }
[lang="ur"] { font-family: 'Noto Nastaliq Urdu', serif; }
[lang="sd"] { font-family: 'Noto Naskh Arabic', serif; }
[lang="en"] { font-family: 'Inter', system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: var(--lh);
  -webkit-font-smoothing: antialiased; transition: background .3s, color .3s;
}
html[data-lang="ur"] body { font-size: 16px; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1,h2,h3,h4 { font-family: var(--font-head); line-height: var(--lh-head); margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 { letter-spacing: 0; }
.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.container-narrow { width: min(100% - 2.5rem, 780px); margin-inline: auto; }
.muted { color: var(--muted); }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 1rem; top: 1rem; z-index: 999; background: var(--accent); color: #fff; padding: .5rem 1rem; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.hp { position: absolute !important; inset-inline-start: -9999px; opacity: 0; }

/* ---------- Top bar ---------- */
.topbar { background: var(--indigo); color: #e9e4f5; font-size: 13px; }
html.dark .topbar { background: #0b0f22; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 40px; gap: 1rem; }
.today { display: inline-flex; align-items: center; gap: .4rem; opacity: .85; }
.lang-switch { display: inline-flex; align-items: center; gap: .25rem; background: rgba(255,255,255,.08); padding: 3px; border-radius: 999px; }
.lang-switch svg { margin-inline: .45rem .2rem; opacity: .7; }
.lang-switch a { padding: 2px 12px; border-radius: 999px; transition: .2s; line-height: 1.9; }
.lang-switch a:hover { background: rgba(255,255,255,.12); }
.lang-switch a.active { background: #fff; color: var(--indigo); font-weight: 600; }
.lang-switch a[lang="ur"] { font-family: 'Noto Nastaliq Urdu', serif; font-size: 12px; line-height: 2.1; }
.lang-switch a[lang="sd"] { font-family: 'Noto Naskh Arabic', serif; }
.lang-switch a[lang="en"] { font-family: 'Inter', sans-serif; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); transition: box-shadow .3s; }
.site-header.scrolled { box-shadow: 0 10px 30px -20px rgba(0,0,0,.35); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 76px; }
.ajrak-strip { height: 8px; background: var(--ajrak) repeat-x center / auto 100%; }
.brand { display: inline-flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.brand-mark { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #f5e9d3; background: linear-gradient(135deg, var(--accent), var(--indigo)); box-shadow: 0 8px 20px -8px var(--accent); transform: rotate(-6deg); transition: transform .4s var(--ease); }
.brand:hover .brand-mark { transform: rotate(6deg) scale(1.05); }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-family: var(--font-head); font-size: 1.5rem; line-height: 1.5; }
.brand-text small { color: var(--muted); font-size: .72rem; }
html[data-lang="ur"] .brand-text strong { font-size: 1.45rem; line-height: 1.9; }
.main-nav { display: flex; align-items: center; gap: .2rem; margin-inline-start: auto; }
.main-nav > a { position: relative; padding: .4rem .8rem; border-radius: 10px; font-weight: 500; color: var(--ink-2); transition: .2s; white-space: nowrap; }
.main-nav > a::after { content: ""; position: absolute; inset-inline: .8rem; bottom: 2px; height: 2px; background: var(--accent); border-radius: 2px; transform: scaleX(0); transition: transform .3s var(--ease); }
.main-nav > a:hover, .main-nav > a.active { color: var(--ink); }
.main-nav > a:hover::after, .main-nav > a.active::after { transform: scaleX(1); }
.mobile-lang { display: none; }
.header-actions { display: flex; gap: .35rem; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); transition: .2s; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.i-sun { display: none; } html.dark .i-sun { display: block; } html.dark .i-moon { display: none; }
.i-moon, .i-sun { line-height: 0; }
.menu-btn { display: none; }

/* ---------- Search overlay ---------- */
.search-overlay { position: fixed; inset: 0; z-index: 100; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(18px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; animation: fade .25s; }
.search-overlay[hidden] { display: none; }
.search-close { position: absolute; top: 1.5rem; inset-inline-end: 1.5rem; }
.search-big { width: min(760px, 100%); display: flex; align-items: center; gap: 1rem; border-bottom: 2px solid var(--ink); padding: .5rem 0; color: var(--muted); }
.search-big input { flex: 1; border: 0; background: none; font: inherit; font-size: clamp(1.4rem, 4vw, 2.4rem); color: var(--ink); outline: none; font-family: var(--font-head); line-height: 2; }
.search-tags { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 2rem; }
.search-tags a { padding: .3rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); transition: .2s; }
.search-tags a:hover { background: var(--c); color: #fff; border-color: var(--c); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; top: 1.25rem; inset-inline-end: 1.25rem; z-index: 200; display: grid; gap: .6rem; }
.toast { display: flex; align-items: center; gap: .6rem; padding: .8rem 1.1rem; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); border-inline-start: 4px solid; max-width: 380px; animation: slideIn .4s var(--ease); }
.toast-success { border-color: #15803d; } .toast-success svg { color: #15803d; }
.toast-error { border-color: var(--accent); } .toast-error svg { color: var(--accent); }
.toast.hide { opacity: 0; transform: translateY(-10px); transition: .4s; }

/* ---------- Buttons / forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .75rem 1.4rem; border-radius: 12px; border: 0; font-weight: 600; transition: .25s var(--ease); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -12px var(--accent); }
.btn-primary:hover { background: var(--accent-2); transform: translateY(-2px); }
.btn-block { width: 100%; }
input, textarea, select { width: 100%; padding: .8rem 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; transition: .2s; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); background: var(--surface); }
label > span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; color: var(--ink-2); }
.stack-form { display: grid; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.card-surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); box-shadow: var(--shadow); }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.65fr 1fr; gap: 1.25rem; margin-top: 2rem; }
.hero-main, .hero-small { position: relative; overflow: hidden; border-radius: var(--radius); background: #111; isolation: isolate; }
.hero-main { min-height: 540px; }
.hero-side { display: grid; gap: 1.25rem; }
.hero-small { min-height: 260px; }
.hero-media, .hero-media .thumb { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.hero-main:hover img, .hero-small:hover img { transform: scale(1.05); }
.hero-overlay { position: absolute; inset: auto 0 0 0; padding: clamp(1.25rem, 3vw, 2.25rem); color: #fff; z-index: 2; background: linear-gradient(to top, rgba(8,6,4,.92) 0%, rgba(8,6,4,.55) 55%, transparent 100%); padding-top: 6rem; pointer-events: none; }
.hero-overlay a { pointer-events: auto; }
.hero-overlay h1 { font-size: clamp(1.6rem, 3.4vw, 2.6rem); margin: .4rem 0 .6rem; }
.hero-overlay h2 { font-size: clamp(1.1rem, 1.8vw, 1.35rem); margin: .3rem 0 .4rem; }
.hero-overlay p { opacity: .85; max-width: 60ch; margin: 0 0 .8rem; }
.hero-overlay .meta { color: rgba(255,255,255,.75); }
.eyebrow { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); margin-inline-end: .5rem; }
html[dir="rtl"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: .85rem; }

/* ---------- Badges / meta ---------- */
.badge { display: inline-block; padding: .1rem .75rem; border-radius: 999px; font-size: .75rem; font-weight: 600; color: #fff; background: var(--c, var(--accent)); line-height: 1.9; transition: .2s; }
html[data-lang="ur"] .badge { font-size: .72rem; line-height: 2.3; }
.badge:hover { filter: brightness(1.12); }
.meta { display: flex; flex-wrap: wrap; gap: .35rem 1rem; color: var(--muted); font-size: .8rem; }
.meta span { display: inline-flex; align-items: center; gap: .3rem; }

/* ---------- Topics ---------- */
.topics { margin-top: 3rem; }
.section-label { font-size: .85rem; color: var(--muted); font-weight: 600; font-family: var(--font-body); margin-bottom: .9rem; }
.topic-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; }
.topic { position: relative; padding: 1.1rem 1.25rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: .3s var(--ease); display: flex; flex-direction: column; }
.topic::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--c); transition: width .35s var(--ease); z-index: 0; }
.topic > * { position: relative; z-index: 1; }
.topic strong { font-family: var(--font-head); font-size: 1.1rem; }
.topic small { color: var(--muted); font-size: .78rem; transition: color .3s; }
.topic:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: #fff; }
.topic:hover::before { width: 100%; }
.topic:hover small { color: rgba(255,255,255,.8); }

/* ---------- Sections ---------- */
.section-head { display: flex; align-items: center; gap: 1rem; margin: 3.5rem 0 1.5rem; }
.section-title { display: inline-flex; align-items: center; gap: .5rem; font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin: 0; white-space: nowrap; }
.section-rule { flex: 1; height: 8px; background: var(--ajrak) repeat-x center / auto 100%; border-radius: 4px; opacity: .85; }
.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2.5rem; align-items: start; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.card-media { display: block; aspect-ratio: 16/10; overflow: hidden; }
.thumb { width: 100%; height: 100%; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.card:hover .thumb img { transform: scale(1.06); }
.thumb-ph { display: grid; place-items: center; background: linear-gradient(135deg, var(--c), var(--indigo)); position: relative; }
.thumb-ph::after { content: ""; position: absolute; inset: 0; background: var(--ajrak) repeat center / 48px auto; opacity: .12; }
.thumb-ph span { font-family: var(--font-head); font-size: 4rem; color: rgba(255,255,255,.9); z-index: 1; line-height: 1.6; }
.card-body { padding: 1.25rem 1.4rem 1.4rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.card-body .badge { align-self: flex-start; }
.card-title { font-size: 1.22rem; margin: 0; }
.card-title a { background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px; transition: background-size .4s var(--ease); }
html[dir="rtl"] .card-title a { background-position: 100% 100%; }
.card:hover .card-title a { background-size: 100% 1px; }
.card-excerpt { color: var(--ink-2); margin: 0; font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; padding-top: .4rem; }
.card-wide { grid-column: 1 / -1; flex-direction: row; }
.card-wide .card-media { flex: 1.15; aspect-ratio: auto; min-height: 320px; }
.card-wide .card-body { flex: 1; padding: 2rem; justify-content: center; }
.card-wide .card-title { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }

/* ---------- Sidebar ---------- */
.sidebar { display: grid; gap: 1.5rem; position: sticky; top: 110px; margin-top: 3.5rem; }
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.widget-title { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; padding-bottom: .8rem; margin-bottom: 1rem; border-bottom: 1px dashed var(--line); }
.widget-title svg { color: var(--accent); }
.popular-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.popular-list li { display: flex; gap: .9rem; align-items: flex-start; }
.rank { flex-shrink: 0; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); font-weight: 700; color: var(--accent); font-family: var(--font-head); }
.popular-list li:first-child .rank { background: var(--accent); color: #fff; }
.popular-list a { font-weight: 600; font-size: .95rem; line-height: 1.5; display: block; transition: color .2s; }
html[data-lang="ur"] .popular-list a { line-height: 2; }
.popular-list a:hover { color: var(--accent); }
.popular-list small { color: var(--muted); font-size: .75rem; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list a { display: flex; align-items: center; gap: .6rem; padding: .55rem .4rem; border-radius: 10px; transition: .2s; }
.cat-list a:hover { background: var(--surface-2); padding-inline-start: .8rem; }
.cat-list .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); transform: rotate(45deg); }
.cat-list em { margin-inline-start: auto; font-style: normal; font-size: .75rem; background: var(--surface-2); padding: 0 .6rem; border-radius: 999px; color: var(--muted); }
.widget-news { background: linear-gradient(150deg, var(--indigo), #2c1838); color: #f1ebff; border: 0; position: relative; overflow: hidden; }
.widget-news::before { content: ""; position: absolute; inset: auto -20% -40% auto; width: 220px; height: 220px; border-radius: 50%; background: var(--accent); filter: blur(60px); opacity: .55; }
.widget-news > * { position: relative; }
.widget-news .widget-title { border-color: rgba(255,255,255,.18); }
.widget-news .widget-title svg { color: var(--gold); }
.widget-news p { opacity: .85; font-size: .9rem; margin-top: 0; }
.widget-news input { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.widget-news input::placeholder { color: rgba(255,255,255,.6); }

/* ---------- Pagination / empty ---------- */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin: 2.5rem 0 0; }
.pg-btn { min-width: 42px; height: 42px; display: grid; place-items: center; padding: 0 .6rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; transition: .2s; }
.pg-btn:hover { border-color: var(--accent); color: var(--accent); }
.pg-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pg-gap { align-self: center; color: var(--muted); }
html[dir="rtl"] .pagination { flex-direction: row; }
.empty { text-align: center; padding: 4rem 1rem; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty svg { opacity: .5; margin: 0 auto .5rem; }

/* ---------- Page hero ---------- */
.page-hero { position: relative; padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem); background: radial-gradient(1200px 300px at 50% 0, color-mix(in srgb, var(--c, var(--accent)) 16%, transparent), transparent), var(--surface-2); border-bottom: 1px solid var(--line); text-align: center; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 6px; background: var(--ajrak) repeat-x center / auto 100%; opacity: .9; }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3.3rem); margin: .3rem 0 .6rem; }
.page-hero p { color: var(--ink-2); max-width: 60ch; margin: 0 auto 1rem; }
.page-hero .eyebrow { color: var(--c, var(--accent)); }
.pill { display: inline-block; padding: .2rem 1rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.search-inline { display: flex; align-items: center; gap: .6rem; max-width: 620px; margin: 1rem auto 1rem; padding: .4rem .4rem .4rem 1rem; padding-inline-start: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); color: var(--muted); }
.search-inline input { border: 0; background: none; box-shadow: none !important; padding: .5rem 0; }
.page-hero + .container { margin-top: 1rem; }

/* ---------- Article ---------- */
.read-progress { position: fixed; top: 0; inset-inline-start: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--accent), var(--gold)); z-index: 300; transition: width .1s; }
.article-head { text-align: center; padding: clamp(2.5rem, 6vw, 4.5rem) 0 2rem; }
.article-title { font-size: clamp(2rem, 5vw, 3.4rem); margin: 1rem 0; }
.article-lead { font-size: 1.2rem; color: var(--ink-2); margin: 0 auto 1.4rem; max-width: 62ch; }
.article-head .meta { justify-content: center; }
.article-langs { display: inline-flex; gap: .3rem; margin-top: 1.25rem; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.article-langs a { padding: 0 .9rem; border-radius: 999px; font-size: .85rem; line-height: 2.1; }
.article-langs a.active { background: var(--ink); color: var(--bg); }
.article-cover { margin: 0 auto 3rem; }
.article-cover img { width: 100%; max-height: 620px; object-fit: cover; border-radius: calc(var(--radius) + 6px); box-shadow: var(--shadow-lg); }
.article-layout { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 2rem; }
.share-rail { position: sticky; top: 120px; align-self: start; display: grid; gap: .6rem; justify-items: center; }
.share-rail span { font-size: .7rem; color: var(--muted); writing-mode: vertical-rl; margin-bottom: .3rem; }
html[dir="rtl"] .share-rail span { writing-mode: horizontal-tb; }
.share-rail a, .share-rail button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); transition: .25s; }
.share-rail a:hover, .share-rail button:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: scale(1.08); }
.notice { display: flex; gap: .6rem; align-items: flex-start; padding: 1rem 1.2rem; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); font-size: .9rem; margin-bottom: 2rem; }
.notice svg { flex-shrink: 0; color: var(--gold); margin-top: .3em; }

.prose { font-size: 1.12rem; color: var(--ink-2); }
html[data-lang="ur"] .prose, .prose[lang="ur"] { font-size: 1.15rem; line-height: 2.4; }
.prose > * + * { margin-top: 1.3em; }
.prose p { margin: 0; }
.prose h2 { font-size: 1.7rem; color: var(--ink); margin-top: 2em; }
.prose h3 { font-size: 1.35rem; color: var(--ink); margin-top: 1.6em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.prose img { border-radius: var(--radius-sm); margin-inline: auto; }
.prose blockquote { margin: 2em 0; padding: 1.4rem 1.8rem; border-inline-start: 5px solid var(--accent); background: var(--surface); border-radius: var(--radius-sm); font-family: var(--font-head); font-size: 1.3rem; color: var(--ink); position: relative; box-shadow: var(--shadow); }
.prose blockquote::before { content: "”"; position: absolute; top: -.2em; inset-inline-end: .3em; font-size: 5rem; color: var(--accent); opacity: .15; font-family: Georgia, serif; line-height: 1; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--accent); }
.prose code { background: var(--surface-2); padding: .1em .4em; border-radius: 6px; font-size: .9em; }
.prose pre { background: #1c1917; color: #f5f5f4; padding: 1.2rem; border-radius: 12px; overflow: auto; direction: ltr; text-align: left; }
.prose hr { border: 0; height: 8px; background: var(--ajrak) repeat-x center / auto 100%; border-radius: 4px; margin: 2.5em 0; }
.dropcap::first-letter { float: inline-start; font-family: var(--font-head); font-size: 4.2em; line-height: .9; margin-inline-end: .12em; color: var(--accent); font-weight: 700; }
html[dir="rtl"] .dropcap::first-letter { float: none; font-size: inherit; color: inherit; margin: 0; }

.author-box { display: flex; align-items: center; gap: 1rem; margin-top: 3rem; padding: 1.25rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.author-box small { display: block; color: var(--muted); font-size: .8rem; }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-weight: 700; font-size: 1.2rem; color: #fff; background: linear-gradient(135deg, hsl(var(--h, 350) 60% 40%), var(--indigo)); line-height: 1.8; }

/* ---------- Comments ---------- */
.comments { margin-top: 4rem; }
.comments > .section-title { margin-bottom: 1.5rem; }
.comment-list { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: 1rem; }
.comment { display: flex; gap: 1rem; padding: 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); animation: fade .5s; }
.comment-body { flex: 1; min-width: 0; }
.comment-body header { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: baseline; }
.comment-body time { color: var(--muted); font-size: .8rem; }
.comment-body p { margin: .3rem 0 0; color: var(--ink-2); overflow-wrap: anywhere; }
.comment-form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.comment-form h3 { margin: 0; }
.comment-form .btn { justify-self: start; }
.related { margin-top: 2rem; }

/* ---------- About / contact ---------- */
.about { padding: 3rem 0; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 3rem 0; }
.stat { text-align: center; padding: 1.6rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat strong { display: block; font-size: 2.2rem; font-family: var(--font-head); color: var(--accent); line-height: 1.6; }
.stat span { color: var(--muted); }
.lang-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.lang-card { padding: 1.4rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); transition: .3s; text-align: center; }
.lang-card strong { display: block; font-size: 1.5rem; line-height: 2; }
.lang-card small { color: var(--muted); }
.lang-card:hover, .lang-card.active { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.contact-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 2rem; padding: 3rem 0; align-items: start; }
.contact-form .btn { justify-self: start; }
.contact-info { display: grid; gap: 1rem; }
.info-card { display: flex; gap: 1rem; align-items: flex-start; padding: 1.3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.info-card > svg { color: var(--accent); flex-shrink: 0; margin-top: .3rem; }
.info-card small { display: block; color: var(--muted); font-size: .8rem; }
.info-card a { font-weight: 600; direction: ltr; unicode-bidi: embed; }
.not-found { text-align: center; padding: 6rem 0; }
.nf-code { font-size: clamp(6rem, 18vw, 11rem); font-family: var(--font-head); font-weight: 700; line-height: 1.3; background: linear-gradient(135deg, var(--accent), var(--indigo)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 5rem; background: #14110f; color: #d6cfc4; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 2.5rem; padding: 4rem 0 3rem; }
.site-footer h4 { color: #fff; font-size: 1.05rem; margin-bottom: 1rem; }
.site-footer p { color: #a8a29e; font-size: .92rem; }
.brand-light .brand-text small { color: #a8a29e; }
.brand-light .brand-text strong { color: #fff; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.footer-links a { display: flex; align-items: center; gap: .5rem; color: #a8a29e; transition: .2s; }
.footer-links a:hover { color: #fff; padding-inline-start: .3rem; }
.footer-links span { font-size: .7rem; opacity: .7; background: rgba(255,255,255,.08); padding: 0 .5rem; border-radius: 999px; }
.socials { display: flex; gap: .5rem; margin-top: 1rem; }
.socials a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.06); transition: .25s; }
.socials a:hover { background: var(--accent); color: #fff; transform: translateY(-3px); }
.socials-dark a { background: var(--surface-2); }
.newsletter-form { display: flex; gap: .4rem; padding: 5px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.newsletter-form input { border: 0; background: none; color: #fff; padding: .5rem .7rem; box-shadow: none !important; }
.newsletter-form button { flex-shrink: 0; width: 44px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; transition: .2s; }
.newsletter-form button:hover { background: var(--accent-2); }
html[dir="rtl"] .newsletter-form button svg { transform: scaleX(-1); }
.footer-langs { display: flex; gap: .4rem; margin-top: 1rem; }
.footer-langs a { padding: 0 .8rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.15); font-size: .8rem; line-height: 2.2; }
.footer-langs a.active { background: #fff; color: #14110f; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 1.4rem 0; font-size: .85rem; color: #78716c; text-align: center; }

.to-top { position: fixed; bottom: 1.5rem; inset-inline-end: 1.5rem; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(20px); pointer-events: none; transition: .35s var(--ease); z-index: 40; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .reveal { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .with-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 1rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .menu-btn { display: grid; }
  .main-nav { position: fixed; inset: 0 0 0 auto; inset-inline-start: auto; inset-inline-end: 0; width: min(320px, 86vw); height: 100vh; flex-direction: column; align-items: stretch; gap: .2rem; padding: 6rem 1.25rem 2rem; background: var(--surface); box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .4s var(--ease); z-index: 60; overflow-y: auto; }
  html[dir="rtl"] .main-nav { inset-inline-end: auto; inset-inline-start: auto; left: 0; right: auto; transform: translateX(-105%); }
  html[dir="ltr"] .main-nav { right: 0; left: auto; }
  .main-nav.open { transform: none !important; }
  .main-nav > a { padding: .8rem 1rem; font-size: 1.05rem; }
  .main-nav > a::after { display: none; }
  .main-nav > a.active { background: var(--surface-2); color: var(--accent); }
  .mobile-lang { display: flex; gap: .4rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
  .mobile-lang a { flex: 1; text-align: center; padding: .3rem; border-radius: 10px; border: 1px solid var(--line); }
  .mobile-lang a.active { background: var(--accent); color: #fff; border-color: var(--accent); }
  .header-actions { margin-inline-start: auto; }
  .brand-text small { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-main { min-height: 440px; }
  .hero-side { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .today { display: none; }
  .topbar-inner { justify-content: center; }
  .hero-side, .grid, .grid-3, .form-row, .stat-row, .lang-cards, .footer-grid { grid-template-columns: 1fr; }
  .hero-main { min-height: 400px; }
  .card-wide { flex-direction: column; }
  .card-wide .card-media { min-height: 220px; }
  .card-wide .card-body { padding: 1.4rem; }
  .article-layout { grid-template-columns: 1fr; }
  .share-rail { position: static; display: flex; justify-content: center; order: 2; margin-top: 2rem; }
  .share-rail span { writing-mode: horizontal-tb; }
  .section-rule { display: none; }
}
[hidden] { display: none !important; }
