/* =========================================================
   الهيدر المخصص + الوضع الليلي + إمكانية الوصول - Astra Child TQarb
   ========================================================= */
:root{--tq-b:#0b7bc4;--tq-b2:#1d9bf0;--tq-bsoft:#e8f3fb;--tq-fs:1;
	--hd-bg:#fff;--hd-fg:#0f172a;--hd-mut:#64748b;--hd-line:#cfe0ea;--hd-hover:#f1f5f9;--hd-pop:#fff;--hd-pop-line:#e2e8f0}
html[data-tq-theme=dark]{color-scheme:dark;
	--hd-bg:#0b1220;--hd-fg:#e5e7eb;--hd-mut:#94a3b8;--hd-line:#1e2a3f;--hd-hover:#162033;--hd-pop:#111a2b;--hd-pop-line:#233049;
	--tq-bsoft:#0f2a44}

/* إخفاء هيدر Astra الأصلي إن ظهر */
body.tq-hdr #masthead:not(.tq-hd),body.tq-hdr .ast-above-header-wrap,body.tq-hdr .ast-mobile-header-wrap{display:none!important}

.tq-skip{position:absolute;right:-9999px;top:0;background:var(--tq-b);color:#fff;padding:10px 16px;z-index:100000;border-radius:0 0 8px 8px}
.tq-skip:focus{right:12px}

/* ---------- الشريط ---------- */
.tq-hd{position:sticky;top:0;z-index:9999;background:var(--hd-bg);color:var(--hd-fg);border-bottom:1px solid var(--hd-line);direction:rtl;font-family:inherit}
.admin-bar .tq-hd{top:32px}
@media(max-width:782px){.admin-bar .tq-hd{top:46px}}
.tq-hd *{box-sizing:border-box}
.tq-hd-in{max-width:1320px;margin:0 auto;padding:0 20px;height:72px;display:flex;align-items:center;gap:28px}
.tq-logo{display:flex;align-items:center;flex:none;text-decoration:none;color:var(--hd-fg)}
.tq-logo-img{display:block;height:50px;width:auto;max-width:170px;object-fit:contain}
.tq-logo-txt{font-size:22px;font-weight:800;letter-spacing:-.3px}

/* ---------- القائمة ---------- */
.tq-nav{flex:1;min-width:0}
.tq-menu,.tq-menu ul{list-style:none;margin:0;padding:0}
.tq-menu{display:flex;align-items:center;gap:6px;flex-wrap:nowrap}
.tq-menu>li{position:relative}
.tq-menu a{display:flex;align-items:center;gap:6px;padding:10px 12px;font-size:15px;font-weight:500;color:var(--hd-fg);text-decoration:none;border-radius:8px;white-space:nowrap;line-height:1.3;transition:color .2s,background .2s}
.tq-menu a:hover,.tq-menu .current-menu-item>a,.tq-menu .current-menu-ancestor>a,.tq-menu .current-menu-parent>a{color:var(--tq-b2)}
.tq-menu .menu-item-has-children>a::after{content:"";width:6px;height:6px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg) translateY(-2px);margin-inline-start:4px;opacity:.6}
/* قائمة فرعية */
.tq-menu .sub-menu{position:absolute;top:100%;right:0;min-width:210px;background:var(--hd-pop);border:1px solid var(--hd-pop-line);border-radius:12px;padding:8px;box-shadow:0 14px 34px rgba(15,23,42,.14);opacity:0;visibility:hidden;transform:translateY(6px);transition:.2s;z-index:5}
.tq-menu li:hover>.sub-menu,.tq-menu li:focus-within>.sub-menu{opacity:1;visibility:visible;transform:none}
.tq-menu .sub-menu a{padding:9px 12px}
.tq-menu .sub-menu a:hover{background:var(--hd-hover)}
/* عنصر قائمة بأيقونة ذكاء اصطناعي: أضف للعنصر الصنف tq-ai من شاشة القوائم */
.tq-menu .tq-ai>a::before{content:"";width:17px;height:17px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z'/%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 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z'/%3E%3C/svg%3E") center/contain no-repeat}

/* ---------- الأدوات ---------- */
.tq-tools{display:flex;align-items:center;gap:4px;flex:none}
.tq-hd .tq-ib,.tq-search .tq-ib{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;border:0;border-radius:10px;background:transparent;color:var(--hd-fg);cursor:pointer;transition:background .2s,color .2s;line-height:1;box-shadow:none}
.tq-hd .tq-ib:hover,.tq-hd .tq-ib[aria-expanded=true],.tq-search .tq-ib:hover{background:var(--hd-hover);color:var(--tq-b2)}
.tq-hd .tq-ib:focus-visible,.tq-login:focus-visible,.tq-user:focus-visible{outline:2px solid var(--tq-b2);outline-offset:2px}
.tq-i-moon{display:none}
html[data-tq-theme=dark] .tq-i-sun{display:none}
html[data-tq-theme=dark] .tq-i-moon{display:inline-flex}
.tq-i-sun,.tq-i-moon{display:inline-flex}
.tq-burger{display:none!important}

.tq-login{display:inline-flex;align-items:center;margin-inline-start:6px;padding:10px 22px;background:var(--tq-b2);color:#fff!important;border:1px solid var(--tq-b);border-radius:8px;font-size:15px;font-weight:600;text-decoration:none;line-height:1.2;white-space:nowrap;transition:filter .2s,transform .2s}
.tq-login:hover{filter:brightness(.93);transform:translateY(-1px)}

.tq-user{display:inline-flex;align-items:center;gap:4px;margin-inline-start:6px;padding:2px 6px 2px 4px;border:1px solid var(--hd-pop-line);background:transparent;color:var(--hd-fg);border-radius:999px;cursor:pointer}
.tq-user-img{width:34px;height:34px;border-radius:50%;display:block;object-fit:cover}

/* ---------- النوافذ المنبثقة ---------- */
.tq-pop-wrap{position:relative}
.tq-pop[hidden]{display:none}
.tq-pop{position:absolute;top:calc(100% + 10px);left:0;width:260px;background:var(--hd-pop);color:var(--hd-fg);border:1px solid var(--hd-pop-line);border-radius:14px;padding:14px;box-shadow:0 18px 44px rgba(15,23,42,.18);z-index:20;animation:tqPop .18s ease}
.tq-pop-sm{width:218px}
.tq-pop-user{width:230px;padding:8px}
@keyframes tqPop{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
.tq-pop-t{font-size:13px;font-weight:800;color:var(--hd-mut);margin:0 2px 10px}
.tq-fs{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}
.tq-fs button{flex:1;height:38px;border:1px solid var(--hd-pop-line);background:var(--hd-hover);color:var(--hd-fg);border-radius:10px;font-size:15px;font-weight:700;cursor:pointer}
.tq-fs button:hover{border-color:var(--tq-b2);color:var(--tq-b2)}
.tq-fs span{min-width:48px;text-align:center;font-size:13px;color:var(--hd-mut);font-weight:700}
.tq-sw{display:flex;align-items:center;gap:10px;padding:8px 2px;font-size:14px;cursor:pointer}
.tq-sw input{position:absolute;opacity:0;pointer-events:none}
.tq-sw i{position:relative;flex:none;width:38px;height:22px;border-radius:999px;background:#cbd5e1;transition:.2s}
.tq-sw i::after{content:"";position:absolute;top:3px;right:3px;width:16px;height:16px;border-radius:50%;background:#fff;transition:.2s;box-shadow:0 1px 3px rgba(0,0,0,.25)}
.tq-sw input:checked+i{background:var(--tq-b2)}
.tq-sw input:checked+i::after{right:19px}
.tq-sw input:focus-visible+i{outline:2px solid var(--tq-b2);outline-offset:2px}
.tq-hd .tq-reset{width:100%;margin-top:8px;padding:9px;border:1px dashed var(--hd-pop-line);background:transparent;color:var(--hd-mut);border-radius:10px;font-size:13px;cursor:pointer}
.tq-hd .tq-reset:hover{color:var(--tq-b2);border-color:var(--tq-b2)}
.tq-pal{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.tq-hd .tq-sw-c{position:relative;height:42px;border:2px solid transparent;border-radius:12px;background:var(--c);color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0}
.tq-sw-c .tq-hi{opacity:0;transform:scale(.6);transition:.2s}
.tq-sw-c.is-on{border-color:var(--hd-fg)}
.tq-sw-c.is-on .tq-hi{opacity:1;transform:none}
.tq-pop-user a{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:10px;color:var(--hd-fg);text-decoration:none;font-size:14.5px}
.tq-pop-user a:hover{background:var(--hd-hover);color:var(--tq-b2)}
.tq-user-n{padding:8px 12px 10px;border-bottom:1px solid var(--hd-pop-line);margin-bottom:6px}
.tq-user-n strong{display:block;font-size:15px}
.tq-user-n small{display:block;color:var(--hd-mut);font-size:12px;overflow:hidden;text-overflow:ellipsis}

/* ---------- نافذة البحث ---------- */
.tq-search[hidden]{display:none}
.tq-search{position:fixed;inset:0;z-index:100001;background:rgba(15,23,42,.55);backdrop-filter:blur(3px);display:flex;justify-content:center;align-items:flex-start;padding:9vh 16px 16px;animation:tqFade .18s ease}
@keyframes tqFade{from{opacity:0}to{opacity:1}}
.tq-search-box{width:100%;max-width:680px;background:var(--hd-pop);color:var(--hd-fg);border-radius:18px;box-shadow:0 30px 80px rgba(0,0,0,.35);overflow:hidden}
.tq-search-form{display:flex;align-items:center;gap:10px;padding:10px 18px;border-bottom:1px solid var(--hd-pop-line);color:var(--hd-mut)}
.tq-search-form input[type=search]{flex:1;min-width:0;border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;color:var(--hd-fg)!important;font-size:18px;padding:14px 4px!important;font-family:inherit}
.tq-search-res{list-style:none;margin:0;padding:6px;max-height:55vh;overflow:auto}
.tq-search-res li a{display:block;padding:12px 14px;border-radius:10px;color:var(--hd-fg);text-decoration:none;font-size:15.5px;line-height:1.7}
.tq-search-res li a:hover,.tq-search-res li a:focus{background:var(--hd-hover);color:var(--tq-b2);outline:0}
.tq-search-res li.is-msg{padding:16px;color:var(--hd-mut);text-align:center;font-size:14px}
.tq-search-hint{padding:12px 18px;font-size:12.5px;color:var(--hd-mut);border-top:1px solid var(--hd-pop-line)}
body.tq-lock{overflow:hidden}

/* ---------- الجوال ---------- */
.tq-scrim[hidden]{display:none}
.tq-scrim{position:fixed;inset:0;background:rgba(15,23,42,.5);z-index:9998}
@media(max-width:1100px){
	.tq-hd-in{gap:14px;height:64px}
	.tq-burger{display:inline-flex!important;order:-1}
	.tq-logo{margin-inline-end:auto}
	.tq-nav{position:fixed;top:0;right:0;bottom:0;width:min(320px,86vw);background:var(--hd-bg);z-index:10000;padding:72px 14px 20px;overflow:auto;transform:translateX(105%);transition:transform .3s cubic-bezier(.2,.7,.2,1);box-shadow:-18px 0 40px rgba(15,23,42,.2)}
	.tq-nav.is-open{transform:none}
	.tq-menu{flex-direction:column;align-items:stretch;gap:2px}
	.tq-menu a{padding:13px 14px;font-size:16px}
	.tq-menu .sub-menu{position:static;opacity:1;visibility:visible;transform:none;box-shadow:none;border:0;background:transparent;padding:0 14px 0 0}
	.tq-menu .menu-item-has-children>a::after{display:none}
	.tq-login{padding:9px 14px;font-size:14px;margin-inline-start:2px}
	.tq-pop{position:fixed;top:72px;left:12px;right:12px;width:auto}
	.admin-bar .tq-pop{top:118px}
}
@media(max-width:520px){
	.tq-hd-in{padding:0 12px}
	.tq-logo-img{height:42px}
	.tq-hd .tq-ib{width:36px;height:36px}
	#tq-pal-btn{display:none}
}

/* =========================================================
   إمكانية الوصول
   ========================================================= */
html[data-tq-fs] #content{zoom:var(--tq-fs)}
html[data-tq-font] body,html[data-tq-font] body *:not(svg):not(svg *){font-family:Tahoma,"Segoe UI",Arial,sans-serif!important;letter-spacing:0!important}
html[data-tq-links] #content a:not(.tq-login):not([class*=btn]){text-decoration:underline!important;text-underline-offset:3px;background:rgba(255,213,0,.22)}
html[data-tq-calm] *,html[data-tq-calm] *::before,html[data-tq-calm] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
html[data-tq-calm] .tq-js .tq-rv{opacity:1!important;transform:none!important}
html[data-tq-contrast]{filter:contrast(1.25)}
html[data-tq-contrast] body{color:#000}
html[data-tq-contrast][data-tq-theme=dark] body{color:#fff}

/* =========================================================
   الوضع الليلي لبقية الموقع
   ========================================================= */
html[data-tq-theme=dark] body,html[data-tq-theme=dark] #page,html[data-tq-theme=dark] .site,html[data-tq-theme=dark] #content,html[data-tq-theme=dark] .site-content,html[data-tq-theme=dark] .ast-container{background:#0b1220!important;color:#dbe3ee}
html[data-tq-theme=dark] h1,html[data-tq-theme=dark] h2,html[data-tq-theme=dark] h3,html[data-tq-theme=dark] h4,html[data-tq-theme=dark] h5,html[data-tq-theme=dark] h6{color:#f1f5f9}
html[data-tq-theme=dark] .site-footer,html[data-tq-theme=dark] .site-below-footer-wrap,html[data-tq-theme=dark] .site-primary-footer-wrap{background:#080e1a!important;color:#94a3b8}
html[data-tq-theme=dark] .site-footer a{color:#cbd5e1}
html[data-tq-theme=dark] input:not([type=checkbox]):not([type=radio]),html[data-tq-theme=dark] textarea,html[data-tq-theme=dark] select{background:#111a2b;color:#e5e7eb;border-color:#233049}
/* صفحة المقال */
html[data-tq-theme=dark] .tqs-wrap{--ink:#e5e7eb;--mut:#94a3b8;--line:#1e2a3f;--card:#111a2b;--bsoft:#0f2a44;--ok:#34d399;background:#0b1220;color:#e5e7eb}
html[data-tq-theme=dark] .tqs-brief{background:linear-gradient(135deg,#0f1c2e,#0c1626);border-color:#1c3552}
html[data-tq-theme=dark] .tqs-brief p{color:#dbe3ee}
html[data-tq-theme=dark] .tqs-brief-ic{background:#12304f}
html[data-tq-theme=dark] .tqs-brief::after{display:none}
html[data-tq-theme=dark] .tqs-content,html[data-tq-theme=dark] .tqs-content p{color:#dbe3ee}
html[data-tq-theme=dark] .tqs-kw a{background:#162033;color:#cbd5e1}
html[data-tq-theme=dark] .tqs-wrap button.tqs-sbtn,html[data-tq-theme=dark] .tqs-sbtn{background:#111a2b;color:#cbd5e1;border-color:#233049}
html[data-tq-theme=dark] .tqw,html[data-tq-theme=dark] .tqw-ri:hover{background:#111a2b;border-color:#1e2a3f}
html[data-tq-theme=dark] .tqs-badge.is-trust{background:#06281f;border-color:#0b5a43}
html[data-tq-theme=dark] .tq-dot{background:#0b1220}
html[data-tq-theme=dark] .tq-top{background:#111a2b!important}
/* صفحة التصنيف */
html[data-tq-theme=dark] .tq-wrap{background:#0b1220;color:#e5e7eb}
html[data-tq-theme=dark] .tq-wrap .tq-head{background:linear-gradient(135deg,#0f1c2e,#0b1220);border-color:#1e2a3f}
html[data-tq-theme=dark] .tq-wrap .tq-head h1,html[data-tq-theme=dark] .tq-wrap .tq-bc strong{color:#f1f5f9}
html[data-tq-theme=dark] .tq-wrap form.tq-filters select{background-color:#111a2b!important;color:#e5e7eb;border-color:#233049!important}
html[data-tq-theme=dark] .tq-wrap [class*=card],html[data-tq-theme=dark] .tq-wrap article{background:#111a2b;border-color:#1e2a3f;color:#e5e7eb}
html[data-tq-theme=dark] .tq-wrap [class*=card] a,html[data-tq-theme=dark] .tq-wrap article a{color:#e5e7eb}

/* ألوان المقال تتبع لون الموقع المختار */
.tqs-wrap{--b:var(--tq-b);--b2:var(--tq-b2);--bsoft:var(--tq-bsoft)}
