/* ================================================
   OMAN22 THEME v2 - MAIN STYLESHEET
   RTL Arabic News Theme
   ================================================ */

/* ---- VARIABLES ---- */
:root {
    --red:       #c0392b;
    --red-dark:  #96281b;
    --navy:      #1a1a2e;
    --dark:      #2c3e50;
    --bg:        #f0f2f5;
    --white:     #ffffff;
    --text:      #1a1a1a;
    --muted:     #666;
    --border:    #e0e0e0;
    --shadow:    0 1px 6px rgba(0,0,0,0.08);
    --radius:    6px;
    --font:      'Cairo', 'Tajawal', Arial, sans-serif;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* === FIX 1: منع التمرير الأفقي على الجوال === */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}
body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    max-width: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); }
ul, ol { list-style: none; }
button { cursor: pointer; }

/* منع تجاوز العرض في كل العناصر */
.post-content img,
.post-content iframe,
.post-content video,
.post-content embed,
.entry-content img,
.entry-content iframe {
    max-width: 100% !important;
    height: auto !important;
}
.post-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* ---- LAYOUT ---- */
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 15px;
    overflow-x: hidden;
}

/* ================================================
   TOP BAR
   ================================================ */
.topbar {
    background: var(--navy);
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    padding: 5px 0;
    border-bottom: 2px solid var(--red);
}
.topbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar-links a {
    color: rgba(255,255,255,0.75);
    margin-inline-start: 12px;
    font-size: 12px;
    transition: color 0.2s;
}
.topbar-links a:hover { color: #fff; }

/* ================================================
   BREAKING NEWS
   ================================================ */
.breaking {
    background: var(--red);
    color: #fff;
    display: flex;
    align-items: center;
    height: 36px;
    font-size: 13px;
    overflow: hidden;
}
.breaking-badge {
    background: var(--navy);
    padding: 0 14px;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: 700;
    white-space: nowrap;
    gap: 5px;
    flex-shrink: 0;
}
.breaking-dot { width: 8px; height: 8px; background: var(--red); border-radius: 50%; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
.ticker-outer { overflow: hidden; flex: 1; }
.ticker-inner {
    display: flex;
    width: max-content;
    animation: scroll-ticker 35s linear infinite;
}
.ticker-inner:hover { animation-play-state: paused; }
.ticker-inner a { color: #fff; font-weight: 500; padding: 0 28px; white-space: nowrap; }
@keyframes scroll-ticker { from{transform:translateX(-50%)} to{transform:translateX(0)} }

/* ================================================
   HEADER
   ================================================ */
.site-header {
    background: var(--navy);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    padding: 10px 0;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}
.site-logo img { height: 50px; width: auto; }
.logo-text { line-height: 1.1; }
.logo-name {
    font-size: 22px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.5px;
}
.logo-name span { color: var(--red); }
.logo-desc { font-size: 11px; color: rgba(255,255,255,0.55); }

/* Header Ad */
.header-ad {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Search */
.header-search { display: flex; align-items: center; }
.header-search form { display: flex; }
.header-search input {
    width: 200px;
    padding: 7px 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius) 0 0 var(--radius);
    color: #fff;
    font-family: var(--font);
    font-size: 13px;
    outline: none;
    transition: background 0.2s;
}
.header-search input::placeholder { color: rgba(255,255,255,0.45); }
.header-search input:focus { background: rgba(255,255,255,0.18); }
.header-search button {
    background: var(--red);
    border: none;
    color: #fff;
    padding: 7px 12px;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 15px;
    line-height: 1;
    transition: background 0.2s;
}
.header-search button:hover { background: var(--red-dark); }
.dark-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-inline-start: 8px;
    transition: background 0.2s;
}
.dark-btn:hover { background: rgba(255,255,255,0.2); }

/* ================================================
   NAVIGATION
   ================================================ */
.main-nav {
    background: var(--white);
    border-bottom: 3px solid var(--red);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; }
.nav-menu { display: flex; flex-wrap: wrap; }
.nav-menu li { position: relative; }
.nav-menu li a {
    display: block;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
.nav-menu li a:hover,
.nav-menu li.current-menu-item > a,
.nav-menu li.current-menu-ancestor > a {
    color: var(--red);
    border-bottom-color: var(--red);
    background: rgba(192,57,43,0.04);
}
/* Dropdown */
.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 190px;
    background: var(--white);
    border-top: 3px solid var(--red);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.2s;
    border-radius: 0 0 var(--radius) var(--radius);
}
.nav-menu li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-menu .sub-menu a {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text);
}
.nav-menu .sub-menu a:hover { color: var(--red); background: rgba(192,57,43,0.04); }
.hamburger { display: none; background: none; border: none; font-size: 22px; color: var(--dark); padding: 8px; }

/* ================================================
   AD ZONES - FIX 4: إصلاح ظهور الإعلانات
   ================================================ */
.ad-zone {
    text-align: center;
    overflow: visible;          /* مهم: لا تخفي الإعلانات */
    min-height: 0;
}
.ad-zone-bar {
    background: rgba(0,0,0,0.02);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    overflow: visible;
}
.ad-label { font-size: 10px; color: #bbb; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; display: block; }
.ad-zone-sidebar { margin-bottom: 20px; }
.ad-zone-sticky { position: sticky; top: 76px; }

/* إصلاح عرض إعلانات AdSense ins */
.ad-zone ins.adsbygoogle,
.ad-zone-bar ins.adsbygoogle,
.in-content-ad ins.adsbygoogle {
    display: block !important;
    overflow: visible !important;
}
/* إعلان داخل المقال */
.in-content-ad {
    margin: 22px auto;
    text-align: center;
    overflow: visible;
    clear: both;
}

/* ================================================
   HERO SECTION
   ================================================ */
.hero-section { padding: 18px 0 0; }
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 14px;
    margin-bottom: 14px;
}
.hero-main-card { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--white); }
.hero-main-card .hero-img { width: 100%; height: 380px; object-fit: cover; display: block; }
.hero-main-card .hero-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding: 40px 18px 18px;
}
.hero-main-card .hero-cat {
    display: inline-block;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    margin-bottom: 7px;
}
.hero-main-card .hero-title {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    line-height: 1.4;
}
.hero-main-card .hero-title a { color: #fff; }
.hero-main-card .hero-meta { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 6px; }

.hero-side { display: flex; flex-direction: column; gap: 12px; }

/* ================================================
   SLIDER - سلايدر أعلى الصفحة
   ================================================ */
.o22-slider-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
    max-height: 480px;
}
.o22-slider {
    display: flex;
    transition: none;
    height: 480px;
}
.o22-slide {
    min-width: 100%;
    position: relative;
    display: none;
}
.o22-slide.active { display: block; }
.o22-slide .slide-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}
.o22-slide img {
    width: 100%;
    height: 480px;
    object-fit: cover;
    display: block;
    filter: brightness(0.75);
    transition: filter 0.3s;
}
.o22-slide:hover img { filter: brightness(0.85); }
.slide-no-img {
    width: 100%;
    height: 480px;
    background: linear-gradient(135deg, var(--navy), var(--dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
}
.slide-overlay {
    position: absolute;
    bottom: 0; right: 0; left: 0;
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.5) 30%, rgba(0,0,0,0.88) 100%);
    padding: 60px 40px 30px;
    color: #fff;
}
.slide-cat {
    display: inline-block;
    background: var(--red);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
}
.slide-title {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.4;
    color: #fff;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.slide-meta { font-size: 13px; color: rgba(255,255,255,0.75); display: flex; gap: 16px; }

/* Slider buttons */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255,255,255,0.3);
    color: #fff;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}
.slider-btn:hover { background: var(--red); border-color: var(--red); }
.slider-prev { right: 16px; }
.slider-next { left: 16px; }

/* Dots */
.slider-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 7px;
    z-index: 10;
}
.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.45);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
}
.slider-dot.active { background: #fff; width: 24px; border-radius: 4px; }

/* Slide fade animation */
@keyframes slideIn {
    from { opacity: 0; transform: scale(1.03); }
    to   { opacity: 1; transform: scale(1); }
}
.o22-slide.active img { animation: slideIn 0.5s ease; }

/* Slider responsive */
@media (max-width: 768px) {
    .o22-slider, .o22-slider-wrap { max-height: 260px; height: 260px; }
    .o22-slide img, .slide-no-img { height: 260px; }
    .slide-title { font-size: 16px; }
    .slide-overlay { padding: 30px 16px 14px; }
    .slider-btn { width: 34px; height: 34px; font-size: 18px; }
}

/* ================================================
   SECTION HEADER
   ================================================ */
.sec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--red);
    padding-bottom: 8px;
    margin-bottom: 14px;
}
.sec-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 7px;
}
.sec-more {
    font-size: 12px;
    color: var(--red);
    font-weight: 700;
    border: 1px solid var(--red);
    padding: 3px 11px;
    border-radius: 20px;
    white-space: nowrap;
    transition: all 0.2s;
}
.sec-more:hover { background: var(--red); color: #fff; }

/* ================================================
   NEWS LIST
   الصورة يمين + المعلومات + المقتطف يسار
   ================================================ */
.news-list { display: flex; flex-direction: column; gap: 10px; }

.news-item {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, transform 0.2s;
    min-height: 130px;
    border: 1px solid var(--border);
}
.news-item:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,0.13);
    transform: translateY(-2px);
    border-color: rgba(192,57,43,0.2);
}

/* === FIX 3أ: الصورة يمين باحترافية === */
.news-item-img {
    width: 160px;
    min-width: 160px;
    max-width: 160px;
    flex-shrink: 0;
    overflow: hidden;
    order: 2;
    position: relative;
    /* إطار الصورة */
    border-right: 3px solid var(--red);
}
.news-item-img img {
    width: 160px;
    height: 100%;
    min-height: 130px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.news-item:hover .news-item-img img { transform: scale(1.06); }

.news-item-img-empty {
    width: 160px;
    min-height: 130px;
    height: 100%;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #ccc;
}

/* === FIX 3ب: المحتوى يسار مع مقتطف === */
.news-item-body {
    order: 1;
    flex: 1;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    overflow: hidden;
}
.news-item-cat {
    display: inline-block;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    margin-bottom: 6px;
    align-self: flex-start;
    white-space: nowrap;
}
.news-item-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.55;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}
.news-item-title a { color: inherit; }
.news-item-title a:hover { color: var(--red); }

/* المقتطف - جديد */
.news-item-excerpt {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
    flex: 1;
}

.news-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--muted);
    padding-top: 8px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    margin-top: auto;
}

/* ================================================
   GRID CARDS (للصفحة الرئيسية)
   ================================================ */
.cards-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cards-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cards-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

.card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}
.card:hover { box-shadow: 0 4px 18px rgba(0,0,0,0.13); transform: translateY(-2px); }
.card-img-wrap { position: relative; overflow: hidden; }
.card-img-wrap img { width: 100%; height: 185px; object-fit: cover; display: block; transition: transform 0.35s; }
.card:hover .card-img-wrap img { transform: scale(1.05); }
.card-img-empty { width: 100%; height: 185px; background: #e8e8e8; display: flex; align-items: center; justify-content: center; font-size: 32px; color: #ccc; }
.card-cat {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}
.card-body { padding: 12px; flex: 1; display: flex; flex-direction: column; }
.card-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    margin-bottom: 8px;
}
.card-title a { color: inherit; }
.card-title a:hover { color: var(--red); }
.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--muted);
    padding-top: 8px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

/* Large card (hero side) */
.card-lg .card-img-wrap img { height: 155px; }

/* Mixed layout */
.mixed-layout { display: grid; grid-template-columns: 1fr 280px; gap: 14px; }
.mixed-main .card-img-wrap img { height: 280px; }
.mixed-main .card-title { font-size: 18px; }
.mixed-side { display: flex; flex-direction: column; gap: 10px; }

/* ================================================
   PAGE LAYOUT - Content + Sidebar
   ================================================ */
.page-wrap {
    display: grid;
    grid-template-columns: 1fr 270px;
    gap: 24px;
    padding: 20px 0 30px;
    align-items: start;
}
.page-main { min-width: 0; }
.page-sidebar { min-width: 0; }

/* ================================================
   WIDGETS (sidebar + old widgets)
   ================================================ */
.widget-wrap { display: flex; flex-direction: column; gap: 18px; }

/* كل ودجت */
.widget-box {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.widget-box .widget-title,
.widget-box .widgettitle,
.widget-box h2,
.widget-box h3 {
    background: var(--dark) !important;
    color: #fff !important;
    padding: 9px 13px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    border: none !important;
}
.widget-box .widget-inner,
.widget-box .textwidget,
.widget-box ul,
.widget-box .widget-body { padding: 12px 13px !important; }

/* WordPress default widgets - تنسيق القوائم */
.widget-box ul li {
    border-bottom: 1px solid var(--border);
    padding: 7px 0 !important;
    font-size: 13px !important;
}
.widget-box ul li:last-child { border-bottom: none; }
.widget-box ul li a { color: var(--text) !important; display: block; line-height: 1.4; }
.widget-box ul li a:hover { color: var(--red) !important; padding-right: 4px; transition: padding 0.2s; }

/* Popular posts widget rows */
.pop-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.pop-item:last-child { border-bottom: none; }
.pop-img { width: 68px; min-width: 68px; height: 54px; object-fit: cover; border-radius: 4px; }
.pop-img-empty { width: 68px; min-width: 68px; height: 54px; background: #e8e8e8; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #ccc; }
.pop-info { flex: 1; min-width: 0; }
.pop-title { font-size: 13px; font-weight: 700; line-height: 1.4; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pop-title a { color: inherit; }
.pop-title a:hover { color: var(--red); }
.pop-date { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* Category cloud */
.cat-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-tag {
    background: rgba(192,57,43,0.07);
    color: var(--red);
    border: 1px solid rgba(192,57,43,0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}
.cat-tag:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* ================================================
   SINGLE POST
   ================================================ */

/* === FIX 2: إطار أبيض للمقال === */
.post-card-wrapper {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 24px 28px;
    margin-bottom: 24px;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-header { margin-bottom: 16px; }
.post-cat-link {
    display: inline-block;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}
.post-title {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--dark);
    margin-bottom: 12px;
}
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    color: var(--muted);
    padding: 10px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.post-meta span { display: flex; align-items: center; gap: 4px; }
.post-thumb { margin-bottom: 18px; border-radius: var(--radius); overflow: hidden; }
.post-thumb img { width: 100%; height: auto; max-height: 460px; object-fit: cover; }

/* Content */
.post-content {
    font-size: 16px;
    line-height: 1.9;
    color: #2a2a2a;
}
.post-content p { margin-bottom: 16px; }
.post-content h2 { font-size: 20px; color: var(--dark); margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--red); }
.post-content h3 { font-size: 18px; color: var(--dark); margin: 18px 0 8px; }
.post-content ul, .post-content ol { margin: 12px 0 16px 22px; }
.post-content li { margin-bottom: 6px; }
.post-content blockquote { border-right: 4px solid var(--red); background: rgba(192,57,43,0.05); padding: 14px 18px; margin: 16px 0; border-radius: 0 var(--radius) var(--radius) 0; color: #444; font-style: italic; }
.post-content img { border-radius: var(--radius); margin: 12px auto; }
.post-content table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 8px 11px; font-size: 14px; }
.post-content th { background: var(--dark); color: #fff; }

/* In-content ad */
.in-content-ad { margin: 22px auto; text-align: center; }

/* Share */
.share-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 2px solid var(--border); }
.share-label { font-weight: 700; font-size: 14px; }
.share-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 13px; border-radius: var(--radius); font-size: 13px; font-weight: 600; color: #fff; transition: opacity 0.2s; border: none; }
.share-btn:hover { opacity: 0.85; color: #fff; }
.share-fb { background: #1877f2; }
.share-tw { background: #1da1f2; }
.share-wa { background: #25d366; }
.share-tg { background: #0088cc; }
.share-cp { background: var(--dark); cursor: pointer; font-family: var(--font); }

/* Tags */
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 16px; }
.post-tags-lbl { font-weight: 700; font-size: 13px; }
.post-tag { background: #f0f0f0; color: var(--text); padding: 3px 10px; border-radius: 20px; font-size: 12px; transition: all 0.2s; }
.post-tag:hover { background: var(--red); color: #fff; }

/* Related */
.related-sec { margin-top: 28px; padding-top: 20px; border-top: 3px solid var(--red); }
.related-title { font-size: 18px; font-weight: 800; color: var(--dark); margin-bottom: 14px; }

/* ================================================
   ARCHIVE HEADER
   ================================================ */
.archive-hdr {
    background: var(--white);
    border-right: 4px solid var(--red);
    padding: 14px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.archive-hdr h1 { font-size: 22px; font-weight: 800; color: var(--dark); }
.archive-hdr p { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ================================================
   BREADCRUMBS
   ================================================ */
.breadcrumbs {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
}
.breadcrumbs a { color: var(--red); }
.breadcrumbs .sep { color: #bbb; }

/* ================================================
   PAGINATION
   ================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 20px 0;
    flex-wrap: wrap;
}
.page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text);
    background: var(--white);
    transition: all 0.2s;
}
.page-num:hover, .page-num.active { background: var(--red); color: #fff; border-color: var(--red); }

/* ================================================
   READING PROGRESS
   ================================================ */
.read-progress { position: fixed; top: 0; right: 0; height: 3px; background: var(--red); z-index: 9999; width: 0; transition: width 0.1s; }

/* ================================================
   FOOTER
   ================================================ */
.site-footer { background: var(--dark); color: rgba(255,255,255,0.8); }
.footer-body { padding: 36px 0 22px; }
.footer-grid { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr; gap: 28px; }
.footer-logo-name { font-size: 20px; font-weight: 900; color: #fff; margin-bottom: 8px; }
.footer-logo-name span { color: var(--red); }
.footer-about { font-size: 13px; line-height: 1.7; margin-bottom: 12px; }
.footer-socials { display: flex; gap: 8px; flex-wrap: wrap; }
.soc-btn { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.1); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; transition: all 0.2s; }
.soc-btn:hover { transform: translateY(-3px); }
.soc-btn.fb:hover { background: #1877f2; }
.soc-btn.tw:hover { background: #1da1f2; }
.soc-btn.yt:hover { background: #ff0000; }
.soc-btn.ig:hover { background: #e4405f; }
.soc-btn.tg:hover { background: #0088cc; }

.footer-col-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    padding-bottom: 7px;
    border-bottom: 2px solid var(--red);
    display: inline-block;
}
.footer-links a {
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    transition: color 0.2s, padding 0.2s;
}
.footer-links a::before { content: '◂ '; font-size: 10px; color: var(--red); }
.footer-links a:hover { color: #fff; padding-right: 5px; }

.footer-bottom {
    background: rgba(0,0,0,0.25);
    padding: 12px 0;
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,0.55);
}
.footer-bottom a { color: rgba(255,255,255,0.75); }

/* ================================================
   SCROLL TOP
   ================================================ */
.scroll-top {
    position: fixed;
    bottom: 22px;
    left: 22px;
    width: 40px;
    height: 40px;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(192,57,43,0.35);
}
.scroll-top.show { opacity: 1; visibility: visible; }
.scroll-top:hover { background: var(--red-dark); transform: translateY(-2px); }

/* ================================================
   DARK MODE
   ================================================ */
body.dark {
    --bg: #111;
    --white: #1e1e1e;
    --text: #e0e0e0;
    --muted: #888;
    --border: #2e2e2e;
    --shadow: 0 1px 6px rgba(0,0,0,0.3);
}
body.dark .main-nav { background: #1e1e1e; }
body.dark .nav-menu li a { color: #ddd; }
body.dark .nav-menu li a:hover { color: var(--red); background: rgba(192,57,43,0.06); }

/* ================================================
   404 PAGE
   ================================================ */
.not-found-wrap { text-align: center; padding: 60px 15px; }
.not-found-wrap h1 { font-size: 80px; font-weight: 900; color: var(--red); }
.not-found-wrap h2 { font-size: 22px; color: var(--dark); margin: 8px 0 12px; }
.not-found-wrap p { color: var(--muted); margin-bottom: 20px; }
.btn-home { display: inline-block; background: var(--red); color: #fff; padding: 11px 28px; border-radius: var(--radius); font-weight: 700; transition: background 0.2s; }
.btn-home:hover { background: var(--red-dark); color: #fff; }

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1024px) {
    .page-wrap { grid-template-columns: 1fr 240px; gap: 18px; }
    .cards-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
    .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .page-wrap { grid-template-columns: 1fr; }
    .page-sidebar { display: none; }
    .mixed-layout { grid-template-columns: 1fr; }
    /* تصغير صورة القائمة على التابلت */
    .news-item-img { width: 130px; min-width: 130px; max-width: 130px; }
    .news-item-img img { width: 130px; }
}
@media (max-width: 768px) {
    .topbar { display: none; }
    .header-ad { display: none; }
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: var(--white);
        box-shadow: 0 8px 20px rgba(0,0,0,0.1);
        z-index: 999;
        /* FIX 1: منع تجاوز الشاشة */
        max-width: 100vw;
        overflow-x: hidden;
    }
    .nav-menu.open { display: flex; }
    .nav-menu li a { padding: 13px 18px; border-bottom: 1px solid var(--border); }
    .hamburger { display: block; }
    .header-search input { width: 120px; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero-main-card .hero-img { height: 240px; }
    /* إطار المقال على الجوال */
    .post-card-wrapper { padding: 16px 14px; }
    .post-title { font-size: 20px; }
}
@media (max-width: 520px) {
    .cards-grid-4, .cards-grid-3, .cards-grid-2 { grid-template-columns: 1fr; }
    .container { padding: 0 10px; }

    /* FIX 1: صورة القائمة على الجوال الصغير */
    .news-item-img {
        width: 105px;
        min-width: 105px;
        max-width: 105px;
    }
    .news-item-img img {
        width: 105px;
        min-height: 110px;
    }
    .news-item-img-empty {
        width: 105px;
    }
    .news-item-body { padding: 8px 10px; }
    .news-item-title { font-size: 13px; }
    .news-item-excerpt { display: none; } /* إخفاء المقتطف في الشاشات الصغيرة جداً */

    /* منع تجاوز Header */
    .header-inner { flex-wrap: wrap; gap: 6px; }
    .header-search input { width: 100px; }
    .logo-name { font-size: 18px; }
}

@media print {
    .site-header, .main-nav, .page-sidebar, .site-footer, .share-bar, .ad-zone { display: none !important; }
    .page-wrap { grid-template-columns: 1fr; }
}

/* ================================================
   V3 CLASS ALIASES - new prefixed classes
   ================================================ */

/* Container */
.o22-container { max-width:1180px; margin:0 auto; padding:0 15px; overflow-x:hidden; }

/* Page wrap */
.o22-page-wrap { display:grid; grid-template-columns:1fr 270px; gap:24px; padding:20px 0 30px; align-items:start; }
.o22-main { min-width:0; overflow-x:hidden; }

/* Section */
.o22-section { margin-bottom:24px; }
.o22-sec-hdr { display:flex; align-items:center; justify-content:space-between; border-bottom:3px solid var(--red); padding-bottom:8px; margin-bottom:14px; }
.o22-sec-title { font-size:18px; font-weight:800; color:var(--dark); display:flex; align-items:center; gap:7px; }
.o22-sec-more { font-size:12px; color:var(--red); font-weight:700; border:1px solid var(--red); padding:3px 11px; border-radius:20px; white-space:nowrap; transition:all 0.2s; }
.o22-sec-more:hover { background:var(--red); color:#fff; }

/* Grids */
.o22-grid4 { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.o22-grid3 { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.o22-grid2 { display:grid; grid-template-columns:repeat(2,1fr); gap:14px; }

/* Card */
.o22-card { background:var(--white); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); display:flex; flex-direction:column; transition:box-shadow 0.2s,transform 0.2s; }
.o22-card:hover { box-shadow:0 4px 18px rgba(0,0,0,0.13); transform:translateY(-2px); }
.o22-card-img { position:relative; overflow:hidden; display:block; }
.o22-card-img img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #f8f8f8;
    display: block;
    transition: transform 0.3s;
}
.o22-card:hover .o22-card-img img { transform: scale(1.02); }
.o22-card-empty {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #f0f0f0, #e8e8e8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #ccc;
}
.o22-card-lg .o22-card-img img { aspect-ratio: 16 / 9; }
.o22-card-cat { position:absolute; top:8px; right:8px; background:var(--red); color:#fff; font-size:10px; font-weight:700; padding:2px 8px; border-radius:20px; }
.o22-card-body { padding:12px; flex:1; display:flex; flex-direction:column; }
.o22-card-title { font-size:14px; font-weight:700; line-height:1.5; color:var(--text); display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; flex:1; margin-bottom:8px; }
.o22-card-title a { color:inherit; }
.o22-card-title a:hover { color:var(--red); }
.o22-card-meta { display:flex; gap:10px; font-size:11px; color:var(--muted); padding-top:8px; border-top:1px solid var(--border); flex-wrap:wrap; }

/* Mixed */
.o22-mixed { display:grid; grid-template-columns:1fr 280px; gap:14px; }
.o22-mixed-main .o22-card-img img { height:280px; }
.o22-mixed-side { display:flex; flex-direction:column; gap:10px; }

/* News List */
.o22-news-list { display:flex; flex-direction:column; gap:10px; }
.o22-news-item { display:flex; align-items:stretch; background:var(--white); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); border:1px solid var(--border); min-height:120px; transition:box-shadow 0.2s,transform 0.2s; }
.o22-news-item:hover { box-shadow:0 4px 16px rgba(0,0,0,0.12); transform:translateY(-2px); border-color:rgba(192,57,43,0.2); }
/* الصورة يمين */
.o22-ni-img { width:155px; min-width:155px; flex-shrink:0; order:2; overflow:hidden; border-right:3px solid var(--red); }
.o22-ni-img a { display:block; height:100%; }
.o22-ni-img img { width:155px; height:100%; min-height:120px; object-fit:cover; transition:transform 0.4s; }
.o22-news-item:hover .o22-ni-img img { transform:scale(1.06); }
.o22-ni-img-empty { width:155px; height:120px; background:#eee; display:flex; align-items:center; justify-content:center; font-size:28px; color:#ccc; }
/* المحتوى يسار */
.o22-ni-body { order:1; flex:1; padding:10px 14px; display:flex; flex-direction:column; min-width:0; }
.o22-ni-cat { display:inline-block; background:var(--red); color:#fff; font-size:10px; font-weight:700; padding:2px 8px; border-radius:20px; margin-bottom:5px; align-self:flex-start; }
.o22-ni-title { font-size:15px; font-weight:700; line-height:1.5; color:var(--text); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin-bottom:5px; }
.o22-ni-title a { color:inherit; }
.o22-ni-title a:hover { color:var(--red); }
.o22-ni-excerpt { font-size:13px; color:var(--muted); line-height:1.6; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; flex:1; margin-bottom:6px; }
.o22-ni-meta { display:flex; gap:10px; font-size:11px; color:var(--muted); padding-top:7px; border-top:1px solid var(--border); flex-wrap:wrap; margin-top:auto; }

/* Hero */
.o22-hero { display:grid; grid-template-columns:1fr 310px; gap:14px; margin-bottom:20px; }
.o22-hero-main { position:relative; border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); }
.o22-hero-main img { width:100%; height:380px; object-fit:cover; }
.o22-hero-empty { width:100%; height:380px; background:#ddd; display:flex; align-items:center; justify-content:center; font-size:48px; }
.o22-hero-over { position:absolute; bottom:0; right:0; left:0; background:linear-gradient(transparent,rgba(0,0,0,0.85)); padding:40px 18px 18px; }
.o22-hero-cat { display:inline-block; background:var(--red); color:#fff; font-size:11px; font-weight:700; padding:2px 9px; border-radius:20px; margin-bottom:7px; }
.o22-hero-title { font-size:20px; font-weight:800; color:#fff; line-height:1.4; }
.o22-hero-title a { color:#fff; }
.o22-hero-meta { font-size:12px; color:rgba(255,255,255,0.7); margin-top:6px; }
.o22-hero-side { display:flex; flex-direction:column; gap:12px; }

/* Ad zone */
.o22-ad-zone { text-align:center; overflow:visible; }
.o22-ad-zone ins.adsbygoogle { display:block!important; }
.o22-ad-label { font-size:10px; color:#bbb; text-transform:uppercase; letter-spacing:1px; margin-bottom:3px; display:block; }
.o22-ad-wrap { margin:16px 0; }

/* WIDGETS - مُعزَّلة بالكامل عن بقية القالب */
.o22-widget { background:var(--white); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); margin-bottom:18px; }
.o22-widget-title { background:var(--dark); color:#fff; padding:9px 13px; font-size:14px; font-weight:700; margin:0; display:flex; align-items:center; gap:6px; }
/* ودجات WordPress الافتراضية */
.o22-widget ul { padding:0 13px; margin:0; }
.o22-widget ul li { border-bottom:1px solid var(--border); padding:7px 0; font-size:13px; }
.o22-widget ul li:last-child { border-bottom:none; }
.o22-widget ul li a { color:var(--text); display:block; line-height:1.4; }
.o22-widget ul li a:hover { color:var(--red); }
/* pop items */
.o22-pop-item { display:flex; gap:10px; align-items:flex-start; padding:8px 13px; border-bottom:1px solid var(--border); }
.o22-pop-item:last-child { border-bottom:none; }
.o22-pop-img { width:68px; min-width:68px; height:54px; object-fit:cover; border-radius:4px; }
.o22-pop-empty { width:68px; min-width:68px; height:54px; background:#e8e8e8; border-radius:4px; display:flex; align-items:center; justify-content:center; font-size:16px; color:#ccc; }
.o22-pop-info { flex:1; min-width:0; }
.o22-pop-title { font-size:13px; font-weight:700; line-height:1.4; color:var(--text); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.o22-pop-title a { color:inherit; }
.o22-pop-title a:hover { color:var(--red); }
.o22-pop-date { font-size:11px; color:var(--muted); margin-top:3px; }
/* cat cloud */
.o22-cat-cloud { display:flex; flex-wrap:wrap; gap:6px; padding:12px 13px; }
.o22-cat-tag { background:rgba(192,57,43,0.07); color:var(--red); border:1px solid rgba(192,57,43,0.2); padding:4px 10px; border-radius:20px; font-size:12px; font-weight:600; transition:all 0.2s; }
.o22-cat-tag:hover { background:var(--red); color:#fff; border-color:var(--red); }

/* Breadcrumbs */
.o22-breadcrumbs { font-size:12px; color:var(--muted); display:flex; flex-wrap:wrap; align-items:center; gap:4px; padding:8px 0; }
.o22-breadcrumbs a { color:var(--red); }

/* Pagination */
.o22-pagination { display:flex; justify-content:center; align-items:center; gap:5px; padding:20px 0; flex-wrap:wrap; }
.o22-page { display:inline-flex; align-items:center; justify-content:center; min-width:34px; height:34px; padding:0 8px; border:1px solid var(--border); border-radius:var(--radius); font-size:13px; color:var(--text); background:var(--white); transition:all 0.2s; }
.o22-page:hover,.o22-page.active { background:var(--red); color:#fff; border-color:var(--red); }

/* Share */
.o22-share { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:20px; padding-top:16px; border-top:2px solid var(--border); }
.o22-share-lbl { font-weight:700; font-size:13px; }
.o22-sbtn { display:inline-flex; align-items:center; gap:5px; padding:6px 12px; border-radius:var(--radius); font-size:13px; font-weight:600; color:#fff; border:none; cursor:pointer; transition:opacity 0.2s; font-family:var(--font); }
.o22-sbtn:hover { opacity:0.85; }
.o22-fb { background:#1877f2; } .o22-tw { background:#1da1f2; } .o22-wa { background:#25d366; } .o22-tg { background:#0088cc; } .o22-cp { background:var(--dark); }

/* Post single white wrapper */
.o22-post-wrap { background:var(--white); border-radius:var(--radius); box-shadow:0 2px 12px rgba(0,0,0,0.08); padding:24px 28px; margin-bottom:24px; overflow:hidden; word-wrap:break-word; }
.o22-post-cat { display:inline-block; background:var(--red); color:#fff; font-size:11px; font-weight:700; padding:3px 10px; border-radius:20px; margin-bottom:10px; }
.o22-post-title { font-size:26px; font-weight:800; line-height:1.4; color:var(--dark); margin-bottom:12px; }
.o22-post-meta { display:flex; flex-wrap:wrap; gap:14px; font-size:13px; color:var(--muted); padding:10px 0; border-top:1px solid var(--border); border-bottom:1px solid var(--border); margin-bottom:16px; }
.o22-post-meta span { display:flex; align-items:center; gap:4px; }
.o22-post-thumb { margin-bottom:18px; border-radius:var(--radius); overflow:hidden; }
.o22-post-thumb img { width:100%; height:auto; max-height:460px; object-fit:cover; }
.o22-post-content { font-size:16px; line-height:1.9; color:#2a2a2a; overflow-x:hidden; word-wrap:break-word; }
.o22-post-content p { margin-bottom:16px; }
.o22-post-content h2 { font-size:20px; color:var(--dark); margin:22px 0 10px; padding-bottom:6px; border-bottom:2px solid var(--red); }
.o22-post-content h3 { font-size:18px; color:var(--dark); margin:18px 0 8px; }
.o22-post-content ul,.o22-post-content ol { margin:12px 0 16px 22px; }
.o22-post-content li { margin-bottom:6px; }
.o22-post-content blockquote { border-right:4px solid var(--red); background:rgba(192,57,43,0.05); padding:14px 18px; margin:16px 0; border-radius:0 var(--radius) var(--radius) 0; color:#444; font-style:italic; }
.o22-post-content img,.o22-post-content iframe,.o22-post-content video { max-width:100%!important; height:auto!important; }
.o22-post-content table { display:block; overflow-x:auto; max-width:100%; border-collapse:collapse; }
.o22-post-content th,.o22-post-content td { border:1px solid var(--border); padding:8px 11px; font-size:14px; }
.o22-post-content th { background:var(--dark); color:#fff; }
.o22-in-ad { margin:22px auto; text-align:center; clear:both; }

.o22-post-tags { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin-top:16px; }
.o22-post-tags-lbl { font-weight:700; font-size:13px; }
.o22-post-tag { background:#f0f0f0; color:var(--text); padding:3px 10px; border-radius:20px; font-size:12px; }
.o22-post-tag:hover { background:var(--red); color:#fff; }

.o22-related { margin-top:28px; padding-top:20px; border-top:3px solid var(--red); }
.o22-related-title { font-size:18px; font-weight:800; color:var(--dark); margin-bottom:14px; }

/* RESPONSIVE */
@media (max-width:1024px) {
    .o22-page-wrap { grid-template-columns:1fr 240px; gap:18px; }
    .o22-grid4 { grid-template-columns:repeat(2,1fr); }
    .o22-hero { grid-template-columns:1fr; }
}
@media (max-width:860px) {
    .o22-page-wrap { grid-template-columns:1fr; }
    .page-sidebar,.o22-sidebar { display:none; }
    .o22-mixed { grid-template-columns:1fr; }
    .o22-ni-img { width:120px; min-width:120px; }
    .o22-ni-img img { width:120px; }
    .o22-ni-img-empty { width:120px; }
}
@media (max-width:520px) {
    .o22-grid4,.o22-grid3,.o22-grid2 { grid-template-columns:1fr; }
    .o22-container { padding:0 10px; }
    .o22-ni-img { width:100px; min-width:100px; }
    .o22-ni-img img { width:100px; }
    .o22-ni-excerpt { display:none; }
    .o22-post-wrap { padding:14px 12px; }
    .o22-post-title { font-size:20px; }
}

.o22-archive-hdr{background:var(--white);border-right:4px solid var(--red);padding:14px 16px;border-radius:var(--radius);margin-bottom:16px;box-shadow:var(--shadow);}
.o22-archive-hdr h1{font-size:22px;font-weight:800;color:var(--dark);}
.o22-archive-hdr p{font-size:13px;color:var(--muted);margin-top:4px;}

/* ================================================
   WIDGETS v2 - تنسيق شامل لكل الودجات
   ================================================ */

/* --- الإطار العام لكل ودجت --- */
.o22-widget,
.widget {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

/* --- عنوان الودجت - خلفية متدرجة جميلة --- */
.o22-widget-title,
.widget-title,
.widgettitle,
.widget .wp-block-heading,
.widget > h2,
.widget > h3,
.widget > h4 {
    background: linear-gradient(135deg, var(--navy) 0%, #16213e 100%) !important;
    color: #fff !important;
    padding: 11px 16px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    margin: 0 0 0 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    border-bottom: 3px solid var(--red) !important;
    letter-spacing: 0.3px;
}

/* --- محتوى الودجت --- */
.o22-widget .widget-body,
.widget ul,
.widget ol,
.widget .textwidget,
.widget .widget-content {
    padding: 12px 14px;
    margin: 0;
    list-style: none;
}

/* --- قوائم الودجت العامة --- */
.widget ul li,
.widget ol li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.5;
    list-style: none;
}
.widget ul li:last-child,
.widget ol li:last-child { border-bottom: none; }
.widget ul li a,
.widget ol li a {
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s, padding 0.2s;
}
.widget ul li a::before {
    content: '◂';
    color: var(--red);
    font-size: 10px;
    flex-shrink: 0;
}
.widget ul li a:hover { color: var(--red); padding-right: 4px; }

/* --- ودجت البحث --- */
.widget_search .search-form,
.widget_search form {
    display: flex;
    gap: 0;
    padding: 12px 14px;
}
.widget_search input[type="search"],
.widget_search input[type="text"] {
    flex: 1;
    padding: 9px 12px;
    border: 2px solid var(--border);
    border-left: none;
    border-radius: var(--radius) 0 0 var(--radius);
    font-family: var(--font);
    font-size: 13px;
    outline: none;
    color: var(--text);
    background: #f8f9fa;
    transition: border-color 0.2s;
    direction: rtl;
}
.widget_search input[type="search"]:focus { border-color: var(--red); background: #fff; }
.widget_search input[type="search"]::placeholder { color: #aaa; }
.widget_search button,
.widget_search input[type="submit"] {
    background: var(--red);
    color: #fff;
    border: none;
    padding: 9px 14px;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font);
    white-space: nowrap;
}
.widget_search button:hover,
.widget_search input[type="submit"]:hover { background: var(--red-dark); }

/* --- ودجت التصنيفات كـ CLOUD --- */
.widget_categories ul,
.widget_tag_cloud .tagcloud,
.o22-cat-cloud {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 7px !important;
    padding: 12px 14px !important;
    list-style: none !important;
}
.widget_categories ul li,
.widget_categories ul li a,
.widget_tag_cloud .tagcloud a,
.o22-cat-tag {
    display: inline-flex !important;
    align-items: center !important;
    background: rgba(192,57,43,0.08) !important;
    color: var(--red) !important;
    border: 1px solid rgba(192,57,43,0.25) !important;
    padding: 4px 11px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
    text-decoration: none !important;
    border-bottom: none !important;
    white-space: nowrap;
}
.widget_categories ul li { padding: 0 !important; }
.widget_categories ul li a:hover,
.widget_tag_cloud .tagcloud a:hover,
.o22-cat-tag:hover {
    background: var(--red) !important;
    color: #fff !important;
    border-color: var(--red) !important;
    transform: translateY(-1px);
}
/* إخفاء العداد في التصنيفات */
.widget_categories ul li a::before { display: none !important; }

/* --- ودجت الوسوم --- */
.widget_tag_cloud { }
.widget_tag_cloud .tagcloud {
    line-height: 1;
}
.widget_tag_cloud .tagcloud a {
    font-size: 12px !important; /* override WP inline font-size */
}

/* --- ودجت آخر التعليقات --- */
.widget_recent_comments ul li {
    padding: 8px 0;
}
.widget_recent_comments ul li a { font-weight: 600; }

/* --- ودجت الأرشيف --- */
.widget_archive ul li {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.widget_archive ul li a::before { content: '📅'; font-size: 11px; }

/* --- ودجت التقويم --- */
.widget_calendar table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 14px; width: calc(100% - 28px); }
.widget_calendar th { background: var(--navy); color: #fff; padding: 6px; text-align: center; }
.widget_calendar td { padding: 5px; text-align: center; border: 1px solid var(--border); }
.widget_calendar td a { background: var(--red); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; margin: auto; }

/* --- آخر المقالات (custom widget) --- */
.o22-recent-post {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}
.o22-recent-post:last-child { border-bottom: none; }
.o22-recent-post:hover { background: #f8f9fa; }
.o22-recent-post-img {
    width: 70px;
    min-width: 70px;
    height: 56px;
    object-fit: cover;
    border-radius: 5px;
    display: block;
}
.o22-recent-post-no-img {
    width: 70px;
    min-width: 70px;
    height: 56px;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #ccc;
    flex-shrink: 0;
}
.o22-recent-post-info { flex: 1; min-width: 0; }
.o22-recent-post-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}
.o22-recent-post-title a { color: inherit; }
.o22-recent-post-title a:hover { color: var(--red); }
.o22-recent-post-date { font-size: 11px; color: var(--muted); }

/* --- ودجت نص / HTML --- */
.widget_text .textwidget,
.widget_custom_html .textwidget {
    padding: 14px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
}
.widget_text img { border-radius: var(--radius); }

/* --- ودجت الصور --- */
.widget_media_image { padding: 12px; }
.widget_media_image img { border-radius: var(--radius); width: 100%; }

/* Fix: منع الودجت من تجاوز حدودها */
.o22-widget *,
.widget * { box-sizing: border-box; max-width: 100%; }

/* ================================================
   إصلاح الصور - مستطيلة واضحة بإطار أنيق
   ================================================ */

/* بطاقات الشبكة - صور 16:9 واضحة */
.o22-card-img {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    border-bottom: 1px solid #eee;
}

.o22-card-img img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    object-fit: contain !important;
    background: #f8f8f8 !important;
    display: block !important;
    transition: transform 0.3s ease !important;
}

.o22-card:hover .o22-card-img img {
    transform: scale(1.02) !important;
}

/* صور القائمة (news-item) - مستطيلة بدون اقتطاع */
.o22-ni-img img {
    width: 160px !important;
    height: 120px !important;
    object-fit: contain !important;
    background: #f5f5f5 !important;
}

/* Hero slider */
.o22-slider img {
    object-fit: cover !important;
}

/* صور المقال الفردي */
.o22-post-thumb img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    background: #f8f8f8 !important;
    border-radius: 8px !important;
    border: 1px solid #eee !important;
}

/* إطار أنيق للبطاقات */
.o22-card {
    border: 1px solid #e8e8e8 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06) !important;
    transition: box-shadow 0.2s, transform 0.2s !important;
    background: #fff !important;
}
.o22-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important;
    transform: translateY(-3px) !important;
    border-color: #c0392b !important;
}

/* صور المصغّرة في ودجت آخر المقالات */
.o22-recent-post-img {
    width: 72px !important;
    height: 56px !important;
    object-fit: contain !important;
    background: #f5f5f5 !important;
    border-radius: 5px !important;
    border: 1px solid #eee !important;
}
