/*
Theme Name: الجزائر برس (Aljazair Press)
Theme URI: https://aljazairpress.dz
Author: Aljazair Press Dev
Description: قالب ووردبريس إخباري عربي متكامل - يتضمن بنر إعلاني بجانب الشعار، شريط آخر الأخبار المميز، ميجا منيو (Mega Menu)، ومنشئ الصفحة الرئيسية المرئي والمتقدم (Module 21) بالسحب والإفلات مع تعدد التخطيطات والنسخ الاحتياطية والتحكم بالأجهزة.
Version: 1.9.0
Text Domain: aljazair-press
*/

:root {
    --primary-dark: #0b1e33;
    --primary-blue: #15406b;
    --accent-gold: #d9822b;
    --accent-red: #d93025;
    --accent-green: #2ecc71;
    --bg-light: #f4f6f9;
    --card-bg: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

body.dark-mode {
    --bg-light: #0b1320;
    --card-bg: #132033;
    --text-dark: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #243652;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', 'Tajawal', Tahoma, Arial, sans-serif;
    direction: rtl;
    text-align: right;
    background-color: var(--bg-light);
    color: var(--text-dark);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.25s ease;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 0. الشريط الأعلى للبحث والطقس والبث */
.utility-bar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
    font-size: 13px;
}

.utility-bar .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.search-box-mini {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 4px 14px;
    background: var(--bg-light);
}

.search-box-mini input {
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-dark);
    width: 180px;
}

.search-box-mini button {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
}

.weather-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.weather-city {
    border: 1px solid var(--border-color);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
}

.live-stream-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 700;
    color: var(--text-muted);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #cbd5e1;
}

/* 1. الشريط العلوي الداكن */
.top-bar {
    background-color: var(--primary-dark);
    color: #ffffff;
    font-size: 13px;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-bar-left a {
    color: #ffffff;
    font-size: 15px;
}

/* 2. منطقة الشعار + البنر الإعلاني بجانب الشعار */
.main-header {
    background-color: var(--card-bg);
    padding: 18px 0;
    border-bottom: 3px solid var(--accent-red);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
}

.site-logo {
    flex-shrink: 0;
}

.site-logo h1 {
    font-size: 30px;
    color: var(--primary-blue);
    font-weight: 800;
}

.site-logo img {
    max-height: 85px;
    width: auto;
    display: block;
}

body.dark-mode .site-logo h1 {
    color: #ffffff;
}

/* حاوية البنر الإعلاني بجانب الشعار (728x90 متجاوب) */
.header-banner-slot {
    flex: 1;
    max-width: 728px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

.header-banner-slot img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.header-banner-placeholder {
    width: 100%;
    min-height: 90px;
    background: linear-gradient(135deg, #0b1e33 0%, #15406b 100%);
    border: 1px dashed rgba(217, 130, 43, 0.7);
    border-radius: 8px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    gap: 15px;
}

.banner-ad-tag {
    background: var(--accent-gold);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 4px;
}

.header-banner-placeholder h4 {
    font-size: 16px;
    font-weight: 800;
}

.header-banner-placeholder p {
    font-size: 12px;
    color: #cbd5e1;
}

.banner-cta-btn {
    background: var(--accent-red);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

/* 3. القائمة الرئيسية + ميجا منيو المقالات بالصور (Mega Menu) */
.main-nav {
    background-color: var(--primary-dark);
    color: #ffffff;
    position: relative;
    z-index: 995;
    width: 100%;
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
}

.nav-menu > li {
    position: static; /* للسماح للميجا منيو بالامتداد بعرض الحاوية */
}

.nav-menu > li.has-classic-sub {
    position: relative;
}

.nav-menu > li > a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 15px 18px;
    font-weight: 700;
    font-size: 15px;
    color: #ffffff;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-menu > li.menu-item-has-children > a::after,
.nav-menu > li.has-mega-posts > a::after {
    content: '▾';
    font-size: 12px;
    opacity: 0.85;
}

.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-category-ancestor > a,
.nav-menu > li:hover > a {
    background-color: var(--primary-blue);
    border-bottom: 3px solid var(--accent-gold);
}

/* القائمة المنسدلة الكلاسيكية للروابط غير التصنيفية */
.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    background-color: var(--primary-dark);
    border-top: 3px solid var(--accent-gold);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.22s ease;
    z-index: 1000;
}

.nav-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .sub-menu li a {
    display: block;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-menu .sub-menu li a:hover {
    background-color: var(--primary-blue);
    color: var(--accent-gold);
    padding-right: 22px;
}

/* لوحة الميجا منيو (عرض مقالات التصنيف بالصور عند تمرير الماوس) */
.mega-menu-panel {
    position: absolute;
    top: 100%;
    right: 15px;
    left: 15px;
    background-color: var(--card-bg);
    color: var(--text-dark);
    border-top: 3px solid var(--accent-gold);
    border-bottom: 3px solid var(--primary-dark);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
    padding: 22px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.25s ease;
    z-index: 1001;
}

.nav-menu > li.has-mega-posts:hover > .mega-menu-panel,
.nav-menu > li.has-mega-posts:focus-within > .mega-menu-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-subcats-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.mega-subcats-strip span {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary-blue);
}

body.dark-mode .mega-subcats-strip span {
    color: var(--accent-gold);
}

.mega-subcat-pill {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.mega-subcat-pill:hover {
    background: var(--primary-blue);
    color: #ffffff;
    border-color: var(--primary-blue);
}

.mega-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.mega-post-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mega-post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

.mega-post-thumb {
    height: 145px;
    overflow: hidden;
    position: relative;
}

.mega-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.mega-post-card:hover .mega-post-thumb img {
    transform: scale(1.06);
}

.mega-post-body {
    padding: 12px;
}

.mega-post-body h4 {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mega-post-body h4 a:hover {
    color: var(--accent-red);
}

.mega-post-date {
    font-size: 11px;
    color: var(--text-muted);
}

.dark-mode-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* 4. تمييز شريط آخر الأخبار (Elevated Highlighted Breaking Bar) */
.breaking-bar-wrap {
    margin: 16px auto 6px;
}

.breaking-bar {
    background: linear-gradient(90deg, #0b1e33 0%, #153960 50%, #0b1e33 100%);
    color: #ffffff;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 4px 16px rgba(11, 30, 51, 0.18);
    border-right: 5px solid var(--accent-red);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.breaking-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    white-space: nowrap;
    flex-shrink: 0;
    background: linear-gradient(135deg, #e11d48 0%, #b91c1c 100%);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.45);
}

.live-radar {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ffffff;
    display: inline-block;
}

.live-radar::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    animation: radarPing 1.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes radarPing {
    0% { transform: scale(0.7); opacity: 1; }
    100% { transform: scale(1.9); opacity: 0; }
}

.breaking-ticker-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
}

.breaking-ticker-track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 40px;
    width: max-content;
    animation: tickerMoveRTL 40s linear infinite;
}

.breaking-ticker-track:hover {
    animation-play-state: paused;
}

.breaking-item {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #f8fafc;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.breaking-item:hover {
    color: var(--accent-gold);
}

.breaking-time-pill {
    background: rgba(255, 255, 255, 0.14);
    color: var(--accent-gold);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.breaking-sep {
    color: var(--accent-gold);
    font-weight: 800;
}

.breaking-date {
    font-size: 12px;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.08);
    padding: 5px 12px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

@keyframes tickerMoveRTL {
    0% { transform: translateX(0); }
    100% { transform: translateX(50%); }
}

/* 5. الكروسيل الإخباري التفاعلي */
.hero-carousel-section {
    margin: 20px 0;
    position: relative;
}

.carousel-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background-color: var(--primary-dark);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.carousel-slide {
    min-width: 100%;
    position: relative;
    height: 430px;
    overflow: hidden;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(11, 30, 51, 0.95) 10%, rgba(11, 30, 51, 0.45) 55%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 35px;
    color: #ffffff;
}

.carousel-overlay .cat-badge-gold {
    align-self: flex-start;
    margin-bottom: 12px;
}

.carousel-overlay h2 {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 10px;
    max-width: 850px;
}

.carousel-overlay h2 a:hover {
    color: var(--accent-gold);
}

.carousel-overlay p {
    font-size: 15px;
    color: #cbd5e1;
    max-width: 750px;
    margin-bottom: 12px;
}

.carousel-meta {
    font-size: 13px;
    color: #94a3b8;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(11, 30, 51, 0.75);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.carousel-btn:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
}

.carousel-prev { right: 18px; }
.carousel-next { left: 18px; }

.carousel-dots {
    position: absolute;
    bottom: 16px;
    left: 30px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

.carousel-dot.active {
    width: 26px;
    border-radius: 6px;
    background: var(--accent-gold);
}

/* 6. الترويسة المشتركة لأقسام التصنيفات */
.newsroom-section {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    margin: 26px 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.newsroom-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.newsroom-title-wrap .sub-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}

.newsroom-title-wrap h2 {
    font-size: 25px;
    font-weight: 800;
    color: var(--text-dark);
}

.view-all-link {
    color: var(--accent-red);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

.cat-badge-gold {
    display: inline-block;
    background-color: var(--accent-gold);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* الستايل 1: غرفة الأخبار */
.newsroom-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 28px;
    align-items: start;
}

.newsroom-main-card img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.newsroom-main-card h3 {
    font-size: 23px;
    line-height: 1.45;
    font-weight: 800;
    margin-bottom: 10px;
}

.newsroom-main-card h3 a:hover { color: var(--primary-blue); }

.newsroom-main-card p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
}

.newsroom-main-meta {
    font-size: 13px;
    color: #94a3b8;
}

.newsroom-side-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.newsroom-side-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.newsroom-side-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.newsroom-side-thumb {
    width: 140px;
    height: 95px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
}

.newsroom-side-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.newsroom-side-info { flex: 1; }

.side-time {
    display: block;
    color: var(--accent-red);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.newsroom-side-info h4 {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 5px;
}

.side-date {
    display: block;
    font-size: 12px;
    color: #94a3b8;
}

/* الستايل 2: شبكة بطاقات رباعية */
.cat-style-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.style-card-box {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
}

.style-card-box img {
    width: 100%;
    height: 175px;
    object-fit: cover;
}

.style-card-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.style-card-body h3 {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 10px;
}

/* الستايل 3: مجلة أفقية */
.cat-style-magazine {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.mag-card {
    display: flex;
    gap: 16px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    align-items: center;
}

.mag-card img {
    width: 180px;
    height: 125px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.mag-card-content h3 {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 8px;
}

.mag-card-content p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 8px;
}

/* 7. قسم الفيديو المميز */
.video-showcase-section {
    background: linear-gradient(135deg, #091728 0%, #132c4a 100%);
    color: #ffffff;
    border-radius: 12px;
    padding: 30px 25px;
    margin: 30px 0;
    box-shadow: 0 10px 30px rgba(9, 23, 40, 0.25);
    border-top: 4px solid var(--accent-red);
}

.video-showcase-section .newsroom-header {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.video-showcase-section .newsroom-title-wrap h2 {
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-badge-live {
    background: var(--accent-red);
    color: #ffffff;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
}

.video-showcase-section .sub-label,
.video-showcase-section .view-all-link {
    color: var(--accent-gold);
}

.video-grid-layout {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 25px;
}

.video-featured-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

.video-featured-card img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    opacity: 0.85;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.video-featured-card:hover img {
    transform: scale(1.03);
    opacity: 0.7;
}

.play-icon-large {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 68px;
    background: var(--accent-red);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 0 0 10px rgba(217, 48, 37, 0.3);
    transition: 0.3s;
}

.video-featured-caption {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    padding: 25px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
}

.video-featured-caption h3 {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.45;
    margin-bottom: 8px;
}

.video-side-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.video-side-card {
    display: flex;
    gap: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    align-items: center;
    transition: 0.25s;
}

.video-side-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-gold);
}

.video-thumb-wrap {
    position: relative;
    width: 150px;
    height: 92px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.video-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-icon-small {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 34px;
    height: 34px;
    background: rgba(217, 48, 37, 0.9);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.video-side-info h4 {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 6px;
    color: #f8fafc;
}

/* شريط التصنيفات الفرعية داخل صفحات الأقسام */
.subcategories-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.subcat-chip {
    background-color: var(--primary-blue);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}

.subcat-chip:hover {
    background-color: var(--accent-gold);
}

/* شبكة المقالات لصفحات الأرشيف */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.post-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    padding: 15px;
}

.post-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 12px;
}

.post-card h3 {
    font-size: 17px;
    margin-bottom: 8px;
}

.single-article,
.archive-header {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    margin: 25px 0;
}

.site-footer {
    background: var(--primary-dark);
    color: #ffffff;
    text-align: center;
    padding: 25px 0;
    margin-top: 40px;
}

@media (max-width: 992px) {
    .newsroom-grid,
    .video-grid-layout,
    .cat-style-magazine {
        grid-template-columns: 1fr;
    }
    .cat-style-cards-grid,
    .mega-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .carousel-slide {
        height: 340px;
    }
}

@media (max-width: 768px) {
    .breaking-date,
    .mega-menu-panel {
        display: none !important;
    }
    .cat-style-cards-grid {
        grid-template-columns: 1fr;
    }
    .carousel-overlay h2 {
        font-size: 20px;
    }
}

/* ============================================================
   Module 21 – منشئ الصفحة الرئيسية: أنماط العناصر الجديدة بالواجهة الأمامية
   (تعتمد متغيرات القالب --card-bg/--border-color/--text-dark لتحترم الوضع الليلي)
   ============================================================ */

.hpb-section { position: relative; }

.hpb-plain-section { margin: 0 0 8px; }

/* إخفاء الأقسام حسب الجهاز (يولّد المنشئ قواعد ألوان/أعمدة لكل قسم) */
@media (min-width: 769px) {
    .hpb-hide-desktop { display: none !important; }
}
@media (max-width: 992px) {
    .hpb-hide-tablet { display: none !important; }
}
@media (max-width: 768px) {
    .hpb-hide-mobile { display: none !important; }
}

/* شريط تنبيه معاينة المدير */
.hpb-preview-notice {
    background: var(--accent-gold);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin: 12px 0;
}
.hpb-preview-notice a { color: #fff; text-decoration: underline; }

/* ---- قائمة مدمجة ---- */
.hpb-compact-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.hpb-compact-item {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
}

.hpb-compact-thumb { flex: 0 0 86px; }
.hpb-compact-thumb img { width: 86px; height: 62px; object-fit: cover; border-radius: 6px; }
.hpb-compact-info h4 { font-size: 14.5px; line-height: 1.55; margin-bottom: 4px; }
.hpb-compact-info h4 a { color: var(--text-dark); }
.hpb-compact-info h4 a:hover { color: var(--primary-blue); }
.hpb-compact-date { font-size: 11.5px; color: var(--text-muted); }

/* ---- بطاقات صورة غلاف ---- */
.hpb-overlay-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.hpb-overlay-card {
    position: relative;
    height: 260px;
    border-radius: 9px;
    overflow: hidden;
    background: var(--primary-dark);
}

.hpb-overlay-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.hpb-overlay-card:hover img { transform: scale(1.05); }

.hpb-overlay-caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 40px 14px 12px;
    background: linear-gradient(180deg, rgba(11,30,51,0) 0%, rgba(11,30,51,.88) 70%);
}

.hpb-overlay-caption h3 { font-size: 15.5px; line-height: 1.55; margin: 6px 0; }
.hpb-overlay-caption h3 a { color: #ffffff; }
.hpb-overlay-caption p {
    color: #dbe6f2;
    font-size: 12.5px;
    line-height: 1.6;
    margin-bottom: 4px;
}
.hpb-overlay-date { color: #c3d2e2; font-size: 11px; }
.hpb-overlay-caption .cat-badge-gold { font-size: 10px; }

/* ---- عناوين فقط ---- */
.hpb-headlines {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 16px;
}

.hpb-headline-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 2px;
    border-bottom: 1px dashed var(--border-color);
}

.hpb-headline-item:last-child { border-bottom: 0; }
.hpb-headline-num {
    flex: 0 0 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent-gold);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hpb-headline-item a { flex: 1; color: var(--text-dark); font-size: 15px; font-weight: 700; line-height: 1.6; }
.hpb-headline-item a:hover { color: var(--primary-blue); }
.hpb-headline-date { color: var(--text-muted); font-size: 11.5px; white-space: nowrap; }

/* ---- الأكثر قراءة ---- */
.hpb-mostread-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.hpb-mostread-item {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
}

.hpb-mostread-num {
    flex: 0 0 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-gold);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hpb-mostread-thumb { flex: 0 0 76px; }
.hpb-mostread-thumb img { width: 76px; height: 56px; object-fit: cover; border-radius: 6px; }
.hpb-mostread-info h4 { font-size: 14px; line-height: 1.55; margin-bottom: 4px; }
.hpb-mostread-info h4 a { color: var(--text-dark); }
.hpb-mostread-info h4 a:hover { color: var(--primary-blue); }
.hpb-mostread-meta { font-size: 11px; color: var(--text-muted); }

/* ---- الخبر الرئيسي بعرض كامل ---- */
.hpb-hero-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: var(--primary-dark);
}

.hpb-hero-card img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}

.hpb-hero-caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 60px 22px 18px;
    background: linear-gradient(180deg, rgba(11,30,51,0) 0%, rgba(11,30,51,.92) 72%);
}

.hpb-hero-caption h2 { font-size: 24px; line-height: 1.5; margin: 8px 0; }
.hpb-hero-caption h2 a { color: #ffffff; }
.hpb-hero-caption h2 a:hover { color: #f6c47f; }
.hpb-hero-caption p { color: #d9e4f0; font-size: 14px; line-height: 1.7; margin-bottom: 6px; max-width: 760px; }
.hpb-hero-meta { color: #c3d2e2; font-size: 12px; }

/* ---- الخبر الرئيسي مقسوم ---- */
.hpb-hero-split {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.hpb-hero-split > a img, .hpb-hero-split-img img {
    width: 100%;
    height: 340px;
    object-fit: cover;
    display: block;
}

.hpb-hero-split-body { padding: 22px 24px; align-self: center; }
.hpb-hero-split-body h2 { font-size: 21px; line-height: 1.55; margin: 10px 0; }
.hpb-hero-split-body h2 a { color: var(--text-dark); }
.hpb-hero-split-body h2 a:hover { color: var(--primary-blue); }
.hpb-hero-split-body p { color: var(--text-muted); font-size: 14px; line-height: 1.8; margin-bottom: 8px; }
.hpb-hero-split-body .hpb-hero-meta { color: var(--text-muted); font-size: 12px; }

/* ---- شريط آخر الأخبار المتحرك ---- */
.hpb-ticker-section { margin-bottom: 8px; }

.hpb-ticker {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 9px;
    padding: 9px 14px;
    overflow: hidden;
}

.hpb-ticker-label {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-red);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    padding: 6px 13px;
    border-radius: 7px;
    white-space: nowrap;
}

.hpb-ticker-viewport { flex: 1; overflow: hidden; }

.hpb-ticker-track {
    display: flex;
    gap: 34px;
    white-space: nowrap;
    animation: hpbTickerRTL 45s linear infinite;
    width: max-content;
}

.hpb-ticker:hover .hpb-ticker-track { animation-play-state: paused; }

@keyframes hpbTickerRTL {
    from { transform: translateX(0); }
    to { transform: translateX(50%); }
}

.hpb-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dark);
    font-size: 13.5px;
    font-weight: 700;
}

.hpb-ticker-item:hover { color: var(--primary-blue); }

.hpb-ticker-all { color: var(--primary-blue); font-size: 12.5px; font-weight: 700; white-space: nowrap; }

/* ---- بنر إعلاني ---- */
.hpb-ads-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 9px;
    overflow: hidden;
}

.hpb-ads-box img { max-width: 100%; height: auto; display: block; }

.hpb-ads-placeholder {
    flex-direction: column;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 16px;
}

/* ---- النشرة البريدية ---- */
.hpb-newsletter {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
    border-radius: 10px;
    padding: 30px 24px;
    text-align: center;
    color: #ffffff;
}

.hpb-newsletter-icon { font-size: 34px; display: block; margin-bottom: 8px; }
.hpb-newsletter-text { font-size: 15px; margin-bottom: 16px; color: #e3edf8; }

.hpb-newsletter-form {
    display: flex;
    gap: 8px;
    max-width: 480px;
    margin: 0 auto;
}

.hpb-newsletter-form input[type="email"] {
    flex: 1;
    border: 0;
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
}

.hpb-newsletter-form button {
    background: var(--accent-gold);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
}

.hpb-newsletter-form button:hover { background: #bf6f1f; }
.hpb-newsletter-success { background: rgba(46,204,113,.18); color: #b9f4d0; padding: 9px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13.5px; }

/* ---- صندوق مخصص ---- */
.hpb-custom-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 18px;
    font-size: 14.5px;
    line-height: 1.9;
}

/* ---- استجابة الأجهزة لعناصر المنشئ ---- */
@media (max-width: 992px) {
    .hpb-compact-list, .hpb-mostread-grid { grid-template-columns: 1fr; }
    .hpb-overlay-grid { grid-template-columns: repeat(2, 1fr); }
    .hpb-hero-card img { height: 300px; }
    .hpb-hero-caption h2 { font-size: 20px; }
    .hpb-hero-split { grid-template-columns: 1fr; }
    .hpb-hero-split img { height: 240px; }
}

@media (max-width: 768px) {
    .hpb-overlay-grid { grid-template-columns: 1fr; }
    .hpb-overlay-card { height: 220px; }
    .hpb-ticker-label { font-size: 11px; padding: 5px 9px; }
    .hpb-newsletter-form { flex-direction: column; }
    .hpb-hero-caption h2 { font-size: 17px; }
    .hpb-hero-card img { height: 240px; }
}

/* ============================================================
   Module 21 — التحكم الكامل في الصفحة: الفوتر المطور، زر العودة
   للأعلى، إخفاء المناطق على الهاتف، وحالة البث المباشر
   ============================================================ */

/* إخفاء مناطق الهيدر/الفوتر على الهاتف (من إعدادات الصفحة الكاملة) */
@media (max-width: 768px) {
    .hpb-zone-m-hide { display: none !important; }
}

/* ودجات الفوتر (تُفعّل من إعدادات الصفحة الكاملة في المنشئ) */
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.footer-widgets.cols-1 { grid-template-columns: 1fr; }
.footer-widgets.cols-2 { grid-template-columns: repeat(2, 1fr); }
.footer-widgets.cols-4 { grid-template-columns: repeat(4, 1fr); }

.footer-widget-inner { font-size: 13.5px; line-height: 1.8; color: #c9d6e5; }
.footer-widget-inner a { color: #f6c47f; text-decoration: none; }
.footer-widget-inner a:hover { color: #ffd89a; }
.footer-widget-title {
    color: #ffffff;
    font-size: 15.5px;
    font-weight: 800;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--accent-gold);
    display: inline-block;
}

@media (max-width: 768px) {
    .footer-widgets { grid-template-columns: 1fr !important; }
}

/* زر العودة إلى الأعلى (من إعدادات الفوتر) */
.hpb-backtotop {
    position: fixed;
    bottom: 22px;
    left: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: var(--primary-blue);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(11, 30, 51, .35);
    z-index: 999;
    transition: background .2s, transform .2s;
}

.hpb-backtotop:hover { background: var(--accent-gold); transform: translateY(-2px); }

/* حالة البث المباشر (إعدادات الشريط العلوي) */
.live-stream-btn.is-live {
    background: var(--accent-red);
}

.live-stream-btn.is-live .live-dot {
    background: #ffffff;
    animation: livePulse 1.1s infinite;
}

@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .6); }
    50% { box-shadow: 0 0 0 5px rgba(255, 255, 255, 0); }
}

/* ============================================================
   Module 21 v1.7 — أشكال السلايدر الجديدة + أشكال التصنيفات الجديدة
   + ضبط التصميمات القديمة (نص دائم الظهور مع الصور)
   ============================================================ */

/* ---------- صور الشرائح المشتركة ---------- */
.hpb-slide-img-wrap {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hpb-slide-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s;
}

.carousel-slide:hover .hpb-slide-img-wrap img { transform: scale(1.03); }

.hpb-slide-img-fallback {
    width: 100%;
    height: 100%;
    min-height: 200px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
}

.hpb-slide-panel {
    background: var(--card-bg);
    padding: 26px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    text-align: right;
}

.hpb-slide-panel .cat-badge-gold { align-self: flex-start; margin-bottom: 6px; }

.hpb-slide-panel h2 { font-size: 21px; line-height: 1.5; font-weight: 800; margin-bottom: 8px; }
.hpb-slide-panel h2 a { color: var(--text-dark); }
.hpb-slide-panel h2 a:hover { color: var(--primary-blue); }

.hpb-slide-panel p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 10px;
}

.hpb-slide-panel .carousel-meta { font-size: 12.5px; color: #94a3b8; }

.hpb-slide-more {
    align-self: flex-start;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-blue);
    text-decoration: none;
    border-bottom: 2px solid var(--accent-gold);
    padding-bottom: 2px;
}

.hpb-slide-more:hover { color: var(--accent-gold); }

/* ---------- 1) سلايدر مقسوم: صورة يمين + لوح نص يسار ---------- */
.hpb-slide-split {
    display: flex !important;
    align-items: stretch;
}

.hpb-slide-split .hpb-slide-img-wrap { flex: 0 0 55%; }

/* ---------- 2) سلايدر بطاقات نصية: صورة أعلى + لوح نص أسفل ---------- */
.hpb-slide-cover {
    display: flex !important;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: 0 4px 18px rgba(11, 30, 51, .10);
}

.hpb-slide-cover .hpb-slide-img-wrap { flex: 1 1 auto; min-height: 0; }
.hpb-slide-cover .hpb-slide-panel { flex: 0 0 auto; }

/* ---------- 3) سلايدر التلاشي السينمائي ---------- */
.hpb-slider-fade .carousel-track {
    display: grid !important;
    transform: none !important;
}

.hpb-slider-fade .carousel-slide {
    grid-area: 1 / 1;
    opacity: 0;
    transition: opacity .8s ease;
    pointer-events: none;
}

.hpb-slider-fade .carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.hpb-slider-fade .carousel-overlay {
    background: linear-gradient(180deg, rgba(11,30,51,0) 30%, rgba(11,30,51,.85) 100%);
    padding: 34px;
}

/* ---------- 4) سلايدر المصغّرات التفاعلية ---------- */
.hpb-slider-thumbs-strip {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.hpb-slider-thumb {
    flex: 0 0 150px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    text-align: right;
    transition: border-color .25s, box-shadow .25s;
    font-family: inherit;
}

.hpb-slider-thumb img {
    width: 100%;
    height: 66px;
    object-fit: cover;
    border-radius: 5px;
    display: block;
    margin-bottom: 6px;
}

.hpb-slider-thumb span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text-dark);
    font-weight: 700;
}

.hpb-slider-thumb.active {
    border-color: var(--accent-gold);
    box-shadow: 0 3px 10px rgba(246, 196, 127, .35);
}

/* ---------- 5) شبكة موزاييك ---------- */
.hpb-mosaic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 150px;
    gap: 12px;
}

.hpb-mosaic-item {
    position: relative;
    border-radius: 9px;
    overflow: hidden;
    background: var(--primary-dark);
}

.hpb-mosaic-item:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

.hpb-mosaic-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s;
}

.hpb-mosaic-item:hover img { transform: scale(1.04); }

.hpb-mosaic-img-link { display: block; width: 100%; height: 100%; }

.hpb-mosaic-fallback {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
}

.hpb-mosaic-caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 42px 14px 10px;
    background: linear-gradient(180deg, rgba(11,30,51,0) 0%, rgba(11,30,51,.9) 75%);
}

.hpb-mosaic-caption h3 { font-size: 14.5px; line-height: 1.5; margin: 5px 0; }
.hpb-mosaic-caption h3 a { color: #ffffff; }
.hpb-mosaic-featured .hpb-mosaic-caption h3 { font-size: 19px; }
.hpb-mosaic-caption p { color: #dbe6f2; font-size: 12.5px; line-height: 1.6; margin-bottom: 4px; }
.hpb-mosaic-date { color: #c3d2e2; font-size: 11px; }
.hpb-mosaic-caption .cat-badge-gold { font-size: 10px; }

/* ---------- 6) قائمة غنية بالتفاصيل ---------- */
.hpb-rich-list { display: flex; flex-direction: column; }

.hpb-rich-item {
    display: flex;
    gap: 18px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-color);
    align-items: flex-start;
}

.hpb-rich-item:first-child { padding-top: 0; }
.hpb-rich-item:last-child { border-bottom: 0; padding-bottom: 0; }

.hpb-rich-thumb { flex: 0 0 220px; }

.hpb-rich-thumb img {
    width: 220px;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
}

.hpb-rich-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; }

.hpb-rich-body .cat-badge-gold { margin-bottom: 8px; }

.hpb-rich-body h3 { font-size: 17px; line-height: 1.55; font-weight: 800; margin-bottom: 7px; }
.hpb-rich-body h3 a { color: var(--text-dark); }
.hpb-rich-body h3 a:hover { color: var(--primary-blue); }

.hpb-rich-body p { font-size: 13.5px; color: var(--text-muted); line-height: 1.7; margin-bottom: 8px; }

.hpb-rich-meta { font-size: 12px; color: #94a3b8; }

/* ---------- 7) الخط الزمني للأخبار ---------- */
.hpb-timeline { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 34px; }

.hpb-tl-item {
    position: relative;
    display: flex;
    gap: 13px;
    padding: 0 20px 20px 0;
    border-right: 2px solid var(--border-color);
}

.hpb-tl-item::before {
    content: '';
    position: absolute;
    right: -8px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-gold);
    border: 3px solid var(--card-bg);
    box-shadow: 0 0 0 2px var(--accent-gold);
}

.hpb-tl-marker { flex: 0 0 auto; }

.hpb-tl-time {
    display: inline-block;
    background: var(--primary-dark);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
}

.hpb-tl-thumb { flex: 0 0 96px; }

.hpb-tl-thumb img {
    width: 96px;
    height: 92px;
    object-fit: cover;
    border-radius: 7px;
}

.hpb-tl-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; }
.hpb-tl-body .cat-badge-gold { margin-bottom: 6px; font-size: 10px; }
.hpb-tl-body h4 { font-size: 14.5px; line-height: 1.55; margin-bottom: 5px; }
.hpb-tl-body h4 a { color: var(--text-dark); }
.hpb-tl-body h4 a:hover { color: var(--primary-blue); }
.hpb-tl-body p { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin-bottom: 5px; }
.hpb-tl-date { font-size: 11px; color: #94a3b8; }

/* ---------- 8) المجلة العمودية (مميز + قائمة) ---------- */
.hpb-stack-grid {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 24px;
    align-items: start;
}

.hpb-stack-feat > a { display: block; }

.hpb-stack-feat img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 9px;
    margin-bottom: 14px;
}

.hpb-stack-feat-body { display: flex; flex-direction: column; align-items: flex-start; }
.hpb-stack-feat-body .cat-badge-gold { margin-bottom: 8px; }
.hpb-stack-feat-body h3 { font-size: 20px; line-height: 1.5; font-weight: 800; margin-bottom: 8px; }
.hpb-stack-feat-body h3 a { color: var(--text-dark); }
.hpb-stack-feat-body h3 a:hover { color: var(--primary-blue); }
.hpb-stack-feat-body p { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-bottom: 9px; }
.hpb-stack-date { font-size: 12.5px; color: #94a3b8; }

.hpb-stack-list { display: flex; flex-direction: column; gap: 15px; }

.hpb-stack-item {
    display: flex;
    gap: 13px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    align-items: flex-start;
}

.hpb-stack-item:last-child { border-bottom: 0; padding-bottom: 0; }

.hpb-stack-thumb { flex: 0 0 110px; }

.hpb-stack-thumb img {
    width: 110px;
    height: 78px;
    object-fit: cover;
    border-radius: 7px;
}

.hpb-stack-item-body h4 { font-size: 14.5px; line-height: 1.55; margin-bottom: 5px; }
.hpb-stack-item-body h4 a { color: var(--text-dark); }
.hpb-stack-item-body h4 a:hover { color: var(--primary-blue); }

/* ---------- ضبط التصميمات القديمة ---------- */
.hpb-overlay-img-link { display: block; width: 100%; height: 100%; }
.hpb-overlay-img-link img { width: 100%; height: 100%; object-fit: cover; }
.hpb-overlay-fallback {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
}

.style-card-body .cat-badge-gold { align-self: flex-start; margin-bottom: 9px; }

.hpb-card-excerpt {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 9px;
}

.mag-card-content .cat-badge-gold { display: inline-block; margin-bottom: 9px; }

/* ---------- استجابة الأجهزة للتصميمات الجديدة ---------- */
@media (max-width: 992px) {
    .hpb-mosaic-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 140px; }
    .hpb-timeline { grid-template-columns: 1fr; }
    .hpb-stack-grid { grid-template-columns: 1fr; }
    .hpb-slide-split .hpb-slide-img-wrap { flex: 0 0 45%; }
    .hpb-slide-panel h2 { font-size: 18px; }
}

@media (max-width: 768px) {
    .hpb-mosaic-grid { grid-template-columns: 1fr; grid-auto-rows: 170px; }
    .hpb-mosaic-item:first-child { grid-column: span 1; grid-row: span 1; }
    .hpb-mosaic-featured .hpb-mosaic-caption h3 { font-size: 15px; }
    .hpb-rich-item { flex-direction: column; gap: 12px; }
    .hpb-rich-thumb, .hpb-rich-thumb img { width: 100%; flex: none; }
    .hpb-rich-thumb img { height: 170px; }
    .hpb-tl-thumb { display: none; }
    .hpb-slide-split { flex-direction: column; }
    .hpb-slide-split .hpb-slide-img-wrap { min-height: 180px; }
    .hpb-slide-panel { padding: 18px; }
    .hpb-slide-panel h2 { font-size: 16px; }
    .hpb-slider-thumbs-strip { display: none; }
    .hpb-stack-feat img { height: 210px; }
}

/* ============================================================
   Module 21 v1.8 — تحصين التخطيط (ضد التشوه) + 6 تصميمات جديدة
   ============================================================ */

/* ---------- تحصين عام: لا انكماش للصور ولا فيض للنصوص ---------- */
.newsroom-side-info,
.hpb-compact-info,
.hpb-mostread-info,
.hpb-tl-body,
.hpb-stack-item-body,
.hpb-rich-body,
.mag-card-content,
.style-card-body,
.hpb-alt-body,
.hpb-photo-caption,
.hpb-minimal-item {
    min-width: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.mag-card > a { flex: 0 0 180px; }
.hpb-tl-item { overflow: hidden; }

.style-card-box h3 a,
.hpb-stack-item-body h4 a,
.hpb-tl-body h4 a {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- 6) سلايدر سينمائي بعدّاد شرائح ---------- */
.hpb-slide-cinema {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

.hpb-cinema-counter {
    position: absolute;
    top: 14px;
    inset-inline-start: 14px;
    z-index: 3;
    background: rgba(11, 30, 51, .72);
    color: var(--accent-gold, #f6c47f);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(246, 196, 127, .45);
}

.hpb-cinema-bar {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(11,30,51,0) 0%, rgba(11,30,51,.92) 60%);
    padding: 46px 30px 20px;
}

.hpb-cinema-bar h2 { font-size: 22px; line-height: 1.5; margin: 6px 0; }
.hpb-cinema-bar h2 a { color: #fff; }
.hpb-cinema-bar p { color: #dbe6f2; font-size: 13.5px; line-height: 1.65; margin-bottom: 6px; max-width: 75%; }
.hpb-cinema-bar .carousel-meta { color: #c3d2e2; font-size: 12px; }
.hpb-cinema-bar .cat-badge-gold { font-size: 11px; }

.hpb-slider-cinema .carousel-dot {
    width: 26px;
    height: 4px;
    border-radius: 3px;
}

/* ---------- 7) سلايدر بطاقتين معاً ---------- */
.hpb-slide-two-up { background: transparent; }

.hpb-slide-pair {
    display: flex;
    gap: 14px;
    width: 100%;
    height: 100%;
    align-items: stretch;
}

.hpb-pair-card {
    flex: 1 1 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: 0 4px 16px rgba(11, 30, 51, .10);
}

.hpb-pair-card .hpb-slide-img-wrap { flex: 1 1 auto; min-height: 0; }

.hpb-pair-panel {
    flex: 0 0 auto;
    background: var(--card-bg);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hpb-pair-panel .cat-badge-gold { margin-bottom: 6px; font-size: 10px; }

.hpb-pair-panel h3 { font-size: 15.5px; line-height: 1.5; margin-bottom: 5px; }
.hpb-pair-panel h3 a { color: var(--text-dark); }
.hpb-pair-panel h3 a:hover { color: var(--primary-blue); }

.hpb-pair-panel p {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hpb-pair-panel .carousel-meta { font-size: 11.5px; color: #94a3b8; }

/* ---------- 8) سلايدر مكدّس ثلاثي الأبعاد ---------- */
.hpb-slider-stack .carousel-track {
    display: grid !important;
    transform: none !important;
}

.hpb-slider-stack .carousel-slide {
    grid-area: 1 / 1;
    opacity: 0;
    transform: scale(.9) translateY(18px);
    transition: opacity .7s ease, transform .7s ease;
    pointer-events: none;
    z-index: 1;
}

.hpb-slider-stack .carousel-slide.behind {
    opacity: .45;
    transform: scale(.955) translateY(12px);
    pointer-events: none;
    z-index: 2;
}

.hpb-slider-stack .carousel-slide.active {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    z-index: 3;
}

.hpb-slide-stack {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.hpb-stack-slide-info {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(11,30,51,0) 0%, rgba(11,30,51,.9) 65%);
    padding: 44px 28px 18px;
}

.hpb-stack-slide-info h2 { font-size: 20px; line-height: 1.5; margin: 5px 0; }
.hpb-stack-slide-info h2 a { color: #fff; }
.hpb-stack-slide-info p { color: #dbe6f2; font-size: 13px; line-height: 1.65; margin-bottom: 5px; max-width: 70%; }
.hpb-stack-slide-info .carousel-meta { color: #c3d2e2; font-size: 12px; }

/* ---------- 9) صفوف متناوبة بالصورة ---------- */
.hpb-alt-list { display: flex; flex-direction: column; gap: 20px; }

.hpb-alt-item {
    display: flex;
    gap: 20px;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
}

.hpb-alt-item.hpb-alt-reverse { flex-direction: row-reverse; }

.hpb-alt-thumb { flex: 0 0 240px; }

.hpb-alt-thumb img {
    width: 240px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.hpb-alt-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; }
.hpb-alt-body .cat-badge-gold { margin-bottom: 8px; }

.hpb-alt-body h3 { font-size: 17px; line-height: 1.55; font-weight: 800; margin-bottom: 7px; }
.hpb-alt-body h3 a { color: var(--text-dark); }
.hpb-alt-body h3 a:hover { color: var(--primary-blue); }

.hpb-alt-body p { font-size: 13.5px; color: var(--text-muted); line-height: 1.7; margin-bottom: 8px; }
.hpb-alt-meta { font-size: 12px; color: #94a3b8; margin-bottom: 8px; }

.hpb-alt-more {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-blue);
    text-decoration: none;
    border-bottom: 2px solid var(--accent-gold);
    padding-bottom: 2px;
}

.hpb-alt-more:hover { color: var(--accent-gold); }

/* ---------- 10) جدار صور بنص ظاهر ---------- */
.hpb-photo-wall {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.hpb-photo-card {
    border-radius: 10px;
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.hpb-photo-img-link { display: block; width: 100%; }

.hpb-photo-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
    transition: transform .35s;
}

.hpb-photo-card:hover img { transform: scale(1.04); }

.hpb-photo-fallback {
    width: 100%;
    height: 190px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
}

.hpb-photo-caption {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hpb-photo-caption .cat-badge-gold { margin-bottom: 7px; font-size: 10px; }

.hpb-photo-caption h3 { font-size: 14.5px; line-height: 1.5; margin-bottom: 5px; }
.hpb-photo-caption h3 a { color: var(--text-dark); }
.hpb-photo-caption h3 a:hover { color: var(--primary-blue); }

.hpb-photo-caption p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hpb-photo-date { font-size: 11px; color: #94a3b8; }

/* ---------- 11) شبكة نصية أنيقة بدون صور ---------- */
.hpb-minimal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.hpb-minimal-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-inline-start: 4px solid var(--accent-gold);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: box-shadow .2s, transform .2s;
}

.hpb-minimal-item:hover {
    box-shadow: 0 6px 18px rgba(11, 30, 51, .10);
    transform: translateY(-2px);
}

.hpb-minimal-item .cat-badge-gold { margin-bottom: 8px; font-size: 10px; }

.hpb-minimal-item h3 { font-size: 15.5px; line-height: 1.55; margin-bottom: 6px; }
.hpb-minimal-item h3 a { color: var(--text-dark); }
.hpb-minimal-item h3 a:hover { color: var(--primary-blue); }

.hpb-minimal-item p {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hpb-minimal-date { font-size: 11px; color: #94a3b8; margin-top: auto; }

/* ---------- استجابة الأجهزة لتصميمات v1.8 ---------- */
@media (max-width: 992px) {
    .hpb-photo-wall { grid-template-columns: repeat(2, 1fr); }
    .hpb-alt-thumb { flex: 0 0 200px; }
    .hpb-alt-thumb img { width: 200px; height: 130px; }
}

@media (max-width: 768px) {
    .hpb-photo-wall { grid-template-columns: 1fr; }
    .hpb-photo-card img, .hpb-photo-fallback { height: 200px; }
    .hpb-alt-item, .hpb-alt-item.hpb-alt-reverse { flex-direction: column; align-items: flex-start; }
    .hpb-alt-thumb, .hpb-alt-thumb img { width: 100%; flex: none; }
    .hpb-alt-thumb img { height: 180px; }
    .hpb-minimal-grid { grid-template-columns: 1fr; }
    .hpb-slide-pair { flex-direction: column; }
    .hpb-pair-card .hpb-slide-img-wrap { min-height: 150px; }
    .hpb-cinema-bar p, .hpb-stack-slide-info p { max-width: 100%; }
    .hpb-cinema-bar { padding: 34px 16px 14px; }
    .hpb-cinema-bar h2 { font-size: 17px; }
    .hpb-cinema-counter { top: 10px; inset-inline-start: 10px; font-size: 11px; }
    .hpb-stack-slide-info { padding: 34px 16px 14px; }
    .hpb-stack-slide-info h2 { font-size: 16px; }
}

/* ============================================================
   v1.8.1 — حماية من صور الرموز المحقونة (Twemoji/Jetpack):
   إضافات الموقع قد تستبدل رمز التاريخ 📅 بصورة <img class="emoji">
   بلا قياس حجم فتُسحق عمودياً إلى كبسولة عملاقة بجوار التاريخ.
   القالب لم يعد يطبع أي رمز، وهذه القاعدة تقيّد أي صورة محقونة.
   ============================================================ */
.emoji,
.wp-smiley,
.side-date img,
.hpb-el-date img,
.carousel-meta img,
.mega-post-date img {
    height: 1em !important;
    width: auto !important;
    max-width: 1em !important;
    vertical-align: -0.15em;
}

/* ============================================================
   v1.8.2 — الفوتر الاحترافي:
   شريط علوي بأربعة أعمدة (عن الموقع + التواصل، الأقسام، الصفحات،
   أحدث الأخبار) + شريط سفلي للحقوق + منطقة ودجات اختيارية.
   الخلفية على .site-footer حتى تحترم إعداد لون الفوتر من المنشئ.
   ============================================================ */
.site-footer {
    background: linear-gradient(180deg, #0c1a2e 0%, #091423 100%);
    color: #cfd8e3;
    text-align: start;
    padding: 0;
    margin-top: 40px;
    border-top: 4px solid var(--accent-red);
}

.footer-widgets-band {
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 30px 0;
}

.footer-main {
    padding: 44px 0 36px;
}

.footer-cols {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
    gap: 34px;
}

.footer-cols.footer-cols-3 { grid-template-columns: 1.5fr 1fr 1.3fr; }
.footer-cols.footer-cols-2 { grid-template-columns: 1.5fr 1fr; }
.footer-cols.footer-cols-1 { grid-template-columns: 1fr; }

.footer-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 15px;
}

.footer-brand-mark {
    background: linear-gradient(135deg, var(--accent-red), #8f1015);
    color: #ffffff;
    font-weight: 800;
    font-size: 21px;
    width: 47px;
    height: 47px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -1px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.footer-logo {
    font-size: 21px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
}

.footer-tagline {
    font-size: 12px;
    color: #8fa3bd;
    display: block;
    margin-top: 3px;
}

.footer-desc {
    font-size: 13.5px;
    color: #aeb9c9;
    line-height: 1.95;
    margin: 0 0 18px;
}

.footer-social {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.footer-social-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #cfd8e3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.footer-social-btn:hover {
    background: var(--accent-red);
    color: #ffffff;
    transform: translateY(-3px);
}

.footer-social-btn svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.footer-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 18px;
    padding-bottom: 10px;
    position: relative;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    width: 44px;
    height: 3px;
    background: var(--accent-red);
    border-radius: 2px;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #aeb9c9;
    font-size: 13.5px;
    text-decoration: none;
    transition: color 0.2s ease, padding 0.2s ease;
    display: inline-block;
}

.footer-links a::before {
    content: '‹';
    margin-inline-end: 7px;
    color: var(--accent-red);
    font-weight: 700;
}

.footer-links a:hover {
    color: #ffffff;
    padding-inline-start: 4px;
}

.footer-news {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-news li {
    margin-bottom: 13px;
    padding-bottom: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-news li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.footer-news a {
    color: #cfd8e3;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.65;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
}

.footer-news a:hover {
    color: #ffffff;
}

.footer-news-date {
    font-size: 11.5px;
    color: #7186a0;
    display: block;
    margin-top: 3px;
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.32);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 16px 0;
}

.footer-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-copy {
    margin: 0;
    font-size: 13px;
    color: #8fa3bd;
}

.footer-credit {
    margin: 0;
    font-size: 12.5px;
    color: #66798f;
}

@media (max-width: 992px) {
    .footer-cols,
    .footer-cols.footer-cols-3,
    .footer-cols.footer-cols-2 {
        grid-template-columns: 1fr 1fr;
    }
    .footer-about {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .footer-cols,
    .footer-cols.footer-cols-3,
    .footer-cols.footer-cols-2 {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .footer-main { padding: 34px 0 28px; }
    .footer-bottom-row { justify-content: center; text-align: center; }
}
