/* MOH Sehha — WordPress glue. Loads after the approved files (sehha/tokens.css, sehha/bundle.css, inner.css),
   which are kept exactly as delivered. This file only: ties the Sehha tokens to theme.json, cancels WordPress
   defaults that would move the layout, and styles the few states the static design could not show
   (open phone menu, search panel, keyboard dismiss). */

/* ---------- 1. Tokens: theme.json (rem) is the source for spacing, radii, blur and the two type families ---------- */
:root{
  --space-1:var(--wp--preset--spacing--10);--space-2:var(--wp--preset--spacing--20);--space-3:var(--wp--preset--spacing--30);
  --space-4:var(--wp--preset--spacing--40);--space-5:var(--wp--preset--spacing--50);--space-6:var(--wp--preset--spacing--60);
  --space-7:var(--wp--preset--spacing--70);--space-8:var(--wp--preset--spacing--80);--space-9:var(--wp--preset--spacing--90);
  --radius-sm:var(--wp--custom--radius--sm);--radius-md:var(--wp--custom--radius--md);--radius-lg:var(--wp--custom--radius--lg);
  --radius-xl:var(--wp--custom--radius--xl);--radius-pill:var(--wp--custom--radius--pill);
  --blur-sm:var(--wp--custom--blur--sm);--blur-md:var(--wp--custom--blur--md);--blur-lg:var(--wp--custom--blur--lg);
  --font-display:var(--wp--preset--font-family--display);
  --font-text:var(--wp--preset--font-family--text);
}

/* ---------- 2. Page shell (templates: div.sh-root.sh-backdrop.pv > div.pv-in > header part, main, footer part) ---------- */
body{margin:0}
.wp-site-blocks>.pv{min-height:100vh;box-sizing:border-box}
/* The backdrop's glow (.sh-backdrop::before, inset -12%) is wider than the page. «hidden» clips it but still lets
   the browser scroll it sideways when focus moves (the page jumped ~47px on phones when the menu opened);
   «clip» paints the same and can never scroll. flow-root keeps the block context «hidden» gave. */
.sh-backdrop{overflow:hidden;overflow:clip;display:flow-root}
/* The glow's top and bottom reach a fixed 160px past the page instead of 12% of its height: with a percentage the
   whole glow moved every time the page grew while loading (fonts, pictures), and Lighthouse counted it as layout
   shift (CLS 0.30–0.40 on articles). Sides keep the design's 12%. (QA 2026-12-03, D6 approved) */
.sh-backdrop::before{inset:-160px -12%}
/* WordPress spaces blocks with margins; .pv-in already spaces its parts with gap (24px), as in the design */
.pv .pv-in>*{margin-block:0}

/* Skip link (from the approved homepage): first stop for keyboard users, visible only when focused */
.pv-skip{position:absolute;z-index:20;inset-inline-start:16px;top:-60px;padding:10px 18px;border-radius:var(--radius-pill);background:var(--primary);color:var(--on-primary);font-weight:600;text-decoration:none;transition:top var(--dur-2,260ms) ease}
.pv-skip:focus{top:12px}
/* here it sits in the header part, which starts 20px below the page top (.pv padding): same place on screen */
.pv-part--head>.pv-skip{top:-80px}
.pv-part--head>.pv-skip:focus{top:-8px}

/* ---------- 3. Desktop menu ---------- */
/* a column heading that is itself a link keeps the heading's look */
.pv-mega .pv-mega-h a{display:inline;padding:0;border-radius:0;font:inherit;color:inherit;white-space:normal}
.pv-mega .pv-mega-h a:hover{background:none;text-decoration:underline}
/* Esc closes a panel even while the pointer or focus is still on its item */
.pv-mi.is-dismissed>.pv-mega,.pv-mi.is-dismissed::after{display:none!important}

/* ---------- 4. Phone menu (review/menu-mobile.html, opened in place) ---------- */
.sh-menu .pv-menu-open,.sh-menu .pv-menu-close{display:contents}
.sh-menu .pv-menu-close,.sh-menu[aria-expanded="true"] .pv-menu-open{display:none}
.sh-menu[aria-expanded="true"] .pv-menu-close{display:contents}
/* while it is open the header keeps only the close button, and the page below gives way to the menu */
.pv-hdr.is-menu-open .sh-header-actions>:not(.sh-menu){display:none!important}
.pv-hdr.is-menu-open .sh-header-actions{margin-inline-start:auto}
.pv-in.is-menu-open>:not(.pv-part--head){display:none!important}
.pv-drawer:focus{outline:none}
@media (min-width:1280px){.pv-drawer{display:none!important}.pv-in.is-menu-open>:not(.pv-part--head){display:revert!important}}

/* ---------- 5. Search panel under the header's search button ---------- */
.pv-search-pop{position:absolute;z-index:40;inset-block-start:calc(100% + 8px);inset-inline-end:0;width:min(380px,100%);padding:12px;border-radius:var(--radius-lg)}
.pv-search-pop .sh-search{padding:4px;padding-inline-start:14px;background:var(--surface-solid);border:1px solid var(--hairline)}
.pv-search-pop .sh-search input{min-height:40px}
@media (max-width:699px){.pv-search-pop{inset-inline-start:0;width:auto}}

/* ---------- 6. Placeholder list of the minimal index template (session 3 replaces it) ---------- */
.pv-index-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-2)}
.pv-index-title{margin:0;font:var(--text-ar-h4)}
.pv-index-title a{color:var(--ink);text-decoration:none}
.pv-index-title a:hover{color:var(--primary-text)}

/* ---------- 7. Page templates (session 3) ---------- */
/* Each template's <main> is only a landmark: its children sit in the page's column (.pv-in, gap 24px) exactly as in
   the approved pages, which have no wrapper there. WordPress's block spacing is cancelled inside it too. */
.pv-main{display:contents}
.pv-main>*{margin-block:0}
.pv-main:focus{outline:none}
/* a page without a side menu: the text takes the whole width */
@media (min-width:960px){.pv-doc.pv-doc--solo{grid-template-columns:minmax(0,1fr)}}
/* side menu: a branch without a page of its own opens in place (same look as the menu's links) */
.pv-sidenav .pv-sidenav-btn{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:44px;padding:8px 12px;border:0;border-radius:var(--radius-md);background:none;color:var(--ink);font:500 0.9375rem/1.5rem var(--font-text);text-align:start;cursor:pointer}
.pv-sidenav .pv-sidenav-btn:hover{background:var(--primary-soft);color:var(--primary-text)}
.pv-sidenav .pv-sidenav-btn.is-open,.pv-sidenav .pv-sidenav-btn[aria-expanded="true"]{color:var(--primary-text);font-weight:600}
.pv-sidenav .pv-sidenav-btn[aria-expanded="true"] .sh-icon{transform:rotate(-90deg)}
.pv-sidenav .pv-sidenav-btn.is-open[aria-expanded="true"] .sh-icon{transform:none}
[dir="ltr"] .pv-sidenav .pv-sidenav-btn[aria-expanded="true"]:not(.is-open) .sh-icon{transform:rotate(90deg)} /* a left-to-right page draws chevron-right */
/* no picture (no featured image, or production's placeholder 124946): the official emblem, as it is, on dark green */
.pv-noimg{display:grid!important;place-items:center;background:linear-gradient(160deg,var(--brand-700),var(--brand-900))!important}
.pv-noimg::after{display:none}
.pv-noimg>img.pv-noimg-mark,.sh-news-media.pv-noimg>img.pv-noimg-mark{position:static;inset:auto;width:auto;height:42%;max-height:120px;min-height:28px;object-fit:contain;filter:none;transform:none}
.sh-news-media.pv-noimg{position:relative}
.pv-post .sh-news-media.pv-noimg>img.pv-noimg-mark{position:static}
/* the post's own text (Classic Editor): pictures, tables, lists and embeds inside the approved prose */
.pv-content{overflow-wrap:anywhere}
.pv-content :where(h2,h3,h4,h5,h6){font-family:var(--font-display);font-weight:600;color:var(--ink);margin:var(--space-5) 0 var(--space-2)}
.pv-content :where(h2){font-size:1.5rem;line-height:2.25rem}
.pv-content :where(h3){font-size:1.1875rem;line-height:1.875rem}
.pv-content :where(h4,h5,h6){font-size:1.0625rem;line-height:1.75rem}
.pv-content>:where(h2,h3,h4):first-child{margin-top:0}
.pv-content :where(ul,ol){margin:0 0 var(--space-4);padding-inline-start:1.5em}
.pv-content :where(li){margin-bottom:var(--space-1)}
.pv-content :where(a:not(.sh-btn)){color:var(--primary-text);text-decoration:underline;text-underline-offset:3px}
.pv-content :where(img){max-width:100%;height:auto;border-radius:var(--radius-md)}
.pv-content :where(img[width="16"],img[height="16"],img.emoji){display:inline;width:1.1em;height:1.1em;border-radius:0;vertical-align:-.15em}
.pv-content :where(figure,.wp-caption){max-width:100%!important;margin:0 0 var(--space-4)}
.pv-content :where(figcaption,.wp-caption-text){font-size:0.875rem;line-height:1.5rem;color:var(--ink-muted);margin-top:var(--space-2)}
.pv-content :where(.aligncenter){display:block;margin-inline:auto}
.pv-content :where(iframe,video){max-width:100%;border:0;border-radius:var(--radius-md)}
.pv-content :where(iframe[src*="youtube"],iframe[src*="vimeo"],iframe[src*="facebook.com/plugins/video"]){width:100%;height:auto;aspect-ratio:16/9}
/* every table of the text sits in a box that scrolls sideways on narrow screens (inc/views.php → moh_wrap_tables()) */
.pv-table{max-width:100%;overflow-x:auto;margin:0 0 var(--space-4);-webkit-overflow-scrolling:touch}
.pv-sect.pv-content>.pv-table{margin-block:0}
.pv-content :where(table){width:100%;border-collapse:collapse;font-size:0.9375rem;line-height:1.625rem}
.pv-content :where(th,td){padding:8px 12px;border:1px solid var(--hairline);text-align:start;vertical-align:top}
.pv-content :where(th){background:var(--primary-soft);color:var(--ink);font-weight:600}
.pv-content :where(blockquote){margin:0 0 var(--space-4);padding:var(--space-3) var(--space-4);border-inline-start:4px solid var(--primary);background:var(--primary-soft);border-radius:var(--radius-md)}
.pv-content :where(hr){border:0;border-top:1px solid var(--hairline);margin:var(--space-5) 0}
.pv-content :where(pre,code){font-family:ui-monospace,Menlo,monospace;font-size:.9em}
.pv-content[dir="ltr"]{text-align:start}
/* content pages: each card of review/about.html keeps its own spacing (.pv-sect); the text's blocks follow it */
.pv-sect.pv-content>*{margin-block:0}
.pv-sect.pv-content :where(ul,ol){padding-inline-start:1.5em}
.pv-sect.pv-content :where(li,td,th){font-size:1.0625rem;line-height:2rem}
/* the link of a «link» post (tenders): the file or page it points to */
.pv-link-target{display:flex;flex-wrap:wrap;gap:var(--space-2)}
/* an empty list */
.pv-empty p{margin:0}
/* the 404 page's three newest items */
@media (min-width:960px){.pv-arch.pv-arch--3{grid-template-columns:repeat(3,minmax(0,1fr))}}
/* «نسخ الرابط»: said aloud when the link is copied */
.pv-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
/* text pasted from Facebook arrives as <div dir="auto"> lines, not paragraphs: give them the paragraphs' spacing */
.pv-content :where(div[dir="auto"]:not(:empty)){margin:0 0 var(--space-4)}
.pv-content :where(p:empty,div[dir="auto"]:empty){display:none}
.pv-prose>:last-child,.pv-prose>:last-child>:last-child{margin-bottom:0}

/* ---------- 8. English interface (pages under /en/: <html lang="en" dir="ltr">) ----------
   The approved files are bidirectional (logical properties, [dir] rules); only what they leave physical is set here,
   always under [dir="ltr"], so Arabic pages are untouched. */

/* the English header's lockup (the ministry's decision, 2026-11-23): the Arabic header's lockup with the emblem on
   the left — emblem, gold rule, name — same sizes, tracking and compact phone version. Only the order changes: the
   emblem image is never flipped. Both lines of the name start at the rule. */
.lk.lk--mirror{direction:ltr}
.lk--mirror .lk-text,.lk--mirror .lk-ar,.lk--mirror .lk-en,.lk--mirror .lk-ar2{text-align:left}
.lk--mirror .lk-en{margin-left:0}
/* the footer's stacked lockup (emblem above the name) sits at the column's start, the left, like the address and
   buttons under it — the same mirroring as the header (docs/screens/en-footer-lockup.jpg) */
[dir="ltr"] .lk--start{align-items:flex-end}
[dir="ltr"] .lk--start .lk-text,[dir="ltr"] .lk--start .lk-en{text-align:left}
[dir="ltr"] .lk--start .lk-en{margin-left:0}
/* a footer without the e-services block (the English one: no English services menu) starts with its columns; their
   top space, meant to set them apart from that block, would add to the footer's own: the top inset is made equal to
   the sides' instead (desktop 24 + 12 = 32 + 4; phones 20 + 0 = 16 + 4) */
.sh-footer>.sh-footer-main:first-child{padding-top:12px}
@media (max-width:699px){.sh-footer>.sh-footer-main:first-child{padding-top:0}}
/* the wide third column is made for «الوحدات» in two columns (.pv-cols); lists of one column each (the English main
   menu's groups) take four equal columns, so the columns keep an even rhythm and no wide gap opens before the apps */
@media (min-width:960px){.sh-footer-main.pv-foot-main:not(:has(.pv-cols)){grid-template-columns:repeat(4,minmax(0,1fr))}}

/* Latin text: the design system's English metrics (tokens.css --text-en-*) are tighter than the Arabic ones the inner
   pages use; only line height and tracking change, as for the bundle's own [dir="ltr"] .sh-h1/.sh-h2 rules */
[dir="ltr"] .pv-art-title{line-height:2.375rem;letter-spacing:-.01em}
[dir="ltr"] .pv-prose,[dir="ltr"] .pv-prose .pv-lead,[dir="ltr"] .pv-sect p,[dir="ltr"] .pv-sect.pv-content :where(li,td,th){line-height:1.875rem}
[dir="ltr"] .pv-vision p{line-height:2.375rem;letter-spacing:-.01em}
[dir="ltr"] .pv-prin p{line-height:1.5rem}
@media (max-width:699px){[dir="ltr"] .pv-art-title{line-height:2rem}[dir="ltr"] .pv-vision p{line-height:1.875rem}}
/* Arabic paragraphs inside an English text (production's English pages list Arabic posts too) read right to left,
   each paragraph from its own first letter */
[dir="ltr"] .pv-content :where(p,li,h2,h3,h4,h5,h6,td,th,figcaption,div[dir="auto"]){unicode-bidi:plaintext}
/* a drawing pasted into the text (e.g. the organisational chart, an inline SVG from CorelDRAW): as wide as the card
   at most, its height from its own proportions */
.pv-content :where(svg:not(.sh-icon)){max-width:100%;height:auto}
.pv-content :where(object,embed,canvas,video){max-width:100%}
/* a row of the design's buttons written in a page's text (<p class="pv-actions"><a class="sh-btn …">): the English
   «Strategic Plan» page (View the plan · Download the file), as the report card of the homepage */
.pv-content p.pv-actions{display:flex;flex-wrap:wrap;gap:var(--space-2)}
/* a link to a card («…/#plan-2014-2018») shows the whole card, not its heading cut at the window's edge */
.pv-sect>h2.sh-h2[id]{scroll-margin-top:56px}

/* ---------- 8. Content from the migration (session 4): files lists, TablePress tables, video and data frames ---------- */
/* «WB MOH Files» lists, now plain tables (# · الاسم · التصنيف · التاريخ · الرابط) and TablePress tables (.moh-table):
   the design's list look — hairline rows on the card, a soft green header, the link as a small green button */
.pv-content :is(.moh-files__table,.moh-table){border-collapse:separate;border-spacing:0;background:var(--surface-solid)}
/* the rounded border is the scroll box's, so it clips the header's corners and scrolls with the table */
.pv-table:has(>.moh-files__table,>.moh-table){border:1px solid var(--hairline);border-radius:var(--radius-md);background:var(--surface-solid)}
.pv-content :is(.moh-files__table,.moh-table) :is(th,td){padding:10px 14px;border:0;border-block-end:1px solid var(--hairline);font-size:0.9375rem;line-height:1.625rem;text-align:start;vertical-align:middle}
.pv-content :is(.moh-files__table,.moh-table) tbody tr:last-child>*{border-block-end:0}
.pv-content :is(.moh-files__table,.moh-table) thead th{background:var(--primary-soft);color:var(--primary-text);font:600 0.875rem/1.375rem var(--font-display);white-space:nowrap}
.pv-content :is(.moh-files__table,.moh-table) tbody tr:hover>*{background:var(--primary-soft)}
.pv-content :is(.moh-files__table,.moh-table) :is(th,td):first-child{width:1%;white-space:nowrap;color:var(--ink-muted);font-variant-numeric:tabular-nums}
.pv-content .moh-files__table td:nth-child(2){min-width:14em;color:var(--ink);font-weight:500}
.pv-content .moh-files__table td:nth-child(3){color:var(--ink-muted);white-space:nowrap}
.pv-content .moh-files__table :is(td,th):nth-child(4){white-space:nowrap;font-variant-numeric:tabular-nums;color:var(--ink-muted)}
.pv-content .moh-files__table :is(td,th):last-child,.pv-content .moh-table td:last-child>a:only-child{white-space:nowrap}
.pv-content .moh-table td:nth-child(2){min-width:10em;font-weight:500}
.pv-content :is(.moh-files__table,.moh-table) td>a:only-child{display:inline-flex;align-items:center;min-height:36px;padding:0 14px;border-radius:var(--radius-pill);background:var(--primary-soft);color:var(--primary-text);font-weight:600;font-size:0.875rem;text-decoration:none;white-space:nowrap}
.pv-content :is(.moh-files__table,.moh-table) td>a:only-child:hover,.pv-content :is(.moh-files__table,.moh-table) td>a:only-child:focus-visible{background:var(--primary);color:var(--on-primary)}
.pv-content .moh-files{display:contents}
/* video and data frames (YouTube, Vimeo, Power BI): 16:9, as wide as the text. Until a frame shows something — or if
   it never does (a report no longer published) — the box keeps the card's surface with a faint sign of what belongs
   there, instead of a white hole */
.pv-content .moh-embed{position:relative;display:block;width:100%;max-width:100%;aspect-ratio:16/9;margin:0 0 var(--space-4);border:1px solid var(--hairline);border-radius:var(--radius-lg);overflow:hidden;background:var(--surface-solid);box-shadow:var(--shadow-glass)}
.pv-sect.pv-content>.moh-embed{margin-block:0}
.pv-content .moh-embed::before{content:"";position:absolute;inset:0;margin:auto;width:56px;height:56px;background:var(--ink-subtle);opacity:.45;-webkit-mask:var(--moh-embed-sign) center/contain no-repeat;mask:var(--moh-embed-sign) center/contain no-repeat}
.pv-content .moh-embed--video{--moh-embed-sign:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17'/%3E%3Cpath d='m10 15 5-3-5-3z'/%3E%3C/svg%3E");background:#0c1a14}
.pv-content .moh-embed--powerbi{--moh-embed-sign:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v16a2 2 0 0 0 2 2h16'/%3E%3Cpath d='M18 17V9'/%3E%3Cpath d='M13 17V5'/%3E%3Cpath d='M8 17v-3'/%3E%3C/svg%3E")}
.pv-content .moh-embed--video::before{background:#fff;opacity:.35}
.pv-content .moh-embed>iframe,.pv-content .moh-embed>p>iframe{position:absolute;z-index:1;inset:0;width:100%!important;height:100%!important;max-width:none;aspect-ratio:auto;border:0;border-radius:0}
.pv-content .moh-embed>p{margin:0}
/* phones: the two list tables become stacked rows — the name on its own line, then type and date, the button at the
   end — so nothing needs a sideways scroll (other tables keep their columns and scroll inside .pv-table) */
@media (max-width:699px){
  .pv-content :is(.moh-files__table,.moh-table),.pv-content :is(.moh-files__table,.moh-table) tbody{display:block}
  .pv-content :is(.moh-files__table,.moh-table) thead{display:none}
  .pv-content :is(.moh-files__table,.moh-table) tr{display:flex;flex-wrap:wrap;align-items:center;gap:2px 12px;padding:12px 14px;border-block-end:1px solid var(--hairline)}
  .pv-content :is(.moh-files__table,.moh-table) tbody tr:last-child{border-block-end:0}
  .pv-content :is(.moh-files__table,.moh-table) tbody tr:hover{background:var(--primary-soft)}
  .pv-content :is(.moh-files__table,.moh-table) tbody tr:hover>*{background:none}
  .pv-content :is(.moh-files__table,.moh-table) td{display:block;width:auto;padding:0;border:0}
  .pv-content :is(.moh-files__table,.moh-table) td:first-child{display:none}
  .pv-content :is(.moh-files__table,.moh-table) td:nth-child(2){flex:1 1 100%;min-width:0}
  .pv-content .moh-files__table :is(td:nth-child(3),td:nth-child(4)){font-size:0.8125rem;line-height:1.375rem}
  .pv-content .moh-table td:nth-child(3){flex:1 1 auto;min-width:0;font-size:0.875rem;line-height:1.5rem;color:var(--ink-muted)}
  .pv-content :is(.moh-files__table,.moh-table) td:last-child{margin-inline-start:auto}
}

/* ---------- 9. Light/dark switch beside «إعدادات العرض» (top row) ----------
   Secondary to the green settings button: glass, same size as the social buttons. The icon shows what one click
   gives: a moon in light mode, a sun in dark mode. */
.pv-top-tools{display:flex;align-items:center;gap:8px}
.pv-theme-btn{border-radius:var(--radius-pill)}
.pv-theme-btn .sh-icon{width:20px;height:20px}
.pv-theme-i{display:inline-flex}
.pv-theme-i--sun{display:none}
[data-theme="dark"] .pv-theme-i--moon{display:none}
[data-theme="dark"] .pv-theme-i--sun{display:inline-flex}
.pv-theme-btn.is-turning .pv-theme-i{animation:pv-theme-turn .32s ease-out}
@keyframes pv-theme-turn{from{opacity:0;transform:rotate(-70deg) scale(.6)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.pv-theme-btn.is-turning .pv-theme-i{animation:none}}
.pv-still .pv-theme-btn.is-turning .pv-theme-i{animation:none}
