:root {
    --primary-color: #3b82f6;
    --primary-dark: #1e40af;
    --secondary-color: #ef4444;
    --accent-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
}

a {
    text-decoration: none !important;
    color: #000000
}


/* Critical CSS - Above the fold */

body {
    background-color: var(--bg-color) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.card {
    border: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

button {
    border: none !important;
    box-shadow: none !important;
}

button:focus {
    box-shadow: none !important;
}

#main-content {
    width: 100%;
    overflow: hidden;
    min-height: 600px;
}

.navbar {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 !important;
}

.dropdown-toggle::after {
    vertical-align: middle !important;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.navbar-brand img {
    width: auto;
    height: 60px
}

.nav-link {
    color: var(--text-color) !important;
    position: relative;
    transition: all 0.3s ease;
    line-height: 70px;
}

.nav-link:focus {
    outline: 0;
}

.themeSwitch {
    cursor: pointer;
    color: orange;
    background: rgba(0, 0, 0, 0.1);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
}

.themeSwitch:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.themeSwitch:hover {
    /*    background: rgba(0, 0, 0, 0.2);*/
    transform: rotate(15deg);
}

.header-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 1.25rem;
    background: linear-gradient(45deg, var(--primary-dark), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.header-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 37.5rem;
    margin-right: auto;
    margin-left: auto;
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.stat-box {
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 1.25rem;
    border-radius: 0.75rem;
    backdrop-filter: blur(10px);
    min-width: 9.375rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    display: block;
    color: white;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.section-title {
    color: var(--primary-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.625rem;
    margin-bottom: 1.5rem;
    font-weight: bold;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.news-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.news-card:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.news-card:hover {
    transform: translateY(-0.5rem);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.news-image {
    height: 12.5rem;
    object-fit: cover;
    width: 100%;
    background-color: #e2e8f0;
}

.news-card .card-body {
    padding: 1.25rem;
}

.news-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer {
    background-color: var(--card-bg);
    color: var(--text-color);
    padding: 2.5rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    font-size: 17px;
}

footer ul {
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: end;
}

footer ul li a {
    display: block;
    margin-left: 20px;
    color: var(--text-muted);
}

.copyright a {
    color: var(--text-muted);
    text-decoration: underline !important;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}

.footer-links a:focus {
    outline: 1px solid var(--primary-color);
    outline-offset: 2px;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.social-icons a {
    color: var(--text-color);
    transition: color 0.3s;
}

.social-icons a:focus {
    outline: 1px solid var(--primary-color);
    outline-offset: 2px;
}

.social-icons a:hover {
    color: var(--primary-color);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.5);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:focus {
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.5);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

.form-control {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.form-control:focus {
    background-color: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--text-color);
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}


/* Loading states */

.loading {
    opacity: 0.7;
    pointer-events: none;
}

.sidebar-card {
    margin-bottom: 25px;
    border: none;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.article-card {
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 20px;
    border: none;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.post-card-big {
    /*    height: 246px;*/
    overflow: hidden;
}

.main-card .article-img {
    height: 100%;
    object-fit: cover;
    display: block;
}

.min-card .article-img {
    height: 200px;
    object-fit: cover;
}

.sidebar-header {
    display: flex;
    align-items: center;
    color: white;
    padding: 12px 15px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 15px;
}

.sidebar-card-inner {
    padding: 0 10px;
}

.sidebar-header i {
    margin-left: 10px;
    font-size: 1.2rem;
}

.sidebar-card .post-thumbnail {
    width: 100%;
    height: 100px;
}

.post-card .post-thumbnail {
    width: 100%;
    height: 180px;
}

.post-thumbnail img {
    height: 100%;
    width: 100%;
    object-fit: cover
}

p.card-text {
    font-size: 14px;
}

.sidebar-card .card-body {
    padding-top: 5px;
}

.post-tags a {
    background-color: rgb(255 255 255) !important;
    color: rgb(0 0 0) !important;
    border: 1px solid #ddd;
    --bs-badge-padding-x: 0.65em;
    --bs-badge-padding-y: 0.35em;
    --bs-badge-font-size: 0.75em;
    --bs-badge-font-weight: 700;
    --bs-badge-border-radius: var(--bs-border-radius);
    display: inline-block;
    padding: var(--bs-badge-padding-y) var(--bs-badge-padding-x);
    border-radius: var(--bs-badge-border-radius);
    margin-bottom: 10px;
    transition: all 0.4s;
}

.post-tags a:hover {
    opacity: 0.7
}


/*بداية كود search*/

.search-icon {
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
}

.search-icon:hover {
    transform: scale(1.1);
}

.search-container {
    position: relative;
}

.search-box {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 0;
    overflow: hidden;
    transition: width 0.4s ease;
    display: flex;
    background: white;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999999;
}

.search-box.active {
    width: 320px;
}

.search-input {
    border: none;
    padding: 0.9rem 1.4rem;
    border-radius: 30px;
    width: 100%;
    outline: none;
    font-size: 1.1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #333;
}

.search-box.active .search-input {
    opacity: 1;
}

.search-btn {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    margin: 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
    font-weight: 600;
    white-space: nowrap;
}

.search-btn:hover {
    background: linear-gradient(135deg, #5a0db9 0%, #1c67e3 100%);
}

.search-box.active .search-btn {
    opacity: 1;
}

@media (max-width: 768px) {
    .search-box.active {
        width: 250px;
    }
    .search-btn {
        padding: 0.7rem 1rem;
    }
    .navbar-brand img {
        height: 46px
    }
    .nav-link {
        line-height: normal;
    }
}

@media (max-width: 480px) {
    .search-box.active {
        width: 200px;
    }
    .search-input {
        padding: 0.7rem 1rem;
    }
    .search-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    .search-icon {
        width: 45px;
        height: 45px;
    }
}


/*نهاية كود search*/


/* Reduced motion support */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* High contrast support */

@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ff;
        --text-color: #000000;
        --bg-color: #ffffff;
    }
}

@media (max-width: 768px) {
    .header-stats {
        gap: 1rem;
    }
    .stat-box {
        min-width: 7.5rem;
        padding: 1rem;
    }
    .stat-number {
        font-size: 1.5rem;
    }
    .about-section,
    .news-card .card-body {
        padding: 1.5rem;
    }
}


/* Print styles */

@media print {
    .navbar,
    .themeSwitch,
    footer {
        display: none;
    }
    .main-header {
        background: white !important;
        color: black !important;
    }
    .header-title {
        background: none !important;
        -webkit-text-fill-color: black !important;
        color: black !important;
    }
}


/*
/////////////////////////////////////////////
/////////////////////////////////////////////
/////////////////////////////////////////////*/

.comments-block {
    margin: 40px 0;
}

.all-comments .comment-content {
    margin: 15px 0;
    font-size: 0.88rem !important;
    padding: 0 !important;
    line-height: inherit !important;
}

.all-comments .comment-reply {
    font-weight: 400;
    color: #777;
    font-size: 13px;
    border: 1px solid #dadada;
    padding: 5px 10px;
    border-radius: 3px;
}

.all-comments .comment-reply:hover {
    background: var(--bs-primary);
    color: #fff;
}

.comments-counter {
    font-size: 18px;
}

.comments-counter a {
    color: #323232;
}

.all-comments {
    list-style: none;
    margin: 0;
    padding: 20px 0;
}

.all-comments .comment {
    border-bottom: 1px solid #e7e7e7;
    padding-bottom: 20px;
    margin-bottom: 20px;
    display: flex;
}

.all-comments .comment.last {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}

.all-comments img.commented-person {
    height: 80px;
    margin-right: 20px;
    border-radius: 5px;
}

img.avatar {
    margin-left: 20px;
    border-radius: 5px;
    width: auto;
}

.all-comments .commented-person-name {
    margin-bottom: 0;
    margin-top: 0;
    font-weight: 600;
    font-size: 18px;
    color: #303030;
}

.comment-date {
    display: block;
    font-size: 10px
}

.all-comments .comment-hour {
    color: #959595;
    font-size: 14px;
}

.comments-reply {
    list-style: none;
    margin: 0 0 0 70px;
}

.comment-form {
    margin-bottom: 0;
}

.comment-form .title-normal {
    font-size: 22px;
}

.comment-form .comments-btn {
    margin-top: 10px;
    font-size: 12px;
}


/*
/////////////////////////////////////////////
/////////////////////////////////////////////
/////////////////////////////////////////////*/


/* القائمة الجانبية للجوال */

.offcanvas-header {
    background: #ffffff;
}

.offcanvas-body {
    background: #f8f9fa;
}

.offcanvas .mobile-nav .nav-link {
    padding: 12px 20px;
}

.offcanvas .social-nav a {
    background: #ffffff;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 5px;
    border-radius: 50%;
    font-size: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.social-nav a:hover {
    transform: translateY(-3px);
}

.offcanvas .social-nav a i {
    font-size: 1.3rem;
}

.offcanvas .social-nav a svg {
    width: 18px;
    height: 18px
}

.offcanvas .current_page_item .nav-link.active,
.offcanvas .current-menu-item .nav-link.active {
    display: inline-block;
}

button.button-close.text-reset {
    background: no-repeat;
    border: none;
}


/*
/////////////////////////////////////////////
/////////////////////////////////////////////
/////////////////////////////////////////////*/


/* 🎁 الحاوية العامة للويدجات */

.sidebar .box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}


/* ✨ تأثير عند تمرير الفأرة */

.sidebar .box:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
}


/* 🏷️ عنوان الودجت */

.sidebar .wp-block-heading,
.sidebar h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 0;
    border-bottom: 2px solid #007bff;
    display: inline-block;
    padding-bottom: 10px;
}


/* 🗂️ القوائم داخل الودجت */

.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar ul li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}


/* 🖇️ روابط العناصر */

.sidebar ul li a {
    color: #444;
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
    line-height: 1.5;
}

.sidebar ul li a:hover {
    color: #007bff;
}


/* 📰 قائمة أحدث المقالات */

.sidebar .wp-block-latest-posts__list li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}


/* 💬 تنسيق التعليقات الأخيرة */

.sidebar .wp-block-latest-comments__comment {
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}


/* 📚 تنسيق الأرشيف والتصنيفات */

.sidebar select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 14px;
}


/* 🧩 النصوص داخل الودجت */

.sidebar p {
    color: #555;
    line-height: 1.7;
}


/* 🌈 تحسين التباعد العام */

.sidebar .wp-block-group__inner-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.article-share a,
.article-share button {
    font-size: 21px
}

.post-meta {
    color: var(--text-muted) !important;
}


/*
/////////////////////////////////////////////
/////////////////////////////////////////////
/////////////////////////////////////////////*/

[data-theme="dark"] {
    --bg-color: #000000;
    --card-bg: #1e293b;
    --text-color: #ffffff;
    --text-muted: #e2e8f0;
    --border-color: #334155;
}

[data-theme="dark"] .sidebar ul li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .sidebar ul li a {
    color: #ddd;
}

[data-theme="dark"] .sidebar select {
    background: #222;
    color: #fff;
    border-color: #555;
}

[data-theme="dark"] .sidebar .wp-block-latest-comments__comment {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .sidebar p {
    color: #ccc;
}

[data-theme="dark"] .search-icon svg {
    fill: var(--text-color)
}

[data-theme="dark"] .themeSwitch {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .offcanvas-body {
    background: #0f172a;
}

[data-theme="dark"] .sidebar .wp-block-heading,
[data-theme="dark"] .sidebar h2 {
    color: #fff;
    border-color: #4da3ff;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-color);
}

[data-theme="dark"] .article-content p,
[data-theme="dark"] .article-content,
[data-theme="dark"] .small,
[data-theme="dark"] small,
[data-theme="dark"] .card-text,
[data-theme="dark"] .article-comments p,
[data-theme="dark"] .error-description {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .sidebar .box {
    background: #1e293b;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.05);
    color: #eee;
}

[data-theme="dark"] .list-group-item {
    color: var(--text-muted);
    background-color: var(--card-bg);
}

[data-theme="dark"] .card,
[data-theme="dark"] .post-tags a {
    color: var(--text-color) !important;
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color);
}

.offcanvas-header {
    color: var(--text-color) !important;
    background: var(--card-bg) !important;
}

[data-theme="dark"] .form-control {
    color: var(--text-color);
    background-color: var(--card-bg);
    border: var(--bs-border-width) solid var(--border-color);
}

[data-theme="dark"] .navbar {
    background-color: rgba(15, 23, 42, 0.95);
}

[data-theme="dark"] .article-comments a {
    color: var(--text-color);
}

[data-theme="dark"] .page-link {
    color: #000;
}

[data-theme="dark"] .nav-link,
[data-theme="dark"] .breadcrumb-item.active,
[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .current_page_item .nav-link.active,
[data-theme="dark"] .current-menu-item .nav-link.active {
    color: var(--text-color) !important;
}

[data-theme="dark"] .navbar-brand img {
    -webkit-filter: invert(1);
    filter: invert(1);
}

[data-theme="dark"] .error-container {
    background-color: #191d2d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: #f8f9fa;
}


/* لتغيير لون أيقونة زر القائمة (hamburger) إلى أبيض */

[data-theme="dark"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255,1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
    background-color: transparent !important;
    background-repeat: no-repeat;
}

[data-theme="dark"] .search-icon {
    color: var(--text-color) !important;
}

[data-theme="dark"] .btn-close {
    -webkit-filter: invert(1);
    filter: invert(1);
}

[data-theme="dark"] .form-control:focus {
    color: #ffffff;
    background-color: #0f172a;
}

[data-theme="dark"] .form-control::placeholder {
    color: #ccc;
    /* لون أفتح ليتناسب مع الخلفية الداكنة */
    opacity: 1;
}

[data-theme="dark"] .article-card.main-card a,
[data-theme="dark"] .breadcrumb a,
[data-theme="dark"] .article-meta a,
[data-theme="dark"] .related_posts a,
[data-theme="dark"] .article-share a,
[data-theme="dark"] .article-share button {
    color: var(--text-color) !important;
}


/*
/////////////////////////////////////////////
/////////////////////////////////////////////
/////////////////////////////////////////////*/

@media (max-width: 768px) {
    .search-icon,
    .theme-switch {
        font-size: 1.1rem;
    }
    .social-nav a {
        width: 26px;
        height: 26px;
        border-radius: 5px;
    }
    .offcanvas-header button {
        font-size: 12px;
        width: 26px;
        height: 26px;
    }
    .search-box input {
        padding: 15px 25px 15px 25px;
        font-size: 1rem;
    }
    .search-close-btn {
        width: 30px;
        height: 30px;
    }
    .span-folow {
        font-size: 15px;
    }
}

/*
//////////////////////////////////////////////////////
Satart Css 404 error-container
//////////////////////////////////////////////////////
*/
.error-container {
    margin: 0 auto;
    text-align: center;
    padding: 2rem;
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
    border-radius: 15px;
    animation: fadeIn 0.8s ease-in-out;
    transition: all 0.5s ease;
}

.error-icon {
    font-size: 8rem;
    color: #dc3545;
    margin-bottom: 1.5rem;
    animation: bounce 2s infinite;
}

.error-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: color: var(--text-color);
    margin-bottom: 1rem;
    transition: all 0.5s ease;
}

.error-subtitle {
    font-size: 1.5rem;
    color: color: var(--text-color);
    margin-bottom: 2rem;
    transition: all 0.5s ease;
}

.error-description {
    font-size: 1.1rem;
    color: color: var(--text-color);
    margin-bottom: 2.5rem;
    line-height: 1.6;
    transition: all 0.5s ease;
}

.btn-home {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-home:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-30px);
    }

    60% {
        transform: translateY(-15px);
    }
}