:root {
    --bg-matrix: #F3F6FD; --surface-matrix: #FFFFFF; --text-matrix: #0F172A;
    --text-muted: #64748B; --accent-matrix: #10B981; --border-matrix: rgba(0,0,0,0.06);
    --shadow-soft: 0 10px 40px rgba(0,0,0,0.04); --x-color: #000000;
    --gnews-color: #4285F4; --ease-matrix: cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-mode {
    --bg-matrix: #07090E; --surface-matrix: #121723; --text-matrix: #F8FAFC;
    --text-muted: #9CA3AF; --border-matrix: rgba(255,255,255,0.06);
    --shadow-soft: 0 10px 40px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; outline: none; }
/* reset عام — خارج محتوى المقال فقط */
:not(.article-body) ul,
:not(.article-body) ol { list-style: none; margin: 0; padding: 0; }
:not(.article-body) li { list-style: none; margin: 0; padding: 0; }
:not(.article-body) li::before,
:not(.article-body) li::after { display: none; }

/* قوائم محتوى المقال — طبيعية وقابلة للقراءة */
.article-body ul { list-style: disc; padding-right: 22px; margin: 0 0 16px; }
.article-body ol { list-style: decimal; padding-right: 22px; margin: 0 0 16px; }
.article-body li { list-style: inherit; margin-bottom: 8px; padding: 0; }
.article-body li::before,
.article-body li::after { display: unset; }

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background: var(--bg-matrix);
    color: var(--text-matrix);
    font-family: "Noto Naskh Arabic", serif;
    margin: 0;
    direction: rtl;
    line-height: 1.8;
    transition: background 0.3s;
    overflow-x: hidden;
}

.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
img { max-width: 100%; height: auto; display: block; border-radius: 16px; }
body.no-scroll { overflow: hidden !important; }

.main-header-2030 { background: var(--surface-matrix); border-bottom: 1px solid var(--border-matrix); height: 85px; position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; backdrop-filter: blur(15px); }
.header-container-fluid { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.matrix-logo-img { height: 42px !important; width: auto !important; display: block; }
.header-nav-center-2030 { flex: 1; display: flex; justify-content: center; min-width: 0; }
.elite-nav-links { display: flex; gap: 30px; }
.elite-nav-links li a { font-weight: 700; padding: 10px; color: var(--text-matrix); font-size: 16px; transition: 0.3s; }
.elite-nav-links li a:hover { color: var(--accent-matrix); }

.header-tools-left-2030 { display: flex; gap: 12px; align-items: center; }
.tool-action-btn { background: var(--bg-matrix); border: 1px solid var(--border-matrix); color: var(--text-matrix); width: 45px; height: 45px; border-radius: 12px; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: 0.3s var(--ease-matrix); }
.tool-action-btn:hover { background: var(--accent-matrix); color: #fff; transform: translateY(-3px); }

.elite-search-overlay { position: fixed; inset: 0; width: 100%; height: 100vh; background: rgba(11, 15, 25, 0.96); backdrop-filter: blur(20px); z-index: 9999; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: 0.4s var(--ease-matrix); }
.elite-search-overlay.open { opacity: 1; visibility: visible; }
.search-inner-2030 { width: 100%; max-width: 800px; position: relative; padding: 0 25px; }
.search-form-2030 { display: flex; width: 100%; position: relative; }
.search-field-2030 { width: 100%; height: 80px; border-radius: 40px; border: 2px solid var(--accent-matrix); background: transparent; color: #fff; font-size: 24px; padding: 0 35px 0 85px; font-family: "Noto Naskh Arabic", serif; }
.search-btn-2030 { position: absolute; left: 12px; top: 12px; height: 56px; width: 56px; border-radius: 50%; background: var(--accent-matrix); border: none; font-size: 22px; cursor: pointer; color: #fff; }
.close-search-2030 { position: absolute; top: -70px; left: 20px; background: none; border: none; color: #fff; font-size: 55px; cursor: pointer; }

.side-panel-2030 { position: fixed; top: 0; right: -320px; width: 310px; height: 100vh; background: var(--surface-matrix); z-index: 2000; transition: 0.4s var(--ease-matrix); box-shadow: -15px 0 40px rgba(0,0,0,0.15); }
.side-panel-2030.open { right: 0; }
.panel-header-matrix { padding: 30px 25px; border-bottom: 1px solid var(--border-matrix); display: flex; justify-content: space-between; align-items: center; }
.panel-logo-img { height: 38px; width: auto; }
.close-panel-2030 { font-size: 40px; background: none; border: none; cursor: pointer; color: var(--text-matrix); }
.panel-items-list li a { display: block; padding: 20px 25px; font-size: 18px; font-weight: 700; border-bottom: 1px solid var(--border-matrix); text-align: right; }
.panel-dimmer-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; z-index: 1999; backdrop-filter: blur(5px); }

.seo-breadcrumbs { padding: 15px 0 25px; font-size: 13.5px; font-weight: 600; display: flex; }
.breadcrumbs-inner { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 10px; background: var(--surface-matrix); padding: 12px 25px; border-radius: 12px; border: 1px solid var(--border-matrix); box-shadow: 0 5px 15px rgba(0,0,0,0.02); }
.seo-breadcrumbs a { color: var(--text-matrix); transition: 0.3s; display: flex; align-items: center; }
.seo-breadcrumbs a:hover { color: var(--accent-matrix); }
.seo-breadcrumbs .sep { color: var(--text-muted); opacity: 0.5; font-size: 11px; margin: 0 2px; }
.seo-breadcrumbs .current { color: var(--accent-matrix); font-weight: 800; }

.article-layout-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 40px;
    align-items: start;
}

.article-layout-wrapper > * {
    min-width: 0;
}

.article-main-content,
.article-sidebar,
.single-article,
.single-content,
.article-body,
.related-posts-section,
.comments-wrapper,
.custom-comments-section {
    min-width: 0;
    max-width: 100%;
}

.single-article { background: var(--surface-matrix); padding: 50px; border-radius: 28px; box-shadow: var(--shadow-soft); border: 1px solid var(--border-matrix); margin-bottom: 35px; }
.single-header-center { text-align: center; margin-bottom: 45px; }
.single-title { font-size: 40px; font-weight: 900; color: var(--text-matrix); margin: 0 0 20px 0; line-height: 1.35; overflow-wrap: anywhere; word-break: break-word; }
.single-meta-centered { display: flex; align-items: center; justify-content: center; gap: 18px; color: var(--text-muted); font-size: 15px; font-weight: 700; flex-wrap: wrap; }
.meta-separator { color: var(--border-matrix); font-weight: 300; margin: 0 5px; }
.author-link,
.author-link:visited {
    color: var(--text-muted);
    font-weight: 700;
    text-decoration: none;
}

.author-link:hover,
.author-link:focus {
    color: var(--text-muted);
    opacity: .92;
    text-decoration: none;
}

.single-thumb,
.single-thumb img {
    max-width: 100%;
}

.single-thumb img {
    width: 100%;
    height: auto;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.article-body {
    font-size: 21px;
    line-height: 2.2;
    color: var(--text-matrix);
    text-align: justify;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.article-body p,
.article-body li,
.article-body blockquote,
.article-body h2,
.article-body h3,
.article-body h4 {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.article-body p { margin-bottom: 28px; }
.article-body h2, .article-body h3 { margin: 45px 0 25px; font-weight: 900; color: var(--text-matrix); padding-right: 15px; border-right: 5px solid var(--accent-matrix); }

.single-content > *,
.article-body > * {
    max-width: 100%;
}

.article-body img,
.article-body video,
.article-body iframe,
.article-body embed,
.article-body object,
.article-body figure,
.article-body .wp-block-image,
.article-body .wp-block-embed,
.article-body .wp-caption,
.article-body .twitter-tweet,
.article-body .instagram-media {
    max-width: 100% !important;
    height: auto;
}

.article-body iframe {
    width: 100%;
    min-height: 320px;
    border: 0;
}

.article-body table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
}

.article-body pre,
.article-body code {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.modern-action-bar-2026 { display: flex; align-items: center; gap: 15px; background: var(--surface-matrix); padding: 12px 22px; border-radius: 60px; border: 1px solid var(--border-matrix); margin: 40px 0; box-shadow: var(--shadow-soft); }
.gnews-pill { flex: 1; display: flex; align-items: center; gap: 12px; background: #f1f3f4; padding: 12px 22px; border-radius: 40px; font-weight: 900; font-size: 15px; color: #3c4043; transition: 0.3s; min-width: 0; }
.gnews-pill:hover { background: #e8eaed; transform: translateY(-2px); }
.gnews-pill img { width: 22px; height: 22px; flex: 0 0 auto; }
.gnews-pill span { overflow-wrap: anywhere; }

.related-posts-section { background: var(--surface-matrix); padding: 40px; border-radius: 28px; border: 1px solid var(--border-matrix); margin-bottom: 35px; box-shadow: var(--shadow-soft); }
.related-title { font-size: 24px; font-weight: 900; margin-bottom: 30px; color: var(--text-matrix); padding-right: 15px; border-right: 5px solid var(--accent-matrix); }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.post-card { min-width: 0; }
.post-card a { display: block; background: var(--bg-matrix); border-radius: 20px; overflow: hidden; border: 1px solid var(--border-matrix); transition: 0.3s; height: 100%; }
.post-card a:hover { transform: translateY(-6px); border-color: var(--accent-matrix); box-shadow: var(--shadow-soft); }
.post-card img { width: 100%; height: 170px; object-fit: cover; transition: 0.4s; }
.card-content { padding: 18px; min-width: 0; }
.card-content h3 { font-size: 16px; font-weight: 800; line-height: 1.5; margin: 0; color: var(--text-matrix); overflow-wrap: anywhere; word-break: break-word; }

.article-sidebar {
    position: sticky;
    top: 110px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    min-width: 0;
}

.custom-comments-section { background: var(--surface-matrix); padding: 45px; border-radius: 28px; border: 1px solid var(--border-matrix); box-shadow: var(--shadow-soft); margin-bottom: 50px; }

.elite-footer-2030 { background: var(--surface-matrix); border-top: 1px solid var(--border-matrix); padding: 70px 0 30px; margin-top: 70px; }
.footer-grid-2030 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 50px; margin-bottom: 50px; }
.footer-logo img { height: 48px; margin-bottom: 20px; }
.footer-links-col h3 { font-size: 20px; font-weight: 900; margin-bottom: 25px; position: relative; padding-bottom: 12px; }
.footer-links-col h3::after { content: ''; position: absolute; right: 0; bottom: 0; width: 40px; height: 4px; background: var(--accent-matrix); border-radius: 2px; }
.footer-menu-list li a { color: var(--text-matrix); font-weight: 700; font-size: 15px; transition: 0.3s; display: block; margin-bottom: 12px; overflow-wrap: anywhere; }
.footer-menu-list li a:hover { color: var(--accent-matrix); transform: translateX(-5px); }
.social-icons-wrapper { display: flex; gap: 15px; flex-wrap: wrap; }
.social-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--bg-matrix); display: flex; justify-content: center; align-items: center; border: 1px solid var(--border-matrix); transition: 0.4s; }
.social-icon.youtube:hover { background: #FF0000; color: #fff; border-color: #FF0000; }
.footer-bottom-2030 { text-align: center; border-top: 1px solid var(--border-matrix); padding-top: 30px; font-size: 15px; opacity: 0.8; }

.hide-on-mobile { display: block; }
.hide-on-desktop { display: block; }

.footer-menu-list,
.panel-items-list,
.elite-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

#sidebarOverlayBg[hidden] { display: none !important; }

.single-gnews-bar{
    justify-content:center;
    padding:10px 14px;
    margin:26px 0 34px;
}

.compact-gnews-pill{
    flex:0 1 auto;
    min-width:0;
    max-width:100%;
    padding:10px 16px;
    border-radius:16px;
    font-size:14px;
    font-weight:800;
    justify-content:center;
}

.compact-gnews-pill img{
    width:20px;
    height:20px;
}

/* تابلت: السايدبار يختفي ويصبح عمود واحد */
@media (max-width: 900px) and (min-width: 769px) {
    .article-sidebar { display: none !important; }
    .article-layout-wrapper {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }
}

@media (max-width: 992px) {
    .hide-mobile, .seo-breadcrumbs { display: none !important; }

    .article-sidebar { display: none !important; }
    .article-layout-wrapper {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .main-header-2030 { height: 75px; }
    .mobile-menu-toggle-btn { display: flex !important; }
    #searchTrigger { display: none !important; }

    .single-container,
    .article-layout-wrapper,
    .article-main-content,
    .single-article,
    .single-content,
    .article-body,
    .related-posts-section,
    .custom-comments-section {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .single-container { padding: 0; }
    .single-article { border-radius: 0; border: none; padding: 35px 20px; margin-bottom: 0; }
    .single-title { font-size: 28px; }
    .article-body { font-size: 19.5px; }

    .modern-action-bar-2026 {
        margin: 25px 15px;
        padding: 12px 15px;
        border-radius: 20px;
        flex-wrap: wrap;
    }

    .gnews-pill {
        width: 100%;
        min-width: 0;
        padding: 10px 15px;
        gap: 8px;
    }

    .gnews-pill span { font-size: 11.5px; }
    .gnews-pill img { width: 18px; }

    .related-posts-section { padding: 35px 20px; border-radius: 0; border: none; border-top: 8px solid var(--bg-matrix); }
    .related-grid { display: flex; overflow-x: auto; gap: 15px; padding-bottom: 20px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
    .related-grid::-webkit-scrollbar { display: none; }
    .post-card { flex: 0 0 85%; scroll-snap-align: center; min-width: 0; }

    .custom-comments-section { padding: 35px 20px; border-radius: 0; border: none; border-top: 8px solid var(--bg-matrix); margin-bottom: 0; }

    .footer-grid-2030 { grid-template-columns: 1fr; text-align: center; gap: 40px; }
    .footer-logo img { margin: 0 auto; }
    .footer-links-col h3::after { right: 0; left: 0; margin: 0 auto; }
    .social-icons-wrapper { justify-content: center; }

    .article-body iframe {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 220px;
    }

    .single-gnews-bar{
        margin:20px 10px 26px;
        padding:10px 12px;
        border-radius:16px;
    }

    .compact-gnews-pill{
        width:100%;
        padding:10px 14px;
        font-size:13px;
    }

    .compact-gnews-pill img{
        width:18px;
        height:18px;
    }
}

@media (max-width: 768px) {
    .hide-on-mobile { display: none !important; }
}

@media (min-width: 769px) {
    .hide-on-desktop { display: none !important; }
}

.mobile-menu-toggle-btn{
    display:none;
}

@media (max-width: 992px){
    .mobile-menu-toggle-btn{
        display:flex !important;
    }
}

.article-body img,
.article-body video,
.article-body figure {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.article-body figure {
    width: fit-content;
    max-width: 100%;
    margin-bottom: 28px;
}