/* News index: a stack of WordPress "media and text" blocks. Same block and image rules as the article's rich text; only the list frame, title link and pager are new. Logical properties only, except the media-text grid, which is physical like core's. */
.ni-wrap{inline-size:min(100% - 2*var(--gap),1100px);margin-inline:auto}
.ni-list{padding-block:clamp(28px,calc(4*var(--vw)),56px) 0}

.ni-item{direction:ltr;display:grid;grid-template-columns:1fr 40%;gap:clamp(18px,calc(3*var(--vw)),40px);align-items:center;padding-block:clamp(22px,calc(3*var(--vw)),36px);border-block-end:1px solid var(--line);position:relative}
.ni-item:first-child{padding-block-start:0}
.ni-item>*{direction:rtl}
.ni-item .wp-block-media-text__media{order:2;margin:0;overflow:hidden;border-radius:var(--img-r)}
.ni-item .wp-block-media-text__media img{inline-size:100%;aspect-ratio:3/2;object-fit:cover;object-position:var(--fp,50% 50%);display:block;transition:transform .6s cubic-bezier(.2,.8,.2,1)}
.ni-item:hover .wp-block-media-text__media img{transform:scale(1.03)}
/* date and text: the same styling as the home page's news rows (.nd, .nt in frontpage/style.css) */
.ni-item .wp-block-media-text__content{display:grid;grid-template-columns:clamp(84px,calc(8*var(--vw)),130px) minmax(0,1fr);align-items:center;gap:clamp(16px,calc(2.5*var(--vw)),40px)}
.ni-item :is(.nd,.nt){grid-area:auto}
.ni-item .nd{display:flex;flex-direction:column;align-items:center;line-height:1}
.ni-item .nd b{font-family:var(--title);font-weight:700;font-size:clamp(44px,calc(4.6*var(--vw)),72px);color:var(--navy);transition:color .2s}
.ni-item .nd span{margin-block-start:6px;font-weight:700;font-size:15px;color:var(--muted);text-align:center}
.ni-item .nt h2{font-family:var(--title);font-weight:700;font-size:clamp(24px,calc(2.3*var(--vw)),36px);line-height:1.35;color:var(--navy);transition:color .2s;text-wrap:balance}
.ni-item .nt h2 a{color:inherit;text-decoration:none}
/* the whole row is the click target, through the title link */
.ni-item .nt h2 a::after{content:"";position:absolute;inset:0;z-index:1}
.ni-item:has(a:focus-visible){outline:3px solid var(--navy);outline-offset:-3px;border-radius:8px}
.ni-item .nt a:focus-visible{outline:0}
.ni-item .nt p{margin-block-start:6px;color:var(--muted);font-size:17px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
@media (hover:hover){.ni-item:hover .nt h2{color:var(--teal-deep)}.ni-item:hover .nd b{color:var(--teal-deep)}}
/* under 900px, as on the home page: the day in a navy square, month and year beside it, then the title */
@media (max-width:899px){
 .ni-item .wp-block-media-text__content{grid-template-columns:1fr;gap:10px}
 .ni-item .nd{flex-direction:row;align-items:center;gap:10px;justify-content:flex-start}
 .ni-item .nd b{display:grid;place-items:center;inline-size:46px;block-size:46px;background:var(--navy);color:#fff;border-radius:3px;font-family:Tajawal,system-ui,sans-serif;font-weight:800;font-size:24px}
 .ni-item .nd span{margin:0;font-size:16px;white-space:nowrap}
 .ni-item .nt h2{font-size:22px}
}
@media (max-width:781px){.ni-item{grid-template-columns:1fr}.ni-item .wp-block-media-text__media{order:0}}
@media (prefers-reduced-motion:reduce){.ni-item .wp-block-media-text__media img,.ni-more .pg-ic{transition:none!important}.ni-item:hover .wp-block-media-text__media img{transform:none}}

/* pager */
.ni-pager{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:12px 20px;margin-block:clamp(32px,calc(4*var(--vw)),56px) 0}
.ni-pager ol{display:flex;gap:8px;list-style:none;padding:0}
.ni-pager ol a{display:grid;place-items:center;min-inline-size:44px;min-block-size:44px;border-radius:50%;font-weight:700;color:var(--navy)}
.ni-pager ol a:hover{background:var(--sky)}
.ni-pager ol a[aria-current]{background:var(--navy);color:#fff}
.ni-pager .pn{display:inline-flex;align-items:center;gap:8px;min-block-size:44px;padding-inline:8px;font-weight:700;color:var(--teal-deep)}
.ni-pager .pn .pg-ic{inline-size:18px;block-size:18px;background:currentColor;-webkit-mask:var(--arr) center/contain no-repeat;mask:var(--arr) center/contain no-repeat}
.ni-pager .pn-prev .pg-ic{scale:-1 1}
.ni-pager .is-off{color:#6b6e8a;pointer-events:none}
.ni-pager a:focus-visible{outline:3px solid var(--teal-deep);outline-offset:2px}
.ni-note{text-align:center;color:var(--muted);font-size:14px;margin-block:36px clamp(40px,calc(5*var(--vw)),64px)}
@media (max-width:599px){.ni-item .wp-block-media-text__media img{aspect-ratio:16/9}}

/* month filter: one button -> a panel with a year switcher and a 12-month grid. Popover on desktop, bottom sheet on phones.
   Without JS the button is hidden and every year's grid is shown inline. */
.ni-bar{padding-block:clamp(20px,calc(2.5*var(--vw)),32px) 0;display:flex;flex-wrap:wrap;align-items:center;gap:14px 24px}
.ni-filter{position:relative}
.mf-btn{display:inline-flex;align-items:center;gap:10px;min-block-size:52px;padding-inline:18px 16px;font:inherit;color:var(--ink);background:#fff;border:1.5px solid var(--line);border-radius:4px;cursor:pointer;box-shadow:0 1px 2px rgba(21,22,59,.06);transition:border-color .2s,box-shadow .2s}
.mf-btn:hover,.is-open .mf-btn{border-color:var(--navy);box-shadow:0 6px 18px -8px rgba(35,58,146,.35)}
.mf-btn:focus-visible{outline:3px solid var(--teal-deep);outline-offset:3px}
.mf-lab{color:var(--muted);font-size:15px}
.mf-btn strong{color:var(--navy);font-weight:800;min-inline-size:6.5em;text-align:start}
.mf-cal,.mf-chev{flex:none;inline-size:20px;block-size:20px;background:var(--navy);-webkit-mask:var(--ic) center/contain no-repeat;mask:var(--ic) center/contain no-repeat}
.mf-cal{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 3v3M17 3v3M4 9h16M5 5h14a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1z' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E")}
.mf-chev{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");inline-size:18px;block-size:18px;transition:rotate .25s}
.is-open .mf-chev{rotate:180deg}

.mf-panel{inline-size:min(360px,calc(100vw - 2*var(--gap)));background:#fff;border:1px solid var(--line);border-radius:6px;padding:16px 16px 12px;box-shadow:0 30px 60px -24px rgba(21,22,59,.45),0 4px 12px rgba(21,22,59,.08)}
.js .mf-panel{position:absolute;z-index:30;inset-block-start:calc(100% + 10px);inset-inline-end:0;display:none}
.js .is-open .mf-panel{display:block;animation:mfin .22s cubic-bezier(.2,.8,.2,1)}
@keyframes mfin{from{opacity:0;translate:0 -8px}}
html:not(.js) .mf-btn,html:not(.js) .mf-head{display:none}
html:not(.js) .mf-panel{box-shadow:none}
html:not(.js) .mf-year+.mf-year{margin-block-start:14px}
.js .mf-year>h3{position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%)}
.mf-year>h3{font-family:var(--title);color:var(--navy);font-size:22px;margin-block-end:8px}
.mf-year[hidden]{display:none}

.mf-head{display:flex;align-items:center;justify-content:space-between;margin-block-end:10px}
.mf-yr{font-family:var(--title);font-size:26px;color:var(--navy);line-height:1}
.mf-nav{display:grid;place-items:center;inline-size:44px;block-size:44px;border:0;border-radius:4px;background:transparent;cursor:pointer}
.mf-nav i{inline-size:20px;block-size:20px;background:var(--navy);-webkit-mask:var(--arr) center/contain no-repeat;mask:var(--arr) center/contain no-repeat}
.mf-prev i{scale:-1 1}
.mf-nav:hover:not(:disabled){background:var(--sky)}
.mf-nav:disabled{opacity:.3;cursor:default}
.mf-nav:focus-visible{outline:3px solid var(--teal-deep);outline-offset:2px}

.mf-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;list-style:none;padding:0;margin:0}
.mf-grid a,.mf-grid .is-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-block-size:60px;padding:6px;border-radius:4px;text-align:center;font-weight:700;line-height:1.25;text-decoration:none}
.mf-grid a{background:var(--sky);color:var(--navy);transition:background .15s,color .15s}
.mf-grid a small{font-size:13px;font-weight:700;color:var(--muted);white-space:nowrap}
@media (hover:hover){.mf-grid a:hover{background:var(--navy);color:#fff}.mf-grid a:hover small{color:#fff}}
.mf-grid a[aria-current]{background:var(--navy);color:#fff}
.mf-grid a[aria-current] small{color:rgba(255,255,255,.85)}
.mf-grid a:focus-visible{outline:3px solid var(--teal-deep);outline-offset:2px}
.mf-grid .is-empty{color:#7c7f98;font-weight:500}
.mf-all{display:block;margin-block-start:12px;padding:12px;border-block-start:1px solid var(--line);text-align:center;font-weight:700;color:var(--teal-deep);text-decoration:none}
.mf-all:hover{color:var(--navy)}
.mf-all[aria-current]{color:var(--navy)}
.mf-all:focus-visible{outline:3px solid var(--teal-deep);outline-offset:-3px;border-radius:8px}
.mf-backdrop{display:none}

/* phones: the panel is a bottom sheet over a dimmed page */
@media (max-width:599px){
 .mf-btn{inline-size:100%}
 .ni-filter{inline-size:100%}
 .js .mf-panel{position:fixed;inset:auto 0 0;inline-size:auto;z-index:60;border-radius:6px 6px 0 0;padding-block-end:max(16px,env(safe-area-inset-bottom));animation:mfsheet .3s cubic-bezier(.2,.8,.2,1)}
 @keyframes mfsheet{from{translate:0 40px;opacity:0}}
 .js .is-open .mf-backdrop{display:block;position:fixed;inset:0;z-index:59;background:rgba(21,22,59,.5)}
 .mf-grid a,.mf-grid .is-empty{min-block-size:60px}
}
@media (prefers-reduced-motion:reduce){.js .is-open .mf-panel,.js .mf-panel{animation:none!important}.mf-chev{transition:none}}
.ni-status{color:var(--muted)}
.ni-status strong{color:var(--navy)}
.ni-status a{margin-inline-start:14px;color:var(--teal-deep);font-weight:700;text-decoration:underline;text-underline-offset:3px}
.ni-bar+.ni-list{padding-block-start:clamp(16px,calc(2*var(--vw)),28px)}

/* bannerless head: breadcrumb and title sit directly on the page background (no tinted band, no rule) */
.news-index .art-head{background:none;border-block-end:0;padding-block:clamp(20px,calc(3*var(--vw)),36px) 0}
.news-index .crumbs{margin-block-end:clamp(8px,calc(1.2*var(--vw)),16px)}

/* the filter sits in the page header, on the title's row, at the end side (left in Arabic); on phones it drops under the title at full width */
.ni-headrow{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:16px 24px}
.ni-headrow .ni-filter{margin-block-end:.4em}
.ni-bar{padding-block-start:16px}
@media (max-width:599px){.ni-headrow{display:block}.ni-headrow .ni-filter{margin-block-start:14px}}

/* the pager also sits above the list: tighter, and the list starts closer to it */
.ni-pager-top{margin-block:clamp(16px,calc(2*var(--vw)),28px) 0}
.ni-pager-top+.ni-list{padding-block-start:clamp(12px,calc(1.5*var(--vw)),20px)}
/* pager: a hairline runs out to both sides of the page numbers */
.ni-pager{flex-wrap:nowrap;inline-size:min(100% - 2*var(--gap),1100px);margin-inline:auto;gap:14px 20px}
.ni-pager::before,.ni-pager::after{content:"";flex:1 1 0;min-inline-size:0;border-block-start:1px solid var(--line)}
@media (max-width:520px){.ni-pager::before,.ni-pager::after{display:none}.ni-pager{justify-content:center}}
/* the pager's own rule replaces the last item's underline */
.ni-list:has(+.ni-pager) .ni-item:last-child{border-block-end:0}
.ni-pager-top+.ni-list .ni-item:first-child{padding-block-start:clamp(22px,calc(3*var(--vw)),36px)}
.ni-pager-top+.ni-list{padding-block-start:0}

/* month grid: every cell the same size, the name on one line, the count (or "لا أخبار") under it */
.mf-panel{inline-size:min(390px,calc(100vw - 2*var(--gap)))}
.mf-grid{gap:6px}
.mf-grid a,.mf-grid .is-empty{block-size:64px;min-block-size:0;padding:0 4px;gap:4px;justify-content:center;border-radius:4px}
.mf-grid a>span,.mf-grid .is-empty>span{font-size:16px;line-height:1.2;white-space:nowrap}
.mf-grid small{font-size:12.5px;line-height:1.2;white-space:nowrap}
.mf-grid .is-empty{background:transparent;border:1px dashed var(--line);color:#7c7f98}
.mf-grid .is-empty small{color:#7c7f98;font-weight:500}

.ni-pager .gap{display:grid;place-items:center;min-inline-size:28px;min-block-size:44px;color:var(--muted);letter-spacing:.1em}
/* the gap marker: as large and bold as the page numbers, in the body colour */
.ni-pager .gap{min-inline-size:32px;color:var(--ink);font-size:22px;font-weight:800;letter-spacing:.05em;padding-block-end:6px}

/* photo overlay: on hover or keyboard focus a navy gradient fades up and "قراءة الخبر" rises into place (the same behaviour as the article hero). Decorative: the row is already one link. Touch screens have no hover, so no overlay there and the photo stays clean. */
.ni-item .wp-block-media-text__media{position:relative}
.ni-item .wp-block-media-text__media::after{content:"";position:absolute;inset:0;background:linear-gradient(to top,rgba(21,22,59,.78),rgba(21,22,59,0) 62%);opacity:0;transition:opacity .45s ease;pointer-events:none}
.ni-ov{position:absolute;z-index:1;inset-inline:0;inset-block-end:0;display:flex;align-items:center;gap:10px;padding:0 20px 16px;color:#fff;font-weight:700;font-size:17px;opacity:0;translate:0 14px;transition:opacity .3s ease,translate .4s cubic-bezier(.2,.8,.2,1);pointer-events:none}
.ni-ov i{inline-size:20px;block-size:20px;background:currentColor;-webkit-mask:var(--arr) center/contain no-repeat;mask:var(--arr) center/contain no-repeat}
@media (hover:hover){
 .ni-item:hover .wp-block-media-text__media::after,.ni-item:has(a:focus-visible) .wp-block-media-text__media::after{opacity:1}
 .ni-item:hover .ni-ov,.ni-item:has(a:focus-visible) .ni-ov{opacity:1;translate:0 0;transition:opacity .45s ease .1s,translate .55s cubic-bezier(.2,.8,.2,1) .1s}
}
@media (prefers-reduced-motion:reduce){.ni-item .wp-block-media-text__media::after,.ni-ov{transition:none!important}}

/* phones: previous / next only, one at each edge */
@media (max-width:599px){
 .ni-pager{justify-content:space-between;inline-size:min(100% - 2*var(--gap),1100px)}
 .ni-pager ol{display:none}
 .ni-pager .pn{min-block-size:48px;padding-inline:4px;font-size:17px}
}

/* month button: icon, label and value grouped at the start, the chevron alone at the end (no stretched gaps) */
.mf-btn{min-inline-size:230px;justify-content:flex-start;gap:10px}
.mf-btn strong{flex:1 1 auto;min-inline-size:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mf-lab::after{content:":"}
.mf-chev{margin-inline-start:auto}
@media (max-width:599px){.mf-btn{min-inline-size:0}}
