/*
Theme Name: الدليل المصري - Egypt140
Theme URI: https://nile.egypt140.com
Author: SlashWeb Network
Author URI: https://nile.egypt140.com
Description: قالب الدليل المصري (nile.egypt140.com) المطور بتصميم مطابق بالملي لموقع مصراوي (Masrawy) مع دعم كامل للأقسام، الأخبار العاجلة، الأكثر قراءة، الفيديوهات، والأداء السريع.
Version: 13.1.1
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: egypt140
*/

/* =========================================================
 * Egypt140 Masrawy-Exact Layout & Ordering Fixes
 * ========================================================= */
html, body {
    margin: 0;
    padding: 0;
}

body {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    background-color: #f2f2f2 !important;
    overflow-x: hidden;
}

/* Fixed Top Header */
header {
    order: 1 !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 50px !important;
    background: #1d1d1d !important;
    z-index: 999 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    float: none !important;
}
body.admin-bar header {
    top: 32px !important;
}
@media (max-width: 782px) {
    body.admin-bar header {
        top: 46px !important;
    }
}

#cd-top-nav {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    float: none !important;
    width: calc(100% - 74px) !important;
    height: 50px !important;
    margin-right: 14px !important;
    padding: 0 10px;
    box-sizing: border-box;
}

#cd-top-nav .rightDiv {
    display: flex !important;
    align-items: center !important;
    gap: 14px;
    float: none !important;
    height: 50px;
}

header .masLogo,
header #cd-top-nav .masLogo {
    background: none !important;
    display: inline-flex !important;
    align-items: center !important;
    width: auto !important;
    height: 44px !important;
    margin: 0 !important;
    float: none !important;
}

header #cd-top-nav .masLogo img {
    max-height: 40px !important;
    width: auto !important;
    display: block !important;
    object-fit: contain;
}

#cd-top-nav .rightDiv date {
    float: none !important;
    height: 50px !important;
    line-height: 50px !important;
    margin: 0 !important;
    padding: 0 14px 0 0 !important;
    border-right: 1px solid #474747;
    color: #b8b8b8;
    font-size: 14px;
    white-space: nowrap;
}

#cd-top-nav > ul {
    display: flex !important;
    align-items: center !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 50px;
    list-style: none;
}

#cd-top-nav > ul > li {
    float: none !important;
    width: auto !important;
    min-width: 76px;
    height: 50px !important;
    border-left: 1px solid #474747;
    display: flex;
    align-items: center;
}

#cd-top-nav > ul > li > a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 50px !important;
    padding: 0 14px !important;
    color: #e5e7eb !important;
    font-size: 13px !important;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
}

#cd-top-nav > ul > li > a:hover {
    background: #2b2b2b;
    color: #ffffff !important;
}

@media (max-width: 1024px) {
    #cd-top-nav > ul {
        display: none !important;
    }
    #cd-top-nav .rightDiv date {
        display: none !important;
    }
}

/* Search Morph Overlay */
.morphSearchDiv {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    z-index: 997;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

/* Main Content Area (Always between Header and Footer) */
main.cd-main-content {
    order: 2 !important;
    flex: 1 0 auto !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 66px 0 30px 0 !important;
    margin: 0 !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 2 !important;
    float: none !important;
}

main.cd-main-content > .container {
    width: 100%;
    max-width: 1270px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Lateral Nav */
nav#cd-lateral-nav {
    z-index: 998 !important;
}

/* Footer (Always pinned at bottom after main) */
footer {
    order: 3 !important;
    flex-shrink: 0 !important;
    display: block !important;
    float: none !important;
    position: relative !important;
    top: auto !important;
    height: auto !important;
    width: 100% !important;
    padding: 25px 0 0 0 !important;
    margin: 0 !important;
    background: #111111 !important;
    color: #cccccc !important;
    z-index: 5 !important;
}

footer .footerLogo img {
    max-height: 55px;
    width: auto;
    object-fit: contain;
}

/* Single Article Styling */
.masrawyArticleWrap {
    background: #fff;
    padding: 22px;
    border-radius: 4px;
    margin-top: 15px;
    margin-bottom: 25px;
}
.masrawyArticleHeader h1 {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.45;
    color: #111;
    margin-bottom: 12px;
}
.masrawyArticleMeta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}
.masrawyArticleImage {
    margin-bottom: 18px;
    text-align: center;
}
.masrawyArticleImage img {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
    border-radius: 4px;
}
.masrawyArticleBody {
    font-size: 18px;
    line-height: 1.95;
    color: #222;
}
.masrawyArticleBody p {
    margin-bottom: 16px;
}
