/* Jannah Child custom blocks - scoped styles only */
.jcb-block{width:100%;max-width:100%;min-width:0;overflow:hidden}
.jcb-block .jcb-items{width:100%;max-width:100%;min-width:0;display:grid;gap:18px;align-items:stretch}
.jcb-block .jcb-card{position:relative;min-width:0;max-width:100%;overflow:hidden;background:#fff;border:1px solid #eee6ec;border-radius:14px;box-shadow:0 3px 14px rgba(58,34,48,.045);transition:transform .2s ease,box-shadow .2s ease}
.jcb-block .jcb-card:hover{transform:translateY(-3px);box-shadow:0 10px 25px rgba(58,34,48,.10)}
.jcb-block .jcb-image{display:block!important;position:relative!important;width:100%!important;height:auto!important;aspect-ratio:16/9;overflow:hidden;background:#f5eaf0;line-height:0;max-height:470px}
.jcb-block .jcb-image img{display:block!important;position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:cover!important;object-position:center;transition:transform .3s ease}
.jcb-block .jcb-card:hover .jcb-image img{transform:scale(1.035)}
.jcb-block .jcb-placeholder{display:block;width:100%;height:100%;background:linear-gradient(135deg,#f6dfe8,#eee5f8)}
.jcb-block .jcb-card-body{min-width:0;padding:13px 15px 15px}
	.jcb-block .jcb-category{display:inline-block;padding: 3px 8px;margin-bottom: 5px;border-radius: 999px;background: #fbf0f5;color:#b9547b;font-size:12px;font-weight:700;text-decoration:none}
.jcb-block .jcb-title{font-size:16px;line-height:1.65;font-weight:700;margin:0 0 5px;overflow-wrap:anywhere}
.jcb-block .jcb-title a{color:inherit;text-decoration:none}
.jcb-block .jcb-title a:hover{color:#c35c82}
.jcb-block .jcb-excerpt{font-size:13px;line-height:1.8;color:#77717a;margin:5px 0 8px}
.jcb-block .jcb-meta{font-size:11px;color:#999;margin-top:6px}
.jcb-block .jcb-read-more{display:inline-flex;gap:7px;align-items:center;margin-top:8px;color:#b84f78;font-size:12px;font-weight:700;text-decoration:none}
.jcb-block .jcb-read-more:hover{text-decoration:underline}

/* 1. Compact responsive news grid */
.jcb-news-grid .jcb-items{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.jcb-news-grid .jcb-image{aspect-ratio:390/220;max-height:220px}
.jcb-news-grid .jcb-card-body{padding:12px 13px}

/* 2. Hero feature: one wide article, image and text side by side */
.jcb-featured .jcb-items{grid-template-columns:1fr}
.jcb-featured .jcb-card{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);align-items:stretch;background:#2d2338;color:#fff;border:0}
.jcb-featured .jcb-image{height:100%;min-height:270px;aspect-ratio:auto}
.jcb-featured .jcb-card-body{padding:clamp(20px,3vw,34px);display:flex;flex-direction:column;justify-content:center}
.jcb-featured .jcb-category{color:#f5a9c2}
.jcb-featured .jcb-title{font-size:clamp(21px,2.4vw,30px);line-height:1.45}
.jcb-featured .jcb-excerpt{color:#e5dce7;font-size:14px}
.jcb-featured .jcb-meta{color:#c9bdcc}
.jcb-featured .jcb-read-more{color:#ffc2d4}

/* 3. Magazine split: large lead card and compact side stories */
.jcb-split .jcb-items{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);grid-template-rows:repeat(3,minmax(0,1fr));gap:12px}
.jcb-split .jcb-card:first-child{grid-row:span 3}
.jcb-split .jcb-card:first-child .jcb-image{aspect-ratio:16/10;max-height:390px}
.jcb-split .jcb-card:first-child .jcb-title{font-size:21px}
.jcb-split .jcb-card:not(:first-child){display:grid;grid-template-columns:112px minmax(0,1fr);align-items:center}
.jcb-split .jcb-card:not(:first-child) .jcb-image{height:100%!important;min-height:0;aspect-ratio:1/1;max-height:112px}
.jcb-split .jcb-card:not(:first-child) .jcb-card-body{padding:8px 11px}
.jcb-split .jcb-card:not(:first-child) .jcb-excerpt,.jcb-split .jcb-card:not(:first-child) .jcb-meta{display:none}

/* 4. Horizontal list with small thumbnails */
.jcb-article-list .jcb-items{grid-template-columns:1fr;gap:9px}
.jcb-article-list .jcb-card{display:grid;grid-template-columns:116px minmax(0,1fr);align-items:center;border-radius:10px;box-shadow:none;border-inline-start:3px solid #e8b6c8}
.jcb-article-list .jcb-image{grid-column:1;grid-row:1;aspect-ratio:4/3;height:86px}
.jcb-article-list .jcb-card-body{grid-column:2;grid-row:1;padding:8px 13px}
.jcb-article-list .jcb-title{font-size:15px}
.jcb-article-list .jcb-meta{margin-top:3px}

/* 5. Pregnancy stages: horizontal week/article journey */
.jcb-stages .jcb-items{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.jcb-stages .jcb-card{padding:14px 12px 12px;border-radius:18px;background:#fbf7fc}
.jcb-stages .jcb-image{aspect-ratio:16/10;border-radius:11px}
.jcb-stages .jcb-stage-number{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:#8159a8;color:#fff;font-weight:800;font-size:13px;margin:10px 0 6px}
.jcb-stages .jcb-card:nth-child(3n+2) .jcb-stage-number{background:#d8799b}
.jcb-stages .jcb-card:nth-child(3n) .jcb-stage-number{background:#55a99c}
.jcb-stages .jcb-card-body{padding:0}
.jcb-stages .jcb-title{font-size:18px}
.jcb-stages .jcb-excerpt{font-size:14px}

/* 6. Nutrition: soft pastel editorial cards */
.jcb-nutrition .jcb-items{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.jcb-nutrition .jcb-card{display:grid;grid-template-columns:112px minmax(0,1fr);align-items:center;background:#fffaf7;border-color:#f2e6df}
.jcb-nutrition .jcb-image{height:100%;min-height:124px;aspect-ratio:1/1}
.jcb-nutrition .jcb-card-body{padding:11px 13px}
.jcb-nutrition .jcb-title{font-size:15px}
.jcb-nutrition .jcb-excerpt{font-size:12px}

/* 7. Health: vertical timeline */
.jcb-health .jcb-items{grid-template-columns:1fr;gap:0;max-width:900px;margin-inline:auto}
.jcb-health .jcb-card{display:grid;grid-template-columns:42px minmax(0,1fr);border:0;border-radius:0;box-shadow:none;background:transparent;overflow:visible}
.jcb-health .jcb-card:before{content:"";grid-column:1;grid-row:1/3;justify-self:center;width:2px;background:#ead7e2}
.jcb-health .jcb-card:after{content:"";position:absolute;top:19px;inset-inline-start:12px;width:12px;height:12px;border-radius:50%;background:#c86b91;border:3px solid #f8eaf0}
.jcb-health .jcb-image{display:none}
.jcb-health .jcb-card-body{grid-column:2;background:#fff;border:1px solid #f0e5eb;border-radius:12px;padding:12px 16px;margin:0 0 12px}
.jcb-health .jcb-title{font-size:16px}
.jcb-health .jcb-excerpt{margin-bottom:0}

/* 8. Motherhood: magazine cover first, supporting stories after */
.jcb-motherhood .jcb-items{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.jcb-motherhood .jcb-card:first-child{grid-column:span 2;grid-row:span 2}
.jcb-motherhood .jcb-card:first-child .jcb-image{aspect-ratio:16/10}
.jcb-motherhood .jcb-card:first-child .jcb-title{font-size:21px}
.jcb-motherhood .jcb-card:not(:first-child) .jcb-image{aspect-ratio:5/3}
.jcb-motherhood .jcb-card:not(:first-child) .jcb-excerpt{display:none}

/* 9. FAQ accordion */
.jcb-faq .jcb-items{grid-template-columns:1fr;gap:9px;max-width:900px}
.jcb-faq .jcb-card{border-radius:12px;box-shadow:none}
.jcb-faq .jcb-card-body{padding:0}
.jcb-faq .jcb-faq-item{padding:13px 16px}
.jcb-faq .jcb-faq-item summary{cursor:pointer;list-style:none;font-size:15px;font-weight:700;display:flex;align-items:center;justify-content:space-between;gap:14px}
.jcb-faq .jcb-faq-item summary::-webkit-details-marker{display:none}
.jcb-faq .jcb-faq-item summary:after{content:"+";font-size:22px;color:#bd6286}
.jcb-faq .jcb-faq-item[open] summary:after{content:"−"}
.jcb-faq .jcb-faq-item .jcb-excerpt{padding-top:10px}

/* 10. Popular: editorial ranked list */
.jcb-popular .jcb-items{grid-template-columns:1fr;gap:0;max-width:900px}
.jcb-popular .jcb-card{display:grid;grid-template-columns:54px minmax(0,1fr);align-items:center;border:0;border-bottom:1px solid #eee5eb;border-radius:0;box-shadow:none;background:transparent}
.jcb-popular .jcb-rank{grid-column:1;grid-row:1;color:#d98aa7;font-size:29px;font-weight:900;text-align:center}
.jcb-popular .jcb-card-body{grid-column:2;grid-row:1;padding:12px}
.jcb-popular .jcb-title{font-size:16px}
.jcb-popular .jcb-category{margin-bottom:2px}

/* 11. Topic cards */
.jcb-categories .jcb-items{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.jcb-categories .jcb-card{background:linear-gradient(135deg,#fff7fa,#f7f2fb);border-color:#f1e3eb}
.jcb-categories .jcb-card-body{padding:18px 16px}
.jcb-categories .jcb-category{font-size:12px}
.jcb-categories .jcb-title{font-size:16px}
.jcb-categories .jcb-excerpt{font-size:12px}

/* 12. Daily tip quote */
.jcb-tip .jcb-items{grid-template-columns:1fr}
.jcb-tip .jcb-card{background:linear-gradient(120deg,#fff3f7,#f4effb);border:0;border-inline-start:4px solid #d9789d;border-radius:16px}
.jcb-tip .jcb-card-body{padding:clamp(18px,3vw,28px)}
.jcb-tip-label{display:block;color:#bd6286;font-size:12px;font-weight:800;margin-bottom:8px}
.jcb-tip-quote{font-size:clamp(17px,2vw,22px);font-weight:700;line-height:1.8;margin:0;color:#453849}

/* 13. Article ticker */
.jcb-ticker{background:#33283a;border-radius:12px;color:#fff;padding:8px 12px}
.jcb-ticker .jcb-items{display:flex;gap:12px;overflow:hidden;white-space:nowrap}
.jcb-ticker .jcb-card{flex:0 0 auto;display:flex;gap:9px;align-items:center;background:transparent;border:0;box-shadow:none;color:#fff}
.jcb-ticker .jcb-card-body{display:flex;gap:9px;align-items:center;padding:4px 8px}
.jcb-ticker-category{color:#ffc1d4;font-size:11px;font-weight:800}
.jcb-ticker-title{color:#fff;text-decoration:none;font-size:13px;font-weight:600}
.jcb-ticker .jcb-meta{display:none}

/* 14. Image overlay cards */
.jcb-overlay .jcb-items{grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}
.jcb-overlay .jcb-card{border:0;border-radius:14px}
.jcb-overlay .jcb-image{aspect-ratio:4/3}
.jcb-overlay .jcb-card-body{position:absolute;inset:auto 0 0;padding:34px 13px 12px;background:linear-gradient(transparent,rgba(27,18,34,.88));color:#fff}
.jcb-overlay .jcb-category{color:#ffd0df}
.jcb-overlay .jcb-title{font-size:15px;color:#fff;margin:0}
.jcb-overlay .jcb-title a{color:#fff}
.jcb-overlay .jcb-meta,.jcb-overlay .jcb-excerpt{display:none}

@media(max-width:900px){
 .jcb-news-grid .jcb-items,.jcb-categories .jcb-items,.jcb-overlay .jcb-items{grid-template-columns:repeat(2,minmax(0,1fr))}
 .jcb-stages .jcb-items{grid-template-columns:repeat(2,minmax(0,1fr))}
 .jcb-split .jcb-items{grid-template-columns:1fr 1fr;grid-template-rows:auto}
 .jcb-split .jcb-card:first-child{grid-column:span 2;grid-row:auto}
 .jcb-split .jcb-card:not(:first-child){grid-template-columns:90px minmax(0,1fr)}
 .jcb-motherhood .jcb-items{grid-template-columns:repeat(2,minmax(0,1fr))}
 .jcb-motherhood .jcb-card:first-child{grid-column:span 2;grid-row:auto}
 .jcb-featured .jcb-card{grid-template-columns:1fr 1fr}
}
@media(max-width:600px){
 .jcb-block .jcb-items{gap:11px}
 .jcb-news-grid .jcb-items,.jcb-categories .jcb-items,.jcb-overlay .jcb-items{grid-template-columns:repeat(2,minmax(0,1fr))}
 .jcb-news-grid .jcb-title,.jcb-categories .jcb-title,.jcb-overlay .jcb-title{font-size:13px}
 .jcb-featured .jcb-card{grid-template-columns:1fr}
 .jcb-featured .jcb-image{min-height:0;aspect-ratio:16/9}
 .jcb-featured .jcb-card-body{padding:16px}
 .jcb-featured .jcb-title{font-size:20px}
 .jcb-split .jcb-items{grid-template-columns:1fr}
 .jcb-split .jcb-card:first-child{grid-column:auto}
 .jcb-split .jcb-card:not(:first-child){grid-template-columns:92px minmax(0,1fr)}
 .jcb-article-list .jcb-card{grid-template-columns:92px minmax(0,1fr)}
 .jcb-article-list .jcb-image{height:76px}
 .jcb-stages .jcb-items{grid-template-columns:repeat(2,minmax(0,1fr))}
 .jcb-nutrition .jcb-items{grid-template-columns:1fr}
 .jcb-nutrition .jcb-card{grid-template-columns:100px minmax(0,1fr)}
 .jcb-motherhood .jcb-items{grid-template-columns:1fr 1fr}
 .jcb-motherhood .jcb-card:first-child{grid-column:span 2}
}
@media(max-width:380px){
 .jcb-news-grid .jcb-items,.jcb-categories .jcb-items,.jcb-overlay .jcb-items{grid-template-columns:1fr}
 .jcb-stages .jcb-items{grid-template-columns:1fr}
 .jcb-block .jcb-title{font-size:14px}
}
@media(prefers-reduced-motion:reduce){.jcb-block *{transition:none!important}}

/* Image sizing follows Jannah's registered image-large (390x220) and image-post (780x470) sizes. */
.jcb-block .jcb-image{contain:layout paint}
.jcb-block .jcb-image img{object-fit:cover!important}
@media(max-width:767px){
    .jcb-news-grid .jcb-image{aspect-ratio:390/220;max-height:220px}
    .jcb-split .jcb-card:first-child .jcb-image{aspect-ratio:16/10;max-height:300px}
    .jcb-split .jcb-card:not(:first-child) .jcb-image{max-height:90px}
}


/* Half-width custom blocks: consecutive blocks are paired by the front-end helper. */
.jcb-half-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;align-items:start;width:100%;clear:both}
.jcb-half-row>.mag-box.jcb-half-block{float:none!important;width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important;padding-inline:0!important;}
.jcb-half-row>.mag-box.jcb-half-block .mag-box-container{min-width:0;}
.jcb-half-row>.mag-box.jcb-half-block .jcb-items{min-width:0;}
@media(max-width:767px){.jcb-half-row{grid-template-columns:minmax(0,1fr);gap:18px}}

/* Redesigned custom article grid: two balanced horizontal columns. */
.jcb-news-grid .jcb-items{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.jcb-news-grid .jcb-card{display:flex;flex-direction:column;min-height:0}
.jcb-news-grid .jcb-image{height:auto;min-height:0;aspect-ratio:16/9;max-height:220px}
.jcb-news-grid .jcb-card-body{padding:12px 14px}
.jcb-news-grid .jcb-title{font-size:15px;line-height:1.6}
.jcb-news-grid .jcb-excerpt{font-size:12px;line-height:1.65;margin:4px 0}
.jcb-half-row .jcb-news-grid .jcb-items{grid-template-columns:1fr}
@media(max-width:767px){
 .jcb-news-grid .jcb-items{grid-template-columns:1fr;gap:12px}
 .jcb-news-grid .jcb-title{font-size:14px}
}


/* =========================================================
   Jannah Child Blocks — Dark mode
   يعتمد على محدد القالب: html.dark-skin
   لا يغيّر تصميم الوضع الفاتح.
   ========================================================= */

/* الألوان العامة للبطاقات */
html.dark-skin .jcb-block .jcb-card {
    background-color: #282033;
    color: #eee8f2;
    border-color: #493b55;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .18);
}

html.dark-skin .jcb-block .jcb-title,
html.dark-skin .jcb-block .jcb-title a {
    color: #f3edf6;
}

html.dark-skin .jcb-block .jcb-title a:hover,
html.dark-skin .jcb-block .jcb-category,
html.dark-skin .jcb-block .jcb-read-more {
    color: #f2a6c5;
}

html.dark-skin .jcb-block .jcb-excerpt {
    color: #c7bdce;
}

html.dark-skin .jcb-block .jcb-meta {
    color: #aaa0b4;
}

/* بطاقات المراحل */
html.dark-skin .jcb-stages .jcb-card {
    background: #241b40;
    border-color: #4b3b57;
}

/* بطاقات التغذية */
html.dark-skin .jcb-nutrition .jcb-card {
    background: #211a3b;
    border-color: #51404b;
}

/* المخطط الزمني الصحي */
html.dark-skin .jcb-health .jcb-card-body {
    background: #2b2235;
    border-color: #4b3b55;
}

html.dark-skin .jcb-health .jcb-card:before {
    background: #59445e;
}

html.dark-skin .jcb-health .jcb-card:after {
    border-color: #35283d;
}

/* بطاقات التصنيفات */
html.dark-skin .jcb-categories .jcb-card {
    background: linear-gradient(135deg, #30243b, #29243a);
    border-color: #4b3b55;
}

/* بطاقة النصيحة */
html.dark-skin .jcb-tip .jcb-card {
    background: linear-gradient(120deg, #352536, #2b2540);
    border-inline-start-color: #d9789d;
}

html.dark-skin .jcb-tip-quote {
    color: #f0e8f2;
}

/* القوائم الشائعة */
html.dark-skin .jcb-popular .jcb-card {
    border-bottom-color: #493b55;
}

/* الشبكة والمحتوى العام */
html.dark-skin .jcb-block .jcb-placeholder {
    background: linear-gradient(135deg, #3a2d43, #302b48);
}

/* ألوان النصوص داخل البطاقات ذات الخلفيات الداكنة الثابتة */
html.dark-skin .jcb-featured .jcb-card,
html.dark-skin .jcb-ticker,
html.dark-skin .jcb-overlay .jcb-card {
    color: #fff;
}

html.dark-skin .jcb-featured .jcb-title,
html.dark-skin .jcb-featured .jcb-title a,
html.dark-skin .jcb-ticker .jcb-title,
html.dark-skin .jcb-overlay .jcb-title,
html.dark-skin .jcb-overlay .jcb-title a {
    color: #fff;
}

/* =========================================================
   Unified finishing layer: article separators, CTA buttons,
   RTL-safe spacing, and complete Jannah dark-skin support.
   ========================================================= */
.jcb-block .jcb-read-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    width: fit-content;
    max-width: 100%;
    margin-top: 12px;
    padding: 8px 16px;
    border: 1px solid #d9789d;
    border-radius: 999px;
    background: #d9789d;
    color: #fff !important;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 700;
    text-decoration: none !important;
    transition: background-color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.jcb-block .jcb-read-more:hover,
.jcb-block .jcb-read-more:focus-visible {
    background: #bd5d83;
    border-color: #bd5d83;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(189, 93, 131, .22);
    outline: none;
}
.jcb-block .jcb-read-more span[aria-hidden="true"] { line-height: 1; }

/* Delicate editorial separators for list-like layouts. */
.jcb-article-list .jcb-card,
.jcb-popular .jcb-card {
    position: relative;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}
.jcb-article-list .jcb-card:not(:last-child)::after,
.jcb-popular .jcb-card:not(:last-child)::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e8cbd8 12%, #e8cbd8 88%, transparent);
}
.jcb-article-list .jcb-card { padding-block: 5px; }
.jcb-article-list .jcb-card-body { padding-block: 10px; }
.jcb-popular .jcb-card { border-bottom: 0; }
.jcb-popular .jcb-card-body { padding-block: 15px; }

/* Prevent long Arabic words and titles from breaking card geometry. */
.jcb-block .jcb-card-body,
.jcb-block .jcb-title,
.jcb-block .jcb-title a,
.jcb-block .jcb-excerpt { min-width: 0; overflow-wrap: anywhere; }
.jcb-block .jcb-title { text-wrap: pretty; }
.jcb-block .jcb-image img { vertical-align: middle; }
.jcb-block .jcb-faq-item summary { line-height: 1.8; }
.jcb-block .jcb-faq-item .jcb-read-more { margin-top: 12px; }

/* Consistent focus visibility for keyboard users. */
.jcb-block a:focus-visible,
.jcb-block summary:focus-visible {
    outline: 2px solid #d9789d;
    outline-offset: 3px;
    border-radius: 5px;
}

/* Dark mode: Jannah toggles the html element with .dark-skin. */
html.dark-skin .jcb-block,
html.dark-skin .jcb-block .jcb-items { color: #eee8f2; }
html.dark-skin .jcb-block .jcb-card {
    background-color: #292233;
    color: #eee8f2;
    border-color: #493d55;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .2);
}
html.dark-skin .jcb-block .jcb-title,
html.dark-skin .jcb-block .jcb-title a { color: #f4edf6; }
html.dark-skin .jcb-block .jcb-title a:hover,
html.dark-skin .jcb-block .jcb-category { color: #f1a9c5; }
html.dark-skin .jcb-block .jcb-excerpt { color: #c9bfce; }
html.dark-skin .jcb-block .jcb-meta { color: #aaa0b3; }
html.dark-skin .jcb-block .jcb-placeholder { background: linear-gradient(135deg, #403247, #302b45); }
html.dark-skin .jcb-article-list .jcb-card,
html.dark-skin .jcb-popular .jcb-card { background: transparent; }
html.dark-skin .jcb-article-list .jcb-card:not(:last-child)::after,
html.dark-skin .jcb-popular .jcb-card:not(:last-child)::after {
    background: linear-gradient(90deg, transparent, #594454 12%, #594454 88%, transparent);
}
html.dark-skin .jcb-block .jcb-read-more {
    background: #d9789d;
    border-color: #d9789d;
    color: #211923 !important;
}
html.dark-skin .jcb-block .jcb-read-more:hover,
html.dark-skin .jcb-block .jcb-read-more:focus-visible {
    background: #ee94b4;
    border-color: #ee94b4;
    color: #211923 !important;
}
html.dark-skin .jcb-stages .jcb-card { background: #29213a; border-color: #4b3d58; }
html.dark-skin .jcb-nutrition .jcb-card { background: #292233; border-color: #4b3d55; }
html.dark-skin .jcb-health .jcb-card-body { background: #30263a; border-color: #504158; }
html.dark-skin .jcb-health .jcb-card:before { background: #59465e; }
html.dark-skin .jcb-health .jcb-card:after { border-color: #30263a; }
html.dark-skin .jcb-categories .jcb-card { background: linear-gradient(135deg, #33283d, #29253a); border-color: #514257; }
html.dark-skin .jcb-tip .jcb-card { background: linear-gradient(120deg, #392936, #2d2942); border-inline-start-color: #d9789d; }
html.dark-skin .jcb-tip-quote { color: #f2eaf3; }
html.dark-skin .jcb-featured .jcb-card,
html.dark-skin .jcb-ticker,
html.dark-skin .jcb-overlay .jcb-card { background-color: #30263a; color: #fff; }
html.dark-skin .jcb-featured .jcb-title,
html.dark-skin .jcb-featured .jcb-title a,
html.dark-skin .jcb-overlay .jcb-title,
html.dark-skin .jcb-overlay .jcb-title a,
html.dark-skin .jcb-ticker-title { color: #fff; }
html.dark-skin .jcb-featured .jcb-excerpt { color: #e0d5e4; }
html.dark-skin .jcb-featured .jcb-meta { color: #c5b8ca; }
html.dark-skin .jcb-faq .jcb-card { background: #292233; border-color: #493d55; }
html.dark-skin .jcb-faq .jcb-faq-item summary { color: #f1eaf4; }
html.dark-skin .jcb-faq .jcb-faq-item .jcb-excerpt { color: #c9bfce; }
html.dark-skin .jcb-ticker { border: 1px solid #514257; }

/* Half-width blocks: keep each pair balanced and prevent child theme floats. */
.jcb-half-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; width: 100%; clear: both; }
.jcb-half-row > .mag-box.jcb-half-block,
.jcb-half-row > .mag-box.jcb-half-block-unpaired {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
}
.jcb-half-row > .mag-box.jcb-half-block .mag-box-container { min-width: 0; }
@media (max-width: 767px) {
    .jcb-half-row { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .jcb-block .jcb-read-more,
    .jcb-block .jcb-card,
    .jcb-block .jcb-image img { transition: none !important; }
}



/* =========================================================
   JCB News Grid — Editorial redesign (existing block only)
   Keeps Jannah's native .mag-box heading and global box styles.
   ========================================================= */
.jcb-news-grid {
    --jcb-grid-accent: #d9789d;
    --jcb-grid-accent-strong: #bd5d83;
    --jcb-grid-text: #302735;
    --jcb-grid-muted: #817783;
    --jcb-grid-card: #ffffff;
    --jcb-grid-border: #eee4eb;
}
.jcb-news-grid .jcb-items {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(168px, auto);
    gap: 16px;
    align-items: stretch;
}
.jcb-news-grid .jcb-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--jcb-grid-border);
    border-radius: 17px;
    background: var(--jcb-grid-card);
    color: var(--jcb-grid-text);
    box-shadow: 0 5px 18px rgba(53, 34, 48, .055);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.jcb-news-grid .jcb-card:hover {
    transform: translateY(-3px);
    border-color: rgba(217, 120, 157, .42);
    box-shadow: 0 12px 28px rgba(53, 34, 48, .11);
}

/* Lead story: larger editorial card occupying two columns and two rows. */
.jcb-news-grid .jcb-card:first-child {
    grid-column: span 2;
    grid-row: span 2;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    align-items: stretch;
    min-height: 352px;
}
.jcb-news-grid .jcb-card:first-child .jcb-image {
    height: 100% !important;
    min-height: 100%;
    max-height: none;
    aspect-ratio: auto;
    border-radius: 0;
    background: #f4e9ef;
}
.jcb-news-grid .jcb-card:first-child .jcb-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: clamp(17px, 2.1vw, 27px);
}
.jcb-news-grid .jcb-card:first-child .jcb-category {
    padding: 5px 10px;
    border-radius: 999px;
    background: #fbedf3;
    color: #b9547b;
    font-size: 11px;
    margin-bottom: 11px;
}
.jcb-news-grid .jcb-card:first-child .jcb-title {
    font-size: clamp(19px, 2vw, 25px);
    line-height: 1.55;
    margin-bottom: 9px;
}
.jcb-news-grid .jcb-card:first-child .jcb-excerpt {
    font-size: 13px;
    line-height: 1.9;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 12px;
}
.jcb-news-grid .jcb-card:first-child .jcb-meta {
    margin-top: 0;
    margin-bottom: 8px;
}

/* Supporting stories. */
.jcb-news-grid .jcb-card:not(:first-child) .jcb-image {
    flex: 0 0 auto;
    aspect-ratio: 16 / 9;
    height: auto !important;
    min-height: 0;
    max-height: 174px;
}
.jcb-news-grid .jcb-card:not(:first-child) .jcb-card-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px 14px;
}
.jcb-news-grid .jcb-card:not(:first-child) .jcb-category {
    display: inline-flex;
    padding: 3px 8px;
    margin-bottom: 5px;
    border-radius: 999px;
    background: #fbf0f5;
    color: #b9547b;
    font-size: 12px;
    font-weight:700;
}
.jcb-news-grid .jcb-card:not(:first-child) .jcb-title {
    font-size: 18px;
    line-height: 1.65;
    margin: 0 0 5px;
}
.jcb-news-grid .jcb-card:not(:first-child) .jcb-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.7;
    margin: 0 0 7px;
}
.jcb-news-grid .jcb-card:not(:first-child) .jcb-meta {
    margin-top: auto;
    padding-top: 4px;
}

/* CTA button: consistent placement and appearance in every card. */
.jcb-news-grid .jcb-read-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 35px;
    margin-top: 10px;
    padding: 7px 14px;
    border: 1px solid var(--jcb-grid-accent);
    border-radius: 999px;
    background: var(--jcb-grid-accent);
    color: #fff !important;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 700;
    text-decoration: none !important;
    transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.jcb-news-grid .jcb-read-more:hover,
.jcb-news-grid .jcb-read-more:focus-visible {
    background: var(--jcb-grid-accent-strong);
    border-color: var(--jcb-grid-accent-strong);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 5px 13px rgba(189, 93, 131, .2);
}
.jcb-news-grid .jcb-read-more:focus-visible {
    outline: 2px solid var(--jcb-grid-accent);
    outline-offset: 3px;
}

/* Tablet: lead card spans the row, supporting cards use two columns. */
@media (max-width: 900px) {
    .jcb-news-grid .jcb-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: auto;
        gap: 14px;
    }
    .jcb-news-grid .jcb-card:first-child {
        grid-column: 1 / -1;
        grid-row: auto;
        min-height: 270px;
    }
    .jcb-news-grid .jcb-card:not(:first-child) .jcb-image {
        max-height: 190px;
    }
}

/* Mobile: compact horizontal story cards; lead story remains visual-first. */
@media (max-width: 600px) {
    .jcb-news-grid .jcb-items {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }
    .jcb-news-grid .jcb-card:first-child {
        grid-column: auto;
        grid-row: auto;
        display: flex;
        min-height: 0;
    }
    .jcb-news-grid .jcb-card:first-child .jcb-image {
        height: auto !important;
        min-height: 0;
        aspect-ratio: 16 / 9;
        max-height: 235px;
    }
    .jcb-news-grid .jcb-card:first-child .jcb-card-body {
        padding: 14px 15px 16px;
    }
    .jcb-news-grid .jcb-card:first-child .jcb-title {
        font-size: 18px;
    }
    .jcb-news-grid .jcb-card:not(:first-child) {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
        align-items: stretch;
        min-height: 116px;
    }
    .jcb-news-grid .jcb-card:not(:first-child) .jcb-image {
        grid-column: 1;
        grid-row: 1;
        width: 112px !important;
        height: 100% !important;
        min-height: 116px;
        max-height: none;
        aspect-ratio: auto;
    }
    .jcb-news-grid .jcb-card:not(:first-child) .jcb-card-body {
        grid-column: 2;
        grid-row: 1;
        padding: 10px 12px;
    }
    .jcb-news-grid .jcb-card:not(:first-child) .jcb-excerpt {
        -webkit-line-clamp: 2;
    }
    .jcb-news-grid .jcb-card:not(:first-child) .jcb-read-more {
        min-height: 31px;
        padding: 5px 11px;
        margin-top: 7px;
    }
}
@media (max-width: 380px) {
    .jcb-news-grid .jcb-card:not(:first-child) {
        grid-template-columns: 92px minmax(0, 1fr);
    }
    .jcb-news-grid .jcb-card:not(:first-child) .jcb-image {
        width: 92px !important;
    }
    .jcb-news-grid .jcb-card:not(:first-child) .jcb-title {
        font-size: 18px;
    }
}

/* Jannah dark skin: explicitly restyle the redesigned grid, without touching
   the native block heading controlled by blocks_style in the theme. */
html.dark-skin .jcb-news-grid {
    --jcb-grid-text: #f0eaf3;
    --jcb-grid-muted: #b9adbf;
    --jcb-grid-card: #292233;
    --jcb-grid-border: #4a3b54;
}
html.dark-skin .jcb-news-grid .jcb-card {
    background: var(--jcb-grid-card);
    color: var(--jcb-grid-text);
    border-color: var(--jcb-grid-border);
    box-shadow: 0 5px 18px rgba(0, 0, 0, .2);
}
html.dark-skin .jcb-news-grid .jcb-card:hover {
    border-color: #98617c;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .3);
}
html.dark-skin .jcb-news-grid .jcb-title,
html.dark-skin .jcb-news-grid .jcb-title a {
    color: #f4edf6;
}
html.dark-skin .jcb-news-grid .jcb-title a:hover {
    color: #f2a6c5;
}
html.dark-skin .jcb-news-grid .jcb-excerpt {
    color: #c9bfce;
}
html.dark-skin .jcb-news-grid .jcb-meta {
    color: #a99eaf;
}
html.dark-skin .jcb-news-grid .jcb-category {
    background: #493044;
    color: #f2a6c5;
}
html.dark-skin .jcb-news-grid .jcb-placeholder {
    background: linear-gradient(135deg, #403247, #302b45);
}
html.dark-skin .jcb-news-grid .jcb-read-more {
    background: #d9789d;
    border-color: #d9789d;
    color: #241b25 !important;
}
html.dark-skin .jcb-news-grid .jcb-read-more:hover,
html.dark-skin .jcb-news-grid .jcb-read-more:focus-visible {
    background: #ee94b4;
    border-color: #ee94b4;
    color: #241b25 !important;
}

/* =========================================================
   v2: distinct editorial grid + Discovery Path block
   ========================================================= */
/* شبكة المقالات: بطاقات متساوية فعلًا، دون بطاقة أولى مهيمنة. */
.jcb-news-grid .jcb-items {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}
.jcb-news-grid .jcb-card,
.jcb-news-grid .jcb-card-lead {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    grid-row: auto;
    grid-column: auto;
    transform: none;
}
.jcb-news-grid .jcb-image {
    aspect-ratio: 16 / 10;
    max-height: 230px;
    min-height: 0;
}
.jcb-news-grid .jcb-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 15px 16px;
}
.jcb-news-grid .jcb-title { font-size: 15px; line-height: 1.65; }
.jcb-news-grid .jcb-excerpt { font-size: 12px; line-height: 1.75; }
.jcb-news-grid .jcb-meta { margin-top: auto; padding-top: 8px; }
.jcb-news-grid .jcb-read-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    margin-top: 10px;
    padding: 7px 14px;
    border-radius: 999px;
    background: #d96f98;
    color: #fff;
    text-decoration: none;
    transition: background .2s ease, transform .2s ease;
}
.jcb-news-grid .jcb-read-more:hover { background: #bd527d; color: #fff; transform: translateY(-1px); }
.jcb-half-row .jcb-news-grid .jcb-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* اكتشفي المزيد: مسار تحريري عمودي ببطاقات متناوبة وترقيم متصل. */
.jcb-discovery .jcb-items {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 19px;
    padding-inline-start: 42px;
    isolation: isolate;
}
.jcb-discovery .jcb-items::before {
    content: "";
    position: absolute;
    inset-block: 18px 18px;
    inset-inline-start: 15px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(180deg, #e27ba2 0%, #b9a0dc 52%, #83b9bd 100%);
    opacity: .8;
    z-index: -1;
}
.jcb-discovery .jcb-card-discovery {
    display: grid;
    grid-template-columns: minmax(145px, 34%) minmax(0, 1fr);
    align-items: stretch;
    overflow: visible;
    min-height: 174px;
    border: 1px solid #eee2ed;
    border-radius: 19px;
    background: linear-gradient(115deg, #fff 0%, #fff 68%, #fcf4f8 100%);
    box-shadow: 0 7px 22px rgba(73, 43, 76, .07);
}
.jcb-discovery .jcb-card-discovery::before {
    content: "";
    position: absolute;
    inset-inline-start: -35px;
    top: 28px;
    width: 13px;
    height: 13px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #d96f98;
    box-shadow: 0 0 0 3px rgba(217,111,152,.18);
}
.jcb-discovery .jcb-card-discovery:nth-child(even) {
    grid-template-columns: minmax(0, 1fr) minmax(145px, 34%);
    background: linear-gradient(245deg, #fff 0%, #fff 68%, #f4f1fb 100%);
}
.jcb-discovery .jcb-card-discovery:nth-child(even) .jcb-image { grid-column: 2; grid-row: 1; }
.jcb-discovery .jcb-card-discovery:nth-child(even) .jcb-card-body { grid-column: 1; grid-row: 1; }
.jcb-discovery .jcb-card-discovery .jcb-image {
    height: 100% !important;
    min-height: 174px;
    max-height: none;
    aspect-ratio: auto;
    border-radius: 0 18px 18px 0;
}
.jcb-discovery .jcb-card-discovery:nth-child(even) .jcb-image { border-radius: 18px 0 0 18px; }
.jcb-discovery .jcb-card-discovery .jcb-card-body {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    padding: 18px 21px;
}
.jcb-discovery .jcb-discovery-index {
    position: absolute;
    inset-inline-end: 14px;
    top: -13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 39px;
    height: 27px;
    padding: 0 9px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #33234e;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    box-shadow: 0 4px 12px rgba(51,35,78,.2);
}
.jcb-discovery .jcb-discovery-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    color: #c15b84;
    font-size: 11px;
    font-weight: 800;
}
.jcb-discovery .jcb-discovery-kicker::before {
    content: "";
    width: 17px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}
.jcb-discovery .jcb-title { font-size: 17px; line-height: 1.55; }
.jcb-discovery .jcb-excerpt { margin: 5px 0 7px; font-size: 12px; line-height: 1.75; }
.jcb-discovery .jcb-meta { margin-top: auto; padding-top: 5px; }
.jcb-discovery .jcb-read-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 34px;
    margin-top: 9px;
    padding: 7px 15px;
    border-radius: 999px;
    background: linear-gradient(100deg, #d96f98, #b66db1);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 5px 13px rgba(194,91,137,.2);
    transition: transform .2s ease, box-shadow .2s ease;
}
.jcb-discovery .jcb-read-more:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 8px 17px rgba(194,91,137,.27); }

/* Dark mode — scoped to Jannah's html.dark-skin switch. */
html.dark-skin .jcb-discovery .jcb-card-discovery {
    background: linear-gradient(115deg, #292136 0%, #292136 68%, #33263e 100%);
    border-color: #4a3b56;
    box-shadow: 0 8px 22px rgba(0,0,0,.2);
}
html.dark-skin .jcb-discovery .jcb-card-discovery:nth-child(even) {
    background: linear-gradient(245deg, #292136 0%, #292136 68%, #30263e 100%);
}
html.dark-skin .jcb-discovery .jcb-discovery-index { border-color: #292136; background: #e07ca2; color: #241a2c; }
html.dark-skin .jcb-discovery .jcb-discovery-kicker { color: #efa1bf; }
html.dark-skin .jcb-discovery .jcb-items::before { opacity: .65; }
html.dark-skin .jcb-discovery .jcb-card-discovery::before { border-color: #292136; }
html.dark-skin .jcb-news-grid .jcb-read-more { background: #d96f98; color: #fff; }

@media (max-width: 900px) {
    .jcb-news-grid .jcb-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .jcb-half-row .jcb-news-grid .jcb-items { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .jcb-news-grid .jcb-items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .jcb-news-grid .jcb-card-body { padding: 11px 12px 13px; }
    .jcb-news-grid .jcb-title { font-size: 13px; }
    .jcb-news-grid .jcb-excerpt { font-size: 11px; }
    .jcb-discovery .jcb-items { padding-inline-start: 29px; gap: 14px; }
    .jcb-discovery .jcb-items::before { inset-inline-start: 10px; }
    .jcb-discovery .jcb-card-discovery { grid-template-columns: 112px minmax(0, 1fr); min-height: 145px; }
    .jcb-discovery .jcb-card-discovery:nth-child(even) { grid-template-columns: minmax(0, 1fr) 112px; }
    .jcb-discovery .jcb-card-discovery .jcb-image { min-height: 145px; }
    .jcb-discovery .jcb-card-discovery .jcb-card-body { padding: 13px 14px; }
    .jcb-discovery .jcb-title { font-size: 14px; }
    .jcb-discovery .jcb-excerpt { font-size: 11px; line-height: 1.6; }
    .jcb-discovery .jcb-card-discovery::before { inset-inline-start: -25px; width: 10px; height: 10px; }
}
@media (max-width: 420px) {
    .jcb-news-grid .jcb-items { grid-template-columns: 1fr; }
    .jcb-news-grid .jcb-image { max-height: none; }
    .jcb-discovery .jcb-card-discovery,
    .jcb-discovery .jcb-card-discovery:nth-child(even) { grid-template-columns: 1fr; }
    .jcb-discovery .jcb-card-discovery .jcb-image,
    .jcb-discovery .jcb-card-discovery:nth-child(even) .jcb-image { grid-column: 1; grid-row: 1; min-height: 0; aspect-ratio: 16 / 8; border-radius: 17px 17px 0 0; }
    .jcb-discovery .jcb-card-discovery .jcb-card-body,
    .jcb-discovery .jcb-card-discovery:nth-child(even) .jcb-card-body { grid-column: 1; grid-row: 2; }
}


/* =========================================================
   JCB compatibility and final layout layer
   This layer intentionally comes last to neutralize older
   first-card/lead-card rules in this same stylesheet.
   ========================================================= */

/* The custom news grid is one layout in full and half widths:
   equal cards, no oversized first article. */
.jcb-news-grid .jcb-items {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-auto-rows: 1fr;
    gap: 17px;
    align-items: stretch;
}
.jcb-news-grid .jcb-items > .jcb-card,
.jcb-news-grid .jcb-items > .jcb-card:first-child,
.jcb-news-grid .jcb-items > .jcb-card-lead {
    display: flex !important;
    flex-direction: column !important;
    grid-column: auto !important;
    grid-row: auto !important;
    min-width: 0;
    min-height: 100%;
    height: 100%;
    overflow: hidden;
    border: 1px solid #eee4eb;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(53, 34, 48, .055);
}
.jcb-news-grid .jcb-items > .jcb-card .jcb-image,
.jcb-news-grid .jcb-items > .jcb-card:first-child .jcb-image {
    display: block !important;
    flex: 0 0 auto;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 230px !important;
    aspect-ratio: 16 / 10 !important;
    border-radius: 0 !important;
}
.jcb-news-grid .jcb-items > .jcb-card .jcb-card-body,
.jcb-news-grid .jcb-items > .jcb-card:first-child .jcb-card-body {
    display: flex !important;
    flex: 1 1 auto;
    flex-direction: column !important;
    align-items: flex-start;
    justify-content: flex-start;
    min-width: 0;
    padding: 13px 14px 15px;
}
.jcb-news-grid .jcb-card .jcb-category {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 7px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #fbf0f5;
    color: #b9547b;
    font-size: 10px;
}
.jcb-news-grid .jcb-card .jcb-title,
.jcb-news-grid .jcb-card:first-child .jcb-title {
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.7;
}
.jcb-news-grid .jcb-card .jcb-excerpt,
.jcb-news-grid .jcb-card:first-child .jcb-excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    margin: 0 0 8px;
    font-size: 11px;
    line-height: 1.75;
}
.jcb-news-grid .jcb-card .jcb-meta {
    margin-top: auto;
    padding-top: 6px;
}
.jcb-news-grid .jcb-card .jcb-read-more {
    margin-top: 10px;
}

/* A half-width grid uses the same cards and hierarchy, with two columns. */
.jcb-half-row > .mag-box.jcb-half-block.jcb-news-grid .jcb-items,
.jcb-half-row .jcb-news-grid .jcb-items {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px;
}
.jcb-half-row .jcb-news-grid .jcb-card .jcb-card-body {
    padding: 11px 12px 13px;
}
.jcb-half-row .jcb-news-grid .jcb-card .jcb-title {
    font-size: 13px;
}
.jcb-half-row .jcb-news-grid .jcb-card .jcb-excerpt {
    -webkit-line-clamp: 2;
    font-size: 10px;
}

/* Discovery path finishing: consistent image crop, linked hover state,
   balanced content and a more legible number marker. */
.jcb-discovery .jcb-card-discovery {
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.jcb-discovery .jcb-card-discovery:hover {
    transform: translateY(-3px);
    border-color: rgba(217, 111, 152, .48);
    box-shadow: 0 13px 30px rgba(73, 43, 76, .13);
}
.jcb-discovery .jcb-card-discovery .jcb-image {
    overflow: hidden;
    background: #f3e9f0;
}
.jcb-discovery .jcb-card-discovery .jcb-image img {
    object-fit: cover !important;
    transition: transform .35s ease;
}
.jcb-discovery .jcb-card-discovery:hover .jcb-image img {
    transform: scale(1.045);
}
.jcb-discovery .jcb-card-discovery .jcb-card-body {
    gap: 2px;
}
.jcb-discovery .jcb-card-discovery .jcb-title {
    margin-bottom: 5px;
}
.jcb-discovery .jcb-card-discovery .jcb-excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}
.jcb-discovery .jcb-discovery-index {
    z-index: 2;
    min-width: 41px;
    height: 29px;
    border: 2px solid #fff;
    box-shadow: 0 5px 14px rgba(51, 35, 78, .24);
}
.jcb-discovery .jcb-read-more {
    align-self: flex-start;
    margin-top: 9px;
}
.jcb-half-row .jcb-discovery .jcb-card-discovery {
    grid-template-columns: minmax(105px, 31%) minmax(0, 1fr);
    min-height: 150px;
}
.jcb-half-row .jcb-discovery .jcb-card-discovery:nth-child(even) {
    grid-template-columns: minmax(0, 1fr) minmax(105px, 31%);
}
.jcb-half-row .jcb-discovery .jcb-card-discovery .jcb-image {
    min-height: 150px;
}
.jcb-half-row .jcb-discovery .jcb-card-discovery .jcb-card-body {
    padding: 13px 14px;
}
.jcb-half-row .jcb-discovery .jcb-title {
    font-size: 14px;
}
.jcb-half-row .jcb-discovery .jcb-excerpt {
    font-size: 11px;
    -webkit-line-clamp: 2;
}

/* Responsive breakpoints are based on the actual block width. */
@media (max-width: 1000px) {
    .jcb-news-grid .jcb-items {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .jcb-half-row .jcb-news-grid .jcb-items {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}
@media (max-width: 767px) {
    .jcb-news-grid .jcb-items,
    .jcb-half-row .jcb-news-grid .jcb-items {
        grid-template-columns: minmax(0, 1fr) !important;
        grid-auto-rows: auto;
    }
    .jcb-news-grid .jcb-items > .jcb-card,
    .jcb-news-grid .jcb-items > .jcb-card:first-child {
        height: auto;
        min-height: 0;
    }
    .jcb-discovery .jcb-card-discovery,
    .jcb-half-row .jcb-discovery .jcb-card-discovery,
    .jcb-discovery .jcb-card-discovery:nth-child(even),
    .jcb-half-row .jcb-discovery .jcb-card-discovery:nth-child(even) {
        grid-template-columns: 112px minmax(0, 1fr);
        min-height: 145px;
    }
    .jcb-discovery .jcb-card-discovery:nth-child(even) .jcb-image,
    .jcb-half-row .jcb-discovery .jcb-card-discovery:nth-child(even) .jcb-image {
        grid-column: 1;
        grid-row: 1;
        border-radius: 0 17px 17px 0;
    }
    .jcb-discovery .jcb-card-discovery:nth-child(even) .jcb-card-body,
    .jcb-half-row .jcb-discovery .jcb-card-discovery:nth-child(even) .jcb-card-body {
        grid-column: 2;
        grid-row: 1;
    }
    .jcb-discovery .jcb-card-discovery .jcb-image,
    .jcb-half-row .jcb-discovery .jcb-card-discovery .jcb-image {
        min-height: 145px;
    }
}
@media (max-width: 480px) {
    .jcb-discovery .jcb-items {
        padding-inline-start: 27px;
    }
    .jcb-discovery .jcb-items::before {
        inset-inline-start: 9px;
    }
    .jcb-discovery .jcb-card-discovery,
    .jcb-half-row .jcb-discovery .jcb-card-discovery,
    .jcb-discovery .jcb-card-discovery:nth-child(even),
    .jcb-half-row .jcb-discovery .jcb-card-discovery:nth-child(even) {
        grid-template-columns: minmax(0, 1fr);
    }
    .jcb-discovery .jcb-card-discovery .jcb-image,
    .jcb-discovery .jcb-card-discovery:nth-child(even) .jcb-image {
        grid-column: 1;
        grid-row: 1;
        min-height: 0;
        aspect-ratio: 16 / 9;
        border-radius: 17px 17px 0 0;
    }
    .jcb-discovery .jcb-card-discovery .jcb-card-body,
    .jcb-discovery .jcb-card-discovery:nth-child(even) .jcb-card-body {
        grid-column: 1;
        grid-row: 2;
    }
}

/* Dark mode for the final grid and discovery refinements. */
html.dark-skin .jcb-news-grid .jcb-items > .jcb-card,
html.dark-skin .jcb-news-grid .jcb-items > .jcb-card:first-child {
    background: #292233;
    border-color: #4a3b54;
    color: #f0eaf3;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .22);
}
html.dark-skin .jcb-news-grid .jcb-card .jcb-category {
    background: #493044;
    color: #f2a6c5;
}
html.dark-skin .jcb-discovery .jcb-card-discovery:hover {
    border-color: #9a607d;
    box-shadow: 0 13px 30px rgba(0, 0, 0, .3);
}
html.dark-skin .jcb-discovery .jcb-card-discovery .jcb-image {
    background: #342a3d;
}
html.dark-skin .jcb-discovery .jcb-discovery-index {
    border-color: #292136;
    background: #e07ca2;
    color: #241a2c;
}
@media (prefers-reduced-motion: reduce) {
    .jcb-discovery .jcb-card-discovery,
    .jcb-discovery .jcb-card-discovery .jcb-image img {
        transition: none !important;
    }
}

/* =========================================================
   Editorial Magazine block — isolated magazine layout
   ========================================================= */

/* Responsive item limits: hidden cards must remain hidden despite layout display rules. */
.jcb-card[hidden]{display:none!important}

/* Responsive article limits: ensure the browser hidden state wins over
   the layout-specific display rules used by the full-width news grid. */
.jcb-items > .jcb-card[hidden],
.jcb-news-grid .jcb-items > .jcb-card[hidden],
.jcb-news-grid .jcb-items > .jcb-card:first-child[hidden] {
    display: none !important;
}
