/* ============================================
   قالب بلوجر احترافي عصري - Hady v.1
   تصميم: عصري، RTL، متجاوب
   ============================================ */

/* ===== المتغيرات (CSS Variables) ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #0ea5e9;
    --accent-color: #f59e0b;
    --dark-color: #0f172a;
    --dark-2: #1e293b;
    --dark-3: #334155;
    --light-color: #f8fafc;
    --light-2: #f1f5f9;
    --gray-color: #64748b;
    --gray-light: #cbd5e1;
    --white: #ffffff;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-main: 'Cairo', 'Tajawal', sans-serif;
}

/* الوضع الداكن */
body.dark-mode {
    --light-color: #0f172a;
    --light-2: #1e293b;
    --white: #1e293b;
    --text-color: #e2e8f0;
    --text-light: #94a3b8;
    --border-color: #334155;
    --dark-color: #f8fafc;
}

/* ============================================
   إصلاح ألوان الوضع الداكن (Dark Mode Fix)
   الشريط العلوي + شريط التنقل + الفوتر
   ============================================ */

/* --- الشريط العلوي (Top Bar) --- */
body.dark-mode .top-bar {
    background: #0f172a;
    color: #e2e8f0;
    border-bottom: 1px solid #1e293b;
}
body.dark-mode .top-bar-info span {
    color: #cbd5e1;
}
body.dark-mode .top-bar-info i {
    color: var(--accent-color);
}
body.dark-mode .top-bar-social a {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.08);
}
body.dark-mode .top-bar-social a:hover {
    color: #ffffff;
}

/* --- شريط التنقل العلوي (Navigation Bar) --- */
body.dark-mode .nav-wrapper {
    background: #1e293b;
    border-top-color: #334155;
    border-bottom: 1px solid #334155;
}
body.dark-mode .nav-menu > li > a {
    color: #e2e8f0;
}
body.dark-mode .nav-menu > li > a:hover,
body.dark-mode .nav-menu > li.active > a {
    color: #ffffff;
    background: #0f172a;
}
body.dark-mode .dropdown {
    background: #1e293b;
    border-color: #334155;
}
body.dark-mode .dropdown li a {
    color: #e2e8f0;
}
body.dark-mode .dropdown li a:hover {
    background: #0f172a;
    color: #ffffff;
}

/* --- الفوتر (Footer) --- */
body.dark-mode .footer {
    background: #0f172a;
    color: #cbd5e1;
    border-top: 1px solid #1e293b;
}
body.dark-mode .footer-col h3 {
    color: #f1f5f9;
}
body.dark-mode .footer-about .logo-text h1 {
    color: #f1f5f9;
}
body.dark-mode .footer-about p {
    color: #cbd5e1;
}
body.dark-mode .footer-links a {
    color: #cbd5e1;
}
body.dark-mode .footer-links a:hover {
    color: #ffffff;
}
body.dark-mode .footer-contact p {
    color: #cbd5e1;
}
body.dark-mode .footer-contact i {
    color: var(--primary-light);
}
body.dark-mode .footer-social a {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.08);
}
body.dark-mode .footer-social a:hover {
    color: #ffffff;
}
body.dark-mode .footer-bottom .nt-copyright {
    color: #cbd5e1;
}
body.dark-mode .footer-bottom .nt-copyright a {
    color: var(--primary-light);
}
body.dark-mode .footer-bottom .nt-copyright a:hover {
    color: #ffffff;
}
body.dark-mode .footer-bottom::after {
    box-shadow: 0 0 0 5px #0f172a, 0 8px 18px rgba(37, 99, 235, 0.45);
}

/* --- أكواد المقالات (Code / Pre) --- */
body.dark-mode .single-post-content code {
    background: #0f172a;
    color: #f8fafc;
}
body.dark-mode .single-post-content pre {
    background: #0f172a;
    color: #e2e8f0;
}

/* ===== إعادة الضبط (Reset) ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background-color: var(--light-2);
    color: var(--text-color);
    line-height: 1.7;
    direction: rtl;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== شريط المعلومات العلوي (Top Bar) ===== */
.top-bar {
    background: var(--dark-color);
    color: #fff;
    padding: 8px 0;
    font-size: 13px;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.top-bar-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.top-bar-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.top-bar-info i {
    color: var(--accent-color);
}

.top-bar-social {
    display: flex;
    gap: 12px;
    align-items: center;
}

.top-bar-social a {
    color: #fff;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    font-size: 13px;
    transition: var(--transition);
}

.top-bar-social a:hover {
    transform: translateY(-2px);
    color: #fff;
}

/* ألوان الهوفر حسب كل منصة (Top Bar) */
.top-bar-social a.nt-fb:hover { background: #1877f2; }
.top-bar-social a.nt-x:hover  { background: #000000; }
.top-bar-social a.nt-yt:hover { background: #ff0000; }
.top-bar-social a.nt-ig:hover { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }

/* ===== الهيدر الرئيسي ===== */
.header-main {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    padding: 18px 0;
    transition: var(--transition);
}

.header-main .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    box-shadow: var(--shadow-md);
}

.logo-text h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--dark-color);
    margin: 0;
    line-height: 1.2;
}

.logo-text span {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

/* صندوق البحث */
.search-box {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    font-family: var(--font-main);
    font-size: 14px;
    background: var(--light-2);
    color: var(--text-color);
    transition: var(--transition);
    outline: none;
}

.search-box input:focus {
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-box button:hover {
    background: var(--primary-dark);
    transform: translateY(-50%) scale(1.05);
}

/* أزرار الهيدر */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    width: 42px;
    height: 42px;
    border: 2px solid var(--border-color);
    background: var(--light-2);
    color: var(--text-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: rotate(15deg);
}

.theme-toggle .fa-moon { display: none; }
body.dark-mode .theme-toggle .fa-sun { display: none; }
body.dark-mode .theme-toggle .fa-moon { display: block; }

/* ===== مبدّل الألوان (Color Switcher) ===== */
.color-switcher {
    position: relative;
}

.color-switcher-btn {
    width: 42px;
    height: 42px;
    border: 2px solid var(--border-color);
    background: var(--light-2);
    color: var(--text-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
}

.color-switcher-btn:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    transform: rotate(15deg);
}

.color-switcher-btn.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.color-switcher-panel {
    position: absolute;
    top: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 18px;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.color-switcher-panel::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 16px;
    height: 16px;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
}

.color-switcher.active .color-switcher-panel {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.color-switcher-panel h4 {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 14px;
    text-align: center;
    font-weight: 700;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.color-option {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid transparent;
    background: var(--opt);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    outline: 2px solid var(--border-color);
    outline-offset: 1px;
}

.color-option:hover {
    transform: scale(1.15);
}

.color-option.active {
    border-color: var(--white);
    outline: 3px solid var(--opt);
    transform: scale(1.1);
}

.color-option.active::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
}

/* ===== ثيمات الألوان ===== */
body.theme-green {
    --primary-color: #059669;
    --primary-dark: #047857;
    --primary-light: #10b981;
    --secondary-color: #14b8a6;
}
body.theme-purple {
    --primary-color: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #8b5cf6;
    --secondary-color: #a78bfa;
}
body.theme-red {
    --primary-color: #dc2626;
    --primary-dark: #b91c1c;
    --primary-light: #ef4444;
    --secondary-color: #f87171;
}
body.theme-orange {
    --primary-color: #ea580c;
    --primary-dark: #c2410c;
    --primary-light: #f97316;
    --secondary-color: #fb923c;
}
body.theme-teal {
    --primary-color: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #14b8a6;
    --secondary-color: #2dd4bf;
}
body.theme-pink {
    --primary-color: #db2777;
    --primary-dark: #be185d;
    --primary-light: #ec4899;
    --secondary-color: #f472b6;
}
body.theme-indigo {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --secondary-color: #818cf8;
}

/* ===== القائمة العلوية المنزلقة (Sticky Navigation) ===== */
.nav-wrapper {
    background: var(--white);
    border-top: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 100;
    transition: var(--transition);
}

.nav-wrapper.sticky {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 999;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* مصدر القائمة (أداة قائمة الروابط) مخفي في الواجهة، وتُبنى القائمة منه عبر الجافاسكربت */
.nt-menu-source {
    display: none !important;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    color: var(--text-color);
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    position: relative;
}

.nav-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    left: 50%;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
    transition: var(--transition);
}

.nav-menu > li > a:hover,
.nav-menu > li.active > a {
    color: var(--primary-color);
    background: var(--light-2);
}

.nav-menu > li > a:hover::after,
.nav-menu > li.active > a::after {
    right: 10px;
    left: 10px;
}

.nav-menu > li > a i.fa-chevron-down {
    font-size: 11px;
    transition: var(--transition);
}

.nav-menu > li:hover > a i.fa-chevron-down {
    transform: rotate(180deg);
}

/* القائمة المنسدلة */
.dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 240px;
    background: var(--white);
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-sm);
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.nav-menu > li:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-color);
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.dropdown li a:hover {
    background: var(--light-2);
    color: var(--primary-color);
    padding-right: 18px;
}

.dropdown li a i {
    color: var(--primary-color);
    font-size: 13px;
    width: 20px;
    text-align: center;
}

.dropdown .dropdown {
    top: 0;
    right: 100%;
    margin-right: 5px;
}

.dropdown > li:hover > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* زر القائمة للجوال */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
}

.menu-toggle span {
    width: 26px;
    height: 3px;
    background: var(--dark-color);
    border-radius: 3px;
    transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ===== التخطيط الرئيسي (Main Layout) ===== */
.main-content {
    padding: 30px 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: 30px;
}

@media (max-width: 1140px) and (min-width: 1025px) {
    .content-wrapper {
        grid-template-columns: minmax(0, 1fr) 390px;
    }
}

@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
}

/* ===== عنوان القسم ===== */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 80px;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.4s ease;
}

.section-title h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title h2 i {
    color: var(--primary-color);
}

.section-title .view-all {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.section-title .view-all:hover {
    gap: 10px;
}

/* ===== شبكة المقالات (Posts Grid) ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.post-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-6px);
}

.post-card-img {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.post-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-card-img img {
    transform: scale(1.08);
}

.post-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary-color);
    color: #fff;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
}

.post-card-badge.download {
    background: var(--accent-color);
}

.post-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.post-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-card-content h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 10px;
    line-height: 1.4;
    transition: var(--transition);
}

.post-card:hover h3 {
    color: var(--primary-color);
}

.section-title h2 {
    transition: color 0.3s ease;
    position: relative;
}
.section-title:hover h2 {
    color: var(--primary-color);
}
.section-title h2 i {
    transition: transform 0.3s ease, color 0.3s ease;
}
.section-title:hover h2 i {
    transform: translateY(-3px) scale(1.15);
    animation: titleIconPulse 0.6s ease;
}
.section-title:hover::after {
    width: 100%;
}

.widget-title {
    transition: color 0.3s ease, letter-spacing 0.3s ease;
}
.widget-title:hover {
    color: var(--primary-color);
    letter-spacing: 0.5px;
}
.widget-title:hover::after {
    width: 100%;
}
.widget-title:hover i {
    animation: titleIconPulse 0.6s ease;
}

.footer-col h3 {
    transition: color 0.3s ease, text-shadow 0.3s ease;
}
.footer-col h3:hover {
    color: var(--primary-light);
    text-shadow: 0 0 12px color-mix(in srgb, var(--primary-light) 45%, transparent);
}
.footer-col h3:hover::after {
    width: 100%;
    box-shadow: 0 0 10px color-mix(in srgb, var(--primary-light) 60%, transparent);
}

.post-card .post-title,
.post-card-content h3,
li a.popular-post-title,
li .popular-post-title {
    transition: color 0.3s ease, transform 0.3s ease;
}
.post-card:hover .post-title a,
.post-card:hover .post-card-content h3,
.post-card-content h3:hover {
    color: var(--primary-color);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .post-card:hover .post-title a,
    .post-card:hover .post-card-content h3,
    .post-card-content h3:hover {
        background-image: linear-gradient(120deg, var(--primary-color), var(--primary-light));
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}
h3.post-title a {
    transition: color 0.3s ease;
}
h3.post-title a:hover {
    color: var(--primary-color);
}
.popular-post:hover .popular-post-title {
    color: var(--primary-color);
    transform: translateX(-6px);
}
.popular-post-title:hover {
    color: var(--primary-light);
}

.single-post-header h1 {
    position: relative;
    display: inline-block;
    overflow: hidden;
    transition: color 0.3s ease;
}
.single-post-header h1::before {
    content: '';
    position: absolute;
    top: 0;
    right: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
}
.single-post-header h1:hover {
    color: var(--primary-color);
}
.single-post-header h1:hover::before {
    animation: titleShine 1s ease forwards;
}

.logo-text h1 {
    transition: color 0.3s ease, text-shadow 0.3s ease;
}
.logo:hover .logo-text h1 {
    color: var(--primary-color);
    text-shadow: 0 0 14px color-mix(in srgb, var(--primary-color) 40%, transparent);
}
.logo-icon {
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.logo:hover .logo-icon {
    transform: rotate(-8deg) scale(1.08);
    box-shadow: 0 0 16px color-mix(in srgb, var(--primary-color) 45%, transparent);
}

@keyframes titleIconPulse {
    0%   { transform: scale(1); }
    50%  { transform: translateY(-4px) scale(1.2); }
    100% { transform: translateY(-3px) scale(1.15); }
}
@keyframes titleShine {
    0%   { right: -75%; }
    100% { right: 125%; }
}

body.dark-mode .single-post-header h1::before {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}

@media (prefers-reduced-motion: reduce) {
    .section-title:hover h2 i,
    .widget-title:hover i,
    .single-post-header h1:hover::before,
    .logo:hover .logo-icon {
        animation: none;
    }
    .section-title::after,
    .widget-title::after,
    .footer-col h3::after,
    .logo-icon,
    .logo-text h1,
    .section-title h2,
    .section-title h2 i,
    .widget-title,
    .footer-col h3,
    .popular-post-title,
    .post-card .post-title,
    .post-card-content h3 {
        transition-duration: 0.01ms;
    }
}

.post-card-content h3 .nt-word {
    display: inline-block;
    will-change: transform, opacity, filter;
    transform-origin: 50% 100%;
    transform-style: preserve-3d;
}
.post-card-content h3 .nt-word {
    color: inherit;
}
.post-card-content h3.nt-animating .nt-word {
    opacity: 1;
    filter: blur(0);
    transform: none;
}
.post-card-content h3.nt-animating .nt-word.nt-hidden {
    opacity: 0;
    transform: translateY(14px) rotateX(55deg) scale(0.85);
    filter: blur(4px);
}
.post-card.nt-title-hover h3 {
    color: var(--primary-color);
}
.post-card.nt-title-hover h3::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 0;
    height: 2px;
    width: 0;
    border-radius: 2px;
    background: linear-gradient(to left, var(--primary-color), var(--secondary-color));
    transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.post-card.nt-title-hover h3 {
    position: relative;
}
.post-card.nt-title-hover h3::after {
    width: 100%;
}
.post-card.nt-title-hover h3 .nt-word {
    background-image: none !important;
    -webkit-text-fill-color: currentColor;
}
body.dark-mode .post-card.nt-title-hover h3 {
    color: var(--primary-light);
    text-shadow: 0 0 18px color-mix(in srgb, var(--primary-light) 35%, transparent);
}
body.dark-mode .post-card.nt-title-hover h3::after {
    background: linear-gradient(to left, var(--primary-light), var(--secondary-color));
    box-shadow: 0 0 10px color-mix(in srgb, var(--primary-light) 50%, transparent);
}
@media (prefers-reduced-motion: reduce) {
    .post-card-content h3 .nt-word,
    .post-card.nt-title-hover h3::after {
        transition-duration: 0.01ms !important;
        animation: none !important;
    }
    .post-card.nt-title-hover .nt-word.nt-hidden {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

.post-card-content p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 16px;
    flex: 1;
    line-height: 1.6;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.post-card-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.author-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
}

.read-more-btn {
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.read-more-btn:hover {
    gap: 10px;
    color: var(--primary-dark);
}

/* ===== القسم الرئيسي للمقال (Post Wide) ===== */
.post-wide {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
}

.post-wide .post-card-img {
    height: 100%;
    min-height: 220px;
}

/* ===== القائمة الجانبية (Sidebar) ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.widget {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.widget-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--dark-color);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 50px;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.4s ease;
}

.widget-title i {
    color: var(--primary-color);
}

.widget-search {
    position: relative;
}

.widget-search input {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 14px;
    background: var(--light-2);
    color: var(--text-color);
    transition: var(--transition);
    outline: none;
}

.widget-search input:focus {
    border-color: var(--primary-color);
}

.widget-search button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    background: var(--primary-color);
    color: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.widget-search button:hover {
    background: var(--primary-dark);
}

.popular-post {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.popular-post:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.popular-post:first-child {
    padding-top: 0;
}

.popular-post:hover .popular-post-title {
    color: var(--primary-color);
}

.popular-post-img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.popular-post-info {
    flex: 1;
}

.popular-post-num {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

.popular-post-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.4;
    margin-bottom: 6px;
    transition: var(--transition);
    display: block;
}

.popular-post-meta {
    font-size: 11px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== ترقيم الصفحات (Pagination) ===== */
.blog-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 32px 0;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--dark-color), var(--primary-dark));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    flex-wrap: wrap;
}

.pager-numbers {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
}

.pager-numbers a,
.pager-numbers .page-current {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    color: rgba(255,255,255,0.85);
    font-size: 15px;
    font-weight: 700;
    background: transparent;
    transition: background 0.25s ease, color 0.25s ease;
}

.pager-numbers a + a,
.pager-numbers a + .page-current,
.pager-numbers .page-current + a,
.pager-numbers a + .page-dots,
.pager-numbers .page-dots + a {
    border-right: 1px solid rgba(255,255,255,0.22);
}

.pager-numbers .page-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    color: rgba(255,255,255,0.7);
    font-size: 15px;
    font-weight: 700;
}

.pager-numbers a:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
}

.pager-numbers a.page-current {
    background: var(--accent-color);
    color: #fff;
}

.pager-numbers a.page-current:hover {
    background: var(--accent-color);
}

.pager-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: #fff;
    font-size: 15px;
    background: transparent;
    transition: background 0.25s ease, color 0.25s ease;
}

.pager-arrow:hover {
    background: rgba(255,255,255,0.13);
    color: #fff;
}

.pager-newer {
    border-left: 1px solid rgba(255,255,255,0.22);
    border-right: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.pager-older {
    border-right: 1px solid rgba(255,255,255,0.22);
    border-left: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

body.dark-mode .blog-pager {
    background: linear-gradient(135deg, #0f172a, var(--primary-dark));
}

@media (max-width: 560px) {
    .blog-pager {
        padding: 10px;
        margin: 20px 0;
    }
    .pager-numbers a,
    .pager-numbers .page-current,
    .pager-numbers .page-dots {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 14px;
    }
    .pager-arrow {
        width: 36px;
        height: 36px;
    }
}

/* ===== أرشيف المدونة ===== */
#ArchiveList ul.flat {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 10px;
    padding: 14px;
    background: linear-gradient(160deg, var(--light-2), var(--light-color));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

#ArchiveList ul.flat li.archivedate {
    margin: 0;
    min-width: 0;
    display: flex;
    align-items: stretch;
}

#ArchiveList ul.flat li.archivedate a {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-color);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    overflow: hidden;
    min-height: 100%;
    height: 100%;
    box-sizing: border-box;
}

#ArchiveList ul.flat li.archivedate a::before {
    content: '\f073';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary-color);
    font-size: 13px;
    flex-shrink: 0;
    transition: var(--transition);
}

#ArchiveList ul.flat li.archivedate {
    position: relative;
    font-size: 0;
}
#ArchiveList ul.flat li.archivedate a {
    font-size: 14px;
}

#ArchiveList ul.flat li.archivedate > span,
#ArchiveList ul.flat li.archivedate .post-count {
    background: var(--light-2);
    color: var(--primary-color);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--border-color);
}

#ArchiveList ul.flat li.archivedate a:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    padding-right: 18px;
    box-shadow: var(--shadow-md);
}

#ArchiveList ul.flat li.archivedate a:hover::before {
    color: #fff;
}

body.dark-mode #ArchiveList ul.flat {
    background: linear-gradient(160deg, var(--light-2), var(--light-color));
    border-color: var(--border-color);
}

body.dark-mode #ArchiveList ul.flat li.archivedate a {
    background: var(--white);
    border-color: var(--border-color);
}

@media (max-width: 560px) {
    #ArchiveList ul.flat {
        grid-template-columns: 1fr;
        padding: 12px;
    }
}

/* ===== التصنيفات ===== */
.categories-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
    padding: 14px;
    background: linear-gradient(160deg, var(--light-2), var(--light-color));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.categories-list li {
    margin-bottom: 0;
    min-width: 0;
    display: flex;
    align-items: stretch;
}

.categories-list a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-color);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    overflow: hidden;
    min-height: 100%;
    height: 100%;
    box-sizing: border-box;
}

.categories-list a > span:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    line-height: 1.5;
}

.categories-list a > span:first-child i {
    flex-shrink: 0;
}

.categories-list a:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    padding-right: 18px;
    box-shadow: var(--shadow-md);
}

.categories-list a i {
    color: var(--primary-color);
    transition: var(--transition);
}

.categories-list a:hover i {
    color: #fff;
}

.category-count {
    flex-shrink: 0;
    background: var(--light-2);
    color: var(--primary-color);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--border-color);
}

.categories-list a:hover .category-count {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-color: rgba(255,255,255,0.35);
}

@media (max-width: 560px) {
    .categories-list {
        grid-template-columns: minmax(0, 1fr);
        padding: 12px;
    }
}

.social-widget {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}

.social-link:hover {
    transform: translateY(-3px);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.social-link i {
    font-size: 18px;
}

.social-link.facebook { background: #1877f2; }
.social-link.twitter { background: #000000; }
.social-link.youtube { background: #ff0000; }
.social-link.instagram { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }

.newsletter-widget {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    text-align: center;
}

.newsletter-widget .widget-title {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.2);
}

.newsletter-widget .widget-title::after {
    background: #fff;
}

.newsletter-widget p {
    font-size: 14px;
    margin-bottom: 16px;
    opacity: 0.9;
}

.newsletter-widget input {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 14px;
    margin-bottom: 10px;
    outline: none;
}

.newsletter-widget button {
    width: 100%;
    padding: 12px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-widget button:hover {
    background: #fff;
    color: var(--primary-color);
}

/* ===== الفوتر (Footer) ===== */
.footer {
    background: var(--dark-color);
    color: #cbd5e1;
    padding: 50px 0 34px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 30px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 12px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.footer-about .logo {
    margin-bottom: 16px;
}

.footer-about .logo-text h1 {
    color: #fff;
}

.footer-about p {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 16px;
}

.footer-social {
    display: flex;
    gap: 10px;
}

.footer-social a {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: var(--transition);
}

.footer-social a:hover {
    transform: translateY(-3px);
    color: #fff;
}

/* ألوان الهوفر حسب كل منصة (Footer) */
.footer-social a.nt-fb:hover { background: #1877f2; }
.footer-social a.nt-x:hover  { background: #000000; }
.footer-social a.nt-yt:hover { background: #ff0000; }
.footer-social a.nt-ig:hover { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #cbd5e1;
    font-size: 14px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a::before {
    content: '\f053';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    color: var(--primary-color);
}

.footer-links a:hover {
    color: #fff;
    padding-right: 5px;
}

.footer-contact p {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    margin-bottom: 14px;
}

.footer-contact i {
    color: var(--primary-color);
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* ===== شريط الحقوق — منفصل ومميز بتصميم احترافي ===== */
.footer-bottom {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    padding: 28px 40px;
    text-align: center;
    font-size: 14px;
    background: linear-gradient(135deg, #14243f 0%, #1e3560 50%, #14243f 100%);
    border: 1px solid rgba(96, 165, 250, 0.22);
    border-radius: 18px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* خط علوي متدرج مميز يفصل الشريط عن الفوتر */
.footer-bottom::before {
    content: '';
    position: absolute;
    top: -1px;
    right: 24px;
    left: 24px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color) 18%, var(--primary-light) 50%, var(--primary-color) 82%, transparent);
}

/* زخرفة مركزية (نجمة داخل دائرة متدرجة) أعلى الشريط */
.footer-bottom::after {
    content: '\f005';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: -15px;
    right: 50%;
    transform: translateX(50%);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    box-shadow: 0 0 0 5px var(--dark-color), 0 8px 18px rgba(37, 99, 235, 0.45);
}

.footer-bottom .nt-copyright {
    margin: 0;
    text-align: center;
    line-height: 1.9;
    color: #cbd5e1;
    letter-spacing: 0.2px;
}

.footer-bottom .nt-copyright a {
    color: var(--primary-light);
    font-weight: 700;
    transition: color 0.3s ease;
}

.footer-bottom .nt-copyright a:hover {
    color: #fff;
}

.nt-footer-logo {
    position: absolute;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.55);
    border: none;
    overflow: hidden;
    transition: box-shadow 0.35s ease;
}

.nt-footer-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
    filter: grayscale(100%);
    opacity: 0.8;
    transition: filter 0.4s ease, opacity 0.4s ease;
}

.nt-footer-logo:hover {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.nt-footer-logo:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        gap: 14px;
        padding: 30px 20px;
    }
    .nt-footer-logo {
        position: static;
        transform: none;
    }
}

/* ===== زر العودة للأعلى ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-4px);
}

.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: right;
    z-index: 9999;
    transition: transform 0.3s ease;
}

.loading-bar.active {
    transform: scaleX(1);
}

@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    .sidebar {
        order: 2;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .top-bar {
        display: none;
    }
    .header-main .container {
        flex-wrap: wrap;
    }
    .search-box {
        order: 3;
        max-width: 100%;
        width: 100%;
        margin-top: 12px;
    }
    .logo-text h1 {
        font-size: 18px;
    }
    .menu-toggle {
        display: flex;
    }
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        align-items: stretch;
        padding: 70px 0 20px;
        box-shadow: var(--shadow-xl);
        transition: right 0.3s ease;
        overflow-y: auto;
        z-index: 998;
    }
    .nav-menu.active {
        right: 0;
    }
    .nav-menu > li {
        width: 100%;
    }
    .nav-menu > li > a {
        padding: 14px 20px;
        border-bottom: 1px solid var(--border-color);
    }
    .nav-menu > li > a::after {
        display: none;
    }
    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: var(--light-2);
        margin: 0;
        padding: 5px;
        display: none;
    }
    .nav-menu > li.dropdown-active .dropdown {
        display: block;
    }
    .dropdown .dropdown {
        right: 0;
        margin-right: 0;
    }
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 997;
    }
    .nav-overlay.active {
        display: block;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }
    .post-wide {
        grid-template-columns: 1fr;
    }
    .post-wide .post-card-img {
        height: 200px;
    }
    .section-title h2 {
        font-size: 20px;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .back-to-top {
        bottom: 20px;
        left: 20px;
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .logo-text h1 {
        font-size: 16px;
    }
    .logo-text span {
        font-size: 10px;
    }

    .post-card-content {
        padding: 16px;
    }
    .post-card-content h3 {
        font-size: 15px;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===== صفحة المقال (Single Post) ===== */
.single-post {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.single-post-header {
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.single-post-category {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 16px;
}

.single-post-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--dark-color);
    margin-bottom: 16px;
    line-height: 1.3;
}

.single-post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-size: 14px;
    color: var(--text-light);
    flex-wrap: wrap;
}

.single-post-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.single-post-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.single-post-content {
    padding: 30px;
    font-size: 16px;
    line-height: 1.9;
    color: var(--text-color);
}

.single-post-content h2,
.single-post-content h3 {
    color: var(--dark-color);
    margin: 24px 0 14px;
    font-weight: 700;
}

.single-post-content p {
    margin-bottom: 16px;
}

.single-post-content img {
    border-radius: var(--radius-sm);
    margin: 20px 0;
}

.single-post-content blockquote {
    background: var(--light-2);
    border-right: 4px solid var(--primary-color);
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: var(--radius-sm);
    font-style: italic;
}

.single-post-content code {
    background: var(--dark-color);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
}

.single-post-content pre {
    background: var(--dark-color);
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 20px 0;
    direction: ltr;
    text-align: left;
}

.single-post-content pre code {
    background: none;
    padding: 0;
}

/* ===== تأثير احترافي للقوائم داخل التدوينة (منقّطة + مرقّمة) ===== */
.single-post-content ul,
.single-post-content ol,
.post-body ul,
.post-body ol {
    margin: 22px 0;
    padding: 0;
    list-style: none;
}

/* ---------- القائمة المنقّطة (ul) ---------- */
.single-post-content ul li,
.post-body ul li {
    position: relative;
    padding: 11px 52px 11px 16px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.07), rgba(37, 99, 235, 0));
    border-radius: 12px;
    transition: var(--transition);
}

.single-post-content ul li::before,
.post-body ul li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
    transition: var(--transition);
}

.single-post-content ul li:hover,
.post-body ul li:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.15), rgba(37, 99, 235, 0.02));
    padding-right: 58px;
    transform: translateX(-4px);
}

.single-post-content ul li:hover::before,
.post-body ul li:hover::before {
    transform: translateY(-50%) rotate(360deg) scale(1.12);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.5);
}

/* ---------- القائمة المرقّمة (ol) ---------- */
.single-post-content ol,
.post-body ol {
    counter-reset: nt-list;
}

.single-post-content ol li,
.post-body ol li {
    position: relative;
    counter-increment: nt-list;
    padding: 13px 62px 13px 18px;
    margin-bottom: 12px;
    background: var(--light-2);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    transition: var(--transition);
}

.single-post-content ol li::before,
.post-body ol li::before {
    content: counter(nt-list);
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
    transition: var(--transition);
}

.single-post-content ol li:hover,
.post-body ol li:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.16);
    transform: translateX(-4px);
}

.single-post-content ol li:hover::before,
.post-body ol li:hover::before {
    transform: translateY(-50%) scale(1.12);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.5);
}

/* ---------- القوائم المتداخلة ---------- */
.single-post-content ul ul,
.single-post-content ol ol,
.single-post-content ul ol,
.single-post-content ol ul,
.post-body ul ul,
.post-body ol ol,
.post-body ul ol,
.post-body ol ul {
    margin: 10px 0 4px;
}

.single-post-content ul ul li::before,
.post-body ul ul li::before {
    content: '\f111';
    font-size: 8px;
    background: none;
    color: var(--primary-color);
    box-shadow: none;
    width: 20px;
    height: 20px;
}

.single-post-content ul ul li:hover::before,
.post-body ul ul li:hover::before {
    transform: translateY(-50%) scale(1.2);
    box-shadow: none;
}

.download-box {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    color: #fff;
    margin: 24px 0;
}

.download-box h3 {
    color: #fff;
    font-size: 20px;
    margin-bottom: 8px;
}

.download-box p {
    opacity: 0.9;
    margin-bottom: 16px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent-color);
    color: #fff;
    padding: 14px 32px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 700;
    transition: var(--transition);
}

.download-btn:hover {
    background: #fff;
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    color: #fff;
}

/* ============================================================
   قسم مشاركة المقال الاحترافي (Professional Share Post)
   - أزرار دائرية بألوان المنصات + تأثيرات حركية راقية
   - زر نسخ الرابط + زر الطباعة
   - دعم الوضع الداكن + أنماط الطباعة
   (جميع المتغيرات تحتوي على قيم بديلة لتعمل في أي بيئة)
   ============================================================ */

.share-post {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 28px 28px;
    margin: 32px 0;
    background: linear-gradient(135deg, var(--light-2, #f1f5f9) 0%, var(--white, #ffffff) 55%, var(--light-2, #f1f5f9) 100%);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
    /* overflow: visible — لضمان عدم قص الأيقونات أو تأثيرات التمرير */
    overflow: visible;
}

/* الخط العلوي المتدرّج — ظاهر بالكامل بحواف علوية مستديرة مطابقة للبطاقة */
.share-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    border-radius: calc(var(--radius-lg, 16px) - 1px) calc(var(--radius-lg, 16px) - 1px) 0 0;
    background: linear-gradient(90deg, #1877f2 0%, #0ea5e9 25%, #25d366 50%, #f59e0b 75%, #e60023 100%);
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.28);
    z-index: 2;
}

/* اسم القسم مخفي (كما طُلب) — لإظهاره احذف السطر التالي */
.share-post-title { display: none; }

.share-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 2px 0;
}

.share-buttons a,
.share-buttons button {
    position: relative;
    width: 50px;
    height: 50px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    overflow: visible;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2);
    transition: transform .28s cubic-bezier(.34, 1.56, .64, 1), box-shadow .28s ease, filter .28s ease;
    -webkit-tap-highlight-color: transparent;
}

.share-buttons a i,
.share-buttons button i {
    display: block;
    line-height: 1;
}

.share-buttons a:hover,
.share-buttons button:hover {
    transform: translateY(-5px) scale(1.08);
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.32);
    filter: brightness(1.06);
    z-index: 3;
}

.share-buttons a:active,
.share-buttons button:active {
    transform: translateY(-2px) scale(.97);
}

.share-buttons a:focus-visible,
.share-buttons button:focus-visible {
    outline: 3px solid var(--primary-light, #3b82f6);
    outline-offset: 3px;
}

.share-buttons .facebook  { background: linear-gradient(135deg, #1877f2, #0b5fce); }
.share-buttons .twitter   { background: linear-gradient(135deg, #2b2b2b, #000000); }
.share-buttons .whatsapp  { background: linear-gradient(135deg, #25d366, #128c7e); }
.share-buttons .telegram  { background: linear-gradient(135deg, #2aabee, #0088cc); }
.share-buttons .linkedin  { background: linear-gradient(135deg, #0a66c2, #004182); }
.share-buttons .pinterest { background: linear-gradient(135deg, #e60023, #ad081b); }

.share-buttons .share-copy  { background: linear-gradient(135deg, var(--primary-light, #3b82f6), var(--primary-dark, #1e40af)); }
.share-buttons .share-print { background: linear-gradient(135deg, var(--dark-3, #334155), var(--dark-color, #0f172a)); }
.share-buttons .share-copy.copied { background: linear-gradient(135deg, #22c55e, #15803d); }

.share-divider {
    width: 1px;
    height: 32px;
    background: var(--border-color, #e2e8f0);
    margin: 0 6px;
    border-radius: 2px;
}

.share-toast {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(.85);
    background: var(--dark-color, #0f172a);
    color: #fff;
    font-family: var(--font-main, 'Cairo', 'Tajawal', sans-serif);
    font-size: 13px;
    font-weight: 700;
    padding: 9px 20px;
    border-radius: 30px;
    box-shadow: var(--shadow-xl, 0 20px 25px rgba(0, 0, 0, 0.1));
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    z-index: 8;
    transition: opacity .25s ease, transform .25s cubic-bezier(.34, 1.56, .64, 1);
}

.share-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ===== الوضع الداكن ===== */
body.dark-mode .share-post {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 55%, #1e293b 100%);
    border-color: #334155;
}
body.dark-mode .share-divider { background: #334155; }
body.dark-mode .share-buttons .share-print { background: linear-gradient(135deg, #475569, #334155); }

/* ===== استجابة الجوال ===== */
@media (max-width: 480px) {
    .share-post { padding: 22px 14px; gap: 10px; }
    .share-buttons { gap: 10px; }
    .share-buttons a,
    .share-buttons button { width: 46px; height: 46px; font-size: 18px; }
    .share-divider { display: none; }
}

/* ===== أنماط الطباعة (Print) — تُطبع المقالة فقط ===== */
@media print {
    .top-bar, .header-main, .nav-wrapper, .nav-overlay,
    .sidebar, .footer, .back-to-top, #hady-tooltip, .theme-toggle, .menu-toggle,
    .color-switcher-btn, .post-font-tools, .share-post, .nt-author-card,
    .related-posts-section, .comments-section, .blog-pager, .newsletter-widget,
    .widget, .nt-menu-source { display: none !important; }

    html, body { background: #fff !important; color: #000 !important; }
    .main-content, .main-content .container, .main-area, .single-post {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: 0 !important;
        background: #fff !important;
    }
    .single-post-header { margin: 0 0 14px !important; }
    .single-post-header h1 { font-size: 22pt !important; color: #000 !important; }
    .single-post-meta { color: #333 !important; }
    .single-post-content { font-size: 12.5pt !important; line-height: 1.8 !important; color: #000 !important; }
    .single-post-content img, .single-post-img { max-width: 100% !important; page-break-inside: avoid; }
    .single-post-content a { color: #000 !important; text-decoration: underline !important; }
    .single-post-content pre, .single-post-content code {
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
        background: #f5f5f5 !important;
        color: #000 !important;
    }
}

/* ============================================================
   صندوق الكاتب الاحترافي (NT Author Card)
   ============================================================ */
.nt-author-card {
    position: relative;
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 22px;
    margin: 26px 0 14px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(37, 99, 235, .07), rgba(14, 165, 233, .05));
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.nt-author-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(37, 99, 235, .35);
}
.nt-author-card__glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(520px 180px at 100% 0%, rgba(37, 99, 235, .14), transparent 70%);
    pointer-events: none;
}
.nt-author-card__avatar {
    position: relative;
    flex: none;
    width: 86px;
    height: 86px;
    border-radius: 24px;
    padding: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 10px 24px rgba(37, 99, 235, .3);
}
.nt-author-card__initial {
    width: 100%;
    height: 100%;
    border-radius: 21px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    color: var(--primary-color);
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
}
.nt-author-card__badge {
    position: absolute;
    bottom: -5px;
    left: -5px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 3px solid var(--white);
    box-shadow: var(--shadow-md);
}
.nt-author-card__body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.nt-author-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.nt-author-card__name {
    font-size: 19px;
    font-weight: 800;
    color: var(--dark-color);
    margin: 0 0 6px;
}
.nt-author-card__role {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(37, 99, 235, .1);
    padding: 4px 12px;
    border-radius: 999px;
}
.nt-author-card__follow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 9px 18px;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .32);
    transition: var(--transition);
}
.nt-author-card__follow:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, .45);
}
.nt-author-card__bio {
    font-size: 14.5px;
    line-height: 1.9;
    color: var(--text-light);
    margin: 12px 0;
}
.nt-author-card__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-light);
}
.nt-author-card__stats span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nt-author-card__stats i { color: var(--primary-color); }

/* ============================================================
   القسم + الوسوم (NT Taxonomy)
   ============================================================ */
.nt-taxonomy {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 20px;
    margin: 0 0 24px;
    border-radius: var(--radius-lg);
    background: var(--light-2);
    border: 1px solid var(--border-color);
}
.nt-taxonomy__row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}
.nt-taxonomy__label {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 84px;
    padding-top: 7px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-light);
}
.nt-taxonomy__label i { color: var(--primary-color); font-size: 13px; }
.nt-taxonomy__items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.nt-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .3);
    transition: var(--transition);
}
.nt-cat-chip::before {
    content: '\f07b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 11px;
}
.nt-cat-chip:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(37, 99, 235, .42); }
.nt-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 15px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-color);
    background: var(--white);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: var(--transition);
}
.nt-tag-chip::before {
    content: '#';
    font-weight: 800;
    color: var(--primary-color);
}
.nt-tag-chip:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, .3);
}
.nt-tag-chip:hover::before { color: #fff; }
.nt-tag-chip--auto { border-style: dashed; }

body.dark-mode .nt-author-card {
    background: linear-gradient(135deg, rgba(37, 99, 235, .14), rgba(14, 165, 233, .08));
}
body.dark-mode .nt-author-card__initial { background: var(--dark-2); }
body.dark-mode .nt-author-card__badge { border-color: var(--dark-2); }
body.dark-mode .nt-tag-chip { background: var(--dark-2); }

@media (max-width: 640px) {
    .nt-author-card { flex-direction: column; align-items: center; text-align: center; }
    .nt-author-card__top { flex-direction: column; align-items: center; gap: 10px; }
    .nt-author-card__stats { justify-content: center; }
    .nt-taxonomy__row { flex-direction: column; gap: 8px; }
    .nt-taxonomy__label { padding-top: 0; }
}

/* ============================================================
   مقالات ذات صلة - Related Posts Section
   ============================================================ */
.related-posts-section {
    margin: 30px;
    padding-top: 10px;
}
.related-posts-section .section-title {
    margin-bottom: 20px;
}
.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 992px) {
    .related-posts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .related-posts-grid { grid-template-columns: 1fr; }
}

.related-post-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(25px) scale(0.96);
}
.related-post-card.nt-rp-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.related-post-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-8px) scale(1.01) !important;
    border-color: var(--primary-color);
}

.related-post-thumb {
    position: relative;
    height: 150px;
    overflow: hidden;
    background: var(--light-2);
    display: block;
}
.related-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s cubic-bezier(.22,1,.36,1), filter .4s ease;
}
.related-post-card:hover .related-post-thumb img {
    transform: scale(1.12) rotate(0.4deg);
}
.related-post-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15,23,42,0.55), transparent 60%);
    opacity: 0;
    transition: opacity .35s ease;
}
.related-post-card:hover .related-post-thumb::after {
    opacity: 1;
}
.related-post-thumb .related-read-icon {
    position: absolute;
    bottom: -40px;
    right: 14px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: bottom .4s cubic-bezier(.22,1,.36,1);
    box-shadow: var(--shadow-md);
    z-index: 2;
}
.related-post-card:hover .related-read-icon {
    bottom: 12px;
}

.related-post-body {
    padding: 14px 16px;
}
.related-post-body .related-cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-color);
    background: var(--light-2);
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}
.related-post-body h4 {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--dark-color);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .3s ease;
}
.related-post-card:hover .related-post-body h4 {
    color: var(--primary-color);
}
.related-post-body a {
    text-decoration: none;
}
.related-post-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--text-light);
}
.related-post-meta i {
    color: var(--primary-color);
}

.related-posts-loading,
.related-posts-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 14px;
}
.related-posts-loading i {
    animation: ntSpin 0.9s linear infinite;
    margin-left: 6px;
    color: var(--primary-color);
}
@keyframes ntSpin {
    to { transform: rotate(360deg); }
}

body.dark-mode .related-post-card {
    background: var(--white);
    border-color: var(--border-color);
}
body.dark-mode .related-post-body .related-cat {
    background: var(--dark-3);
}

@media (prefers-reduced-motion: reduce) {
    .related-post-card {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* التعليقات */
.comments-section {
    padding: 30px;
}

.comments-section h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 20px;
}

.comment {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.comment:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--light-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 20px;
    flex-shrink: 0;
}

.comment-info h5 {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 4px;
}

.comment-info .comment-date {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.comment-info p {
    font-size: 14px;
    color: var(--text-color);
}

/* ============================================
   نظام التعليقات الاحترافي (NT Pro Comments v3)
   إعادة تصميم كاملة:
   • بطاقات أنيقة مع خط جانبي متحرّك ولمعة عند المرور
   • تمييز تعليق الكاتب (تاج ذهبي + شارة "الكاتب")
   • تمييز الردود (خيط ترابط + شارة "ردّ على ...")
   • تمييز تعليق الزائر/المجهول (شارة "زائر" + مظهر محايد)
   ============================================ */

/* --- الحاوية العامة --- */
.comments.nt-blogger-cmts {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    box-shadow: 0 18px 50px -30px rgba(15, 23, 42, .35);
    padding: 26px 26px 22px;
    overflow: hidden;
    position: relative;
}
.comments.nt-blogger-cmts::before {
    content: '';
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

/* --- العنوان + عدّاد التعليقات --- */
.comments.nt-blogger-cmts .comments-title,
.comments.nt-blogger-cmts h3.title {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-main);
    font-size: 22px;
    font-weight: 800;
    color: var(--dark-color);
    margin: 0 0 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}
.comments.nt-blogger-cmts h3.title::before {
    content: '\f086';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 17px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 13px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 10px 22px -10px rgba(37, 99, 235, .8);
}
.nt-cmt-count {
    margin-inline-start: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 800;
    color: var(--primary-color);
    background: rgba(37, 99, 235, .09);
    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: 999px;
    padding: 5px 14px;
    line-height: 1;
}
.nt-cmt-count::before {
    content: '\f075';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 11px;
}

/* --- القائمة والحاوية --- */
.comments-content { position: relative; }
#comment-holder { font-family: var(--font-main); }
#comment-holder ol,
#comment-holder ul { list-style: none; margin: 0; padding: 0; }
.comments .comment-thread { margin: 0; padding: 0; list-style: none; }

/* --- بطاقة التعليق (شبكة: صورة + بطاقة) --- */
.comments .comment {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 13px;
    padding: 0 0 16px;
    margin: 0;
    list-style: none;
}
.comments .comment:not(:has(> .avatar-image-container)) {
    grid-template-columns: minmax(0, 1fr);
}
.comments .comment > .avatar-image-container { grid-column: 1; grid-row: 1; }
.comments .comment > .comment-block { grid-column: 2; grid-row: 1; }
.comments .comment:not(:has(> .avatar-image-container)) > .comment-block { grid-column: 1; }
.comments .comment > .comment-replies { grid-column: 1 / -1; grid-row: 2; }
.comments .comment:last-child { padding-bottom: 0; }

/* --- بطاقة التعليق + الهوفر الاحترافي --- */
.comments .comment .comment-block {
    position: relative;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 18px;
    margin: 0;
    overflow: hidden;
    transition: transform .45s cubic-bezier(.22, 1, .36, 1),
                box-shadow .45s cubic-bezier(.22, 1, .36, 1),
                border-color .45s ease,
                background-color .45s ease;
}
.comments .comment .comment-block::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    border-radius: 999px;
    background: var(--nt-accent, var(--primary-color));
    opacity: 0;
    transition: height .5s cubic-bezier(.22, 1, .36, 1), opacity .35s ease;
    pointer-events: none;
    z-index: 2;
}
.comments .comment .comment-block::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%);
    transform: translateX(-130%);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}
.comments .comment .comment-block:hover {
    transform: translateY(-3px);
    border-color: var(--nt-accent, var(--primary-color));
    box-shadow: 0 20px 40px -20px rgba(15, 23, 42, .38),
                0 6px 16px -10px rgba(15, 23, 42, .18);
}
.comments .comment .comment-block:hover::before {
    height: 72%;
    opacity: 1;
}
.comments .comment .comment-block:hover::after {
    animation: ntSheen .85s cubic-bezier(.4, 0, .2, 1) forwards;
}
@keyframes ntSheen {
    0%   { transform: translateX(-130%); opacity: 0; }
    25%  { opacity: .6; }
    100% { transform: translateX(130%); opacity: 0; }
}

/* --- رأس التعليق --- */
.comments .comment-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
}
.comments .comment-header .user,
.comments .comment-header cite.user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    color: var(--dark-color);
    font-style: normal;
    text-decoration: none;
    transition: color .3s ease;
}
.comments .comment-header .user a,
.comments .comment-header cite.user a {
    color: inherit;
    text-decoration: none;
    font: inherit;
    background: none;
    border: 0;
    padding: 0;
    transition: color .3s ease;
}
.comments .comment-header .user a:hover,
.comments .comment-header cite.user a:hover {
    color: var(--primary-color);
}
.comments .comment-header .datetime a,
.comments .comment-header .datetime,
.comments .comment-header .datetime2 a {
    font-size: 12px;
    color: var(--text-light);
    text-decoration: none;
    margin-inline-start: auto;
}
.comments .comment-header .datetime a:hover { color: var(--primary-color); }

/* --- شارة الكاتب (تاج ذهبي) --- */
.comments .comment-header .icon.blog-author,
.comments .comment-header .nt-blogger-author-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #ffffff;
    border-radius: 999px;
    padding: 4px 12px;
    line-height: 1;
    font-weight: 800;
    font-size: 11px;
    white-space: nowrap;
    box-shadow: 0 6px 16px -4px rgba(245, 158, 11, .7), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.comments .comment-header .icon.blog-author { font-size: 0; }
.comments .comment-header .icon.blog-author::before,
.comments .comment-header .nt-blogger-author-badge::before {
    content: '\f521';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 11px;
    line-height: 1;
}
.comments .comment-header .icon.blog-author::after,
.comments .comment-header .nt-blogger-author-badge::after {
    content: '\0627\0644\0643\0627\062A\0628';
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    margin-inline-start: 2px;
}

/* --- شارة الرد (ردّ على ...) --- */
.nt-reply-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 220px;
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    color: #0369a1;
    border: 1px solid rgba(3, 105, 161, .2);
    border-radius: 999px;
    padding: 3px 11px;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nt-reply-badge::before {
    content: '\f3e5';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 9px;
    flex-shrink: 0;
}

/* --- شارة الزائر/المجهول --- */
.nt-guest-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #475569;
    border: 1px solid rgba(71, 85, 105, .2);
    border-radius: 999px;
    padding: 3px 11px;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}
.nt-guest-badge::before {
    content: '\f007';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 9px;
}

/* --- محتوى التعليق --- */
.comments .comment-content,
.comments .comment-body {
    font-size: 15px;
    line-height: 1.9;
    color: var(--text-color);
    margin: 0 0 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.comments .comment-content a,
.comments .comment-body a {
    color: var(--primary-color);
    text-decoration: underline;
}
.comments .comment-body.deleted,
.comments .comment-content.deleted {
    color: var(--text-light);
    font-style: italic;
}

/* --- أزرار الإجراءات --- */
.comments .comment-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
}
.comments .comment-actions a,
.comments .comment-actions .item-control a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--light-2);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
}
.comments .comment-actions a:hover,
.comments .comment-actions .item-control a:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    color: #ffffff;
    background: var(--primary-color);
    box-shadow: 0 8px 18px -6px rgba(37, 99, 235, .5);
}
.comments .comment-actions a:active,
.comments .comment-actions .item-control a:active { transform: translateY(0); }

.comments .comment-actions a.comment-reply {
    background: linear-gradient(135deg, #10b981, #059669);
    border: 1px solid rgba(5, 150, 105, .35);
    color: #ffffff;
    box-shadow: 0 4px 12px -4px rgba(16, 185, 129, .45);
}
.comments .comment-actions a.comment-reply::before {
    content: '\f112';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    line-height: 1;
    transition: transform .3s ease;
}
.comments .comment-actions a.comment-reply:hover {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: #047857;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px -8px rgba(5, 150, 105, .6);
}
.comments .comment-actions a.comment-reply:hover::before { transform: translateX(-3px); }

.comments .comment-actions .item-control { display: inline-flex; }
.comments .comment-actions .item-control a {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid rgba(220, 38, 38, .25);
    color: #dc2626;
}
.comments .comment-actions .item-control a::before {
    content: '\2715';
    font-size: 10px;
    line-height: 1;
    font-weight: 900;
}
.comments .comment-actions .item-control a:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border-color: #b91c1c;
    color: #ffffff;
    box-shadow: 0 8px 20px -6px rgba(220, 38, 38, .55);
}
.comments .comment-actions.secondary-text a {
    background: none;
    border: none;
    color: var(--primary-color);
    padding: 0;
}
.comments .comment-actions.secondary-text a:hover { text-decoration: underline; }

/* --- الردود (تمييز الرد على التعليق) --- */
.comments .comment-replies,
.comments .comment-thread .comment-replies {
    clear: both;
    display: block;
    float: none;
    width: auto;
    position: relative;
    margin: 14px 0 0;
    margin-inline-start: 56px;
    padding: 18px 18px 8px;
    padding-inline-start: 24px;
    background: linear-gradient(180deg, rgba(37, 99, 235, .06), rgba(14, 165, 233, .02));
    border: 1px solid rgba(37, 99, 235, .16);
    border-radius: 18px;
    overflow: visible;
}
/* خيط الترابط العمودي */
.comments .comment-replies::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 18px;
    bottom: 18px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, #2563eb, #0ea5e9);
}
.comments .comment-replies .comment-thread { margin: 0; }
.comments .comment-replies .comment-thread .comment { padding: 0 0 12px; }
.comments .comment-replies .comment:last-child { padding-bottom: 2px; }
.comments .comment-replies .comment-block {
    background: rgba(255, 255, 255, .8);
    border: 1px solid rgba(37, 99, 235, .18);
}
.comments .comment-replies .comment-block:hover {
    border-color: #0ea5e9;
    box-shadow: 0 18px 34px -18px rgba(14, 165, 233, .5);
}
/* سهم الرد قبل اسم المعلّق */
.comments .comment-replies .comment-header .user::before,
.comments .comment-replies .comment-header cite.user::before {
    content: '\f3e5';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 11px;
    line-height: 1;
    color: #2563eb;
    margin-inline-end: 2px;
}
.comments .comment-replies .comment-header .user a:hover,
.comments .comment-replies .comment-header cite.user a:hover { color: #2563eb; }

/* --- زر طي/فتح الردود --- */
.comments .thread-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
}
.comments .thread-toggle .thread-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-inline-start: 6px solid var(--primary-color);
    border-block: 5px solid transparent;
    transition: var(--transition);
}
.comments .thread-toggle .thread-arrow.open { transform: rotate(90deg); }
.comments .continue a {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}
.comments .continue a:hover { text-decoration: underline; }

/* --- صورة المعلّق --- */
.comments .avatar-image-container {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--light-2);
    border: 2px solid var(--border-color);
    flex-shrink: 0;
    transition: border-color .4s ease, box-shadow .4s ease, transform .4s ease;
}
.comments .avatar-image-container img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
}
.comments .comment:hover > .avatar-image-container {
    transform: scale(1.05);
    border-color: var(--nt-accent, var(--primary-color));
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

/* --- تعليق الكاتب (تمييز قوي) --- */
.comments .comment.nt-author > .comment-block {
    --nt-accent: #f59e0b;
    background: linear-gradient(180deg, rgba(255, 247, 224, .95), var(--white) 62%);
    border-color: rgba(245, 158, 11, .45);
    box-shadow: 0 10px 28px -18px rgba(245, 158, 11, .6), inset 0 3px 0 0 rgba(245, 158, 11, .85);
}
.comments .comment.nt-author > .comment-block:hover {
    border-color: #f59e0b;
    box-shadow: 0 22px 42px -22px rgba(245, 158, 11, .7),
                0 6px 18px -10px rgba(245, 158, 11, .4),
                inset 0 3px 0 0 #f59e0b;
}
.comments .comment.nt-author > .avatar-image-container {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .25);
}
.comments .comment.nt-author > .avatar-image-container::after {
    content: '\f521';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 8px;
    color: #ffffff;
    position: absolute;
    inset-block-end: -2px;
    inset-inline-end: -2px;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(217, 119, 6, .6);
    z-index: 3;
}
.comments .comment.nt-author > .avatar-image-container { position: relative; overflow: visible; }

/* --- تعليق الزائر/المجهول --- */
.comments .comment.nt-anon > .comment-block {
    --nt-accent: #64748b;
    background: linear-gradient(180deg, rgba(241, 245, 249, .9), var(--white) 62%);
    border-color: rgba(100, 116, 139, .32);
    border-style: dashed;
}
.comments .comment.nt-anon > .comment-block:hover {
    border-color: #64748b;
    box-shadow: 0 22px 42px -22px rgba(100, 116, 139, .55);
}
.comments .comment.nt-anon > .avatar-image-container {
    border-color: #cbd5e1;
    background: #f1f5f9;
}
.comments .comment.nt-anon .comment-header .user,
.comments .comment.nt-anon .comment-header cite.user { color: #475569; }

/* --- ألوان التعليقات المتنوعة (لمسات خفيفة) --- */
.comments .comment[data-nt-color="1"] .comment-block { --nt-accent: #3b82f6; }
.comments .comment[data-nt-color="2"] .comment-block { --nt-accent: #8b5cf6; }
.comments .comment[data-nt-color="3"] .comment-block { --nt-accent: #ec4899; }
.comments .comment[data-nt-color="4"] .comment-block { --nt-accent: #10b981; }
.comments .comment[data-nt-color="5"] .comment-block { --nt-accent: #f59e0b; }
.comments .comment[data-nt-color="6"] .comment-block { --nt-accent: #06b6d4; }

/* --- دعم البنية القديمة (تعليقات غير مترابطة) --- */
.comments #comments-block .comment .comment-author {
    font-weight: 800;
    color: var(--dark-color);
    margin-bottom: 6px;
}
.comments #comments-block .comment .comment-author a {
    color: inherit;
    text-decoration: none;
}
.comments #comments-block .comment .comment-body { margin: 0 0 6px; }
.comments .comment-footer { font-size: 12px; color: var(--text-light); }
.comments .comment-footer a { color: var(--primary-color); text-decoration: none; }
.comments .comment-footer a:hover { text-decoration: underline; }

/* --- ترقيم الصفحات --- */
.comments .paging-control-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 0;
    font-size: 13px;
}
.comments .comment-range-text { color: var(--text-light); font-size: 12px; }
.comments .paging-control-container a {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}
.comments .paging-control-container a:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* --- نموذج التعليق --- */
.comments .comment-form,
.comment-form {
    margin-top: 22px;
    padding: 20px;
    background: linear-gradient(180deg, rgba(37, 99, 235, .05), var(--light-2));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}
.comment-form h4#comment-post-message {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 800;
    color: var(--dark-color);
    margin: 0 0 6px;
}
.comment-form h4#comment-post-message::before {
    content: '\f27a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary-color);
}
.comment-form > p { font-size: 13px; color: var(--text-light); margin: 0 0 12px; }
.comment-form iframe#comment-editor,
iframe.blogger-comment-from-post,
iframe.blogger-iframe-colorize {
    width: 100% !important;
    min-height: 220px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--white);
}
#comment-editor-src { display: none; }
.comments .comment-replybox-thread,
.comments .comment-replybox-single {
    margin: 12px 0 0;
    padding-inline-start: 18px;
}

/* --- حالة عدم وجود تعليقات --- */
.nt-cmt-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    padding: 34px 16px;
    color: var(--text-light);
}
.nt-cmt-empty i {
    font-size: 30px;
    color: var(--primary-color);
    opacity: .55;
}
.nt-cmt-empty span { font-size: 14px; font-weight: 700; }

/* --- الوضع الداكن --- */
body.dark-mode .comments.nt-blogger-cmts {
    background: var(--dark-2);
    border-color: var(--dark-3);
    box-shadow: 0 18px 50px -30px rgba(0, 0, 0, .7);
}
body.dark-mode .comments.nt-blogger-cmts h3.title {
    color: var(--dark-color);
    border-bottom-color: var(--dark-3);
}
body.dark-mode .nt-cmt-count {
    color: #93c5fd;
    background: rgba(59, 130, 246, .16);
    border-color: rgba(59, 130, 246, .3);
}
body.dark-mode .comments .comment-block {
    background: var(--dark-2);
    border-color: var(--dark-3);
}
body.dark-mode .comments .comment .comment-block::after {
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .12) 50%, transparent 65%);
}
body.dark-mode .comments .comment .comment-block:hover {
    border-color: var(--nt-accent, var(--primary-light));
}
body.dark-mode .comments .comment-header { border-bottom-color: var(--dark-3); }
body.dark-mode .comments .comment-header .user,
body.dark-mode .comments .comment-header cite.user { color: var(--dark-color); }
body.dark-mode .comments .comment-actions a,
body.dark-mode .comments .comment-actions .item-control a {
    background: var(--dark-3);
    color: var(--text-color);
    border-color: var(--dark-3);
}
body.dark-mode .comments .comment-actions a:hover { background: var(--primary-color); color: #ffffff; }
body.dark-mode .comments .comment-actions a.comment-reply {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: rgba(16, 185, 129, .4);
    color: #ffffff;
}
body.dark-mode .comments .comment-actions a.comment-reply:hover {
    background: linear-gradient(135deg, #10b981, #059669);
}
body.dark-mode .comments .comment-actions .item-control a {
    background: rgba(220, 38, 38, .15);
    color: #fca5a5;
    border-color: rgba(220, 38, 38, .35);
}
body.dark-mode .comments .comment-actions .item-control a:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff;
}
body.dark-mode .comments .avatar-image-container {
    background: var(--dark-3);
    border-color: var(--dark-3);
}
body.dark-mode .comments .comment-replies {
    background: linear-gradient(180deg, rgba(37, 99, 235, .14), rgba(14, 165, 233, .05));
    border-color: rgba(59, 130, 246, .28);
}
body.dark-mode .comments .comment-replies .comment-block {
    background: rgba(30, 41, 59, .75);
    border-color: rgba(59, 130, 246, .22);
}
body.dark-mode .comments .comment-replies .comment-header .user::before,
body.dark-mode .comments .comment-replies .comment-header cite.user::before { color: #7dd3fc; }
body.dark-mode .nt-reply-badge {
    background: rgba(59, 130, 246, .18);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, .3);
}
body.dark-mode .nt-guest-badge {
    background: rgba(100, 116, 139, .2);
    color: #cbd5e1;
    border-color: rgba(100, 116, 139, .35);
}
body.dark-mode .comments .comment.nt-author > .comment-block {
    background: linear-gradient(180deg, rgba(245, 158, 11, .16), var(--dark-2) 62%);
    border-color: rgba(245, 158, 11, .38);
}
body.dark-mode .comments .comment.nt-anon > .comment-block {
    background: linear-gradient(180deg, rgba(100, 116, 139, .16), var(--dark-2) 62%);
    border-color: rgba(148, 163, 184, .32);
}
body.dark-mode .comments .comment.nt-anon > .avatar-image-container {
    background: var(--dark-3);
    border-color: #475569;
}
body.dark-mode .comments .comment-form,
body.dark-mode .comment-form {
    background: linear-gradient(180deg, rgba(37, 99, 235, .12), var(--dark-3));
    border-color: var(--dark-3);
}
body.dark-mode .comment-form h4#comment-post-message { color: var(--dark-color); }
body.dark-mode .comments .paging-control-container a { border-color: var(--dark-3); }

/* --- استجابة الشاشات الصغيرة --- */
@media (max-width: 768px) {
    .comments.nt-blogger-cmts { padding: 16px; border-radius: 18px; }
    .comments.nt-blogger-cmts h3.title { font-size: 18px; gap: 9px; }
    .comments.nt-blogger-cmts h3.title::before { width: 36px; height: 36px; font-size: 14px; }
    .nt-cmt-count { padding: 4px 11px; font-size: 12px; }
    .comments .comment-block { padding: 12px 14px; }
    .comments .comment-header .datetime a,
    .comments .comment-header .datetime { margin-inline-start: 0; width: 100%; }
    .comments .avatar-image-container { width: 34px; height: 34px; }
    .comments .comment-replies,
    .comments .comment-thread .comment-replies {
        margin-inline-start: 0;
        margin-inline-end: 0;
        padding: 12px 12px 4px;
        padding-inline-start: 16px;
    }
    .comments .comment-actions { gap: 6px; }
    .comments .comment-actions a,
    .comments .comment-actions .item-control a { padding: 5px 12px; font-size: 11px; }
    .comment-form { padding: 12px; }
}

/* --- تقليل الحركة --- */
@media (prefers-reduced-motion: reduce) {
    .comments .comment-block,
    .comments .comment-actions a,
    .comments .thread-toggle .thread-arrow,
    .comments .avatar-image-container {
        animation: none !important;
        transition: none !important;
    }
    .comments .comment .comment-block:hover,
    .comments .comment-actions a:hover,
    .comments .comment-actions a.comment-reply:hover,
    .comments .comment-actions .item-control a:hover { transform: none !important; }
    .comments .comment .comment-block:hover::after { animation: none !important; opacity: 0 !important; }
}

/* الوسوم والتصنيفات السحابية الموحّدة */
.cloud-label-widget-content,
.list-label-widget-content ul,
.tags-cloud {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, .05), rgba(14, 165, 233, .08));
    border: 1px solid rgba(37, 99, 235, .16);
    border-radius: 16px;
    box-shadow: 0 3px 14px rgba(37, 99, 235, .06);
}
/* إزالة الخلفية والحدود الزرقاء من قسم التسميات السحابية بالسايد بار (تظهر خلفية السايد بار الأساسية) */
.cloud-label-widget-content {
    background: transparent;
    border: none;
    box-shadow: none;
}
.list-label-widget-content ul {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.post-labels {
    position: relative;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(37, 99, 235, .04), rgba(14, 165, 233, .06));
    border: 1px solid rgba(37, 99, 235, .14);
    border-radius: 14px;
}
.post-labels .byline-label {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-light);
}
.post-labels .byline-label::before {
    content: '\f02c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 11px;
    color: var(--primary-color);
}

.cloud-label-widget-content::before,
.list-label-widget-content ul::before,
.tags-cloud::before,
.post-labels::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: linear-gradient(135deg, rgba(37, 99, 235, .35), rgba(14, 165, 233, .06), rgba(37, 99, 235, .35));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}
/* تعطيل الحدود المتدرجة الزرقاء لقسم التسميات السحابية فقط */
.cloud-label-widget-content::before {
    content: none;
}

.tags-cloud a,
.cloud-label-widget-content .label-name,
.list-label-widget-content .label-name,
.post-labels a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-color);
    background: linear-gradient(135deg, rgba(37, 99, 235, .09), rgba(14, 165, 233, .14));
    border: 1px solid rgba(37, 99, 235, .2);
    padding: 7px 15px;
    border-radius: 999px;
    text-decoration: none;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 2px 6px rgba(37, 99, 235, .08);
    transition: color .35s ease, background .35s ease, border-color .35s ease, box-shadow .35s ease;
    z-index: 1;
}

.tags-cloud a::before,
.cloud-label-widget-content .label-name::before,
.list-label-widget-content .label-name::before,
.post-labels a::before {
    content: '\f02b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 11px;
    color: var(--primary-color);
    transition: color .3s ease, transform .3s ease;
}

.tags-cloud .tag-count,
.cloud-label-widget-content .label-count,
.list-label-widget-content .label-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 21px;
    height: 21px;
    padding: 0 7px;
    border-radius: 11px;
    background: rgba(37, 99, 235, .1);
    color: var(--primary-color);
    font-size: 10.5px;
    font-weight: 800;
    font-style: normal;
    transition: background .3s ease, color .3s ease;
}

.tags-cloud a::after,
.cloud-label-widget-content .label-name::after,
.list-label-widget-content .label-name::after,
.post-labels a::after {
    content: '';
    position: absolute;
    top: 0;
    right: -80%;
    width: 55%;
    height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .5), transparent);
    transform: skewX(20deg);
    transition: right .6s ease;
    z-index: -1;
    pointer-events: none;
}

.tags-cloud a:hover,
.cloud-label-widget-content .label-name:hover,
.list-label-widget-content .label-name:hover,
.post-labels a:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .18), 0 10px 22px rgba(37, 99, 235, .42);
}
.tags-cloud a:hover::before,
.cloud-label-widget-content .label-name:hover::before,
.list-label-widget-content .label-name:hover::before,
.post-labels a:hover::before {
    color: #fff;
    animation: ntTagIcon .45s ease both;
}
@keyframes ntTagIcon {
    0% { transform: rotate(-14deg) scale(1.2); }
    60% { transform: rotate(6deg) scale(1.18); }
    100% { transform: rotate(0) scale(1.12); }
}
.tags-cloud a:hover::after,
.cloud-label-widget-content .label-name:hover::after,
.list-label-widget-content .label-name:hover::after,
.post-labels a:hover::after {
    right: 125%;
}
.tags-cloud a:hover .tag-count,
.cloud-label-widget-content .label-name:hover .label-count,
.list-label-widget-content .label-name:hover .label-count {
    background: rgba(255, 255, 255, .25);
    color: #fff;
}

.cloud-label-widget-content .label-size {
    display: inline-flex;
    align-items: center;
}
.cloud-label-widget-content .label-size-1 .label-name,
.cloud-label-widget-content .label-size-2 .label-name,
.cloud-label-widget-content .label-size-3 .label-name,
.cloud-label-widget-content .label-size-4 .label-name,
.cloud-label-widget-content .label-size-5 .label-name {
    font-size: 13px;
    font-weight: 700;
    padding: 7px 15px;
}

.list-label-widget-content li {
    width: 100%;
    list-style: none;
}
.list-label-widget-content .label-name {
    width: 100%;
    justify-content: space-between;
    border-radius: 12px;
}

.nt-tag-in {
    opacity: 0;
    transform: translateY(18px) scale(.9);
    animation: ntTagIn .5s cubic-bezier(.22, 1, .36, 1) forwards;
}
@keyframes ntTagIn {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

body.dark-mode .cloud-label-widget-content,
body.dark-mode .list-label-widget-content ul,
body.dark-mode .tags-cloud,
body.dark-mode .post-labels {
    background: linear-gradient(135deg, rgba(37, 99, 235, .1), rgba(14, 165, 233, .13));
    border-color: rgba(59, 130, 246, .22);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .3);
}
body.dark-mode .cloud-label-widget-content::before,
body.dark-mode .list-label-widget-content ul::before,
body.dark-mode .tags-cloud::before,
body.dark-mode .post-labels::before {
    background: linear-gradient(135deg, rgba(59, 130, 246, .45), rgba(14, 165, 233, .1), rgba(59, 130, 246, .45));
}
/* إبقاء قسم التسميات السحابية شفافاً في الوضع الداكن أيضاً */
body.dark-mode .cloud-label-widget-content {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}
body.dark-mode .cloud-label-widget-content::before {
    content: none;
}
body.dark-mode .tags-cloud a,
body.dark-mode .cloud-label-widget-content .label-name,
body.dark-mode .list-label-widget-content .label-name,
body.dark-mode .post-labels a {
    background: linear-gradient(135deg, rgba(59, 130, 246, .16), rgba(14, 165, 233, .22));
    border-color: rgba(59, 130, 246, .3);
    color: #cbd5e1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 2px 8px rgba(0, 0, 0, .25);
}
body.dark-mode .tags-cloud a::before,
body.dark-mode .cloud-label-widget-content .label-name::before,
body.dark-mode .list-label-widget-content .label-name::before,
body.dark-mode .post-labels a::before {
    color: var(--primary-light);
}
body.dark-mode .tags-cloud .tag-count,
body.dark-mode .cloud-label-widget-content .label-count,
body.dark-mode .list-label-widget-content .label-count {
    background: rgba(59, 130, 246, .18);
    color: #93c5fd;
}

@media (prefers-reduced-motion: reduce) {
    .tags-cloud a,
    .cloud-label-widget-content .label-name,
    .list-label-widget-content .label-name,
    .post-labels a,
    .nt-tag-in {
        animation: none !important;
        transition: none !important;
    }
}

/* ===== الفئات/التصنيفات (Categories Page) ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 10px;
}

.category-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 80px 20px;
    text-align: RIGHT;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.category-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.category-card i {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.category-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.category-card p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 14px;
}

.category-card .count {
    display: inline-block;
    background: var(--light-2);
    color: var(--primary-color);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* ===== صفحة الخطأ 404 ===== */
.error-page {
    text-align: center;
    padding: 60px 20px;
}

.error-page h1 {
    font-size: 100px;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 10px;
}

.error-page h2 {
    font-size: 24px;
    color: var(--dark-color);
    margin-bottom: 14px;
}

.error-page p {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 24px;
}

.error-page .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: #fff;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
}

.error-page .btn:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    color: #fff;
}

body {
  min-width: 0 !important;
}
.widget .post-share-buttons { display: none; }
.feed-links { display: none; }
.blog-feeds { display: none; }
#navbar { display: none; }

/* ============================================================
   HADY v.1 — مكتبة الأكواد الاحترافية للتدوين  (Hady Blog Library)
   ------------------------------------------------------------
   استخدم هذه الأصناف داخل التدوينة (وضع HTML في بلوجر).
   كل عنصر مصمم ليعمل مع الوضع الفاتح والداكن والجوال تلقائيًا.
   ============================================================ */

:root {
    --hd-primary: #2563eb;
    --hd-primary-dark: #1d4ed8;
    --hd-primary-light: #3b82f6;
    --hd-secondary: #0ea5e9;
    --hd-success: #16a34a;
    --hd-success-light: #22c55e;
    --hd-danger: #dc2626;
    --hd-danger-light: #ef4444;
    --hd-warning: #d97706;
    --hd-warning-light: #f59e0b;
    --hd-info: #0891b2;
    --hd-purple: #7c3aed;
    --hd-pink: #db2777;
    --hd-dark: #0f172a;
    --hd-dark-2: #1e293b;
    --hd-gray: #64748b;
    --hd-light: #f8fafc;
    --hd-light-2: #f1f5f9;
    --hd-white: #ffffff;
    --hd-border: #e2e8f0;
    --hd-text: #1e293b;
    --hd-text-light: #64748b;
    --hd-radius: 14px;
    --hd-radius-sm: 10px;
    --hd-radius-lg: 20px;
    --hd-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
    --hd-shadow-lg: 0 14px 40px rgba(15, 23, 42, 0.12);
    --hd-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --hd-code-bg: #0f172a;
    --hd-code-bg-2: #1e293b;
    --hd-font: 'Cairo', 'Tajawal', sans-serif;
}

body.dark-mode {
    --hd-light: #0f172a;
    --hd-light-2: #1e293b;
    --hd-white: #1e293b;
    --hd-border: #334155;
    --hd-text: #e2e8f0;
    --hd-text-light: #94a3b8;
    --hd-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    --hd-shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.5);
}

/* كل عناصر المكتبة ترث خط القالب */
.hd-box, .hd-btn, .hd-code, .hd-download, .hd-badge, .hd-table,
.hd-quote, .hd-divider, .hd-alert, .hd-link, .hd-list,
.post-font-tools {
    font-family: var(--hd-font);
    box-sizing: border-box;
}

/* ============================================================
   1) الصناديق (Boxes)  —  .hd-box
   ============================================================ */
.hd-box {
    position: relative;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px 20px 18px 20px;
    margin: 22px 0;
    border-radius: var(--hd-radius);
    border: 1px solid var(--hd-border);
    border-right: 5px solid var(--hd-primary);
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: var(--hd-text);
    line-height: 1.9;
    box-shadow: var(--hd-shadow);
    overflow: hidden;
    transition: var(--hd-transition);
}
.hd-box:hover { transform: translateY(-3px); box-shadow: var(--hd-shadow-lg); }
.hd-box .hd-box-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--hd-primary), var(--hd-primary-dark));
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}
.hd-box .hd-box-body { flex: 1 1 auto; min-width: 0; }
.hd-box .hd-box-title {
    display: block;
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--hd-primary-dark);
}
.hd-box p { margin: 0; }
.hd-box p + p { margin-top: 8px; }

.hd-box-success { border-right-color: var(--hd-success); background: linear-gradient(135deg, #f0fdf4, #dcfce7); }
.hd-box-success .hd-box-icon { background: linear-gradient(135deg, var(--hd-success-light), var(--hd-success)); box-shadow: 0 6px 16px rgba(22, 163, 74, 0.35); }
.hd-box-success .hd-box-title { color: #15803d; }

.hd-box-warning { border-right-color: var(--hd-warning); background: linear-gradient(135deg, #fffbeb, #fef3c7); }
.hd-box-warning .hd-box-icon { background: linear-gradient(135deg, var(--hd-warning-light), var(--hd-warning)); box-shadow: 0 6px 16px rgba(217, 119, 6, 0.35); }
.hd-box-warning .hd-box-title { color: #b45309; }

.hd-box-danger { border-right-color: var(--hd-danger); background: linear-gradient(135deg, #fef2f2, #fee2e2); }
.hd-box-danger .hd-box-icon { background: linear-gradient(135deg, var(--hd-danger-light), var(--hd-danger)); box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35); }
.hd-box-danger .hd-box-title { color: #b91c1c; }

.hd-box-note { border-right-color: var(--hd-gray); background: linear-gradient(135deg, #f8fafc, #f1f5f9); }
.hd-box-note .hd-box-icon { background: linear-gradient(135deg, #94a3b8, var(--hd-gray)); box-shadow: 0 6px 16px rgba(100, 116, 139, 0.35); }
.hd-box-note .hd-box-title { color: #475569; }

.hd-box-tip { border-right-color: var(--hd-purple); background: linear-gradient(135deg, #f5f3ff, #ede9fe); }
.hd-box-tip .hd-box-icon { background: linear-gradient(135deg, #a78bfa, var(--hd-purple)); box-shadow: 0 6px 16px rgba(124, 58, 237, 0.35); }
.hd-box-tip .hd-box-title { color: #6d28d9; }

body.dark-mode .hd-box { background: linear-gradient(135deg, #1e293b, #0f172a); border-color: #334155; }
body.dark-mode .hd-box .hd-box-title { color: #e2e8f0; }

/* ============================================================
   2) صناديق الأكواد (Code Boxes)  —  .hd-code
   ============================================================ */
.hd-code {
    position: relative;
    margin: 22px 0;
    border-radius: var(--hd-radius);
    overflow: hidden;
    background: var(--hd-code-bg);
    box-shadow: var(--hd-shadow-lg);
    border: 1px solid #1e293b;
    direction: ltr;
}
.hd-code .hd-code-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    background: #0b1220;
    border-bottom: 1px solid #1e293b;
}
.hd-code .hd-code-lang {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #cbd5e1;
    text-transform: uppercase;
}
.hd-code .hd-code-lang i { font-size: 14px; }
.hd-code .hd-code-dots { display: inline-flex; gap: 6px; }
.hd-code .hd-code-dots span { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.hd-code .hd-code-dots span:nth-child(1) { background: #ff5f56; }
.hd-code .hd-code-dots span:nth-child(2) { background: #ffbd2e; }
.hd-code .hd-code-dots span:nth-child(3) { background: #27c93f; }
.hd-code .hd-code-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    font-family: var(--hd-font);
    font-size: 12.5px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--hd-transition);
}
.hd-code .hd-code-copy:hover { background: rgba(255, 255, 255, 0.18); transform: translateY(-1px); }
.hd-code .hd-code-copy.copied { background: var(--hd-success); border-color: var(--hd-success); color: #fff; }
.hd-code pre {
    margin: 0;
    padding: 18px 20px;
    overflow-x: auto;
    background: transparent;
    color: #e2e8f0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.7;
    direction: ltr;
    text-align: left;
    tab-size: 4;
}
.hd-code code {
    background: none !important;
    color: inherit !important;
    padding: 0 !important;
    font-family: inherit;
    font-size: inherit;
}
/* لون شريط العنوان حسب اللغة */
.hd-code.lang-html .hd-code-top { background: linear-gradient(90deg, #e34c26, #c1440e); }
.hd-code.lang-css  .hd-code-top { background: linear-gradient(90deg, #264de4, #1a3ab8); }
.hd-code.lang-js   .hd-code-top { background: linear-gradient(90deg, #f7df1e, #e6c800); }
.hd-code.lang-js   .hd-code-lang { color: #1e293b; }
.hd-code.lang-js   .hd-code-copy { color: #1e293b; background: rgba(0,0,0,0.08); border-color: rgba(0,0,0,0.12); }
.hd-code.lang-php  .hd-code-top { background: linear-gradient(90deg, #8892be, #6b77a8); }
.hd-code.lang-xml  .hd-code-top { background: linear-gradient(90deg, #16a34a, #0f7a37); }
.hd-code.lang-sql  .hd-code-top { background: linear-gradient(90deg, #0891b2, #0e7490); }
.hd-code.lang-bash .hd-code-top { background: linear-gradient(90deg, #334155, #0f172a); }

/* ============================================================
   3) الأزرار (Buttons)  —  .hd-btn
   ============================================================ */
.hd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 24px;
    margin: 4px 4px;
    border: none;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: linear-gradient(135deg, var(--hd-primary), var(--hd-primary-dark));
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
    cursor: pointer;
    text-decoration: none !important;
    transition: var(--hd-transition);
    position: relative;
    overflow: hidden;
}
.hd-btn i { font-size: 15px; }
.hd-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45); color: #fff; }
.hd-btn:active { transform: translateY(-1px); }

.hd-btn-success { background: linear-gradient(135deg, var(--hd-success-light), var(--hd-success)); box-shadow: 0 8px 20px rgba(22, 163, 74, 0.3); }
.hd-btn-success:hover { box-shadow: 0 12px 28px rgba(22, 163, 74, 0.45); }
.hd-btn-danger { background: linear-gradient(135deg, var(--hd-danger-light), var(--hd-danger)); box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3); }
.hd-btn-danger:hover { box-shadow: 0 12px 28px rgba(220, 38, 38, 0.45); }
.hd-btn-warning { background: linear-gradient(135deg, var(--hd-warning-light), var(--hd-warning)); box-shadow: 0 8px 20px rgba(217, 119, 6, 0.3); }
.hd-btn-warning:hover { box-shadow: 0 12px 28px rgba(217, 119, 6, 0.45); }
.hd-btn-dark { background: linear-gradient(135deg, #334155, var(--hd-dark)); box-shadow: 0 8px 20px rgba(15, 23, 42, 0.35); }
.hd-btn-dark:hover { box-shadow: 0 12px 28px rgba(15, 23, 42, 0.5); }
.hd-btn-purple { background: linear-gradient(135deg, #a78bfa, var(--hd-purple)); box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3); }
.hd-btn-purple:hover { box-shadow: 0 12px 28px rgba(124, 58, 237, 0.45); }

.hd-btn-outline {
    background: transparent;
    color: var(--hd-primary);
    border: 2px solid var(--hd-primary);
    box-shadow: none;
}
.hd-btn-outline:hover { background: var(--hd-primary); color: #fff; box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35); }

.hd-btn-ghost {
    background: var(--hd-light-2);
    color: var(--hd-text);
    box-shadow: none;
    border: 1px solid var(--hd-border);
}
.hd-btn-ghost:hover { background: var(--hd-primary); color: #fff; }

.hd-btn-sm { padding: 8px 16px; font-size: 13px; }
.hd-btn-lg { padding: 15px 34px; font-size: 17px; }
.hd-btn-block { display: flex; width: 100%; margin: 8px 0; }

/* ============================================================
   4) روابط التحميل والمعاينة (Download / Preview links)
   ============================================================ */
.hd-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    margin: 4px 4px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    transition: var(--hd-transition);
    border: 1px solid transparent;
}
.hd-link i { font-size: 15px; }
.hd-link-download {
    color: #fff;
    background: linear-gradient(135deg, var(--hd-success-light), var(--hd-success));
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.3);
}
.hd-link-download:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(22, 163, 74, 0.45); color: #fff; }
.hd-link-preview {
    color: #fff;
    background: linear-gradient(135deg, var(--hd-primary-light), var(--hd-primary-dark));
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}
.hd-link-preview:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(37, 99, 235, 0.45); color: #fff; }
.hd-link-demo {
    color: #fff;
    background: linear-gradient(135deg, #a78bfa, var(--hd-purple));
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.3);
}
.hd-link-demo:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(124, 58, 237, 0.45); color: #fff; }

/* ============================================================
   5) صندوق التحميل الاحترافي (Professional Download Box)
   ============================================================ */
.hd-download {
    margin: 26px 0;
    border-radius: var(--hd-radius-lg);
    background: var(--hd-white);
    border: 1px solid var(--hd-border);
    box-shadow: var(--hd-shadow-lg);
    overflow: hidden;
    transition: var(--hd-transition);
}
.hd-download:hover { transform: translateY(-4px); }
.hd-download-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 22px;
    background: linear-gradient(135deg, var(--hd-primary), var(--hd-primary-dark));
    color: #fff;
}
.hd-download-head .hd-download-icon {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 26px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.hd-download-head .hd-download-title { flex: 1 1 auto; min-width: 0; }
.hd-download-head .hd-download-title h3 {
    margin: 0 0 4px;
    font-size: 19px;
    font-weight: 800;
    color: #fff;
}
.hd-download-head .hd-download-title span { font-size: 13px; opacity: 0.9; }
.hd-download-body { padding: 20px 22px; }
.hd-download-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.hd-download-meta .hd-meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--hd-radius-sm);
    background: var(--hd-light-2);
    border: 1px solid var(--hd-border);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--hd-text);
}
.hd-download-meta .hd-meta-item i { color: var(--hd-primary); font-size: 15px; }
.hd-download-meta .hd-meta-item b { color: var(--hd-text-light); font-weight: 700; }
.hd-download-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hd-download-actions .hd-btn { flex: 1 1 180px; }

/* ============================================================
   6) القوائم الاحترافية (Lists)
   ============================================================ */
.hd-list { margin: 22px 0; padding: 0; list-style: none; }
.hd-list li {
    position: relative;
    padding: 11px 52px 11px 16px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.07), rgba(37, 99, 235, 0));
    transition: var(--hd-transition);
    color: var(--hd-text);
    line-height: 1.8;
}
.hd-list li::before {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    border-radius: 50%;
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    transition: var(--hd-transition);
}
.hd-list li:hover { background: linear-gradient(90deg, rgba(37, 99, 235, 0.15), rgba(37, 99, 235, 0.02)); padding-right: 58px; }

/* منقّطة بعلامة صح */
.hd-list-check li::before { content: '\f00c'; background: linear-gradient(135deg, var(--hd-primary), var(--hd-secondary)); box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35); }
.hd-list-check li:hover::before { transform: translateY(-50%) rotate(360deg) scale(1.1); }
/* منقّطة بسهم */
.hd-list-arrow li::before { content: '\f0da'; background: linear-gradient(135deg, var(--hd-primary), var(--hd-secondary)); box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35); }
.hd-list-arrow li:hover::before { transform: translateY(-50%) translateX(-3px); }
/* منقّطة بنجمة */
.hd-list-star li::before { content: '\f005'; background: linear-gradient(135deg, var(--hd-warning-light), var(--hd-warning)); box-shadow: 0 6px 14px rgba(217, 119, 6, 0.35); }
.hd-list-star li:hover::before { transform: translateY(-50%) rotate(72deg) scale(1.1); }
/* منقّطة بقلب */
.hd-list-heart li::before { content: '\f004'; background: linear-gradient(135deg, #fb7185, var(--hd-pink)); box-shadow: 0 6px 14px rgba(219, 39, 119, 0.35); }
/* منقّطة بعلامة زائد */
.hd-list-plus li::before { content: '\f067'; background: linear-gradient(135deg, var(--hd-success-light), var(--hd-success)); box-shadow: 0 6px 14px rgba(22, 163, 74, 0.35); }

/* مرقّمة (دوائر متدرجة) */
.hd-list-num { counter-reset: hdnum; }
.hd-list-num li {
    counter-increment: hdnum;
    padding: 13px 64px 13px 18px;
    background: var(--hd-light-2);
    border: 1px solid var(--hd-border);
    border-radius: 14px;
}
.hd-list-num li::before {
    content: counter(hdnum);
    width: 36px;
    height: 36px;
    font-size: 15px;
    font-weight: 800;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--hd-primary), var(--hd-secondary));
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
}
.hd-list-num li:hover { border-color: var(--hd-primary); box-shadow: 0 10px 24px rgba(37, 99, 235, 0.16); }
.hd-list-num li:hover::before { transform: translateY(-50%) scale(1.12); }

/* مرقّمة (دوائر) */
.hd-list-num-circle { counter-reset: hdnum2; }
.hd-list-num-circle li {
    counter-increment: hdnum2;
    padding: 12px 60px 12px 18px;
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.08), transparent);
    border-radius: 12px;
}
.hd-list-num-circle li::before {
    content: counter(hdnum2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--hd-secondary), var(--hd-primary));
    box-shadow: 0 6px 14px rgba(14, 165, 233, 0.35);
}
.hd-list-num-circle li:hover::before { transform: translateY(-50%) scale(1.15); }

/* ============================================================
   7) الشارات / البادجات (Badges)
   ============================================================ */
.hd-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    margin: 3px 3px;
    border-radius: 40px;
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1.4;
    color: #fff;
    vertical-align: middle;
    letter-spacing: 0.2px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
    position: relative;
    overflow: hidden;
}
.hd-badge i { font-size: 12px; }

.hd-badge-featured   { background: linear-gradient(135deg, #fbbf24, #d97706); }   /* مميز */
.hd-badge-exclusive  { background: linear-gradient(135deg, #a78bfa, #7c3aed); }   /* حصري */
.hd-badge-bestseller { background: linear-gradient(135deg, #f87171, #dc2626); }   /* الأكثر مبيعًا */
.hd-badge-new        { background: linear-gradient(135deg, #34d399, #059669); }   /* جديد */
.hd-badge-hot        { background: linear-gradient(135deg, #fb923c, #ea580c); }   /* رائج */
.hd-badge-free       { background: linear-gradient(135deg, #22d3ee, #0891b2); }   /* مجاني */
.hd-badge-sale       { background: linear-gradient(135deg, #f472b6, #db2777); }   /* تخفيض */
.hd-badge-pro        { background: linear-gradient(135deg, #60a5fa, #2563eb); }   /* احترافي */
.hd-badge-update     { background: linear-gradient(135deg, #94a3b8, #475569); }   /* تحديث */
.hd-badge-trending   { background: linear-gradient(135deg, #f43f5e, #be123c); }   /* الأكثر رواجًا */
.hd-badge-premium    { background: linear-gradient(135deg, #facc15, #a16207); }   /* بريميوم */
.hd-badge-limited    { background: linear-gradient(135deg, #38bdf8, #0369a1); }   /* لفترة محدودة */

/* نبض خفيف للشارات المهمة */
.hd-badge-hot, .hd-badge-limited { animation: hdPulse 1.8s ease-in-out infinite; }
@keyframes hdPulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18); }
    50% { box-shadow: 0 4px 20px rgba(234, 88, 12, 0.55); }
}

/* ============================================================
   8) الجدول (Table)  —  .hd-table
   ============================================================ */
.hd-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 24px 0;
    border-radius: var(--hd-radius);
    overflow: hidden;
    border: 1px solid var(--hd-border);
    box-shadow: var(--hd-shadow);
    direction: rtl;
}
.hd-table thead th {
    background: linear-gradient(135deg, var(--hd-primary), var(--hd-primary-dark));
    color: #fff;
    padding: 14px 12px;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
    border: none;
}
.hd-table tbody td {
    padding: 12px;
    text-align: center;
    font-size: 14px;
    color: var(--hd-text);
    border-bottom: 1px solid var(--hd-border);
    background: var(--hd-white);
}
.hd-table tbody tr:nth-child(even) td { background: var(--hd-light-2); }
.hd-table tbody tr:hover td { background: #e0e7ff; }
.hd-table tbody tr:last-child td { border-bottom: none; }
body.dark-mode .hd-table tbody td { background: #1e293b; }
body.dark-mode .hd-table tbody tr:nth-child(even) td { background: #16223a; }
body.dark-mode .hd-table tbody tr:hover td { background: #24334d; }

/* ============================================================
   9) الاقتباس (Quote)  —  .hd-quote
   ============================================================ */
.hd-quote {
    position: relative;
    margin: 24px 0;
    padding: 24px 30px 24px 24px;
    border-radius: var(--hd-radius);
    background: linear-gradient(135deg, #f0f4ff, #e0e7ff);
    border-right: 5px solid var(--hd-primary);
    font-size: 16px;
    line-height: 2;
    font-style: italic;
    color: var(--hd-text);
    box-shadow: var(--hd-shadow);
    overflow: hidden;
}
.hd-quote::before {
    content: '\201D';
    position: absolute;
    top: -18px;
    left: 14px;
    font-size: 90px;
    font-family: Georgia, serif;
    color: rgba(37, 99, 235, 0.18);
    line-height: 1;
}
.hd-quote .hd-quote-author {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    font-style: normal;
    font-weight: 800;
    color: var(--hd-primary-dark);
}
body.dark-mode .hd-quote { background: linear-gradient(135deg, #1e293b, #0f172a); }
body.dark-mode .hd-quote .hd-quote-author { color: #93c5fd; }

/* ============================================================
   10) الفاصل (Divider)  —  .hd-divider
   ============================================================ */
.hd-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 30px 0;
    color: var(--hd-text-light);
    font-size: 16px;
}
.hd-divider::before, .hd-divider::after {
    content: '';
    flex: 1 1 auto;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--hd-border), transparent);
}
.hd-divider i { color: var(--hd-primary); }

/* ============================================================
   11) التنبيهات القابلة للإغلاق (Dismissible Alerts)
   ============================================================ */
.hd-alert {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: var(--hd-radius-sm);
    color: #fff;
    font-weight: 600;
    box-shadow: var(--hd-shadow);
    animation: hdAlertIn 0.4s ease;
}
@keyframes hdAlertIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
.hd-alert i { font-size: 18px; }
.hd-alert .hd-alert-close {
    margin-right: auto;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--hd-transition);
}
.hd-alert .hd-alert-close:hover { background: rgba(255, 255, 255, 0.4); transform: rotate(90deg); }
.hd-alert-info    { background: linear-gradient(135deg, var(--hd-primary-light), var(--hd-primary-dark)); }
.hd-alert-success { background: linear-gradient(135deg, var(--hd-success-light), var(--hd-success)); }
.hd-alert-warning { background: linear-gradient(135deg, var(--hd-warning-light), var(--hd-warning)); }
.hd-alert-danger  { background: linear-gradient(135deg, var(--hd-danger-light), var(--hd-danger)); }

/* ============================================================
   12) أدوات حجم الخط داخل التدوينة (Post Font Tools)
   ============================================================ */
.post-font-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 14px;
    margin: 0 0 22px;
    border-radius: var(--hd-radius-sm);
    background: var(--hd-light-2);
    border: 1px solid var(--hd-border);
    box-shadow: var(--hd-shadow);
}
.post-font-tools .pft-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--hd-text);
    margin-left: 4px;
}
.post-font-tools .pft-label i { color: var(--hd-primary); }
.post-font-tools .pft-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--hd-border);
    border-radius: 10px;
    background: var(--hd-white);
    color: var(--hd-text);
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--hd-transition);
}
.post-font-tools .pft-btn:hover { background: var(--hd-primary); color: #fff; border-color: var(--hd-primary); transform: translateY(-2px); }
.post-font-tools .pft-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; background: var(--hd-white); color: var(--hd-text); }
.post-font-tools .pft-value {
    min-width: 52px;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--hd-primary);
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.1);
}
.post-font-tools .pft-reset { width: auto; padding: 0 14px; gap: 6px; font-family: var(--font-main); font-weight: 400; font-size: 13.5px; }

/* ============================================================
   استجابة الجوال (Responsive)
   ============================================================ */
@media (max-width: 768px) {
    .hd-box { padding: 15px; gap: 11px; }
    .hd-box .hd-box-icon { width: 36px; height: 36px; font-size: 16px; }
    .hd-code pre { font-size: 12.5px; padding: 14px; }
    .hd-btn { padding: 10px 18px; font-size: 14px; }
    .hd-btn-lg { padding: 13px 26px; font-size: 15px; }
    .hd-download-head { flex-direction: column; text-align: center; }
    .hd-download-actions .hd-btn { flex: 1 1 100%; }
    .hd-table thead th, .hd-table tbody td { padding: 9px 7px; font-size: 12.5px; }
    .hd-quote { padding: 18px; font-size: 15px; }
    .hd-list li { padding: 10px 48px 10px 14px; }
    .hd-list-num li { padding: 12px 58px 12px 16px; }
    .post-font-tools { justify-content: center; }
}

/* ============================================================
   تقليل الحركة (Reduced motion)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .hd-box, .hd-btn, .hd-link, .hd-download, .hd-list li,
    .hd-badge, .hd-alert, .post-font-tools .pft-btn {
        animation: none !important;
        transition: none !important;
    }
    .hd-box:hover, .hd-btn:hover, .hd-link:hover,
    .hd-download:hover, .post-font-tools .pft-btn:hover { transform: none !important; }
}

/* ===== Tooltips ===== */
#hady-tooltip {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    z-index: 99999;
    max-width: 280px;
    padding: 7px 14px;
    background: var(--dark-color);
    color: var(--light-color);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 18px rgba(0,0,0,0.28);
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.7;
    text-align: center;
    direction: rtl;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

#hady-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#hady-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 50%;
    transform: translate(50%, -50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: var(--dark-color);
    border-right: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

#hady-tooltip.arrow-top::after {
    top: auto;
    bottom: 100%;
    transform: translate(50%, 50%) rotate(225deg);
    border-right: none;
    border-bottom: none;
    border-left: 1px solid rgba(255,255,255,0.08);
    border-top: 1px solid rgba(255,255,255,0.08);
}

@media (max-width: 560px) {
    #hady-tooltip {
        max-width: 220px;
        font-size: 11px;
    }
}
body { min-width: 0 !important; }
.widget .post-share-buttons { display: none; }
.feed-links { display: none; }
