/* ==========================================================================
   1. RESET & BASE
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #000000;
    font-family: 'Almarai', 'Cairo', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 2.2;
    text-align: center;
    direction: rtl;
}

.article-full ul, .content-area ul {
    list-style-position: inside;
    text-align: center;
}

#wpadminbar {
    z-index: 99999 !important;
    position: fixed !important;
    top: 0;
    width: 100%;
}

html {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ==========================================================================
   2. TYPOGRAPHY
   ========================================================================== */
p {
    display: block;
    margin-block-start: 2em;
    margin-block-end: 2em;
    margin-inline-start: 2px;
    margin-inline-end: 2px;
    unicode-bidi: isolate;
}

h1 .the-subtitle, 
h1, h2, h3, h4, h5, h6, 
.the-subtitle {
    line-height: 1.5;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 16px;
}

h1 { font-size: 41px; font-weight: 700; }
h2 { font-size: 27px; }
h3 { font-size: 23px; }
h4, .the-subtitle { font-size: 17px; }
h5 { font-size: 13px; }
h6 { font-size: 12px; }

/* ==========================================================================
   3. HEADER & NAVIGATION
   ========================================================================== */
#theme-header {
    background: linear-gradient(to left, #ffffff, #0000ff, #ffff00, #ff0000, #008000) !important;
    padding: 15px 0 0 0;
    border-bottom: 4px solid #fff;
}

.header-top-bar {
    display: flex !important;
    flex-direction: column !important; /* هيدي اللي بتحط اللوغو والأيقونات تحت بعض */
    justify-content: center !important;
    align-items: center !important;
    gap: 20px !important;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 15px 25px 15px;
}

.logo-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.logo-wrapper img {
    max-height: 220px !important; /* تكبير اللوغو */
    width: auto !important;
    display: block !important;
    margin: 0 auto !important;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-icons a {
    color: #fff;
    font-size: 26px; /* تكبير أيقونات السوشال ميديا */
    text-decoration: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.7); /* شادو ليخلي الأيقونات تبيّن عالألوان الفاتحة */
}

.social-icons a:hover {
    opacity: 0.9;
    transform: scale(1.15);
}

#header-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    background-color: black;
    padding: 10px 0;
    list-style: none;
    margin: 0;
}

#header-menu li {
    position: relative;
    margin: 0;
}

#header-menu a {
    text-decoration: none;
    color: white;
    font-family: 'Cairo', sans-serif;
    font-weight: 700 !important;
    font-size: 16px;
    padding: 10px 20px;
    display: inline-block;
    transition: color 0.3s ease, background-color 0.3s ease;
    text-align: center;
}

#header-menu a:hover {
    background-color: #008000;
    color: white;
}

#header-menu ul {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #008000;
    padding: 10px 0;
    display: none;
    list-style: none;
    margin: 0;
    z-index: 1000;
    width: 200px;
    text-align: center;
}

#header-menu ul a {
    padding: 10px;
    color: white;
    font-size: 14px;
    font-weight: 600;
}

#header-menu ul a:hover {
    background-color: black;
    color: white;
}

#header-menu .menu-item-has-children > a::after {
    content: " ▼";
    font-size: 18px;
    margin-left: 5px;
    cursor: pointer;
}

/* ==========================================================================
   4. FOOTER & MOVE TO TOP
   ========================================================================== */
footer {
    padding: 20px 0;
    line-height: 20px;
    text-align: center;
    font-size: 13px;
    color: white;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    flex-direction: column;
    text-align: center;
}

.footer-bottom {
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
}

.footer-nav {
    text-align: center;
    margin: 20px 0;
}

.footer-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav-list li {
    display: inline-block;
    margin: 0 10px;
}

.footer-nav-list li a {
    color: white !important;
    text-decoration: none !important;
    font-weight: 500;
}

.footer-nav-list li a:hover {
    opacity: 0.8;
}

.move-to-top {
    position: fixed;
    bottom: 50px;
    left: 10px;
    background: #008000 !important;
    display: block !important;
    color: white;
    border: none;
    padding: 12px;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    text-align: center;
    z-index: 1000;
    transition: opacity 0.3s ease, transform 0.2s ease, background-color 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    direction: rtl !important;
    text-decoration: none;
}

.move-to-top:hover {
    background-color: #ff0000 !important;
    transform: translateY(-3px);
}

.move-to-top::before {
    content: '>';
    font-size: 45px;
    display: inline-block;
    color: white;
    transform: rotate(90deg);
    line-height: 0;
    text-align: center;
    width: 100%;
    direction: rtl !important;
}

/* ==========================================================================
   5. LAYOUT CONTAINERS
   ========================================================================== */
.wrap {
    overflow: hidden;
    background: black;
}

.container {
    max-width: 1200px;
    width: 100% !important;
    margin: 0 auto;
    flex-wrap: nowrap;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
}

.content-area {
    width: 90%;
    padding: 25px;
    background-color: #fff;
    border-radius: 0px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    min-height: 300px;
    flex: 1;
    min-width: 0;
    margin: 0 auto;
}

.content-full-width, .w-100 {
    width: 100%;
}

/* ==========================================================================
   6. POSTS, ARCHIVES & WIDGETS
   ========================================================================== */
.archive-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
    gap: 25px;
}

.archive-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.archive-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.archive-thumb img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.archive-post-title {
    font-size: 18px;
    font-weight: bold;
    color: #000;
    line-height: 1.4;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    transition: color 0.3s;
}

.archive-post-title:hover {
    color: #b60000;
}

.archive-content {
    padding: 15px;
    text-align: right;
}

.load-more-container {
    text-align: center;
    margin: 40px 0;
}

.load-more-btn {
    background: none;
    border: 2px solid #000;
    border-radius: 10px;
    font-size: 22px;
    font-weight: bold;
    color: #008000;
    padding: 10px 40px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn span {
    color: #008000;
    font-size: 26px;
    margin-right: 8px;
}

.load-more-btn:hover {
    background: #008000;
    color: #fff;
}

.load-more-btn:hover span {
    color: #fff;
}

/* Single Post */
.article-full {
    background: #ffffff;
    padding: 15px 0;
}

.article-header {
    line-height: 1.5;
    text-align: center;
}

.post-content {
    line-height: 1.85;
    font-size: 16.5px;
    color: #2d3748;
    margin: 20px 0;
    text-align: center;
}

.post-content p {
    margin-bottom: 18px;
    text-align: center;
}

.social-share {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-share a {
    margin: 0 5px;
    text-decoration: none;
    font-size: 18px;
    transition: transform 0.3s ease;
}

.social-share span {
    font-size: 20px;
    margin-right: 5px;
    color: #333;
}

.social-share a:hover {
    transform: scale(1.1);
}

.social-share .fab {
    font-size: 30px;
    color: #333;
}

.social-share .fab.fa-whatsapp { color: #25d366; }
.social-share .fab.fa-telegram { color: #0088cc; }
.social-share .fab.fa-facebook { color: #1877f2; }
.social-share .fab.fa-twitter { color: #1da1f2; }

/* Related Posts */
#related-posts {
    background-color: #fff;
    padding: 30px;
    margin-top: 40px;
    border-top: 2px solid #f1f5f9;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 15px;
}

.related-posts-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 20px;
    margin-top: 20px;
    align-items: center;
}

.related-item {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.related-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.related-item .post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 5px 5px 0 0;
}

.related-item .post-title {
    margin-top: 5px;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 600;
    text-align: center;
    padding: 10px;
}

.related-item .post-title a {
    text-decoration: none;
    color: #1e293b;
    transition: color 0.2s ease;
}

.related-item .post-title a:hover {
    color: #008000;
}

/* ==========================================================================
   7. EMBEDS (YOUTUBE / SOCIAL)
   ========================================================================== */
.wp-block-embed-twitter, 
.wp-block-embed-facebook,
.wp-block-embed-youtube {
    max-width: 100% !important;
    overflow: hidden;
    display: flex;
    justify-content: center;
    margin: 15px auto;
}

.wp-block-embed-youtube .wp-block-embed__wrapper {
    max-width: 100%;
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    width: 100%;
}

.wp-block-embed-youtube iframe {
    max-width: 100% !important;
    height: 100% !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

/* ==========================================================================
   8. MEDIA QUERIES (RESPONSIVE)
   ========================================================================== */
@media screen and (min-width: 769px) {
    body.admin-bar #theme-header { margin-top: 32px !important; }
    .mobile-menu-toggle { display: none; }
    #header-menu li:hover > ul { display: block; }
}

@media screen and (max-width: 768px) {
    .header-top-bar {
        padding-bottom: 30px;
    }
    .logo-wrapper img {
        max-height: 140px !important; /* حجم اللوغو عالموبايل */
    }
    .social-icons a {
        font-size: 22px;
    }
    
    .mobile-menu-toggle {
        background-color: transparent;
        display: block;
        color: white;
        border: none;
        font-size: 38px;
        cursor: pointer;
        position: absolute;
        top: 30px;
        right: 20px;
        z-index: 1001;
        padding: 50px 10px;
    }
    
    #header-menu {
        display: none;
        flex-direction: column;
        background-color: #008000;
        width: 100%;
        gap: 2px;
    }
    #header-menu.active { display: flex; }
    #header-menu li { width: 100%; }
    #header-menu ul {
        position: static;
        width: 100%;
        background-color: black;
        display: none;
    }
    #header-menu li.menu-item-has-children.open > ul { display: block; }
    #header-menu a { width: 100%; font-size: 17px; }
    
    .container {
        flex-direction: column;
        width: 100% !important;
    }
    .content-area {
        width: 100%;
        margin: 10px 0;
        padding: 15px;
    }
    
    .archive-grid,
    .related-posts-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 480px) {
    .logo-wrapper img {
        max-height: 110px !important;
    }
    .archive-grid,
    .related-posts-list {
        grid-template-columns: 1fr;
    }
}