@media (max-width: 991px) {
    .nav-menu-list li:hover > ul.sub-menu {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        /*pointer-events: none;*/
    }

    .nav-menu-list li.menu-item-has-children.submenu-open > ul.sub-menu {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: static;
        box-shadow: none;
        background: #f9f9f9;
        padding-left: 20px;
        margin-top: 0;
        border-radius: 0;
        transition: all 0.3s;
    }
    .nav-menu-list li.menu-item-has-children.submenu-open > a:after {
        transform: rotate(180deg);
    }
}
/* Force wider Bootstrap container on large screens */
@media (min-width: 1200px) {
    body .container, body .container-lg, body .container-md, body .container-sm, body .container-xl {
        max-width: 1600px !important;
    }
}
.header-secondary{
    background-color: #333;
    color: white;
    padding: 10px 0;
}
.logo-secondary{
    height: 70px;
    margin-right: 10px;
    vertical-align: middle;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
}
.page-wrap{
    padding: 2rem 0;
}

/* Container for the thumbnail */
.sidebar-post-thumbnail {
    width: 100%;
    overflow: hidden;
    border-radius: 4px; /* Optional: adds rounded corners */
}
.nav-menu-list li ul.sub-menu {
        display: none;
        position: absolute;
        left: 0;
        background-color: #ffffff;
        min-width: 220px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.15);
        list-style: none;
        padding: 8px 0;
        margin: 0;
        z-index: 1000;
        border-radius: 8px;
        opacity: 0;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        visibility: hidden;
}

/* The specific image styling */
.custom-sidebar-img {
    width: 100% !important;
    height: 80px !important;
    object-fit: cover; /* This prevents the "cut" or distorted look */
    object-position: center; /* Keeps the focus on the center of the image */
    display: block;
}

/* Adjust title font size for small sidebars if needed */
.sidebar-post-title {
    font-size: 14px;
    margin-bottom: 5px;
    line-height: 1.3;
}


:root {
    --sheesha-dark: #122a44;
    --sheesha-light: #e9e9e9;
    --sheesha-red: #c63d2f;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e9e9e9;
    --card-bg: #ffffff;
}

/* Dark Mode Variables */
body.dark-mode {
    --sheesha-dark: #1a1a1a;
    --sheesha-light: #2d2d2d;
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #e9e9e9;;
    --text-secondary: #b0b0b0;
    --border-color: #3d3d3d;
    --card-bg: #2d2d2d;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    padding-top: 120px; /* Increased to ensure header does not overlap content */
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.3s, color 0.3s;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    color: var(--sheesha-red);
}

.dark-mode-toggle i {
    transition: transform 0.3s;
}

.dark-mode-toggle:active i {
    transform: rotate(360deg);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.footer-bottom{
    background-color: var(--sheesha-dark);
    color: white;
    padding: 15px 20px;
    text-align: center;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--sheesha-red);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(198, 61, 47, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background-color: #b02e20;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(198, 61, 47, 0.5);
}

.scroll-to-top:active {
    transform: translateY(-2px);
}



/* Fixed header styles */
.sheesha-header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background: var(--sheesha-dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

/* Top Bar Styles */
.top-bar {
    background-color: var(--sheesha-dark);
    color: white;
    padding: 15px 20px;
}

.container-header {
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo img {
    height: 45px;
}

.top-right-elements {
    display: flex;
    align-items: center;
    gap: 20px;
}

.social-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.social-icons a {
    color: white;
    text-decoration: none;
    font-size: 18px;
    transition: opacity 0.3s;
}

.social-icons a:hover {
    opacity: 0.7;
}

.brand-name {
    font-weight: 300;
    font-size: 16px;
    margin-left: 10px;
}

.utility-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.utility-icons a {
    color: white;
    text-decoration: none;
    font-size: 18px;
}

/* Navigation Bar Styles */
.main-navigation {
    background-color: var(--sheesha-light);
    border-bottom: 2px solid #ccc;
    padding: 15px 20px;
}

.main-navigation .container-header {
    justify-content: space-between;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.donate-btn {
    background-color: transparent;
    border: 1px solid #666;
    color: #333;
    padding: 8px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s;
}

.donate-btn:hover {
    background-color: var(--sheesha-red);
    color: white;
    border-color: var(--sheesha-red);
}

.search-box {
    position: relative;
}

.search-box input {
    background: #e0e0e0;
    border: none;
    border-radius: 20px;
    padding: 8px 40px 8px 20px;
    color: #333;
    width: 200px;
}

.search-box input::placeholder {
    color: #666;
}

.search-box button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box button:hover {
    color: #333;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.lang-switch {
    color: #333;
    font-size: 14px;
}
.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* WordPress Menu Styling */
.nav-menu-list {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    gap: 5px;
}

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

.nav-menu-list li a {
    text-decoration: none;
    color: #333;
    font-weight: 700;
    padding: 10px 18px;
    display: block;
    transition: all 0.3s;
    font-size: 15px;
    border-radius: 8px;
}

.nav-menu-list li a:hover {
    background-color: rgba(198, 61, 47, 0.18);
}

/* Dropdown/Submenu styles */
.nav-menu-list li ul.sub-menu {
    display: none;
    position: absolute;
    left: 0;
    background-color: #ffffff;
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    list-style: none;
    padding: 8px 0;
    margin: 0;
    z-index: 1000;
    border-radius: 8px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    visibility: hidden;
}

.nav-menu-list li:hover > ul.sub-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.nav-menu-list li ul.sub-menu li {
    width: 100%;
    background-color: #ffffff;
}

.nav-menu-list li ul.sub-menu li a {
    padding: 12px 20px;
    border-bottom: none;
    color: #333;
    font-weight: 400;
    position: relative;
    transition: all 0.3s;
    background-color: #ffffff;
}

.nav-menu-list li ul.sub-menu li a:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 100%;
    background-color: rgba(198, 61, 47, 0.08);
    transition: width 0.3s ease;
    z-index: -1;
}


.nav-menu-list li ul.sub-menu li a:hover:before {
    width: 100%;
}

.nav-menu-list li ul.sub-menu li a:hover {
    color: var(--sheesha-red);
    background-color: rgba(198, 61, 47, 0.18);
    padding-left: 25px;
}

.nav-menu-list li ul.sub-menu li:last-child a {
    border-radius: 0 0 8px 8px;
}

/* Arrow indicator for parent items with submenus */
.nav-menu-list li.menu-item-has-children > a:after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-inline-start: 6px !important;
    font-size: 12px;
    transition: transform 0.3s;
}

.nav-menu-list li.menu-item-has-children:hover > a:after {
    transform: rotate(180deg);
}

/* Highlighted menu item */
.nav-menu-list li.current-menu-item > a,
.nav-menu-list li.current-page-ancestor > a {
    background-color: #c63d2f;
    color: white;
    border-radius: 5px;
}

.nav-menu-list li.current-menu-item > a:hover,
.nav-menu-list li.current-page-ancestor > a:hover {
    background-color: #b02e20;
}

/* Highlight parent menu item for subcategories */
.nav-menu-list li.current-cat-ancestor > a {
    background-color: #c63d2f;
    color: white;
    border-radius: 5px;
}

.nav-menu-list li.current-cat-ancestor > a:hover {
    background-color: #b02e20;
}

.home-icon {
    color: var(--sheesha-red);
    font-size: 22px;
    margin-left: 10px;
    text-decoration: none;
    transition: opacity 0.3s;
}

.home-icon:hover {
    opacity: 0.7;
}

/* Menu Toggle Button */
.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: none;
    padding: 5px;
    z-index: 1001;
    position: relative;
}

.menu-toggle i {
    transition: transform 0.3s ease;
}

.menu-toggle:hover i {
    transform: scale(1.1);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .menu-toggle {
        display: block;
    }

    .top-right-elements {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .social-icons .brand-name {
        display: none;
    }

    body.menu-open {
        overflow: hidden;
    }

    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        animation: fadeIn 0.3s ease;
    }

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

    .main-navigation {
        position: relative;
    }

    .main-navigation .container-header {
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -100%;
        bottom: 0;
        width: 340px;
        max-width: 85%;
        background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
        overflow-y: auto;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        box-shadow: -8px 0 24px rgba(0,0,0,0.2);
        padding: 30px 20px 20px;
    }

    body.dark-mode .main-navigation .container-header {
        background: linear-gradient(to bottom, #212529 0%, #212529 100%) !important;
    }

    .main-navigation.mobile-menu-open .container-header {
        right: 0;
    }

    .nav-right {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        order: 1;
        padding: 20px 15px;
        background-color: rgba(18, 42, 68, 0.03);
        border-radius: 12px;
        margin-bottom: 20px;
    }

    .nav-left {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        order: 2;
    }

    .search-box {
        width: 100%;
        margin: 0;
    }

    .search-box input {
        width: 1004px 45px 14px 20px;
        font-size: 15px;
        border: 2px solid #e0e0e0;
        border-radius: 25px;
        transition: all 0.3s;
        background-color: white;
    }

    .search-box input:focus {
        outline: none;
        border-color: var(--sheesha-red);
        box-shadow: 0 0 0 3px rgba(198, 61, 47, 0.1);
    }

    .search-box i {
        font-size: 16px;
    }

    .lang-switch {
        width: 100%;
        padding: 12px 15px;
        font-size: 15px;
        background-color: white;
        border-radius: 8px;
        text-align: center;
        font-weight: 500;
        color: #555;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .lang-switch span {
        padding: 0 8px;
        transition: color 0.3s;
    }

    .lang-switch span:hover {
        color: var(--sheesha-red);
        font-size: 16px;
    }

    .nav-menu-list {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .nav-menu-list li {
        width: 100%;
    }

    .nav-menu-list li a {
        padding: 14px 15px;
        border-bottom: 1px solid #e0e0e0;
        border-radius: 0;
    }

    .nav-menu-list li a:hover {
        background-color: rgba(198, 61, 47, 0.05);
        padding-left: 20px;
    }

    .nav-menu-list li ul.sub-menu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        padding-left: 20px;
        background-color: #f9f9f9;
        margin-top: 0;
    }

    .nav-menu-list li ul.sub-menu li a {
        padding: 10px 15px;
        font-size: 14px;
    }

    .home-icon {
        margin-left: 0;
        padding: 14px 15px;
        width: 100%;
        border-bottom: 1px solid #e0e0e0;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .home-icon::after {
        content: 'Home';
        font-family: Arial, sans-serif;
        font-size: 15px;
        color: #333;
    }
}

@media (max-width: 576px) {
    .container-header {
        padding: 0 10px;
    }

    .header-logo img {
        height: 40px;
    }

    .social-icons a, .utility-icons a {
        margin: 0 5px;
        font-size: 16px;
    }

    .top-bar {
        padding: 8px 10px;
    }

    .donate-btn {
        width: 100%;
        text-align: center;
    }
}

/* ========================================
   DARK MODE STYLES
   ======================================== */
body.dark-mode .text-muted,
body.dark-mode .sidebar-post-title a,
body.dark-mode .column-post-excerpt,
body.dark-mode .column-post-title a,
body.dark-mode .widget-post-title a,
body.dark-mode .widget-post-meta span,
body.dark-mode .text-dark {
        color: var(--text-primary) !important;
}

/* Cards and Post Items */
body.dark-mode .card,
body.dark-mode .category-post-item,
body.dark-mode .related-post-item,
body.dark-mode .category-slide,
body.dark-mode .hero-slide {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

/* Post Content Areas */
body.dark-mode .single-post-content,
body.dark-mode .category-post-content,
body.dark-mode .related-post-content,
body.dark-mode .category-slide-content {
    background-color: var(--card-bg);
    color: var(--text-primary);
}

/* Titles and Headings */
body.dark-mode h1, 
body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode h4, 
body.dark-mode h5, 
body.dark-mode h6,
body.dark-mode .single-post-title,
body.dark-mode .category-post-title a,
body.dark-mode .related-post-title a,
body.dark-mode .category-slide-title a {
    color: var(--text-primary);
}

/* Sidebar */
body.dark-mode .catSidebar {
    background-color: var(--bg-secondary);
}

body.dark-mode .category-sidebar-widget {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

/* Comments Section */
body.dark-mode .single-post-comments,
body.dark-mode .comment-form-wrapper {
    background-color: var(--card-bg);
}

body.dark-mode .comment-item {
    border-color: var(--border-color);
}

body.dark-mode .comment-text {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

body.dark-mode #comment,
body.dark-mode .comment-form input[type="text"],
body.dark-mode .comment-form input[type="email"] {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.dark-mode #comment::placeholder,
body.dark-mode .comment-form input::placeholder {
    color: var(--text-secondary);
}

/* Search Box */
body.dark-mode .search-box input {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.dark-mode .search-box input::placeholder {
    color: var(--text-secondary);
}

/* Borders and Separators */
body.dark-mode .category-header {
    border-bottom-color: var(--sheesha-red);
}

body.dark-mode .widget-header {
    border-bottom-color: var(--sheesha-red);
}

/* Meta Information */
body.dark-mode .post-date,
body.dark-mode .post-author,
body.dark-mode .category-post-meta span,
body.dark-mode .single-post-meta span {
    color: var(--text-primary);
}

/* Navigation Menu */
body.dark-mode .main-navigation {
    background-color: var(--sheesha-light);
}

body.dark-mode .nav-menu-list li a {
    color: var(--text-primary);
}

body.dark-mode .nav-menu-list li ul.sub-menu {
    background-color: var(--bg-secondary);
}

body.dark-mode .nav-menu-list li ul.sub-menu li a {
    color: var(--text-primary);
}

body.dark-mode .nav-menu-list li ul.sub-menu li a:hover {
    background-color: var(--bg-primary);
}

/* Pagination */
body.dark-mode .category-pagination .page-numbers {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.dark-mode .category-pagination .page-numbers.current {
    background-color: var(--sheesha-red);
    color: white;
}

/* Font Face for Vazirmatn */
@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSansX';
    src: url('fonts/IRANSansX-Thin.woff') format('woff');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansX';
    src: url('fonts/IRANSansX-UltraLight.woff') format('woff');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansX';
    src: url('fonts/IRANSansX-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansX';
    src: url('fonts/IRANSansX-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansX';
    src: url('fonts/IRANSansX-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansX';
    src: url('fonts/IRANSansX-DemiBold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansX';
    src: url('fonts/IRANSansX-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansX';
    src: url('fonts/IRANSansX-ExtraBold.woff') format('woff');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansX';
    src: url('fonts/IRANSansX-Black.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

html[lang="fa"]{
    font-family: 'IRANSansX', Tahoma, Arial, sans-serif !important;
}
.mb-3, .my-3 {
    margin-bottom: 0px !important;
}

/* 1. Remove the forced Bootstrap margin */
.catSidebar .mb-3, 
.sidebar-post .mb-3, 
.catSidebar .my-3 {
    margin-bottom: 0 !important;
}


/* 2. Add a clean, controlled separator between posts */
.catSidebar .widget-post {
    border-bottom: 1px solid var(--border-color);
}

/* 3. Remove border from the very last post so it looks clean */
.catSidebar .widget-post:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
/* Noto Sans Arabic Font Faces */
@font-face {
    font-family: 'Noto Sans Arabic';
    src: url('fonts/Nano_Sans_Arabic/NotoSansArabic-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Noto Sans Arabic';
    src: url('fonts/Nano_Sans_Arabic/NotoSansArabic-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

html[lang="ps"], body[lang="ps"], html[lang="ps"] body, body[lang="ps"] * {
    font-family: 'Noto Sans Arabic', 'IRANSansX', Tahoma, Arial, sans-serif !important;
}