/*
Theme Name: BrandCore Force Fix
Theme URI: https://brandcore.com
Author: BrandCore Team
Description: Full Package with Forced Image Centering & Mobile Fit.
Version: 22.0
*/

/* --- 1. Fonts & Global Reset --- */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;700&family=Roboto:wght@400;500;700&display=swap');

* { box-sizing: border-box; }

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* يمنع السكرول العرضي */
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #334155;
    background-color: #f8fafc;
    font-size: 16px;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
a:hover { color: #38bdf8; }

/* قاعدة عامة لكل الميديا */
img, video, iframe, figure {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- 2. Header & Navigation --- */
.site-header { background: #0f172a; padding: 25px 0; position: relative; box-shadow: 0 4px 25px rgba(0,0,0,0.15); z-index: 1000; }
.header-inner { display: flex; flex-direction: column; align-items: center; max-width: 1200px; margin: 0 auto; padding: 0 20px; gap: 30px; }
.site-branding a { display: flex; align-items: center; text-decoration: none; }
.site-branding svg { height: 50px; width: auto; max-width: 100%; }

/* Desktop Menu */
.main-navigation { width: 100%; display: flex; justify-content: center; }
.main-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.main-navigation > ul > li > a { display: block; padding: 12px 24px; color: #f8fafc; background: #1e293b; border: 1px solid #334155; border-radius: 8px; font-family: 'Oswald', sans-serif; font-size: 14px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; transition: all 0.2s ease; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.main-navigation > ul > li > a:hover, .main-navigation > ul > li.current-menu-item > a { background: #38bdf8; color: #0f172a; border-color: #38bdf8; transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(56, 189, 248, 0.4); }

/* Dropdown */
.main-navigation li { position: relative; }
.main-navigation ul ul { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); width: 220px; background: #1e293b; border: 1px solid #334155; border-radius: 8px; padding: 10px; box-shadow: 0 20px 40px rgba(0,0,0,0.4); flex-direction: column; gap: 5px; z-index: 999; margin-top: 15px; }
.main-navigation li:hover > ul { display: flex; animation: fadeInUp 0.2s ease forwards; }
.main-navigation ul ul li a { display: block; padding: 10px 15px; color: #cbd5e1; font-family: 'Roboto', sans-serif; font-size: 14px; border-radius: 4px; text-align: center; background: transparent; border: none; box-shadow: none; }
.main-navigation ul ul li a:hover { background: rgba(255,255,255,0.05); color: #38bdf8; }
@keyframes fadeInUp { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
#menu-toggle { display: none; }

/* --- 3. Hero & Ticker --- */
.hero-section { max-width: 1200px; margin: 40px auto 30px auto; padding: 0 20px; width: 100%; }
.swiper-wrapper.mosaic-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 280px); gap: 20px; }
.mosaic-item { position: relative; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 20px rgba(0,0,0,0.1); background: #e2e8f0; height: 100%; width: 100%; }
.mosaic-item.item-1 { grid-column: span 2; grid-row: span 2; }
.mosaic-item img { width: 100%; height: 100%; transition: transform 0.6s; object-fit: cover; }
.mosaic-item:hover img { transform: scale(1.1); }
.mosaic-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(15, 23, 42, 0.95), transparent); padding: 25px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.mosaic-cat { display: inline-block; background: #38bdf8; color: #0f172a; font-size: 11px; font-weight: 800; text-transform: uppercase; padding: 4px 10px; border-radius: 4px; width: fit-content; margin-bottom: 10px; }
.mosaic-title { color: #fff; font-family: 'Oswald', sans-serif; font-weight: 700; line-height: 1.2; margin: 0; }
.item-1 .mosaic-title { font-size: 30px; } .mosaic-item:not(.item-1) .mosaic-title { font-size: 16px; }
.swiper-pagination { display: none; }

.news-ticker-wrap { max-width: 1200px; margin: 0 auto 40px auto; padding: 0 20px; display: flex; align-items: center; overflow: hidden; width: 100%; }
.ticker-label { background: #ef4444; color: #fff; padding: 8px 15px; font-family: 'Oswald', sans-serif; font-weight: 700; text-transform: uppercase; font-size: 13px; border-radius: 4px 0 0 4px; z-index: 2; flex-shrink: 0; }
.ticker-content { background: #fff; flex: 1; padding: 8px 15px; border: 1px solid #e2e8f0; border-left: none; border-radius: 0 4px 4px 0; overflow: hidden; white-space: nowrap; position: relative; }
.ticker-move { display: inline-block; padding-left: 100%; animation: ticker 20s linear infinite; }
.ticker-item { display: inline-block; margin-right: 40px; color: #334155; font-weight: 500; font-size: 14px; }
@keyframes ticker { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(-100%, 0, 0); } }

/* --- 4. Featured Grid --- */
.features-section { max-width: 1200px; margin: 0 auto 60px auto; padding: 0 20px; width: 100%; }
.mag-heading { border-bottom: 2px solid #0f172a; margin-bottom: 30px; position: relative; display: flex; justify-content: space-between; align-items: flex-end; }
.mag-heading span { background: #0f172a; color: #fff; padding: 6px 15px; font-family: 'Oswald', sans-serif; font-size: 18px; font-weight: 700; text-transform: uppercase; }
.mag-heading a { font-size: 12px; font-weight: 600; text-transform: uppercase; color: #64748b; margin-bottom: 5px; }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature-card { background: #fff; border-radius: 0; overflow: hidden; transition: transform 0.3s; }
.feature-img-wrap { height: 160px; overflow: hidden; position: relative; border-radius: 8px; margin-bottom: 15px; }
.feature-img-wrap img { width: 100%; height: 100%; transition: 0.5s; object-fit: cover; }
.feature-card:hover .feature-img-wrap img { transform: scale(1.1); }
.feature-meta { font-size: 11px; color: #94a3b8; text-transform: uppercase; margin-bottom: 5px; font-weight: 600; }
.feature-title { font-family: 'Oswald', sans-serif; font-size: 18px; margin: 0; color: #0f172a; line-height: 1.3; }

/* --- 5. Ad Banner & Bottom Grid --- */
.ad-section { max-width: 1000px; margin: 0 auto 60px auto; padding: 0 20px; text-align: center; width: 100%; }
.ad-container { background: #fff; border: 1px solid #e2e8f0; height: 120px; display: flex; align-items: center; justify-content: center; color: #cbd5e1; font-weight: 700; letter-spacing: 2px; width: 100%; }
.bottom-section { max-width: 1200px; margin: 0 auto 80px auto; padding: 0 20px; width: 100%; }
.bottom-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.column-title { font-family: 'Oswald', sans-serif; font-size: 20px; font-weight: 700; color: #0f172a; border-bottom: 2px solid #e2e8f0; padding-bottom: 10px; margin-bottom: 25px; position: relative; }
.column-title::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 60px; height: 2px; background: #38bdf8; }
.small-card { display: flex; gap: 15px; margin-bottom: 25px; align-items: flex-start; }
.small-img { width: 90px; height: 70px; border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.small-img img { width: 100%; height: 100%; object-fit: cover; }
.small-content { flex: 1; }
.small-title { font-family: 'Roboto', sans-serif; font-size: 15px; font-weight: 600; line-height: 1.4; color: #334155; margin: 0; }

/* --- 7. Single Post Design (الإصلاح الجذري للصور) --- */
.container { max-width: 1000px; margin: 0 auto; padding: 0 20px; width: 100%; }
.breadcrumbs { font-size: 13px; color: #64748b; margin-bottom: 20px; text-transform: uppercase; font-weight: 600; flex-wrap: wrap; display: flex; justify-content: center; }
.single-title { font-family: 'Oswald', sans-serif; font-size: 42px; line-height: 1.2; color: #0f172a; margin: 10px 0 20px 0; word-wrap: break-word; text-align: center; }
.single-thumb { margin-bottom: 40px; border-radius: 12px; overflow: hidden; width: 100%; }
.single-thumb img { width: 100%; height: auto; object-fit: cover; }

.entry-content { font-size: 18px; line-height: 1.8; color: #334155; overflow-wrap: break-word; }

/* >> [إجبار] كل صور المحتوى (Force Center & Fit) << */
.entry-content img, 
.entry-content figure, 
.wp-block-image,
.wp-block-image img {
    max-width: 100% !important; /* ممنوع تعدي عرض الشاشة */
    height: auto !important;    /* الحفاظ على الأبعاد */
    margin-left: auto !important;  /* هوامش تلقائية لليمين */
    margin-right: auto !important; /* هوامش تلقائية لليسار (توسيط) */
    display: block !important;     /* تحويلها لبلوك */
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); /* جماليات */
    border-radius: 8px;
}

/* إلغاء أي محاذاة قديمة من ووردبريس */
.alignleft, .alignright, .aligncenter {
    float: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
    max-width: 100% !important;
}

/* باقي تنسيقات المقال */
#toc-container { background: #f8fafc; border: 1px solid #e2e8f0; border-left: 4px solid #38bdf8; padding: 25px; margin-bottom: 40px; border-radius: 8px; max-width: 100%; overflow-x: hidden; }
.toc-title { font-family: 'Oswald', sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 15px; color: #0f172a; display: flex; align-items: center; gap: 10px; }
#toc-list { list-style: none; margin: 0; padding: 0; }
#toc-list li { margin-bottom: 8px; }
#toc-list li a { color: #334155; font-weight: 500; font-size: 15px; display: block; padding-left: 15px; position: relative; transition: 0.2s; }
#toc-list li a::before { content: '•'; color: #38bdf8; position: absolute; left: 0; font-size: 20px; line-height: 1; top: -2px; }
#toc-list li a:hover { color: #38bdf8; transform: translateX(5px); }
#toc-list li.toc-h3 { margin-left: 20px; font-size: 14px; }
.entry-content h2 { font-family: 'Oswald', sans-serif; font-size: 28px; color: #0f172a; margin-top: 40px; margin-bottom: 20px; }
.entry-content h3 { font-family: 'Oswald', sans-serif; font-size: 24px; color: #1e293b; margin-top: 30px; margin-bottom: 15px; }
.author-box { background: #fff; border: 1px solid #e2e8f0; padding: 30px; border-radius: 12px; display: flex; gap: 20px; margin-top: 60px; align-items: center; }
.author-avatar img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.author-info h4 { margin: 0 0 5px 0; font-family: 'Oswald', sans-serif; font-size: 18px; }
.author-info p { margin: 0; font-size: 14px; color: #64748b; }
.related-posts { margin-top: 60px; }
.related-heading { font-family: 'Oswald', sans-serif; font-size: 24px; border-bottom: 2px solid #0f172a; padding-bottom: 10px; margin-bottom: 30px; text-align: center; }

/* --- 8. Home Generator & Footer --- */
.home-tool-section { background: linear-gradient(135deg, #0f172a 0%, #334155 100%); padding: 80px 20px; text-align: center; position: relative; overflow: hidden; margin-bottom: 60px; width: 100%; box-shadow: inset 0 0 50px rgba(0,0,0,0.5); }
.home-tool-section::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 60%); animation: rotateBg 60s linear infinite; }
@keyframes rotateBg { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.tool-container { max-width: 800px; margin: 0 auto; position: relative; z-index: 2; width: 100%; }
.tool-headline { font-family: 'Oswald', sans-serif; font-size: 42px; color: #fff; margin-bottom: 15px; }
.home-search-box { background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.2); padding: 10px; border-radius: 60px; display: flex; }
.home-input { flex: 1; background: transparent; border: none; padding: 15px 30px; font-size: 18px; color: #fff; outline: none; width: 100%; }
.home-btn { background: #38bdf8; color: #0f172a; border: none; padding: 15px 40px; border-radius: 50px; font-weight: 700; cursor: pointer; }
.home-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; margin-top: 40px; display: none; }
.result-tag { background: #fff; color: #0f172a; padding: 15px; border-radius: 8px; font-weight: 600; cursor: pointer; }

.site-footer { background: #0b1120; color: #94a3b8; font-size: 15px; border-top: 5px solid #38bdf8; width: 100%; }
.footer-widgets { padding: 80px 0 60px 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 40px; }
.footer-col h3 { color: #fff; font-family: 'Oswald', sans-serif; font-size: 18px; margin-bottom: 25px; text-transform: uppercase; letter-spacing: 1px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: #94a3b8; display: flex; align-items: center; gap: 8px; }
.footer-newsletter input { width: 100%; padding: 12px 15px; background: #1e293b; border: 1px solid #1e293b; color: #fff; border-radius: 6px; margin-bottom: 10px; }
.footer-btn { width: 100%; padding: 12px; background: #38bdf8; color: #0f172a; border: none; border-radius: 6px; font-weight: 700; cursor: pointer; }
.social-icons { display: flex; gap: 15px; margin-top: 25px; }
.social-icon { width: 40px; height: 40px; background: #1e293b; color: #fff; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.social-icon svg { width: 20px; height: 20px; fill: currentColor; }
.footer-bottom { background: #020617; padding: 25px 0; border-top: 1px solid #1e293b; text-align: center; }
.static-page-card { background: #fff; padding: 50px; border-radius: 12px; border: 1px solid #f1f5f9; box-shadow: 0 5px 20px rgba(0,0,0,0.02); }

/* =========================================================
   MOBILE ONLY STYLES (Max Width 1100px)
   ========================================================= */
@media (max-width: 1100px) {
    html, body { overflow-x: hidden; width: 100%; }
    .site-content, .container, .hero-section { max-width: 100vw; overflow: hidden; }

    /* Header & Menu */
    .site-header { padding: 15px 0; } 
    .header-inner { flex-direction: row; justify-content: space-between; gap: 0; }
    #menu-toggle { display: flex !important; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 8px 12px; cursor: pointer; border-radius: 6px; z-index: 100001; }
    #site-navigation { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(15, 23, 42, 0.98); backdrop-filter: blur(10px); z-index: 100000; flex-direction: column; justify-content: center; align-items: center; padding: 20px; }
    #site-navigation.toggled { display: flex !important; }
    .main-navigation ul { flex-direction: column; gap: 20px; width: 100%; text-align: center; }
    .main-navigation li a { background: transparent; border: none; border-bottom: 1px solid rgba(255,255,255,0.1); color: #fff; font-size: 22px; padding: 15px 0; }
    
    /* Layout Adjustments */
    .hero-section { margin-top: 20px; margin-bottom: 20px; padding: 0; width: 100vw; }
    .swiper-wrapper.mosaic-grid { display: flex; gap: 0; } 
    .mosaic-item { width: 100vw; height: auto; aspect-ratio: 16 / 9; border-radius: 0; flex-shrink: 0; }
    .mosaic-item img { object-fit: cover; width: 100%; height: 100%; }
    .swiper-pagination { display: block; bottom: 15px !important; } 
    .swiper-pagination-bullet-active { background: #38bdf8 !important; }
    
    .features-grid { grid-template-columns: 1fr 1fr; gap: 15px; }
    .bottom-grid { grid-template-columns: 1fr; gap: 40px; } 
    .footer-grid { grid-template-columns: 1fr; gap: 40px; }
    .footer-col { text-align: center; }
    .social-icons { justify-content: center; }
    .footer-links a { justify-content: center; }
    
    .home-search-box { flex-direction: column; border-radius: 20px; }
    .home-btn { width: 100%; border-radius: 12px; }
    .tool-headline { font-size: 28px; }
    .single-title { font-size: 30px; }
    .author-box { flex-direction: column; text-align: center; }
    .static-page-card { padding: 25px; }
    .entry-title { font-size: 30px !important; }
    
    article.news-block { flex-direction: column; gap: 15px; }
    .post-thumbnail-wrap { width: 100%; height: auto; aspect-ratio: 16 / 9; }
}

@media (max-width: 600px) { 
    .features-grid { grid-template-columns: 1fr; }
    .feature-img-wrap { height: auto; aspect-ratio: 16/9; }
}