/* =============================================
   RESET & BASE
   ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    direction: rtl;
    text-align: right;
}

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

/* =============================================
   HEADER & NAVBAR
   ============================================= */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, background 0.3s ease;
}
body.dark-mode .header {
    background: #15212c;
    color: #f8f8f8
}
.header.scrolled {
    background: rgba(102, 126, 234, 0.95);
}
.header.header--hidden {
    transform: translateY(-100%);
}
body.dark-mode .header.scrolled {
    background: #15212c;
}

.navbar { padding: 1rem 0; }

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    flex-shrink: 0;
}
.nav-logo img {
    width:40px;
    height: 40px;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
.nav-logo h1 {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.nav-logo i {
    color: #ffd700;
    animation: pulse 2s infinite;
}



/* ===== Nav Menu (Desktop) ===== */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

/* لين المسافة كتضيق، نقلصو gap والفونط قبل ما يبدا التلف */
@media (max-width: 1400px) {
    .nav-menu { gap: 1.1rem; }
    .nav-link { padding: 0.5rem 0.7rem; font-size: 0.92rem; }
    .nav-logo h1 { font-size: 1.5rem; }
}
@media (max-width: 1150px) {
    .nav-menu { gap: 0.6rem; }
    .nav-link { padding: 0.45rem 0.5rem; font-size: 0.85rem; }
    .nav-logo h1 { font-size: 1.3rem; }
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.nav-link.active {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: #ffd700;
    border-radius: 2px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { width: 0; }
    to { width: 80%; }
}

/* ===== Nav Action Buttons ===== */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}


.nav-icon-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-icon-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* ===== Hamburger ===== */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* ===== Dropdown (Desktop) ===== */
.nav-item.has-dropdown { position: relative; }

.dropdown-toggle i {
    font-size: 0.7rem;
    margin-right: 4px;
    transition: transform 0.3s ease;
    vertical-align: middle;
}

.nav-item.has-dropdown:hover .dropdown-toggle i {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    list-style: none;
    min-width: 180px;
    padding: 0.5rem 0;
    z-index: 500;
    animation: dropdownIn 0.25s ease;
}
body.dark-mode .dropdown-menu {
    background: #0e151b;
}
body.dark-mode .dropdown-link {
    color: #bdbdbd;
}
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 20px;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid white;
}

.nav-item.has-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-link {
    display: block;
    padding: 0.7rem 1.2rem;
    color: #444;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    font-family: 'Cairo', sans-serif;
}

.dropdown-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding-right: 1.6rem;
}

/* ===== عناصر السايدبار — مخفية في الديسكتوب ===== */
.nav-search-bar,
.nav-darkmode-mobile {
    display: none;
}
.nav-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =============================================
   SEARCH OVERLAY
   ============================================= */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 8, 30, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-overlay-inner {
    width: 90%;
    max-width: 620px;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.search-overlay.active .search-overlay-inner {
    transform: translateY(0);
}

.search-box {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box .search-icon {
    color: rgba(255,255,255,0.5);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
}

.search-box input::placeholder {
    color: rgba(255,255,255,0.35);
}

.search-hint {
    color: rgba(255,255,255,0.3);
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* =============================================
   DARK MODE
   ============================================= */
body.dark-mode {
    background: #0d1520;
    color: #e2e8f0;
}

body.dark-mode .articles {
    background: #0d1520;
}

body.dark-mode .section-title {
    color: #f1f5f9;
}

body.dark-mode .hero {
    background: linear-gradient(135deg, #1a1060 0%, #0d1520 100%);
}

body.dark-mode .article-hero {
    background: #15212c;
}

body.dark-mode .newsletter {
    background: linear-gradient(135deg, #1e1060 0%, #0f1e35 100%);
    border-top: 1px solid rgba(102,126,234,0.2);
    border-bottom: 1px solid rgba(102,126,234,0.2);
}

body.dark-mode .newsletter-form input {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    color: white;
}

body.dark-mode .newsletter-form input::placeholder {
    color: rgba(255,255,255,0.35);
}

/* =============================================
   HERO
   ============================================= */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: var(--header-height, 80px);
}

.hero-content {
    color: white;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.2s both;
}

@media (max-width: 768px) {
    .hero {
        min-height: 50vh;
        margin-top: 70px;
    }
}

.cta-button {
    display: inline-block;
    background: #ffd700;
    color: #333;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease 0.4s both;
    box-shadow: 0 10px 30px rgba(255,215,0,0.3);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255,215,0,0.4);
}

.hero-animation {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    overflow: hidden;
}

.floating-icon {
    position: absolute;
    font-size: 3rem;
    color: rgba(255,255,255,0.1);
    animation: float 6s ease-in-out infinite;
}

.floating-icon:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.floating-icon:nth-child(2) { top: 60%; left: 80%; animation-delay: 1.5s; }
.floating-icon:nth-child(3) { top: 80%; left: 20%; animation-delay: 3s; }
.floating-icon:nth-child(4) { top: 30%; left: 70%; animation-delay: 4.5s; }

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

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

/* =============================================
   ARTICLES SECTION
   ============================================= */
.articles {
    padding: 5rem 0;
    background: #f0f2f8;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* =============================================
   ARTICLES GRID
   ============================================= */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

@media (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   HOME LAYOUT (main content + sidebar)
   ============================================= */
.home-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: start;
}

.home-main .articles-grid { grid-template-columns: repeat(2, 1fr); }

.home-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .home-layout { grid-template-columns: 1fr; }
    .home-sidebar { position: static; }
    .home-main .articles-grid { grid-template-columns: repeat(2, 1fr); }
    .home-sidebar .mobile-hide-widget { display: none; }
}

@media (max-width: 600px) {
    .home-main .articles-grid { grid-template-columns: 1fr; }
}

body.dark-mode .home-sidebar .sidebar-widget { background: #111a24; }

/* =============================================
   ARTICLE CARD — احترافي مع زر ثابت
   ============================================= */
.article-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.08);
    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease,
        opacity 0.6s ease var(--reveal-delay, 0s),
        translate 0.6s ease var(--reveal-delay, 0s);
    border: 1px solid rgba(102, 126, 234, 0.08);

    /* ✅ الحل الجوهري — flex عمودي */
    display: flex;
    flex-direction: column;

    /* ✅ Scroll Reveal — الحالة الابتدائية قبل ما تبان */
    opacity: 0;
    translate: 0 40px;
}

.article-card.revealed {
    opacity: 1;
    translate: 0 0;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(102, 126, 234, 0.18);
}

.article-card.hidden {
    opacity: 0;
    transform: translateY(20px);
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

/* ===== الصورة ===== */
.article-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    flex-shrink: 0;
    background: linear-gradient(135deg, #dde4ff 0%, #ede5ff 100%);
    display: block;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.06);
}

/* Overlay خفيف على الصورة عند الهوفر */
.article-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(102,126,234,0.15) 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.article-card:hover .article-image::after {
    opacity: 1;
}

/* ===== بادج التصنيف ===== */
.article-category {
    position: absolute;
    top: 14px;
    right: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(102,126,234,0.35);
}

/* ===== محتوى الكارد ===== */
.article-content {
    padding: 1.6rem 1.8rem 1.8rem;

    /* ✅ يأخد كل الفراغ المتبقي */
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===== العنوان ===== */
.article-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.7rem;
    color: #1e293b;
    line-height: 1.55;

    /* ✅ حد أقصى سطرين لكل الكروت */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;   
    overflow: hidden;
    min-height: 2.4em;
}

.article-card:hover .article-content h3 {
    color: #667eea;
}

.article-content h3 a {
    color: inherit;
    text-decoration: none;
}

/* ===== الوصف ===== */
.article-content p {
    color: #7a8099;
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 1.2rem;

    /* ✅ حد أقصى 3 أسطر */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.6em;

    /* ✅ يدفع ما تحته للأسفل */
    flex-grow: 1;
}

/* ===== الميتا: التاريخ + وقت القراءة ===== */
.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
    font-size: 0.82rem;
    color: #a0aabe;
    flex-wrap: wrap;
}

.article-meta i {
    margin-left: 0.3rem;
    color: #b0a0e0;
}

/* ===== هوية الكاتب ===== */
.article-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f5;
}

.article-author img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.article-author span {
    font-size: 0.85rem;
    font-weight: 700;
    color: #6b7280;
}

body.dark-mode .article-author { border-bottom-color: #1e2733; }
body.dark-mode .article-author span { color: #9aa4b2; }

/* ===== فاصل خفيف قبل الزر ===== */
.article-content::before {
    content: none;
}

/* ===== رابط قراءة المزيد + زر المشاركة ===== */
.card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-top: auto;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    color: #667eea;
    padding: 0;
    text-decoration: none;
    border-radius: 0;
    font-weight: 600;
    font-size: 0.92rem;
    transition: color 0.25s ease;
    letter-spacing: 0.2px;
    box-shadow: none;
}

.read-more::after {
    content: '←';
    display: inline-block;
    transition: transform 0.25s ease;
}

.read-more:hover {
    color: #764ba2;
    transform: none;
    box-shadow: none;
    background: none;
}

.read-more:hover::after {
    transform: translateX(-4px);
}

/* ===== زر المشاركة على الكارد ===== */
.card-share {
    position: relative;
    flex-shrink: 0;
}

.card-share-toggle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid #e4e2f5;
    background: #f8f9fc;
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.25s ease;
}

.card-share-toggle:hover,
.card-share-toggle.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
}

.card-share-menu {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    background: white;
    border-radius: 14px;
    box-shadow: 0 10px 26px rgba(102,126,234,0.22);
    padding: 0.5rem;
    display: flex;
    gap: 0.4rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    z-index: 30;
}

.card-share.open .card-share-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.share-mini {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    text-decoration: none;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.share-mini:hover { transform: translateY(-3px); }
.share-mini.facebook { background: #3b5998; }
.share-mini.twitter  { background: #000; }
.share-mini.whatsapp { background: #25d366; }
.share-mini.telegram { background: #0088cc; }

body.dark-mode .card-share-toggle {
    background: #1a2535;
    border-color: rgba(255,255,255,0.08);
    color: #a78bfa;
}
body.dark-mode .card-share-menu {
    background: #1a2535;
    box-shadow: 0 10px 26px rgba(0,0,0,0.4);
}

/* ===== Dark Mode للكروت ===== */
body.dark-mode .article-card {
    background: #1a2535;
    border-color: rgba(255,255,255,0.06);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

body.dark-mode .article-card:hover {
    background: #1f2d42;
    box-shadow: 0 16px 40px rgba(0,0,0,0.5);
    border-color: rgba(102,126,234,0.2);
}

body.dark-mode .article-content h3 {
    color: #c4b5fd;
}

body.dark-mode .article-card:hover .article-content h3 {
    color: #a78bfa;
}

body.dark-mode .article-content p {
    color: #8896b0;
}

body.dark-mode .article-meta {
    color: #4e5e78;
}

body.dark-mode .article-meta i {
    color: #6b5fa0;
}

body.dark-mode .articles-content {
    background: #111d2b;
}

/* =============================================
   LOADING SPINNER
   ============================================= */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 60px 20px;
    grid-column: 1 / -1;
    gap: 16px;
    color: #888;
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
    display: flex;
    flex-direction: row-reverse;  
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.page-btn {
    background:  #8c45ff; 
    color: white;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover {
    background: #8325ee;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(22, 37, 249, 0.4);
}

.page-btn.active {
    background: #360b9b;
    color: white;
    cursor: default;
    transform: none;
    box-shadow: none;
}

.page-btn.dots {
    background: #9233ff;
    cursor: default;
    letter-spacing: 1px;
}

.page-btn.next-btn {
    width: auto;
    padding: 0 1.2rem;
    gap: 0.4rem;
    font-size: 0.95rem;
}

.page-btn.prev-btn {
    width: auto;
    padding: 0 1.2rem;
    gap: 0.4rem;
    font-size: 0.95rem;
}

.page-btn.dots:hover,
.page-btn.active:hover {
    transform: none;
    box-shadow: none;
}

body.dark-mode .page-btn {
    background: #160c44;
}

body.dark-mode .page-btn.active {
    background: #e2e8f0;
    color: #1e293b;
}

/* =============================================
   NO RESULTS
   ============================================= */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
body.dark-mode .no-results {
    color: #fafafa;
    background: #121725;
}

/* =============================================
   NEWSLETTER
   ============================================= */
.newsletter {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4rem 0;
    text-align: center;
}

.newsletter-content {
    color: white;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.newsletter-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    text-align: right;
    direction: rtl;
}

.newsletter-form button {
    background: #ffd700;
    color: #333;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255,215,0,0.3);
}

@media (max-width: 768px) {
    .newsletter {
        min-height: 20vh;
        padding: 1rem 0;
    }
    .newsletter-content h2 { font-size: 2rem; margin-bottom: 1rem; }
    .newsletter-content p { font-size: 1rem; margin-bottom: 2rem; opacity: 0.9; }
    .newsletter-form input { font-size: 0.8rem; }
    .newsletter-form button { padding: 1rem 1rem; font-weight: 600; }
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 1rem 0 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #ffd700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.footer-section  img {
    width: 40px;
    height: 40px;

}
.footer-section.about p {
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #bdc3c7;
}

.social-links { display: flex; gap: 1rem; }

.social-link {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    color: white;
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    background: #ffd700;
    color: #333;
    transform: translateY(-3px);
}

.footer-section ul { list-style: none; }
.footer-section ul li { margin-bottom: 0.8rem; }

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 0.3rem 0;
    display: block;
}

.footer-section ul li a:hover {
    color: #ffd700;
    padding-right: 10px;
}

.contact-info p {
    margin-bottom: 1rem;
    color: #bdc3c7;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-info i { color: #ffd700; width: 20px; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem 0;
    margin-top: 2rem;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

body.dark-mode .footer { background: #0a111c; color: #94a3b8; }
body.dark-mode .footer h3 { color: #e2e8f0; }
body.dark-mode .footer a { color: #64748b; }
body.dark-mode .footer a:hover { color: #a78bfa; }
body.dark-mode .footer-bottom { border-top-color: rgba(255,255,255,0.07); color: #4b5563; }
body.dark-mode .contact-info p { color: #64748b; }

@media (max-width: 768px) {
    .footer-section.links,
    .footer-section.categories,
    .footer-section.contact { display: none; }
    .footer-content { flex-direction: column; align-items: center; text-align: center; }
    .footer-section.about { width: 100%; }
    .social-links { justify-content: center; }
}

/* =============================================
   ARTICLE PAGE
   ============================================= */
.article-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 8rem 0 4rem;
    margin-top: 80px;
    color: white;
}

.breadcrumb {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.breadcrumb a { color: white; text-decoration: none; transition: opacity 0.3s ease; }
.breadcrumb a:hover { opacity: 0.7; }
.breadcrumb span { margin: 0 0.5rem; }
.article-header { max-width: 800px; }

.article-category-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

.article-title {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 2rem;
    font-weight: 700;
}

.article-meta-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.author-info { display: flex; align-items: center; gap: 1rem; }

.author-avatar {
    width: 50px; height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
}

.author-details { display: flex; flex-direction: column; }
.author-name { font-weight: 600; font-size: 1.1rem; }
.publish-date { opacity: 0.8; font-size: 0.9rem; }

.article-stats { display: flex; gap: 1.5rem; font-size: 0.9rem; opacity: 0.8; }
.article-stats i { margin-left: 0.5rem; }

.article-main { padding: 4rem 0; }

.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.article-content {
    background: white;
    border-radius: 15px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    animation: fadeInUp 0.8s ease;
}

.featured-image {
    margin-bottom: 2rem;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.featured-image:hover { transform: scale(1.02); }
.featured-image img { width: 100%; height: 400px; object-fit: cover; }

.image-caption {
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    text-align: center;
}

.article-content {
    background: #ececec;
    color: #e2e8f0;
}
body.dark-mode .article-content {
    background: #1a202c;
    color: #e2e8f0;
}
.article-body { font-size: 1.1rem; line-height: 1.8; color: #4b5563; }
body.dark-mode .article-body { color: #cbd5e1; }

.lead {
    font-size: 1.3rem;
    color: #555;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-right: 4px solid #667eea;
}
body.dark-mode .lead { background: #111d2b; color: #cbd5e1; border-right-color: #667eea; }
body.dark-mode .article-body h2,
body.dark-mode .article-body h3 { color: #e2d9f9; }
body.dark-mode .article-body a { color: #a78bfa; }
body.dark-mode .article-body blockquote { background: #111d2b; border-right-color: #764ba2; color: #94a3b8; }
body.dark-mode .article-body code { background: #1a2535; color: #c4b5fd; }
body.dark-mode .article-body pre { background: #111d2b; border: 1px solid rgba(255,255,255,0.08); }

.article-body h2 {
    color: #707070;
    font-size: 2rem;
    margin: 3rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.article-body h3 { color: #636262; font-size: 1.5rem; margin: 2rem 0 1rem; }
.article-body h4 { color: #a8a8a8; font-size: 1.3rem; margin: 1.5rem 0 0.5rem; }
.article-body ul, .article-body ol { margin: 1rem 0 1rem 2rem; }
.article-body li { margin-bottom: 0.5rem; }

.article-quote {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-right: 4px solid #667eea;
    padding: 2rem;
    margin: 2rem 0;
    font-size: 1.2rem;
    font-style: italic;
    border-radius: 10px;
}

.article-quote cite {
    display: block;
    margin-top: 1rem;
    font-size: 0.9rem;
    font-style: normal;
    color: #666;
    text-align: left;
    direction: ltr;
}

.info-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #2196f3;
    border-radius: 10px;
    margin: 2rem 0;
    overflow: hidden;
}

.info-box-header {
    background: #2196f3;
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-box-header h4 { margin: 0; font-size: 1.1rem; }
.info-box p { padding: 1.5rem; margin: 0; }

.warning-box {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 1px solid #ff9800;
    border-radius: 10px;
    margin: 2rem 0;
    overflow: hidden;
}

.warning-box-header {
    background: #ff9800;
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.warning-box-header h4 { margin: 0; font-size: 1.1rem; }
.warning-box p { padding: 1.5rem; margin: 0; }

.tips-list { margin: 2rem 0; }

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-right: 4px solid #28a745;
}

.tip-number {
    background: #28a745;
    color: white;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.tip-content h4 { margin: 0 0 0.5rem; color: #28a745; font-size: 1.2rem; }
.tip-content p { margin: 0; line-height: 1.6; }

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 3rem 0 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: transform 0.3s ease;
}
.tag:hover { transform: translateY(-2px); }

.social-share {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    margin: 2rem 0;
    text-align: center;
}
body.dark-mode .social-share { background: #0c1018; }
.social-share h4 { margin-bottom: 1rem; color: #333; }
.share-buttons { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px; height: 45px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: transform 0.3s ease;
    font-size: 1.2rem;
}
.share-btn:hover { transform: translateY(-3px); }
.share-btn.facebook { background: #3b5998; }
.share-btn.twitter { background: #000;}
.share-btn.linkedin { background: #0077b5; }
.share-btn.whatsapp { background: #25d366; }
.share-btn.telegram { background: #0088cc; }

.author-bio {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-radius: 15px;
    margin: 3rem 0;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}
body.dark-mode .author-bio { background: #0c1018; }

.author-avatar-large img {
    width: 100px; height: 100px;
    border-radius: 50%;
    border: 3px solid #667eea;
}

.author-bio .author-info { display: block; }
.author-bio .author-info h4 { margin: 0 0 0.5rem; color: #333; font-size: 1.4rem; }
.author-title { color: #667eea; font-weight: 600; margin-bottom: 1rem; }
.author-description { line-height: 1.6; color: #666; margin-bottom: 1rem; }
.author-social { display: flex; gap: 0.5rem; }
body.dark-mode .author-info h4 { color: #888888; }
body.dark-mode .author-title { color: #a5a5a5; }
body.dark-mode .author-description { color: #dfdfdf; }
body.dark-mode .author-social { color: #dfdfdf; }

.author-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px; height: 35px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}
.author-social a:hover { background: #764ba2; transform: translateY(-2px); }

/* ===== Article Sidebar ===== */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeInRight 0.8s ease;
}

@media (min-width: 1025px) {
    .article-sidebar {
        position: sticky;
        top: 100px;
        height: fit-content;
    }
}

.sidebar-widget {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.sidebar-widget h4 {
    color: #b1c3fd;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
    font-size: 1.3rem;
}
body.dark-mode .sidebar-widget { background: #111a24; }
body.dark-mode .sidebar-widget h4 { color: #dddddd; }

.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin-bottom: 0.5rem; }

.toc a {
    color: #666;
    text-decoration: none;
    padding: 0.3rem 0;
    display: block;
    transition: color 0.3s ease;
}
.toc a:hover, .toc a.active { color: #667eea; padding-right: 10px; font-weight: 600; }
.toc ul ul { margin-right: 1rem; margin-top: 0.5rem; }

.related-list { display: flex; flex-direction: column; gap: 1rem; }

.related-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    transition: background 0.3s ease;
}
.related-item:hover { background: #f8f9fa; }

.related-item img {
    width: 80px; height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.related-content h5 { margin: 0 0 0.5rem; font-size: 1rem; line-height: 1.3; color: #a3a3a3; }
.related-content h5:hover { color: #667eea; }
.related-date { font-size: 0.8rem; color: #888; }

/* Site stats widget */
.site-stats { display: flex; flex-direction: column; gap: 1rem; }
.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}
.stat-item i {
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.stat-item .stat-number { font-size: 1.3rem; font-weight: 800; color: #333; display: block; }
.stat-item .stat-label { font-size: 0.85rem; color: #888; }
body.dark-mode .stat-item { background: #0d1117; }
body.dark-mode .stat-item .stat-number { color: #eee; }

/* Quick links widget */
.quick-links { display: flex; flex-direction: column; gap: 0.3rem; }
.quick-links a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #666;
    text-decoration: none;
    padding: 0.6rem 0.2rem;
    font-size: 0.92rem;
    border-bottom: 1px solid #f0f0f5;
    transition: color 0.25s ease, padding-right 0.25s ease;
}
.quick-links a:last-child { border-bottom: none; }
.quick-links a i { color: #a0a0d0; font-size: 0.85rem; width: 16px; text-align: center; }
.quick-links a:hover { color: #667eea; padding-right: 0.5rem; }
body.dark-mode .quick-links a { color: #9aa4b2; border-bottom-color: #1e2733; }
body.dark-mode .quick-links a:hover { color: #a78bfa; }

.sidebar-newsletter-form { display: flex; flex-direction: column; gap: 1rem; }

.sidebar-newsletter-form input {
    padding: 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: right;
    direction: rtl;
    transition: border-color 0.3s ease;
}
.sidebar-newsletter-form input:focus { outline: none; border-color: #667eea; }

.sidebar-newsletter-form button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.sidebar-newsletter-form button:hover { transform: translateY(-2px); }

.tags-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tag-link {
    background: #f8f9fa;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}
.tag-link:hover { background: #667eea; color: white; transform: translateY(-2px); }

/* tag-link في الوضع المظلم */
body.dark-mode .tag-link {
    background: #1a2535;
    color: #94a3b8;
    border-color: rgba(255,255,255,0.08);
}
body.dark-mode .tag-link:hover {
    background: #667eea;
    color: white;
    border-color: transparent;
}
/* ===== Comments ===== */
.comments-section {
    background: white;
    padding: 4rem 0;
    border-top: 1px solid #e9ecef;
}
.comments-section h3 { color: #333; margin-bottom: 2rem; font-size: 2rem; }

.comment-form {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 3rem;
}
body.dark-mode .comments-section { background: #15212c; }
body.dark-mode .comment-form { background: #15212c; color: #f1f1f1; }
body.dark-mode .comment-form h4 { color: #f1f1f1; }
.comment-form h4 { color: #333; margin-bottom: 1.5rem; }

.form-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group input {
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    text-align: right;
    direction: rtl;
    transition: border-color 0.3s ease;
}
body.dark-mode .form-group input { background: #172836; color: #f1f1f1; }
.form-group input:focus { outline: none; border-color: #667eea; }

.comment-form textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    text-align: right;
    direction: rtl;
    resize: vertical;
    min-height: 120px;
    margin-bottom: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}
body.dark-mode .comment-form textarea { background: #172836; color: #f1f1f1; }
.comment-form textarea:focus { outline: none; border-color: #667eea; }

.submit-comment {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}
.submit-comment:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102,126,234,0.3);
}

.comments-list { display: flex; flex-direction: column; gap: 2rem; }

.comment {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    animation: fadeInUp 0.6s ease;
}
body.dark-mode .comment { background: #172836; }
body.dark-mode h3#comments-heading { color: #f1f1f1; }
.comment-avatar img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.comment-content { flex: 1; }

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.comment-header h5 { color: #333; margin: 0; font-size: 1.1rem; }
.comment-date { color: #888; font-size: 0.9rem; }
.comment-content p { color: #666; line-height: 1.6; margin-bottom: 1rem; }
.comment-actions { display: flex; gap: 1rem; }
body.dark-mode .comment-header h5 { color: #dddddd; }
body.dark-mode .comment-date { color: #dddddd; }
body.dark-mode .comment-content p { color: #dddddd; }

.like-btn, .reply-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.3rem 0;
    transition: color 0.3s ease;
}
.like-btn:hover, .reply-btn:hover { color: #667eea; }
.like-btn { display: flex; align-items: center; gap: 0.3rem; }

/* =============================================
   ANIMATIONS
   ============================================= */
.fade-in { animation: fadeIn 0.6s ease; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up { animation: slideUp 0.8s ease; }

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

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.loading {
    display: inline-block;
    width: 20px; height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}
body.dark-mode ::-webkit-scrollbar-thumb { background: #0a1118; }

/* =============================================
   FOCUS / ACCESSIBILITY
   ============================================= */
.nav-link:focus,
.cta-button:focus,
.read-more:focus,
.newsletter-form input:focus,
.newsletter-form button:focus {
    outline: 2px solid #ffd700;
    outline-offset: 2px;
}

/* =============================================
   RESPONSIVE — TABLET (max 1024px)
   ============================================= */
@media (max-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .article-sidebar { order: -1; }
    .sidebar-widget { padding: 1.5rem; }
}

/* =============================================
   RESPONSIVE — MOBILE (max 1150px)
   ============================================= */
@media (max-width: 1150px) {

    .hamburger { display: flex; z-index: 1002; position: relative; }
    #search-toggle { display: none; }
    .nav-actions { display: flex; }

    .nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1000;
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }
    .nav-overlay.active { display: block; }
    body.sidebar-open { overflow: hidden; }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        min-height: 100%;
        background: rgba(9, 7, 27, 0.87);
        backdrop-filter: blur(100px);
        -webkit-backdrop-filter: blur(100px);
        flex-direction: column;
        z-index: 1001;
        overflow-y: auto;
        padding: 5rem 0 2rem;
        gap: 0;
        text-align: right;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }
    .nav-menu.active { right: 0; }

    body.dark-mode .nav-menu { background: #15212c; color: #f8f8f8; }

    .nav-menu .nav-item { margin: 0 !important; padding: 0 !important; width: 100%; }

    .nav-menu .nav-link {
        padding: 0.85rem 2rem;
        display: block;
        width: 100%;
        font-size: 1.05rem;
        border-radius: 0;
        position: relative;
    }
    .nav-menu .nav-link.active { background: transparent; transform: none; }
    .nav-menu .nav-link.active::after { display: none; }
    .nav-menu .nav-link.active::before {
        content: '';
        position: absolute;
        bottom: 0;
        right: 2rem;
        left: 2rem;
        height: 2px;
        background: #ffd700;
        border-radius: 2px;
    }
    .nav-menu .nav-link:hover { background: rgba(255,255,255,0.12); transform: none; }

    /* ✅ Collapsible accordion — كتبقى مسدودة حتى تضغط عليها */
    .nav-item.has-dropdown > .dropdown-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
    }
    .dropdown-toggle i {
        display: inline-block;
        transition: transform 0.3s ease;
    }
    .nav-item.has-dropdown.open .dropdown-toggle i {
        transform: rotate(180deg);
    }

    .nav-item.has-dropdown .dropdown-menu {
        display: block;
        position: static;
        box-shadow: none;
        border-radius: 0;
        background: rgba(255,255,255,0.05);
        padding: 0;
        margin: 0;
        animation: none;
        min-width: unset;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
    }
    .nav-item.has-dropdown.open .dropdown-menu {
        max-height: 600px;
    }
    .nav-item.has-dropdown .dropdown-menu::before { display: none; }

    .dropdown-link {
        color: white;
        padding: 0.85rem 2rem;
        margin: 0;
        font-size: 1.05rem;
        font-weight: 500;
        text-align: right;
        display: block;
        transition: background 0.2s ease;
    }
    .dropdown-link:hover { background: rgba(255,255,255,0.12); color: white; padding-right: 2rem; }

    .nav-search-bar,
    .nav-darkmode-mobile { display: block; padding: 0.3rem 0; margin: 0; }

    .sidebar-search {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        background: rgba(255,255,255,0.15);
        border-radius: 25px;
        padding: 0.7rem 1.2rem;
        margin: 0.3rem 1.5rem;
    }
    .sidebar-search i { color: rgba(255,255,255,0.7); font-size: 0.95rem; }
    .sidebar-search input {
        background: transparent;
        border: none;
        outline: none;
        color: white;
        font-family: 'Cairo', sans-serif;
        font-size: 0.95rem;
        width: 100%;
        direction: rtl;
    }
    .sidebar-search input::placeholder { color: rgba(255,255,255,0.5); }

    .sidebar-darkmode-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.7rem;
        background: rgba(255,255,255,0.15);
        border: none;
        color: white;
        width: calc(100% - 3rem);
        margin: 0.3rem 1.5rem;
        padding: 0.7rem 1.2rem;
        border-radius: 25px;
        font-family: 'Cairo', sans-serif;
        font-size: 1rem;
        cursor: pointer;
        transition: background 0.3s ease;
    }
    .sidebar-darkmode-btn:hover { background: rgba(255,255,255,0.25); }
    .search-hint { display: none; }

    .hero-content h1 { font-size: 1.5rem; }
    .hero-content { padding: 0.5rem; }
    .articles-grid { grid-template-columns: 1fr; gap: 1.5rem; }

    .newsletter-form { flex-direction: column; gap: 1rem; }
    .newsletter-form input, .newsletter-form button { width: 100%; }

    .footer-bottom-content { flex-direction: column; text-align: center; gap: 1rem; }
    .section-title { font-size: 2rem; }
    .newsletter-content h2 { font-size: 2rem; }

    .article-title { font-size: 2.5rem; }
    .article-meta-info { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .article-content { padding: 2rem 1.5rem; }
    .author-bio { flex-wrap: wrap; text-align: right; }
    .author-bio .author-info { flex: 1 1 100%; width: 100%; }
    .article-stats { flex-wrap: wrap; }
    .form-group { grid-template-columns: 1fr; }
    .comment { padding: 1rem; }
    .share-buttons { gap: 0.5rem; }
    .tips-list .tip-item { flex-direction: column; text-align: center; }
}

/* =============================================
   RESPONSIVE — SMALL MOBILE (max 480px)
   ============================================= */
@media (max-width: 480px) {
    .hero-content h1 { font-size: 2rem; }
    .hero-content p { font-size: 1rem; }
    .articles-grid { grid-template-columns: 1fr; }
    .article-card { margin: 0 10px; }
    .footer-content { grid-template-columns: 1fr; gap: 2rem; }
    .nav-logo h1 { font-size: 1.5rem; }
    .container { padding: 0 15px; }
    .article-hero { padding: 6rem 0 3rem; }
    .article-title { font-size: 2rem; }
    .article-content { padding: 1.5rem 1rem; }
    .article-body { font-size: 1rem; }
    .lead { font-size: 1.1rem; padding: 1rem; }
    .article-body h2 { font-size: 1.7rem; }
    .article-body h3 { font-size: 1.4rem; }
    .sidebar-widget { padding: 1rem; }
    .comment-form { padding: 1.5rem; }
    .author-avatar-large img { width: 80px; height: 80px; }
}

/* =============================================
   PRINT
   ============================================= */
@media print {
    .header, .hero, .newsletter, .footer,
    .article-sidebar, .comments-section, .social-share { display: none !important; }
    .articles { padding: 0; }
    .article-layout { grid-template-columns: 1fr; }
    .article-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 2rem;
    }
    .article-content { box-shadow: none; padding: 0; }
    .article-hero { background: none !important; color: black !important; padding: 2rem 0; }
}


/* =============================================
   SKELETON LOADING (بديل الـ Spinner الكبير)
   ============================================= */
:root {
    --sk-base: #e9ecf6;
    --sk-shine: rgba(255, 255, 255, 0.65);
}
body.dark-mode {
    --sk-base: #243248;
    --sk-shine: rgba(255, 255, 255, 0.08);
}

/* بلوك رمادي */
.sk {
    display: block;
    height: 12px;
    border-radius: 8px;
    background: var(--sk-base);
}
.sk-line  { height: 12px; }
.sk-title { height: 18px; }

/* Shimmer واحد لكل حاوية (transform فقط = خفيف على الـ GPU) */
.sk-wrap {
    position: relative;
    overflow: hidden;
}
.sk-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 20%, var(--sk-shine) 50%, transparent 80%);
    transform: translateX(-100%);
    animation: skSweep 1.5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes skSweep {
    to { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
    .sk-wrap::after { animation: none; }
}

/* ----- Skeleton ديال كارد المقال (نفس هيكل .article-card) ----- */
.skeleton-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(102, 126, 234, 0.08);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.08);
    display: flex;
    flex-direction: column;
}
.skeleton-card .sk-image {
    height: auto;
    aspect-ratio: 16 / 10;
    border-radius: 0;
}
.skeleton-card .sk-body {
    padding: 1.6rem 1.8rem 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.skeleton-card .sk-btn {
    height: 38px;
    width: 120px;
    border-radius: 10px;
    margin-top: 0.4rem;
}
body.dark-mode .skeleton-card {
    background: #1a2535;
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
@media (max-width: 600px) {
    .skeleton-card:nth-child(n+4) { display: none; }
}

/* ----- صورة الكارد: fade-in فور ما تجهز (كتخدم غير مع img.fade-img) ----- */
.article-image img.fade-img {
    opacity: 0;
    transition: transform 0.45s ease, opacity 0.5s ease;
}
.article-image img.fade-img.loaded { opacity: 1; }
.article-image img.fade-img.img-failed { display: none; }

/* ----- حالة الخطأ داخل الشبكة + زر إعادة المحاولة ----- */
.articles-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}
.articles-error i {
    font-size: 2.6rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.7;
}
.articles-error h3 {
    font-size: 1.05rem;
    color: #64748b;
    margin-bottom: 1.2rem;
    line-height: 1.7;
}
body.dark-mode .articles-error h3 { color: #94a3b8; }

.retry-btn {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    padding: 0.7rem 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
}
.error .retry-btn { margin-inline-start: 0.8rem; padding: 0.4rem 1rem; }

/* ----- Popup مشكل الإنترنت ----- */
.conn-popup {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(10, 8, 30, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.25s ease;
    font-family: 'Cairo', sans-serif;
}
.conn-popup.show { opacity: 1; }
.conn-popup-box {
    width: 100%;
    max-width: 380px;
    text-align: center;
    background: #ffffff;
    border-radius: 18px;
    padding: 2rem 1.75rem 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(16px) scale(0.97);
    transition: transform 0.25s ease;
}
.conn-popup.show .conn-popup-box { transform: none; }
.conn-popup-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.conn-popup-box h3 {
    font-size: 1.2rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}
.conn-popup-box p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #64748b;
    margin-bottom: 1.25rem;
}
.conn-popup-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
}
.conn-btn-secondary {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.7rem 1.3rem;
    cursor: pointer;
    transition: background 0.2s ease;
}
.conn-btn-secondary:hover { background: #f1f5f9; }
body.dark-mode .conn-popup-box { background: #1a2535; }
body.dark-mode .conn-popup-box h3 { color: #e2e8f0; }
body.dark-mode .conn-popup-box p { color: #94a3b8; }
body.dark-mode .conn-btn-secondary { color: #94a3b8; border-color: rgba(255, 255, 255, 0.12); }
body.dark-mode .conn-btn-secondary:hover { background: rgba(255, 255, 255, 0.06); }

/* ----- صفحة المقال: Skeleton بدل الـ Loader الكبير ----- */
.article-skeleton { display: none; }
.is-loading .article-skeleton { display: block; }
.is-loading .article-header,
.is-loading .article-featured-image,
.is-loading .article-body,
.is-loading .article-tags,
.is-loading .social-share { display: none; }

.article-skeleton .sk-badge { width: 90px; height: 32px; border-radius: 20px; margin: 0 auto 20px; }
.article-skeleton .sk-h1    { height: 32px; width: 90%; margin: 0 auto 14px; }
.article-skeleton .sk-meta  { height: 14px; width: 42%; margin: 24px auto 40px; }
.article-skeleton .sk-hero  { height: 400px; border-radius: 12px; margin-bottom: 40px; }
.article-skeleton .sk-p     { height: 14px; margin-bottom: 14px; }
@media (max-width: 768px) {
    .article-skeleton .sk-h1   { height: 24px; }
    .article-skeleton .sk-hero { height: 220px; }
}

.article-featured-image { background: linear-gradient(135deg, #dde4ff 0%, #ede5ff 100%); }
body.dark-mode .article-featured-image { background: #1a2535; }

/* ----- Skeleton ديال "مقالات ذات صلة" ----- */
.sk-related {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}
.sk-related .sk-related-img { width: 90px; height: 75px; border-radius: 0; flex-shrink: 0; }
.sk-related-body {
    flex: 1;
    padding: 0.6rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
#related-desktop-list .sk-related + .sk-related { margin-top: 0.8rem; }
body.dark-mode .sk-related { background: #1a2535; }


/* ----- Skeleton ديال ويدجتات الـ Sidebar (وسوم / الأكثر مشاهدة / أرشيف) ----- */
.sk-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; width: 100%; }
.sk-tags .sk-tag { height: 34px; border-radius: 20px; }

.sk-list { display: flex; flex-direction: column; gap: 1rem; width: 100%; }
.sk-item { display: flex; gap: 1rem; padding: 1rem; }
.sk-item .sk-thumb { width: 80px; height: 60px; border-radius: 8px; flex-shrink: 0; }
.sk-item-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 0.6rem; }

.sk-links { display: flex; flex-direction: column; gap: 0.3rem; width: 100%; }
.sk-links .sk-link { height: 14px; margin: 0.85rem 0.2rem; }
.home-inline-ad {
    grid-column: 1 / -1;
    width: 100%;
    text-align: center;
    margin: 25px 0;
    min-height: 100px;
}

.home-inline-ad .ad-label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}