/*
Theme Name: 	   AlmasaeNews
Text Domain: 	   almasaenews
Version:            1.0.70
Tested up to:       6.8
Requires at least:  4.7
Requires PHP:       7.0
Author:             M. Diouane
Author URI:         
Description:        AlmasaeNews is a fast, clean, Best Responsive News Magazine WordPress theme. 
Tags:               blog, news, entertainment, grid-layout, one-column, two-columns, three-columns, left-sidebar, right-sidebar, custom-background, custom-header, custom-logo, custom-menu, featured-images, featured-image-header, flexible-header, post-formats, rtl-language-support, translation-ready, theme-options, threaded-comments, footer-widgets
License: GPLv3 or later
License URI:  https://www.gnu.org/licenses/gpl-3.0.html

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned
with others.
 */

/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&display=swap');

/* Base Styles */
html, body {
    width: 100%;
    overflow-x: hidden;
}
body {
    font-family: "Almarai", sans-serif;
    font-weight: 700;
    font-size: 18px;
       margin: 0;
    padding: 0;
}

  

.header-main {
    display: flex;
    align-items: center;
    justify-content: center;
    height:62px;
}

.header-main .container {
    display: flex;
    align-items: center;
    justify-content: start;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
        display: flex;
    }
}
@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
    }
}
 
    .container {
        width: 100%;
        margin:0 auto;
    }
 
/* Section 1 layout */
.sec{
    margin:15px 0
}
 
#dark-mode-toggle i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 24px;
}

#dark-mode-toggle .light-icon {
    display: block;
}

#dark-mode-toggle .dark-icon {
    display: none;
}

.dark-mode #dark-mode-toggle .light-icon {
    display: none;
}

.dark-mode #dark-mode-toggle .dark-icon {
    display: block;
}

#dark-mode-toggle:hover {
    transform: scale(1.2);
}

#dark-mode-toggle:hover i {
    transform: translate(-50%, -50%) scale(1.2);
}

/* Dark mode styles */
html body.dark-mode {
    background-color: #121212 !important;
    color: #ffffff !important;
}

html body.dark-mode,
html body.dark-mode .site-main,
html body.dark-mode .site-main *:not(a) {
    color: inherit !important;
}

html body.dark-mode .header-bottom {
    background-color: #0a2e1a !important;
}

html body.dark-mode .main-navigation a {
    color: #e0e0e0 !important;
}

/* Force dark mode on all elements */
html body.dark-mode * {
    background-color: inherit !important;
    color: inherit !important;
    border-color: currentColor !important;
}

/* Ensure all text elements inherit dark mode colors */
body.dark-mode,
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 p,
body.dark-mode span,
body.dark-mode a:not(.social-links-menu a) {
    color: #ffffff !important;
}

/* Dark mode transitions */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Mobile Menu Styles */
.mobile-menu-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.mobile-menu-container[data-mobile-menu="open"] {
    transform: translateX(0);
}

.mobile-menu-container .close-menu {
    position: absolute;
    top: 20px;
    left: 20px;
    color: red;
    font-size: 2rem;
    cursor: pointer;
}

.mobile-navigation {
    padding: 9px 20px;
}

.mobile-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-navigation li {
    margin-bottom: 15px;
}

.mobile-navigation a {
    color: rgb(255, 0, 0);
    font-size: 1.2rem;
    text-decoration: none;
    display: block;
    padding: 10px;
}

@media (min-width: 768px) {
.mobile-menu-container,
.theme-toggle.mobile-only {
    display: none;
}

.mobile-menu-toggle {
    position: absolute;
    right: 20px;
    background: none;
    border: none;
    color: #09411e;
    font-size: 2rem;
    cursor: pointer;
    z-index: 100;
}

.mobile-menu-toggle .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}
}

.header-social {
    position: absolute;
    left: 20px;
}

.custom-logo {
    width: 210px;
    height: auto;
}

.header-social {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.social-links-menu {
    display: flex;
    gap: 15px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.social-links-menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #09411e;
    font-size: 24px;
    transition: all 0.3s ease;
}

.social-links-menu a:hover {
    color: #a3e635;
    transform: translateY(-3px);
}

/* Social platform specific icons */
.social-links-menu a[href*="facebook.com"]::before {
    content: "\ecba"; /* ri-facebook-circle-fill */
    font-family: remixicon;
}

.social-links-menu a[href*="twitter.com"]::before,
.social-links-menu a[href*="x.com"]::before {
    content: "\eeb6"; /* ri-twitter-x-fill */
    font-family: remixicon;
}

.social-links-menu a[href*="instagram.com"]::before {
    content: "\ee66"; /* ri-instagram-line */
    font-family: remixicon;
}

.social-links-menu a[href*="youtube.com"]::before {
    content: "\ef96"; /* ri-youtube-fill */
    font-family: remixicon;
}

.social-links-menu a[href*="linkedin.com"]::before {
    content: "\eea9"; /* ri-linkedin-fill */
    font-family: remixicon;
}

.social-links-menu .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Main Navigation Styles */
.header-bottom {
    background-color: #cd0114; 
}

.main-navigation {
    width: 100%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.main-navigation .theme-toggle {
    order: 3; /* Left side */
}

.main-navigation .mobile-menu-toggle {
    order: 1; /* Right side */
}

.main-navigation ul {
    order: 2; /* Middle */
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0 10px;
    padding: 0;
    gap: 0;
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

/* Style the mobile menu toggle and theme toggle in navigation */
.main-navigation .mobile-menu-toggle,
.main-navigation .theme-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    position:relative
}

.main-navigation .mobile-menu-toggle:hover,
.main-navigation .theme-toggle:hover {
    color: #a3e635;
}

/* Mobile logo styling */
.main-navigation .mobile-logo {
    display: none; /* Hidden by default on desktop */
}

@media (max-width: 767px) {
    /* Hide original logo in header-main on mobile */
    .header-main .site-branding {
        display: none;
    }
    .header-main  {
        display: none;
    }
    
    .main-navigation {
        justify-content: space-between;
        padding: 0 ;
    }
    
    .main-navigation ul {
        display: none; /* Hide primary nav on mobile */
    }
    
    .main-navigation .theme-toggle {
        display: block; /* Hide theme toggle on mobile */
    }
    
    /* Show and position mobile logo */
    .main-navigation .mobile-logo {
        display: flex;
        order: 3; /* Center position */
        justify-content: center;
        flex: 1;
    }
    
    .main-navigation .mobile-menu-toggle {
        order: 1; /* left side */
        position:absolute;
    }
    
    /* Adjust mobile logo size */
    .main-navigation .mobile-logo .custom-logo {
        width: 120px;
        height: auto;
    }
}

.main-navigation li {
    display: inline-block;
    white-space: nowrap;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    padding: 10px 15px;
    margin: 0;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 8px ;
    transition: all 0.3s ease;
    display: block;
    font-size: 14px;
}

.main-navigation a:hover,
.main-navigation a:focus {
    color: #a3e635;
}

.main-navigation .current-menu-item > a {
    color: #fff;
    background: #08411e
}

/* Dropdown menu styles */


 #sec_3 .container{
    display: flex;
    gap:10px
 }
@media (min-width: 768px) {
    /* Post content styling */
#sec_1 .blocks-content{
    width:66%
}
    #sec_2 .container{
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap:10px
    }

 #sec_3 .two-posts{
    flex:2
 }
}
#sec_4 .container .block-4{
    display:flex;
    width:66%;
    gap:10px
}
#sec_4 .container .block-4 div{
    flex:1
}
.block-title{
    position: relative;
    display: flex;
    justify-content: center;
     transform: skewX(-20deg);  
}
.block-title .the-subtitle {
    position: relative;
    z-index: 9;
    display: inline-flex
;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background-color: #cd0114;
    padding: .5rem 1rem;
    color: #fff;
    margin:0;
}
.block-title .the-subtitle {
    transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.block-title>div:before {
    position: absolute;
    top: 50%;
    right: 0;
    height: 3px;
    width: 100%;
    background-color: gray;
    --tw-content: "";
    content: var(--tw-content);
}
.second-sidebar{
    flex:1;
}

/* Single post styles */
.container.single {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 ;
}

.single-layout {
    display: flex;
    gap: 40px;
}

.single-sidebar {
    width: 300px;
    flex-shrink: 0;
}

.single-content {
    flex: 1;
    min-width: 0;
}
.single-content article{
padding:0 8px;
}
.sidebar-widget {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
     
}

.sidebar-widget h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2rem;
}

.sidebar-widget p {
    margin: 0 0 10px 0;
    color: #666;
    line-height: 1.6;
}

.sidebar-widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-widget li {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.sidebar-widget li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar-widget a {
    color: #cd0114;
    text-decoration: none;
}

.sidebar-widget a:hover {
    text-decoration: underline;
}

.entry-header {
    margin-bottom: 30px;
}

.entry-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #333;
}

.entry-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.entry-meta span {
    margin-right: 15px;
}

.post-thumbnail {
    margin-bottom: 30px;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.entry-content {
    line-height: 1.8;
    font-size: 1.1rem;
    color: #333;
}

.entry-content p {
    margin-bottom: 20px;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin: 30px 0 15px 0;
    color: #222;
}

.entry-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.post-tags {
    color: #666;
    font-size: 0.9rem;
}

.post-tags a {
    color: #cd0114;
    text-decoration: none;
}

.post-tags a:hover {
    text-decoration: underline;
}

/* Category archive styles */
.category-archive {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
    margin: 0 10px 40px;
    padding: 30px 0;
    background: linear-gradient(135deg, #cd0114 0%, #a3000f 100%);
    border-radius: 12px;
    color: white;
}

.page-title {
    font-size: 2.5rem;
    margin: 0;
    color: white;
}

.archive-description {
    font-size: 1.1rem;
    margin-top: 15px;
    opacity: 0.9;
}

.category-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.category-post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.post-thumbnail {
    position: relative;
    overflow: hidden;
}

.post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-post-card:hover .post-image {
    transform: scale(1.05);
}

.post-content {
    padding: 25px;
}

.entry-title {
    font-size: 1.4rem;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.entry-title a {
    color: #333;
    text-decoration: none;
}

.entry-title a:hover {
    color: #cd0114;
}

.entry-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.entry-summary {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.read-more {
    display: inline-block;
    background: #cd0114;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
}

.read-more:hover {
    background: #a3000f;
    color: white;
}

.pagination {
    text-align: center;
    margin: 40px 0;
}

.pagination .nav-links {
    display: inline-flex;
    gap: 10px;
}

.pagination .page-numbers {
    padding: 10px 18px;
    border: 2px solid #cd0114;
    border-radius: 6px;
    text-decoration: none;
    color: #cd0114;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: #cd0114;
    color: white;
}

.pagination .page-numbers.dots {
    border-color: transparent;
}

.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 1.1rem;
}

/* Responsive design for category archive */
@media (max-width: 768px) {
    .category-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .post-content {
        padding: 20px;
    }
    
    .entry-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .category-archive {
        padding: 0 15px;
    }
    
    .page-header {
        padding: 20px 15px;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
}

/* Footer styles */
.site-footer {
    background: #222;
    color: #fff;
    padding: 30px 0;
    margin-top: 60px;
    border-top: 4px solid #cd0114;
}

.site-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.site-info {
    display: flex;
    justify-content: center;
    align-items: center;
}

.copyright {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.6;
}

.copyright a {
    color: #fff;
    text-decoration: none;
}

.copyright a:hover {
    color: #cd0114;
    text-decoration: underline;
}

/* Responsive footer */
@media (max-width: 768px) {
    .site-footer {
        padding: 25px 0;
        margin-top: 40px;
    }
    
    .copyright {
        font-size: 0.85rem;
    }
}

/* Single post mobile layout */
@media (max-width: 768px) {
    .container.single {
      
        margin: 15px auto; /* Center with proper margins */
    }
    
    .single-layout {
        flex-direction: column;
        gap: 25px;
        width: 100%;
    }
    
    .single-sidebar {
        width: 100%;
        order: 2; /* Move sidebar below content */
    }
    
    .single-content {
        order: 1; /* Ensure content comes first */
        width: 100%;
    }
    
    /* Adjust sidebar widget spacing for mobile */
    .sidebar-widget {
        margin-bottom: 20px;
        padding: 15px;
    }
    
    /* Ensure content is properly centered with padding - RTL compatible */
    .entry-header,
    .entry-content,
    .entry-footer {
        width: 100%;
        padding-inline: 10px; /* Use logical properties for RTL support */
        box-sizing: border-box;
    }
    
    /* Adjust title and meta for better mobile centering */
    .entry-title {
        text-align: center;
        font-size: 2rem; /* Slightly smaller for mobile */
        line-height: 1.3;
        margin-inline: 10px; /* Use logical properties for RTL support */
    }
    
    .entry-meta {
        text-align: center;
        justify-content: center;
        margin-inline: 10px; /* Use logical properties for RTL support */
    }
    
    /* Add padding to post thumbnail for better spacing */
    .post-thumbnail {
        margin-inline: 10px; /* Use logical properties for RTL support */
    }
    
    /* Ensure sidebar content also has proper padding */
    .sidebar-widget {
        padding-inline: 15px; /* Use logical properties for RTL support */
    }
}

/* RTL specific adjustments for Arabic language */
html[dir="rtl"] .single-layout,
html[dir="rtl"] .single-content,
html[dir="rtl"] .single-sidebar {
    direction: rtl;
}

/* Force horizontal centering and padding for all mobile elements */
@media (max-width: 768px) {
    .container.single { 
        margin-left: auto !important;
        margin-right: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .single-layout {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .single-content,
    .single-sidebar {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .entry-header,
    .entry-content, 
    .entry-footer {
        padding-left: 15px !important;
        padding-right: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .entry-title,
    .entry-meta {
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center !important;
        width: fit-content !important;
        max-width: 100% !important;
    }
    
    .post-thumbnail {
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .post-thumbnail img {
        width: 100% !important;
        height: auto !important;
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    .sidebar-widget {
        padding-left: 15px !important;
        padding-right: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* Force horizontal centering for category archive pages on mobile */
@media (max-width: 768px) {
    .category-archive {
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .page-header {
        width: 100% !important;
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    .page-title {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: fit-content !important;
        max-width: 100% !important;
    }
    
    .category-posts-grid {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .category-post-card {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    .post-thumbnail {
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
    }
    
    .post-image {
        width: 100% !important;
        height: auto !important;
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    .post-content {
        padding-left: 15px !important;
        padding-right: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        text-align: center !important;
    }
    
    .entry-title {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: fit-content !important;
        max-width: 100% !important;
    }
    
    .entry-meta {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        justify-content: center !important;
    }
    
    .entry-summary {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    .read-more {
        margin-left: auto !important;
        margin-right: auto !important;
        display: block !important;
        width: fit-content !important;
    }
    
    .pagination {
        width: 100% !important;
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    .pagination .nav-links {
        justify-content: center !important;
    }
    
    .no-posts {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
    }
}
