/* ============================================================
   الجزائر برس v3.1 — مكتبة تخطيطات منشئ الصفحة الرئيسية
   كل قواعد هذه الملفة محصورة تحت .hpb-section (لا تؤثر على
   صفحات المقالات أو الصفحات الداخلية أو أي جزء آخر من القالب).
   تستخدم متغيرات القالب الأصلية: --card-bg --border-color
   --text-dark --text-muted --primary-blue --accent-gold
   لذلك تتبع الوضع الليلي تلقائياً.
   ============================================================ */

/* ---------- الأساس والمتغيرات ---------- */
.hpb-section {
    --hpb-gap: 14px;
    --hpb-image-fit: cover;
    --hpb-hero-w: 62%;
    --hpb-side-w: 30%;
    --hpb-cr-visible: 3;
}

/* بديل موحّد للبطاقة (يحترم خلفية البطاقات المخصصة + الوضع الليلي) */
.hpb-section .hpb-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 9px;
}

/* صور البطاقات: الاحتواء المطلوب + عدم كسر النسب */
.hpb-section .hpb-img-fallback {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, var(--primary-dark, #0b1e33), var(--primary-blue, #15406b));
    border-radius: 8px;
}

/* ---------- إخفاءات الخيارات (حماية إضافية فوق CSS الديناميكي) ---------- */
.hpb-section.hpb-post-title-off h3,
.hpb-section.hpb-post-title-off h4,
.hpb-section.hpb-post-title-off .hpb-hs-hero h3,
.hpb-section.hpb-post-title-off .hpb-fb-hero h3 {
    display: none !important;
}

/* ============================================================
   1) الخبر الرئيسي + الأخبار الجانبية (hero_side)
   ============================================================ */
.hpb-section .hpb-hs-grid {
    display: grid;
    grid-template-columns: var(--hpb-hero-w) 1fr;
    gap: calc(var(--hpb-gap, 14px) + 6px);
    align-items: start;
}

/* عكس الاتجاه: الخبر الرئيسي في النهاية (يسار RTL) */
.hpb-section.hpb-hero-end .hpb-hs-grid > .hpb-hs-hero { order: 2; }
.hpb-section.hpb-hero-end .hpb-hs-grid > .hpb-hs-side { order: 1; }

.hpb-section .hpb-hs-hero-img img,
.hpb-section .hpb-hs-hero-img .hpb-img-fallback {
    width: 100%;
    height: 360px;
    object-fit: var(--hpb-image-fit);
    border-radius: 9px;
    display: block;
}

.hpb-section .hpb-hs-hero-body { padding-top: 14px; }
.hpb-section .hpb-hs-hero-body h3 {
    font-size: 24px;
    line-height: 1.45;
    font-weight: 800;
    margin: 8px 0;
}
.hpb-section .hpb-hs-hero-body h3 a { color: var(--text-dark, #1e293b); }
.hpb-section .hpb-hs-hero-body h3 a:hover { color: var(--primary-blue, #15406b); }
.hpb-section .hpb-hs-hero-body p {
    color: var(--text-dark, #1e293b);
    font-size: 15px;
    line-height: 1.75;
    margin-bottom: 6px;
}
.hpb-section .hpb-hs-hero-body .hpb-el-date {
    font-size: 12px;
    color: var(--text-muted, #64748b);
}

.hpb-section .hpb-hs-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hpb-section .hpb-hs-side-item {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 9px;
    padding: 10px;
}

.hpb-section .hpb-hs-side-thumb img,
.hpb-section .hpb-hs-side-thumb .hpb-img-fallback {
    width: 92px;
    height: 66px;
    object-fit: var(--hpb-image-fit);
    border-radius: 6px;
    display: block;
    flex: 0 0 92px;
}

.hpb-section .hpb-hs-side-info h4 {
    font-size: 14.5px;
    line-height: 1.55;
    margin-bottom: 4px;
}
.hpb-section .hpb-hs-side-info h4 a { color: var(--text-dark, #1e293b); }
.hpb-section .hpb-hs-side-info h4 a:hover { color: var(--primary-blue, #15406b); }
.hpb-section .hpb-hs-side-excerpt {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    line-height: 1.6;
    margin-bottom: 3px;
}
.hpb-section .hpb-hs-side-info .hpb-el-date {
    font-size: 11px;
    color: var(--text-muted, #64748b);
}

/* كثافة القائمة (hero_side: الجانبية) */
.hpb-section.hpb-density-compact .hpb-hs-side-item { padding: 6px; gap: 8px; }
.hpb-section.hpb-density-compact .hpb-hs-side-thumb img,
.hpb-section.hpb-density-compact .hpb-hs-side-thumb .hpb-img-fallback { width: 70px; height: 50px; flex-basis: 70px; }
.hpb-section.hpb-density-compact .hpb-hs-side-info h4 { font-size: 13px; }
.hpb-section.hpb-density-compact .hpb-hs-side-excerpt { display: none; }

.hpb-section.hpb-density-expanded .hpb-hs-side-item { padding: 14px; }
.hpb-section.hpb-density-expanded .hpb-hs-side-thumb img,
.hpb-section.hpb-density-expanded .hpb-hs-side-thumb .hpb-img-fallback { width: 120px; height: 84px; flex-basis: 120px; }
.hpb-section.hpb-density-expanded .hpb-hs-side-info h4 { font-size: 16px; }

/* ============================================================
   2) المجلة الإخبارية غير المتماثلة (magazine_mosaic)
   ============================================================ */
.hpb-section .hpb-mz-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(120px, auto);
    gap: var(--hpb-gap, 14px);
}

.hpb-section .hpb-mz-lead {
    grid-column: span 2;
    grid-row: span 2;
}
.hpb-section .hpb-mz-mid {
    grid-column: span 1;
}
.hpb-section .hpb-mz-sm {
    grid-column: span 1;
}

.hpb-section .hpb-mz-item {
    position: relative;
    border-radius: 9px;
    overflow: hidden;
    background: var(--primary-dark, #0b1e33);
    min-height: 150px;
}
.hpb-section .hpb-mz-lead { min-height: 320px; }

.hpb-section .hpb-mz-img-link {
    display: block;
    position: absolute;
    inset: 0;
}
.hpb-section .hpb-mz-img-link img,
.hpb-section .hpb-mz-img-link .hpb-img-fallback {
    width: 100%;
    height: 100%;
    object-fit: var(--hpb-image-fit);
    display: block;
    transition: transform .3s;
}
.hpb-section .hpb-mz-item:hover .hpb-mz-img-link img { transform: scale(1.04); }

.hpb-section .hpb-mz-caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 42px 14px 12px;
    background: linear-gradient(180deg, rgba(11,30,51,0) 0%, rgba(11,30,51,.9) 68%);
}
.hpb-section .hpb-mz-caption h3 {
    font-size: 17px;
    line-height: 1.5;
    margin: 6px 0 4px;
}
.hpb-section .hpb-mz-caption h3 a { color: #ffffff; }
.hpb-section .hpb-mz-caption .hpb-mz-sm-title { font-size: 14px; }
.hpb-section .hpb-mz-caption p {
    color: #dbe6f2;
    font-size: 12.5px;
    line-height: 1.6;
    margin-bottom: 4px;
}
.hpb-section .hpb-mz-caption .hpb-el-date { color: #c3d2e2; font-size: 11px; }
.hpb-section .hpb-mz-caption .cat-badge-gold { font-size: 10px; }

/* ارتفاع موحّد للبطاقات (خيار عام) */
.hpb-section.hpb-eq-height .hpb-mz-grid { grid-auto-rows: 1fr; }
.hpb-section.hpb-eq-height .cat-style-cards-grid { grid-auto-rows: 1fr; }
.hpb-section.hpb-eq-height .cat-style-cards-grid .style-card-box,
.hpb-section.hpb-eq-height .hpb-dual-grid .hpb-dual-item,
.hpb-section.hpb-eq-height .cat-style-magazine .mag-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.hpb-section.hpb-eq-height .cat-style-cards-grid .style-card-box img {
    height: 175px !important;
    object-fit: cover;
}

/* ============================================================
   3) البطاقات الأفقية المتحركة (card_carousel)
   ============================================================ */
.hpb-section .hpb-carousel { position: relative; }

.hpb-section .hpb-cr-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--hpb-cr-visible) - 1) * var(--hpb-gap, 14px)) / var(--hpb-cr-visible));
    gap: var(--hpb-gap, 14px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color, #e2e8f0) transparent;
}
.hpb-section .hpb-cr-track::-webkit-scrollbar { height: 6px; }
.hpb-section .hpb-cr-track::-webkit-scrollbar-thumb { background: var(--border-color, #e2e8f0); border-radius: 3px; }

.hpb-section .hpb-cr-card {
    scroll-snap-align: start;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 9px;
    overflow: hidden;
}

.hpb-section .hpb-cr-img-link img,
.hpb-section .hpb-cr-img-link .hpb-img-fallback {
    width: 100%;
    height: 180px;
    object-fit: var(--hpb-image-fit);
    display: block;
}

.hpb-section .hpb-cr-body { padding: 12px 14px 14px; }
.hpb-section .hpb-cr-body h3 {
    font-size: 15px;
    line-height: 1.55;
    margin: 4px 0 6px;
}
.hpb-section .hpb-cr-body h3 a { color: var(--text-dark, #1e293b); }
.hpb-section .hpb-cr-body h3 a:hover { color: var(--primary-blue, #15406b); }
.hpb-section .hpb-cr-body p {
    font-size: 12.5px;
    color: var(--text-muted, #64748b);
    line-height: 1.65;
    margin-bottom: 6px;
}
.hpb-section .hpb-cr-body .hpb-el-date { font-size: 11px; color: var(--text-muted, #64748b); }
.hpb-section .hpb-cr-body .cat-badge-gold { font-size: 10px; padding: 3px 9px; }

/* أزرار التنقل */
.hpb-section .hpb-cr-btn {
    position: absolute;
    top: 42%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, .92);
    color: var(--primary-dark, #0b1e33);
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(11, 30, 51, .22);
    z-index: 2;
    transition: background .15s;
}
.hpb-section .hpb-cr-btn:hover { background: var(--accent-gold, #d9822b); color: #fff; }
.hpb-section .hpb-cr-prev { inset-inline-start: 10px; }
.hpb-section .hpb-cr-next { inset-inline-end: 10px; }

/* احترام تقليل الحركة في الأجهزة (المرحلة الثانية بند 7) */
@media (prefers-reduced-motion: reduce) {
    .hpb-section .hpb-cr-track { scroll-behavior: auto; }
    .hpb-section .hpb-mz-img-link img,
    .hpb-section .hpb-overlay-card img { transition: none; }
}

/* ============================================================
   4) المحتوى مع العمود الجانبي (content_sidebar)
   ============================================================ */
.hpb-section .hpb-cs-grid {
    display: grid;
    grid-template-columns: 1fr var(--hpb-side-w);
    gap: calc(var(--hpb-gap, 14px) + 8px);
    align-items: start;
}

/* العمود الجانبي في النهاية (يسار RTL) */
.hpb-section.hpb-side-end .hpb-cs-grid > .hpb-cs-main { order: 2; }
.hpb-section.hpb-side-end .hpb-cs-grid > .hpb-cs-side { order: 1; }

.hpb-section .hpb-cs-main { display: flex; flex-direction: column; gap: 12px; }

.hpb-section .hpb-cs-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 9px;
    padding: 12px;
}

.hpb-section .hpb-cs-thumb img,
.hpb-section .hpb-cs-thumb .hpb-img-fallback {
    width: 128px;
    height: 88px;
    object-fit: var(--hpb-image-fit);
    border-radius: 6px;
    display: block;
    flex: 0 0 128px;
}

.hpb-section .hpb-cs-body h3 { font-size: 16px; line-height: 1.55; margin-bottom: 5px; }
.hpb-section .hpb-cs-body h3 a { color: var(--text-dark, #1e293b); }
.hpb-section .hpb-cs-body h3 a:hover { color: var(--primary-blue, #15406b); }
.hpb-section .hpb-cs-body p {
    font-size: 13px;
    color: var(--text-muted, #64748b);
    line-height: 1.65;
    margin-bottom: 5px;
}
.hpb-section .hpb-cs-body .hpb-el-date { font-size: 11.5px; color: var(--text-muted, #64748b); }
.hpb-section .hpb-cs-body .cat-badge-gold { font-size: 10px; }

/* العمود الجانبي */
.hpb-section .hpb-cs-side {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 9px;
    padding: 12px;
}

.hpb-section .hpb-cs-side-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-blue, #15406b);
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--border-color, #e2e8f0);
}

.hpb-section .hpb-cs-side-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color, #e2e8f0);
}
.hpb-section .hpb-cs-side-item:last-child { border-bottom: 0; }

.hpb-section .hpb-cs-side-thumb img,
.hpb-section .hpb-cs-side-thumb .hpb-img-fallback {
    width: 68px;
    height: 50px;
    object-fit: var(--hpb-image-fit);
    border-radius: 5px;
    display: block;
    flex: 0 0 68px;
}

.hpb-section .hpb-cs-side-info h4 { font-size: 13px; line-height: 1.5; margin-bottom: 3px; }
.hpb-section .hpb-cs-side-info h4 a { color: var(--text-dark, #1e293b); }
.hpb-section .hpb-cs-side-info h4 a:hover { color: var(--primary-blue, #15406b); }
.hpb-section .hpb-cs-side-info .hpb-el-date { font-size: 10.5px; color: var(--text-muted, #64748b); }
.hpb-section .hpb-cs-side-empty { font-size: 12px; color: var(--text-muted, #64748b); }

/* كثافة القائمة (content_sidebar: المساحة الرئيسية) */
.hpb-section.hpb-density-compact .hpb-cs-item { padding: 8px; gap: 10px; }
.hpb-section.hpb-density-compact .hpb-cs-thumb img,
.hpb-section.hpb-density-compact .hpb-cs-thumb .hpb-img-fallback { width: 100px; height: 68px; flex-basis: 100px; }
.hpb-section.hpb-density-compact .hpb-cs-body h3 { font-size: 14.5px; }
.hpb-section.hpb-density-expanded .hpb-cs-item { padding: 16px; }
.hpb-section.hpb-density-expanded .hpb-cs-thumb img,
.hpb-section.hpb-density-expanded .hpb-cs-thumb .hpb-img-fallback { width: 180px; height: 120px; flex-basis: 180px; }
.hpb-section.hpb-density-expanded .hpb-cs-body h3 { font-size: 18px; }

/* ============================================================
   5) القسم المميز (featured_band)
   ============================================================ */
.hpb-section .hpb-featured-band {
    background: var(--hpb-bg, var(--primary-dark, #0b1e33));
    border-radius: 12px;
    padding: 22px !important;
    margin-bottom: 10px;
}

/* ترويسة القسم المميز تظهر على خلفية داكنة */
.hpb-section .hpb-featured-band .newsroom-header { border-bottom-color: rgba(255, 255, 255, .18); }
.hpb-section .hpb-featured-band .newsroom-title-wrap h2 { color: #ffffff; }
.hpb-section .hpb-featured-band .newsroom-title-wrap .sub-label { color: rgba(255, 255, 255, .75); }
.hpb-section .hpb-featured-band .view-all-link { color: #ffd7a8; }

.hpb-section .hpb-fb-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: calc(var(--hpb-gap, 14px) + 4px);
    align-items: start;
}

.hpb-section .hpb-fb-hero {
    background: var(--card-bg, #ffffff);
    border-radius: 10px;
    overflow: hidden;
}

.hpb-section .hpb-fb-hero-img img,
.hpb-section .hpb-fb-hero-img .hpb-img-fallback {
    width: 100%;
    height: 330px;
    object-fit: var(--hpb-image-fit);
    display: block;
}

.hpb-section .hpb-fb-hero-body { padding: 16px 18px 18px; }
.hpb-section .hpb-fb-hero-body h3 { font-size: 21px; line-height: 1.45; margin: 6px 0 8px; }
.hpb-section .hpb-fb-hero-body h3 a { color: var(--text-dark, #1e293b); }
.hpb-section .hpb-fb-hero-body h3 a:hover { color: var(--primary-blue, #15406b); }
.hpb-section .hpb-fb-hero-body p { font-size: 14px; color: var(--text-muted, #64748b); line-height: 1.7; margin-bottom: 6px; }
.hpb-section .hpb-fb-hero-body .hpb-el-date { font-size: 12px; color: var(--text-muted, #64748b); }

.hpb-section .hpb-fb-list { display: flex; flex-direction: column; gap: 10px; }

.hpb-section .hpb-fb-item {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--card-bg, #ffffff);
    border-radius: 9px;
    padding: 10px 12px;
}

.hpb-section .hpb-fb-thumb img,
.hpb-section .hpb-fb-thumb .hpb-img-fallback {
    width: 86px;
    height: 62px;
    object-fit: var(--hpb-image-fit);
    border-radius: 6px;
    display: block;
    flex: 0 0 86px;
}

.hpb-section .hpb-fb-item-body h4 { font-size: 14px; line-height: 1.55; margin-bottom: 4px; }
.hpb-section .hpb-fb-item-body h4 a { color: var(--text-dark, #1e293b); }
.hpb-section .hpb-fb-item-body h4 a:hover { color: var(--primary-blue, #15406b); }
.hpb-section .hpb-fb-item-body .hpb-el-date { font-size: 11px; color: var(--text-muted, #64748b); }

/* ============================================================
   6) ودجت التبويبات (tabs_widget) — مصادر حقيقية
   ============================================================ */
.hpb-section .hpb-tabs {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 9px;
    overflow: hidden;
}

.hpb-section .hpb-tabs-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px 12px 0;
    border-bottom: 2px solid var(--border-color, #e2e8f0);
}

.hpb-section .hpb-tab-btn-f {
    border: 0;
    background: transparent;
    color: var(--text-muted, #64748b);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    padding: 9px 16px 11px;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, background .15s;
}
.hpb-section .hpb-tab-btn-f:hover { color: var(--primary-blue, #15406b); background: rgba(21, 64, 107, .06); }
.hpb-section .hpb-tab-btn-f.active {
    color: var(--primary-blue, #15406b);
    border-bottom-color: var(--accent-gold, #d9822b);
}

.hpb-section .hpb-tab-panel { display: none; padding: 8px 14px 12px; }
.hpb-section .hpb-tab-panel.active { display: block; }

.hpb-section .hpb-tab-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color, #e2e8f0);
}
.hpb-section .hpb-tab-item:last-child { border-bottom: 0; }

.hpb-section .hpb-tab-thumb img,
.hpb-section .hpb-tab-thumb .hpb-img-fallback {
    width: 76px;
    height: 56px;
    object-fit: var(--hpb-image-fit);
    border-radius: 6px;
    display: block;
    flex: 0 0 76px;
}

.hpb-section .hpb-tab-info h4 { font-size: 14.5px; line-height: 1.55; margin-bottom: 4px; }
.hpb-section .hpb-tab-info h4 a { color: var(--text-dark, #1e293b); }
.hpb-section .hpb-tab-info h4 a:hover { color: var(--primary-blue, #15406b); }
.hpb-section .hpb-tab-info .hpb-el-date { font-size: 11px; color: var(--text-muted, #64748b); }

/* ============================================================
   7) العرض المزدوج (dual_list)
   ============================================================ */
.hpb-section .hpb-dual-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--hpb-gap, 14px);
    align-items: start;
}

.hpb-section .hpb-dual-col {
    display: flex;
    flex-direction: column;
    gap: var(--hpb-gap, 12px);
}

.hpb-section .hpb-dual-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 9px;
    padding: 10px 12px;
}

.hpb-section .hpb-dual-thumb img,
.hpb-section .hpb-dual-thumb .hpb-img-fallback {
    width: 92px;
    height: 66px;
    object-fit: var(--hpb-image-fit);
    border-radius: 6px;
    display: block;
    flex: 0 0 92px;
}

.hpb-section .hpb-dual-body h3 { font-size: 14.5px; line-height: 1.55; margin-bottom: 5px; }
.hpb-section .hpb-dual-body h3 a { color: var(--text-dark, #1e293b); }
.hpb-section .hpb-dual-body h3 a:hover { color: var(--primary-blue, #15406b); }
.hpb-section .hpb-dual-body p { font-size: 12px; color: var(--text-muted, #64748b); line-height: 1.6; margin-bottom: 4px; }
.hpb-section .hpb-dual-body .hpb-el-date { font-size: 11px; color: var(--text-muted, #64748b); }
.hpb-section .hpb-dual-body .cat-badge-gold { font-size: 10px; padding: 3px 9px; }

/* كثافة القائمة + موضع الصورة (dual_list) */
.hpb-section.hpb-thumb-end .hpb-dual-item,
.hpb-section.hpb-thumb-end .hpb-compact-item,
.hpb-section.hpb-thumb-end .hpb-rich-item,
.hpb-section.hpb-thumb-end .hpb-mostread-item,
.hpb-section.hpb-thumb-end .hpb-tl-item {
    flex-direction: row-reverse;
}

.hpb-section.hpb-density-compact .hpb-dual-item { padding: 6px 8px; }
.hpb-section.hpb-density-compact .hpb-dual-thumb img,
.hpb-section.hpb-density-compact .hpb-dual-thumb .hpb-img-fallback { width: 70px; height: 50px; flex-basis: 70px; }
.hpb-section.hpb-density-expanded .hpb-dual-item { padding: 14px; }
.hpb-section.hpb-density-expanded .hpb-dual-thumb img,
.hpb-section.hpb-density-expanded .hpb-dual-thumb .hpb-img-fallback { width: 130px; height: 92px; flex-basis: 130px; }

/* كثافة القوائم على التصميمات الحالية (rich_list وcompact_list وtimeline) */
.hpb-section.hpb-density-compact .hpb-rich-item,
.hpb-section.hpb-density-compact .hpb-compact-item { padding: 6px 8px; }
.hpb-section.hpb-density-compact .hpb-rich-thumb img { height: 80px !important; }
.hpb-section.hpb-density-compact .hpb-rich-body h3 { font-size: 14px; }
.hpb-section.hpb-density-compact .hpb-rich-body p { display: none; }
.hpb-section.hpb-density-expanded .hpb-rich-item { padding: 16px; }
.hpb-section.hpb-density-expanded .hpb-rich-thumb img { height: 190px !important; }
.hpb-section.hpb-density-expanded .hpb-rich-body h3 { font-size: 19px; }

.hpb-section.hpb-density-expanded .hpb-compact-item { padding: 14px; }
.hpb-section.hpb-density-expanded .hpb-compact-thumb img { width: 110px !important; height: 80px !important; }

/* ============================================================
   أشكال عنوان القسم (كل التصميمات — عبر أصناف غلاف القسم)
   ============================================================ */

/* مع خط سفلي ملوّن */
.hpb-section.hpb-title-underline .newsroom-title-wrap h2 {
    padding-bottom: 8px;
    border-bottom: 3px solid var(--accent-gold, #d9822b);
}
.hpb-section.hpb-title-underline .newsroom-header { border-bottom: 0; padding-bottom: 0; }

/* داخل شريط ملوّن */
.hpb-section.hpb-title-bar .newsroom-title-wrap h2 {
    background: var(--primary-blue, #15406b);
    color: #ffffff;
    display: inline-block;
    padding: 8px 18px;
    border-radius: 7px 22px 7px 7px;
    margin-top: 6px;
}
.hpb-section.hpb-title-bar .newsroom-header { border-bottom: 0; padding-bottom: 0; align-items: center; }
.hpb-section.hpb-title-bar .newsroom-title-wrap .sub-label { margin-inline-start: 4px; }

/* داخل إطار */
.hpb-section.hpb-title-boxed .newsroom-title-wrap h2 {
    border: 2px solid var(--primary-blue, #15406b);
    color: var(--primary-blue, #15406b);
    display: inline-block;
    padding: 8px 18px;
    border-radius: 9px;
    margin-top: 6px;
}
.hpb-section.hpb-title-boxed .newsroom-header { border-bottom: 0; padding-bottom: 0; align-items: center; }

/* مع رمز صغير */
.hpb-section .hpb-th-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-inline-end: 10px;
    border-radius: 8px;
    background: rgba(217, 130, 43, .14);
    font-size: 18px;
    vertical-align: middle;
}
.hpb-section.hpb-title-icon .newsroom-header { border-bottom: 0; padding-bottom: 0; }

/* ألوان البطاقات/الفواصل/النص الثانوي على التصميمات الجديدة نفسها */
.hpb-section .hpb-hs-side-item,
.hpb-section .hpb-cr-card,
.hpb-section .hpb-cs-item,
.hpb-section .hpb-cs-side,
.hpb-section .hpb-fb-hero,
.hpb-section .hpb-fb-item,
.hpb-section .hpb-tabs,
.hpb-section .hpb-dual-item {
    background: var(--card-bg, #ffffff);
    border-color: var(--border-color, #e2e8f0);
}

.hpb-section .hpb-hs-hero-body .hpb-el-date,
.hpb-section .hpb-hs-side-info .hpb-el-date,
.hpb-section .hpb-hs-side-excerpt,
.hpb-section .hpb-cr-body p,
.hpb-section .hpb-cr-body .hpb-el-date,
.hpb-section .hpb-cs-body p,
.hpb-section .hpb-cs-body .hpb-el-date,
.hpb-section .hpb-cs-side-info .hpb-el-date,
.hpb-section .hpb-fb-hero-body p,
.hpb-section .hpb-fb-hero-body .hpb-el-date,
.hpb-section .hpb-fb-item-body .hpb-el-date,
.hpb-section .hpb-tab-info .hpb-el-date,
.hpb-section .hpb-dual-body p,
.hpb-section .hpb-dual-body .hpb-el-date {
    color: var(--text-muted, #64748b);
}

.hpb-section .hpb-cs-side-item,
.hpb-section .hpb-tab-item,
.hpb-section .hpb-tabs-bar {
    border-color: var(--border-color, #e2e8f0);
}

/* ============================================================
   التصميم المتجاوب (الحاسوب / اللوحي / الهاتف)
   ============================================================ */
@media (max-width: 992px) {
    .hpb-section .hpb-hs-grid { grid-template-columns: 1fr; }
    .hpb-section.hpb-hero-end .hpb-hs-grid > .hpb-hs-hero { order: 0; }
    .hpb-section.hpb-hero-end .hpb-hs-grid > .hpb-hs-side { order: 1; }

    .hpb-section .hpb-mz-grid { grid-template-columns: repeat(2, 1fr); }
    .hpb-section .hpb-mz-lead { grid-column: span 2; grid-row: span 1; min-height: 240px; }

    .hpb-section .hpb-cs-grid { grid-template-columns: 1fr; }
    .hpb-section.hpb-side-end .hpb-cs-grid > .hpb-cs-main { order: 0; }
    .hpb-section.hpb-side-end .hpb-cs-grid > .hpb-cs-side { order: 1; }

    .hpb-section .hpb-fb-grid { grid-template-columns: 1fr; }

    /* عدد البطاقات الظاهرة في الكاروسيل: بطاقتان على اللوحي */
    .hpb-section .hpb-cr-track {
        grid-auto-columns: calc((100% - var(--hpb-gap, 14px)) / 2);
    }
}

@media (max-width: 768px) {
    .hpb-section .hpb-hs-hero-img img,
    .hpb-section .hpb-hs-hero-img .hpb-img-fallback { height: 230px; }
    .hpb-section .hpb-hs-hero-body h3 { font-size: 19px; }

    .hpb-section .hpb-mz-grid { grid-template-columns: 1fr; }
    .hpb-section .hpb-mz-lead { grid-column: span 1; min-height: 200px; }
    .hpb-section .hpb-mz-caption h3 { font-size: 15px; }

    /* بطاقة واحدة تقريباً على الهاتف + مسافة ملامسة مريحة */
    .hpb-section .hpb-cr-track {
        grid-auto-columns: 86%;
        gap: 10px;
    }
    .hpb-section .hpb-cr-btn { display: none; }

    .hpb-section .hpb-fb-hero-img img,
    .hpb-section .hpb-fb-hero-img .hpb-img-fallback { height: 220px; }
    .hpb-section .hpb-fb-hero-body h3 { font-size: 17px; }

    .hpb-section .hpb-dual-grid { grid-template-columns: 1fr; }

    .hpb-section .hpb-tab-btn-f { padding: 8px 10px 10px; font-size: 13px; }

    .hpb-section .hpb-featured-band { padding: 14px !important; }

    /* منع أي خروج عن حدود الشاشة */
    .hpb-section .hpb-carousel,
    .hpb-section .hpb-hs-grid,
    .hpb-section .hpb-mz-grid,
    .hpb-section .hpb-cs-grid,
    .hpb-section .hpb-fb-grid,
    .hpb-section .hpb-dual-grid,
    .hpb-section .hpb-tabs {
        max-width: 100%;
        overflow-x: hidden;
    }
    .hpb-section .hpb-carousel { overflow-x: hidden; }
    .hpb-section .hpb-cr-track { overflow-x: auto; }
}
