/* ============================================================
   الجزائر برس 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-cr-visible-t: 2;
    --hpb-cr-visible-m: 1;
}

/* بديل موحّد للبطاقة (يحترم خلفية البطاقات المخصصة + الوضع الليلي) */
.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; }

/* زر إيقاف/استئناف الحركة التلقائية — تحكم واضح ومتوافق مع لوحة المفاتيح */
.hpb-section .hpb-cr-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    margin-top: 10px;
    padding: 7px 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 7px;
    background: var(--card-bg, #fff);
    color: var(--text-dark, #1e293b);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.hpb-section .hpb-cr-toggle:hover {
    border-color: var(--accent-gold, #d9822b);
    color: var(--primary-blue, #15406b);
}
.hpb-section .hpb-cr-toggle:focus-visible,
.hpb-section .hpb-cr-btn:focus-visible,
.hpb-section .hpb-cr-track:focus-visible {
    outline: 3px solid var(--accent-gold, #d9822b);
    outline-offset: 3px;
}
.hpb-section .hpb-cr-toggle[hidden] { display: none !important; }

/* ---- v3.6.0: نقاط التنقل، تعطيل الأسهم، شكل الصورة الكاملة ---- */
.hpb-section .hpb-cr-btn:disabled { opacity: .35; cursor: default; pointer-events: none; }
.hpb-section .hpb-cr-no-arrows .hpb-cr-btn,
.hpb-section .hpb-cr-static .hpb-cr-btn { display: none; }
.hpb-section .hpb-cr-dots {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.hpb-section .hpb-cr-dots[hidden] { display: none; }
.hpb-section .hpb-cr-dot {
    /* منطقة لمس 24px مع نقطة مرئية أصغر */
    position: relative;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.hpb-section .hpb-cr-dot::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: var(--border-color, #cbd5e1);
    transition: background .15s, width .15s;
}
.hpb-section .hpb-cr-dot.is-active::before {
    width: 22px;
    border-radius: 6px;
    background: var(--accent-gold, #d9822b);
}
.hpb-section .hpb-cr-dot:focus-visible { outline: 3px solid var(--accent-gold, #d9822b); outline-offset: 0; border-radius: 6px; }

.hpb-section .hpb-cr-style-overlay .hpb-cr-card { position: relative; border: 0; min-height: 260px; background: #0b1e33; }
.hpb-section .hpb-cr-style-overlay .hpb-cr-img-link { display: block; position: absolute; inset: 0; }
.hpb-section .hpb-cr-style-overlay .hpb-cr-img-link img,
.hpb-section .hpb-cr-style-overlay .hpb-cr-img-link .hpb-img-fallback { height: 100%; min-height: 260px; }
.hpb-section .hpb-cr-style-overlay .hpb-cr-body {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 44px 14px 14px;
    background: linear-gradient(to top, rgba(11, 30, 51, .92) 0%, rgba(11, 30, 51, .55) 60%, rgba(11, 30, 51, 0) 100%);
    pointer-events: none;
}
.hpb-section .hpb-cr-style-overlay .hpb-cr-body a { pointer-events: auto; }
.hpb-section .hpb-cr-style-overlay .hpb-cr-body h3 a,
.hpb-section .hpb-cr-style-overlay .hpb-cr-body h3 a:hover { color: #fff; }
.hpb-section .hpb-cr-style-overlay .hpb-cr-body p { display: none; }
.hpb-section .hpb-cr-style-overlay .hpb-cr-body .hpb-el-date { color: rgba(255, 255, 255, .82); }

/* احترام تقليل الحركة في الأجهزة (المرحلة الثانية بند 7) */
@media (prefers-reduced-motion: reduce) {
    .hpb-section .hpb-cr-track { scroll-behavior: auto; }
    .hpb-section .hpb-cr-dot::before { transition: none; }
    .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);
}

/* ============================================================
   الأقسام التحريرية الجديدة
   ============================================================ */
.hpb-section .hpb-picks {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
    gap: var(--hpb-gap, 18px);
    align-items: start;
}

.hpb-section .hpb-picks-lead {
    overflow: hidden;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
}

.hpb-section .hpb-picks-lead-image { display: block; overflow: hidden; }
.hpb-section .hpb-picks-lead-image img,
.hpb-section .hpb-picks-lead-image .hpb-img-fallback {
    display: block;
    width: 100%;
    height: 380px;
    object-fit: var(--hpb-image-fit, cover);
    border-radius: 0;
}

.hpb-section .hpb-picks-lead-body { padding: 16px 18px 18px; }
.hpb-section .hpb-picks-meta,
.hpb-section .hpb-discussion-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}

.hpb-section .hpb-picks-meta .hpb-el-date,
.hpb-section .hpb-discussion-meta .hpb-el-date {
    color: var(--text-muted, #64748b);
    font-size: 11.5px;
}

.hpb-section .hpb-picks-lead-body h3 {
    margin: 0 0 9px;
    color: var(--text-dark, #1e293b);
    font-size: 25px;
    font-weight: 800;
    line-height: 1.45;
}

.hpb-section .hpb-picks-lead-body h3 a:hover,
.hpb-section .hpb-picks-item-body h3 a:hover,
.hpb-section .hpb-discussion-body h3 a:hover { color: var(--primary-blue, #15406b); }

.hpb-section .hpb-picks-lead-body p {
    margin: 0;
    color: var(--text-muted, #64748b);
    font-size: 14px;
    line-height: 1.8;
}

.hpb-section .hpb-picks-list {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.hpb-section .hpb-picks-list > li { border-bottom: 1px solid var(--border-color, #e2e8f0); }
.hpb-section .hpb-picks-item {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 11px;
    padding: 11px 4px;
}

.hpb-section .hpb-picks-thumb { display: block; width: 88px; overflow: hidden; border-radius: 7px; }
.hpb-section .hpb-picks-thumb img,
.hpb-section .hpb-picks-thumb .hpb-img-fallback {
    display: block;
    width: 100%;
    height: 88px;
    object-fit: var(--hpb-image-fit, cover);
    border-radius: 7px;
}

.hpb-section .hpb-picks-item-body { min-width: 0; }
.hpb-section .hpb-picks-item-body .hpb-picks-meta { margin-bottom: 4px; }
.hpb-section .hpb-picks-item-body h3 {
    margin: 0;
    color: var(--text-dark, #1e293b);
    font-size: 15.5px;
    font-weight: 750;
    line-height: 1.6;
}

.hpb-section .hpb-picks-number {
    align-self: start;
    padding-top: 4px;
    color: var(--hpb-accent, var(--accent-gold, #d9822b));
    font-size: 17px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.hpb-section .hpb-picks-single { grid-template-columns: minmax(0, 1fr); }
.hpb-section .hpb-picks-single .hpb-picks-lead { max-width: 900px; }
.hpb-section .hpb-picks.hpb-no-images .hpb-picks-item { grid-template-columns: minmax(0, 1fr) 28px; }
.hpb-section.hpb-density-compact .hpb-picks-item { padding-block: 7px; }
.hpb-section.hpb-density-expanded .hpb-picks-item { padding-block: 17px; }

.hpb-section .hpb-topic-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--hpb-gap, 12px);
}

.hpb-section .hpb-topic-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 102px;
    padding: 16px 14px;
    overflow: hidden;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-inline-start: 3px solid var(--hpb-accent, var(--accent-gold, #d9822b));
    border-radius: 8px;
    color: var(--text-dark, #1e293b);
    transition: transform .18s, border-color .18s, box-shadow .18s;
}

.hpb-section .hpb-topic-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-blue, #15406b);
    border-inline-start-color: var(--hpb-accent, var(--accent-gold, #d9822b));
    box-shadow: 0 5px 16px rgba(11, 30, 51, .09);
}

.hpb-section .hpb-topic-rank {
    flex: 0 0 auto;
    color: var(--hpb-accent, var(--accent-gold, #d9822b));
    font-size: 22px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.hpb-section .hpb-topic-body { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 5px; }
.hpb-section .hpb-topic-name { font-size: 15px; font-weight: 800; line-height: 1.5; }
.hpb-section .hpb-topic-count { color: var(--text-muted, #64748b); font-size: 11.5px; }
.hpb-section .hpb-topic-arrow { color: var(--primary-blue, #15406b); font-size: 18px; }

.hpb-section .hpb-discussion-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--hpb-gap, 14px);
}

.hpb-section .hpb-discussion-card {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 9px;
    transition: transform .18s, box-shadow .18s;
}

.hpb-section .hpb-discussion-card:hover { transform: translateY(-2px); box-shadow: 0 5px 16px rgba(11, 30, 51, .09); }
.hpb-section .hpb-discussion-rank,
.hpb-section .hpb-comment-pill {
    position: absolute;
    z-index: 2;
    top: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 27px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 800;
}

.hpb-section .hpb-discussion-rank {
    inset-inline-start: 11px;
    min-width: 30px;
    background: var(--hpb-accent, var(--accent-gold, #d9822b));
    color: #fff;
    font-size: 14px;
}

.hpb-section .hpb-comment-pill { inset-inline-end: 11px; padding: 4px 8px; background: rgba(11, 30, 51, .88); color: #fff; }
.hpb-section .hpb-discussion-thumb { display: block; overflow: hidden; }
.hpb-section .hpb-discussion-thumb img,
.hpb-section .hpb-discussion-thumb .hpb-img-fallback {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: var(--hpb-image-fit, cover);
    border-radius: 0;
}

.hpb-section .hpb-discussion-body { display: flex; flex: 1; flex-direction: column; padding: 14px; }
.hpb-section .hpb-discussion-body h3 { margin: 0 0 8px; color: var(--text-dark, #1e293b); font-size: 17px; font-weight: 800; line-height: 1.55; }
.hpb-section .hpb-discussion-body p { margin: 0; color: var(--text-muted, #64748b); font-size: 13px; line-height: 1.75; }
.hpb-section .hpb-discussion-grid.hpb-no-images .hpb-discussion-body { padding-top: 50px; }
.hpb-section.hpb-eq-height .hpb-discussion-grid { grid-auto-rows: 1fr; }
.hpb-section.hpb-eq-height .hpb-discussion-card { height: 100%; }
.hpb-section .hpb-discussion-card,
.hpb-section .hpb-picks-lead { 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-picks { grid-template-columns: minmax(0, 1fr); }
    .hpb-section .hpb-picks-single .hpb-picks-lead { max-width: none; }
    .hpb-section .hpb-picks-lead-body h3 { font-size: 22px; }

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

@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: repeat(2, minmax(0, 1fr));
        grid-auto-rows: minmax(150px, auto);
    }
    .hpb-section .hpb-mz-lead {
        grid-column: 1 / -1;
        grid-row: auto;
        min-height: 230px;
    }
    .hpb-section .hpb-mz-mid,
    .hpb-section .hpb-mz-sm { min-height: 165px; }
    .hpb-section .hpb-mz-caption { padding: 34px 10px 10px; }
    .hpb-section .hpb-mz-caption h3 { font-size: 14px; }
    .hpb-section .hpb-mz-caption .hpb-mz-sm-title { font-size: 12.5px; }
    .hpb-section .hpb-mz-caption p { display: none; }

    .hpb-section .hpb-hs-side-thumb img,
    .hpb-section .hpb-hs-side-thumb .hpb-img-fallback { width: 78px; height: 58px; flex-basis: 78px; }
    .hpb-section .hpb-cs-thumb img,
    .hpb-section .hpb-cs-thumb .hpb-img-fallback { width: 100px; height: 70px; flex-basis: 100px; }

    /* الهاتف: العدد الظاهر + إطلالة (~16%) على البطاقة التالية ليتّضح أن الشريط قابل للسحب */
    .hpb-section .hpb-cr-track {
        grid-auto-columns: calc((100% - (var(--hpb-cr-visible-m) - 1) * 10px) / (var(--hpb-cr-visible-m) + .16));
        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-picks-lead-body { padding: 13px 14px 15px; }
    .hpb-section .hpb-picks-lead-body h3 { font-size: 19px; }
    .hpb-section .hpb-picks-item { grid-template-columns: 72px minmax(0, 1fr) 25px; gap: 9px; }
    .hpb-section .hpb-picks-thumb { width: 72px; }
    .hpb-section .hpb-picks-item-body h3 { font-size: 14px; }
    .hpb-section .hpb-topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hpb-section .hpb-discussion-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hpb-section .hpb-topic-card { min-height: 90px; padding: 12px; gap: 9px; }
    .hpb-section .hpb-topic-rank { font-size: 19px; }
    .hpb-section .hpb-topic-name { font-size: 13.5px; }
    .hpb-section .hpb-discussion-body h3 { font-size: 15.5px; }

    .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-picks,
    .hpb-section .hpb-topic-grid,
    .hpb-section .hpb-discussion-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; }
}

@media (max-width: 480px) {
    .hpb-section .hpb-mz-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
    .hpb-section .hpb-mz-item,
    .hpb-section .hpb-mz-mid,
    .hpb-section .hpb-mz-sm { min-height: 185px; }
    .hpb-section .hpb-mz-lead { min-height: 215px; }
    .hpb-section .hpb-mz-caption h3,
    .hpb-section .hpb-mz-caption .hpb-mz-sm-title { font-size: 15px; }

    .hpb-section .hpb-hs-side-item,
    .hpb-section .hpb-cs-item { gap: 9px; padding: 8px; }
    .hpb-section .hpb-hs-side-info h4,
    .hpb-section .hpb-cs-body h3 { font-size: 13px; }
    .hpb-section .hpb-cs-thumb img,
    .hpb-section .hpb-cs-thumb .hpb-img-fallback { width: 84px; height: 62px; flex-basis: 84px; }
    .hpb-section .hpb-picks-item { grid-template-columns: 64px minmax(0, 1fr) 23px; }
    .hpb-section .hpb-picks-thumb { width: 64px; }
    .hpb-section .hpb-discussion-grid { grid-template-columns: minmax(0, 1fr); }
    .hpb-section .hpb-topic-card { min-height: 84px; padding: 10px; }
    .hpb-section .hpb-topic-arrow { display: none; }
    .hpb-section .hpb-discussion-body { padding: 12px; }
}

/* ============================================================
   v3.7.0 — أنواع الكروسيل الخمسة الجديدة (بنية بطاقة لكل نوع،
   نفس محرك الحركة: الأسهم والنقاط والسحب والتشغيل التلقائي)
   ============================================================ */

/* ---------- نظام المسافات الموحد (تصميم الصفحة) ----------
   الغلاف .hpb-section هو المسؤول الوحيد عن الفاصل بين الأقسام،
   والقسم الداخلي بلا هوامش إضافية — لا مضاعفة margin+padding. */
.hpb-section { margin-bottom: var(--ajp-sec-gap, 16px); }
.hpb-section > .newsroom-section { margin-block: 0; }
.hpb-section:last-child { margin-bottom: 0; }

/* ---------- 1) كروسيل الصور الكاملة ---------- */
.hpb-section .hpb-carousel.hpb-cr-fi .hpb-cr-card {
    position: relative;
    border: 0;
    border-radius: 10px;
    background: var(--card-bg, #ffffff);
    overflow: hidden;
    box-shadow: 0 3px 14px rgba(11, 30, 51, .08);
}
.hpb-section .hpb-carousel.hpb-cr-fi .hpb-cr-card img,
.hpb-section .hpb-carousel.hpb-cr-fi .hpb-cr-img-link .hpb-img-fallback {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: var(--hpb-image-fit, cover);
    display: block;
}
.hpb-section .hpb-carousel.hpb-cr-fi.hpb-cr-ratio-32 .hpb-cr-card img,
.hpb-section .hpb-carousel.hpb-cr-fi.hpb-cr-ratio-32 .hpb-cr-img-link .hpb-img-fallback { aspect-ratio: 3 / 2; }
.hpb-section .hpb-carousel.hpb-cr-fi.hpb-cr-ratio-43 .hpb-cr-card img,
.hpb-section .hpb-carousel.hpb-cr-fi.hpb-cr-ratio-43 .hpb-cr-img-link .hpb-img-fallback { aspect-ratio: 4 / 3; }
.hpb-section .hpb-carousel.hpb-cr-fi.hpb-cr-ratio-11 .hpb-cr-card img,
.hpb-section .hpb-carousel.hpb-cr-fi.hpb-cr-ratio-11 .hpb-cr-img-link .hpb-img-fallback { aspect-ratio: 1 / 1; }
.hpb-section .hpb-carousel.hpb-cr-fi .hpb-cr-cap {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 34px 14px 12px;
    background: linear-gradient(180deg, rgba(11, 30, 51, 0) 0%, rgba(11, 30, 51, .84) 76%);
    color: #ffffff;
}
.hpb-section .hpb-carousel.hpb-cr-fi .hpb-cr-cap .cat-badge-gold { font-size: 10px; }
.hpb-section .hpb-carousel.hpb-cr-fi .hpb-cr-cap h3 {
    font-size: 15.5px;
    line-height: 1.5;
    margin: 6px 0 3px;
}
.hpb-section .hpb-carousel.hpb-cr-fi .hpb-cr-cap h3 a { color: #ffffff; }
.hpb-section .hpb-carousel.hpb-cr-fi .hpb-cr-cap h3 a:hover { color: var(--accent-gold, #d9822b); }
.hpb-section .hpb-carousel.hpb-cr-fi .hpb-cr-cap p {
    font-size: 12px;
    line-height: 1.6;
    color: #e2e8f0;
    margin: 0 0 3px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hpb-section .hpb-carousel.hpb-cr-fi .hpb-cr-cap .hpb-el-date { font-size: 11px; color: #cbd5e1; }

/* ---------- 2) الكروسيل المدمج ---------- */
.hpb-section .hpb-carousel.hpb-cr-cp .hpb-cr-track { gap: var(--hpb-gap, 10px); }
.hpb-section .hpb-carousel.hpb-cr-cp .hpb-cr-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 9px;
}
.hpb-section .hpb-carousel.hpb-cr-cp .hpb-cr-thumb {
    flex: 0 0 92px;
    display: block;
}
.hpb-section .hpb-carousel.hpb-cr-cp .hpb-cr-thumb img,
.hpb-section .hpb-carousel.hpb-cr-cp .hpb-cr-thumb .hpb-img-fallback {
    width: 92px;
    height: 64px;
    object-fit: var(--hpb-image-fit, cover);
    border-radius: 6px;
    display: block;
}
.hpb-section .hpb-carousel.hpb-cr-cp .hpb-cr-info { min-width: 0; }
.hpb-section .hpb-carousel.hpb-cr-cp .hpb-cr-info .cat-badge-gold { font-size: 9px; padding: 2px 7px; }
.hpb-section .hpb-carousel.hpb-cr-cp .hpb-cr-info h3 {
    font-size: 13px;
    line-height: 1.5;
    margin: 4px 0 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hpb-section .hpb-carousel.hpb-cr-cp .hpb-cr-info h3 a { color: var(--text-dark, #1e293b); }
.hpb-section .hpb-carousel.hpb-cr-cp .hpb-cr-info h3 a:hover { color: var(--primary-blue, #15406b); }
.hpb-section .hpb-carousel.hpb-cr-cp .hpb-cr-info .hpb-el-date { font-size: 10.5px; color: var(--text-muted, #64748b); }

/* ---------- 3) كروسيل الصفّين ---------- */
.hpb-section .hpb-carousel.hpb-cr-tr .hpb-cr-track {
    grid-auto-flow: column;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-auto-columns: calc((100% - (var(--hpb-cr-visible) - 1) * var(--hpb-gap, 14px)) / var(--hpb-cr-visible));
    align-content: stretch;
}
.hpb-section .hpb-carousel.hpb-cr-tr .hpb-cr-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 9px;
    overflow: hidden;
    min-height: 0;
}
.hpb-section .hpb-carousel.hpb-cr-tr .hpb-cr-card img,
.hpb-section .hpb-carousel.hpb-cr-tr .hpb-cr-img-link .hpb-img-fallback {
    width: 100%;
    height: 110px;
    object-fit: var(--hpb-image-fit, cover);
    display: block;
}
.hpb-section .hpb-carousel.hpb-cr-tr .hpb-cr-body { padding: 8px 10px 10px; }
.hpb-section .hpb-carousel.hpb-cr-tr .hpb-cr-body h3 {
    font-size: 13.5px;
    line-height: 1.5;
    margin: 3px 0 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hpb-section .hpb-carousel.hpb-cr-tr .hpb-cr-body p { display: none; }
.hpb-section .hpb-carousel.hpb-cr-tr .hpb-cr-body .hpb-el-date { font-size: 10.5px; }

/* ---------- 4) الكروسيل المرقّم ---------- */
.hpb-section .hpb-carousel.hpb-cr-nm .hpb-cr-card {
    position: relative;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 9px;
    overflow: hidden;
}
.hpb-section .hpb-carousel.hpb-cr-nm .hpb-cr-num {
    position: absolute;
    top: 8px;
    inset-inline-start: 8px;
    z-index: 2;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 8px;
    background: var(--accent-gold, #d9822b);
    color: #ffffff;
    font-weight: 800;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(11, 30, 51, .28);
}
.hpb-section .hpb-carousel.hpb-cr-nm .hpb-cr-card img,
.hpb-section .hpb-carousel.hpb-cr-nm .hpb-cr-img-link .hpb-img-fallback {
    width: 100%;
    height: 120px;
    object-fit: var(--hpb-image-fit, cover);
    display: block;
}
.hpb-section .hpb-carousel.hpb-cr-nm .hpb-cr-body { padding: 10px 12px 12px; }
.hpb-section .hpb-carousel.hpb-cr-nm .hpb-cr-body h3 {
    font-size: 14px;
    line-height: 1.5;
    margin: 3px 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hpb-section .hpb-carousel.hpb-cr-nm .hpb-cr-body p { display: none; }
.hpb-section .hpb-carousel.hpb-cr-nm .hpb-cr-body .hpb-el-date { font-size: 11px; }

/* ---------- 5) كروسيل الغلاف الكبير ---------- */
.hpb-section .hpb-carousel.hpb-cr-hc .hpb-cr-card {
    position: relative;
    border: 0;
    border-radius: 12px;
    background: var(--primary-dark, #0b1e33);
    overflow: hidden;
    box-shadow: 0 6px 22px rgba(11, 30, 51, .16);
}
.hpb-section .hpb-carousel.hpb-cr-hc .hpb-cr-card img,
.hpb-section .hpb-carousel.hpb-cr-hc .hpb-cr-img-link .hpb-img-fallback {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: var(--hpb-image-fit, cover);
    display: block;
}
.hpb-section .hpb-carousel.hpb-cr-hc.hpb-cr-ratio-32 .hpb-cr-card img,
.hpb-section .hpb-carousel.hpb-cr-hc.hpb-cr-ratio-32 .hpb-cr-img-link .hpb-img-fallback { aspect-ratio: 3 / 2; }
.hpb-section .hpb-carousel.hpb-cr-hc.hpb-cr-ratio-43 .hpb-cr-card img,
.hpb-section .hpb-carousel.hpb-cr-hc.hpb-cr-ratio-43 .hpb-cr-img-link .hpb-img-fallback { aspect-ratio: 4 / 3; }
.hpb-section .hpb-carousel.hpb-cr-hc.hpb-cr-ratio-11 .hpb-cr-card img,
.hpb-section .hpb-carousel.hpb-cr-hc.hpb-cr-ratio-11 .hpb-cr-img-link .hpb-img-fallback { aspect-ratio: 1 / 1; }
.hpb-section .hpb-carousel.hpb-cr-hc .hpb-cr-cap-hero {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 44px 20px 16px;
    background: linear-gradient(180deg, rgba(11, 30, 51, 0) 0%, rgba(11, 30, 51, .9) 72%);
    color: #ffffff;
}
.hpb-section .hpb-carousel.hpb-cr-hc .hpb-cr-cap-hero .cat-badge-gold { font-size: 11px; }
.hpb-section .hpb-carousel.hpb-cr-hc .hpb-cr-cap-hero h3 {
    font-size: 21px;
    font-weight: 800;
    line-height: 1.45;
    margin: 8px 0 4px;
}
.hpb-section .hpb-carousel.hpb-cr-hc .hpb-cr-cap-hero h3 a { color: #ffffff; }
.hpb-section .hpb-carousel.hpb-cr-hc .hpb-cr-cap-hero h3 a:hover { color: var(--accent-gold, #d9822b); }
.hpb-section .hpb-carousel.hpb-cr-hc .hpb-cr-cap-hero p {
    font-size: 13px;
    line-height: 1.6;
    color: #e2e8f0;
    margin: 0 0 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hpb-section .hpb-carousel.hpb-cr-hc .hpb-cr-cap-hero .hpb-el-date { font-size: 12px; color: #cbd5e1; }

/* ---------- استجابة الأنواع الخمسة للهاتف واللوحي ---------- */
@media (max-width: 768px) {
    .hpb-section .hpb-carousel.hpb-cr-fi .hpb-cr-card img,
    .hpb-section .hpb-carousel.hpb-cr-fi .hpb-cr-img-link .hpb-img-fallback { aspect-ratio: 4 / 3; }
    .hpb-section .hpb-carousel.hpb-cr-fi .hpb-cr-cap { padding: 26px 12px 10px; }
    .hpb-section .hpb-carousel.hpb-cr-fi .hpb-cr-cap h3 { font-size: 14px; }
    .hpb-section .hpb-carousel.hpb-cr-fi .hpb-cr-cap p { display: none; }

    .hpb-section .hpb-carousel.hpb-cr-cp .hpb-cr-thumb { flex-basis: 74px; }
    .hpb-section .hpb-carousel.hpb-cr-cp .hpb-cr-thumb img,
    .hpb-section .hpb-carousel.hpb-cr-cp .hpb-cr-thumb .hpb-img-fallback { width: 74px; height: 52px; }
    .hpb-section .hpb-carousel.hpb-cr-cp .hpb-cr-info h3 { font-size: 12px; }

    .hpb-section .hpb-carousel.hpb-cr-tr .hpb-cr-card img,
    .hpb-section .hpb-carousel.hpb-cr-tr .hpb-cr-img-link .hpb-img-fallback { height: 84px; }
    .hpb-section .hpb-carousel.hpb-cr-tr .hpb-cr-body h3 { font-size: 12.5px; }

    .hpb-section .hpb-carousel.hpb-cr-nm .hpb-cr-num { min-width: 26px; height: 26px; font-size: 12px; border-radius: 7px; }
    .hpb-section .hpb-carousel.hpb-cr-nm .hpb-cr-card img,
    .hpb-section .hpb-carousel.hpb-cr-nm .hpb-cr-img-link .hpb-img-fallback { height: 92px; }

    .hpb-section .hpb-carousel.hpb-cr-hc .hpb-cr-card img,
    .hpb-section .hpb-carousel.hpb-cr-hc .hpb-cr-img-link .hpb-img-fallback { aspect-ratio: 4 / 3; }
    .hpb-section .hpb-carousel.hpb-cr-hc .hpb-cr-cap-hero { padding: 30px 14px 12px; }
    .hpb-section .hpb-carousel.hpb-cr-hc .hpb-cr-cap-hero h3 { font-size: 15.5px; }
    .hpb-section .hpb-carousel.hpb-cr-hc .hpb-cr-cap-hero p { display: none; }
}

/* v3.7.1 — توازن بصري إضافي للأقسام التحريرية دون تغيير إعداداتها المحفوظة */
.hpb-section .hpb-picks-lead,
.hpb-section .hpb-topic-card,
.hpb-section .hpb-discussion-card { box-shadow: 0 3px 14px rgba(11, 30, 51, .045); }
.hpb-section .hpb-picks-lead-body h3,
.hpb-section .hpb-picks-item-body h3,
.hpb-section .hpb-topic-name,
.hpb-section .hpb-discussion-body h3 {
    overflow-wrap: anywhere;
    text-wrap: balance;
}
.hpb-section .hpb-picks-lead:focus-within,
.hpb-section .hpb-topic-card:focus-visible,
.hpb-section .hpb-discussion-card:focus-within {
    transform: translateY(-2px);
    border-color: var(--primary-blue, #15406b);
    box-shadow: var(--ajp-focus-ring, 0 0 0 3px rgba(21, 105, 190, .28)), var(--ajp-shadow-hover, 0 12px 28px rgba(11, 30, 51, .13));
}
.hpb-section .hpb-picks-item-body h3 a,
.hpb-section .hpb-topic-name,
.hpb-section .hpb-discussion-body h3 a { text-underline-offset: 4px; }
body.dark-mode .hpb-section .hpb-picks-lead,
body.dark-mode .hpb-section .hpb-topic-card,
body.dark-mode .hpb-section .hpb-discussion-card { box-shadow: 0 4px 18px rgba(0, 0, 0, .16); }
@media (prefers-reduced-motion: reduce) {
    .hpb-section .hpb-picks-lead,
    .hpb-section .hpb-topic-card,
    .hpb-section .hpb-discussion-card { transition: none !important; }
}
