/* ==========================================================================
   FCSC Menu - the one header stylesheet
   --------------------------------------------------------------------------
   Variants are classes on <header class="fm-header">:
     .fm-en / .fm-ar      language (Arabic also has dir="rtl")
     .fm-inner / .fm-home white bar / transparent over the hero
     .fm-compact          burger layout (added by JS below the breakpoint)
     .fm-stuck            the page is scrolled and the sticky bar is showing
   Logical properties (inline-start/end) are used throughout, so the same
   rules serve English (LTR) and Arabic (RTL).

   Sections: 1 tokens  2 reset  3 top bar  4 nav  5 tools  6 sticky bar
             7 drawer  8 panels  9 compact layout  10 small screens
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
.fm-header {
	--fm-navy: #374A66;
	--fm-navy-glass: rgba(55, 74, 102, .9);
	--fm-accent: #BF7969;
	--fm-accent-soft: #AE7E6F;
	--fm-burger-mobile: #B57C6C;
	--fm-text: #333;
	--fm-pad: 30px;
	--fm-offset: 161px;      /* where drawer/panels start; kept in sync by JS */
	--fm-x: 0px;             /* inline-start of a small dropdown; set by JS */
	--fm-w: 100%;            /* page width in px; set by JS */
	--fm-z-bar: 99;
	--fm-z-panel: 9999;
	font-family: "UNIVERS NEXT ARABIC", sans-serif;
	font-size: 16px;
	line-height: 1.5;
	position: relative;
	z-index: var(--fm-z-bar);
}

/* 2. Reset (theme styles must not leak into the header) --------------------- */
.fm-header *, .fm-header *::before, .fm-header *::after { box-sizing: border-box; }
.fm-header ul { list-style: none; margin: 0; padding: 0; }
.fm-header a { text-decoration: none; }
.fm-header h3 { margin: 0; font: inherit; }
.fm-header img { display: block; width: 100%; height: auto; }
.fm-header button,
.fm-header button:hover,
.fm-header button:focus {
	background: none; border: 0; border-radius: 0; padding: 0; margin: 0;
	color: inherit; font: inherit; cursor: pointer; box-shadow: none;
}
.fm-header [hidden] { display: none !important; }
.fm-header a:focus-visible,
.fm-header button:focus-visible { outline: 2px solid var(--fm-accent); outline-offset: 3px; }
.fm-ico { display: inline-flex; flex: none; }
.fm-ico svg, .fm-ico img { display: block; width: 100%; height: 100%; }

/* Space the header takes in the page flow. Pages were laid out against the
   old Elementor header, so these values keep every page exactly where it was. */
.fm-flow { height: 7px; }

/* Logged-in admin bar */
.admin-bar .fm-header { --fm-ab: 32px; }
@media (max-width: 782px) { .admin-bar .fm-header { --fm-ab: 46px; } }

/* 3. Top bar ----------------------------------------------------------------- */
.fm-top {
	position: relative;
	z-index: var(--fm-z-bar);
	display: flex;
	flex-direction: column;
	background: #fff;
	color: var(--fm-text);
	transition: opacity .9s ease, transform .5s ease;
}
@media (min-width: 1024px) { .fm-en .fm-top { position: fixed; top: var(--fm-ab, 0px); left: 0; right: 0; } }
@media (min-width: 1270px) { .fm-ar .fm-top { position: fixed; top: var(--fm-ab, 0px); left: 0; right: 0; } }
.fm-top.is-away { opacity: 0; transform: translateY(-100px); pointer-events: none; }

.fm-logos { display: flex; justify-content: space-between; align-items: flex-start; padding: var(--fm-pad) var(--fm-pad) 0; }
.fm-logo { width: 10%; min-width: 71px; }
.fm-partner { width: 12%; min-width: 78px; }

.fm-bar { display: flex; justify-content: space-between; align-items: center; padding: 25px var(--fm-pad); }

.fm-burger { display: inline-flex; align-items: center; width: 55px; height: 35px; flex: none; }
.fm-burger svg { width: 25px; height: 25px; fill: var(--fm-navy); }
.fm-burger .fm-i-close { display: none; }
.fm-burger[aria-expanded="true"] .fm-i-bars { display: none; }
.fm-burger[aria-expanded="true"] .fm-i-close { display: block; }

/* Home: transparent over the hero, everything white */
.fm-home .fm-top { background: transparent; color: #fff; padding: 0 var(--fm-pad); }
.fm-home .fm-logos { padding: var(--fm-pad) 0 0; }
.fm-home .fm-top .fm-bar { padding: 25px 0 30px; } /* live home template: no line under the nav */
/* Live home header takes no space in the page: the hero starts at the very top. */
@media (min-width: 1025px) { .fm-home .fm-flow { height: 0; } }
.fm-home .fm-top .fm-burger svg { fill: #fff; }

/* 4. Main navigation (top bar + sticky bar) --------------------------------- */
.fm-nav { flex: 1 1 auto; min-width: 0; }
.fm-nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: 0 15px; }
.fm-link { display: flex; align-items: center; font-size: 12px; line-height: 1; color: inherit; white-space: nowrap; }
.fm-link .fm-ico { width: 30px; height: 30px; margin-inline: 3.75px; }
.fm-link .fm-ico svg { stroke: currentColor; transition: stroke .3s; }
.fm-link .fm-label { padding-inline-start: 5px; transition: color .3s; }
.fm-nav .fm-link:hover,
.fm-nav .fm-link[aria-expanded="true"],
.fm-nav .fm-link.is-current,
.fm-nav .fm-link.is-current-parent { color: var(--fm-accent); }
.fm-nav .fm-link.is-current .fm-label,
.fm-nav .fm-link.is-current-parent .fm-label { font-weight: 700; } /* parent of the current page is highlighted too */

/* 5. Search + language switch ------------------------------------------------ */
.fm-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex: none; }
.fm-search { width: 200px; }
.fm-search .asl_w_container { width: 100% !important; min-width: 100px !important; margin: 0 !important; }
.fm-search div[id*="ajaxsearchlite"].asl_m { display: flex !important; width: 100% !important; }
.fm-search div.asl_m.asl_w .probox { width: 100% !important; }
.fm-lang { display: flex; align-items: center; direction: rtl; font-size: 12px; line-height: 1; color: inherit; }
.fm-ar .fm-lang { direction: ltr; }
.fm-lang .fm-ico { width: 30px; height: 30px; }
.fm-lang .fm-label { padding-inline-start: 5px; }
.fm-lang:hover { color: var(--fm-accent); }

/* 6. Sticky bar -------------------------------------------------------------- */
.fm-sticky {
	position: fixed; top: var(--fm-ab, 0px); inset-inline-start: 0; width: var(--fm-w, 100%);
	z-index: var(--fm-z-bar);
	display: flex; justify-content: space-between; align-items: center; gap: 1px;
	padding: 10px;
	background: var(--fm-navy-glass);
	color: #fff;
	transform: translateY(-100px); opacity: 0; pointer-events: none;
	transition: transform 1s ease, opacity 1s ease;
}
.fm-stuck .fm-sticky { transform: none; opacity: 1; pointer-events: auto; }
.fm-logo-sm, .fm-partner-sm { flex: none; width: 59px; padding: 10px; }
/* Spacing copied from the old Elementor sticky bar (same as live):
   bar 0 10px, 2px between burger / menu / tools, menu stretches,
   20px between items (Arabic: tight), search box 118px inside 10px padding. */
.fm-sticky .fm-bar { flex: 1 1 auto; padding: 0 10px; justify-content: space-evenly; gap: 2px; min-width: 0; }
.fm-sticky .fm-burger { width: 34px; }
.fm-sticky .fm-burger svg { fill: #fff; }
.fm-sticky .fm-nav { flex: 1 1 auto; }
.fm-sticky .fm-nav ul { gap: 0 20px; }
.fm-ar .fm-sticky .fm-nav ul { gap: 0 1px; } /* the Arabic sticky bar sets its items tight, as on live */
.fm-logo-sm img, .fm-partner-sm img { width: 34px; margin-inline: auto; }
.fm-sticky .fm-link .fm-ico { width: 34px; height: 34px; margin-inline: 4.25px; }
/* Language link: a fixed 28px slot at the end of the bar with the text running
   over it, exactly as in the old bar, so the search box never moves with the
   length of "English" / "العربية". */
.fm-sticky .fm-tools { gap: 20px; }
.fm-sticky .fm-lang { direction: inherit; flex: 0 0 28px; width: 28px; justify-content: flex-end; white-space: nowrap; padding-inline-end: 12px; }
.fm-ar .fm-sticky .fm-lang { padding-inline-end: 3px; }
.fm-sticky .fm-search { width: 138px; padding: 10px; }

/* 7. Drawer (burger panel) --------------------------------------------------- */
.fm-drawer, .fm-panel {
	position: fixed;
	top: calc(var(--fm-offset) + var(--fm-ab, 0px));
	z-index: var(--fm-z-panel);
	background: var(--fm-navy-glass);
	color: #fff;
	visibility: hidden; opacity: 0; transform: translateY(-10px); pointer-events: none;
	transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s;
	overscroll-behavior: contain;
}
.fm-drawer.is-open, .fm-panel.is-open {
	visibility: visible; opacity: 1; transform: none; pointer-events: auto;
	transition-delay: 0s;
}
.fm-drawer {
	inset-inline-start: var(--fm-pad);
	width: 520px; max-width: 100%;
	max-height: calc(100vh - var(--fm-offset) - 10px); overflow-y: auto;
	padding: 15px;
	border-top: 1px solid var(--fm-accent-soft);
	box-shadow: 0 4px 6px rgba(0, 0, 0, .2);
}
.fm-drawer-head, .fm-drawer-search, .fm-drawer-main { display: none; }
.fm-header .fm-side { padding: 0 56px; }
.fm-side-item { border-bottom: 1px solid var(--fm-accent); }
.fm-side-item:last-child { border-bottom: 0; }
.fm-side-item > .fm-item { padding: 15px 0; padding-inline-end: 20px; font-size: 12px; line-height: 1; }

/* Links inside drawer and panels: accent bar slides in on hover */
.fm-item { display: flex; align-items: center; color: #fff; }
a.fm-item::before {
	content: ""; flex: none;
	width: 4.5px; height: 15px; margin-inline-end: 10px;
	background: var(--fm-accent-soft);
	transform: scaleX(0); transform-origin: left; transition: transform .3s ease-in-out;
}
.fm-ar a.fm-item::before { transform-origin: right; }
a.fm-item:hover::before, a.fm-item:focus-visible::before { transform: scaleX(1); }
a.fm-item:hover, a.fm-item:focus-visible, a.fm-col-label:hover { color: var(--fm-accent-soft); } /* #AE7E6F, as in the old menu */
.fm-item.is-current { color: var(--fm-accent-soft); font-weight: 700; }
.fm-dl { display: inline-flex; margin-inline-start: .4em; }
.fm-dl svg { width: .8em; height: 1em; fill: currentColor; }
a.fm-item:hover .fm-dl { color: var(--fm-accent); }

/* Accordion groups in the drawer (Media Center, E-Participation) */
.fm-acc-btn { display: flex; align-items: center; width: 100%; padding: 16px 0 !important; padding-inline-end: 20px !important; font-size: 12px !important; line-height: 1; text-align: start; color: #fff !important; }
.fm-acc-btn svg { flex: none; width: 14px; height: 14px; margin-inline-end: 3.5px; fill: var(--fm-accent); transition: transform .3s; }
.fm-acc-btn span { padding-inline-start: 5px; }
.fm-acc-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.fm-acc-list { display: flex; flex-direction: column; gap: 20px; padding: 4px 10px 14px !important; }
.fm-acc-list .fm-item { font-size: 13px; line-height: 16px; text-transform: capitalize; }

/* 8. Dropdown panels ---------------------------------------------------------- */
.fm-panel { border-top: 1px solid var(--fm-accent); overflow-y: auto; max-height: 80vh; }
.fm-back { display: none; }

/* 8a. Mega menu (UAE.Stat): columns > groups > links */
.fm-panel-mega { inset-inline-start: 4.5%; width: var(--fm-mega-w, 70%); padding: 0; } /* width: Header settings > Wide dropdown width (live site: 70%) */
.fm-cols { display: flex; padding: 0 10px; }
.fm-col { flex: 1 1 0; min-width: 0; padding: 10px; }
.fm-col-title {
	display: flex; align-items: center;
	padding-bottom: 10px; margin-bottom: 20px !important;
	border-bottom: 1px solid var(--fm-accent);
	color: var(--fm-accent);
	font-size: 13px !important; font-weight: 500 !important; line-height: 16px !important; text-transform: uppercase;
}
.fm-col-title .fm-ico { width: 45px; height: 45px; margin-inline: 5.625px; }
.fm-col-title .fm-ico svg { stroke: var(--fm-accent); fill: var(--fm-accent); }
.fm-col-label { padding-inline-start: 5px; color: inherit; }
.fm-group { padding-bottom: 10px; padding-inline-start: 0; }
.fm-group .fm-item { font-size: 14px; line-height: 20px; text-transform: capitalize; margin-bottom: 1px; }
.fm-group-title { color: var(--fm-accent); padding-bottom: 4px; }
.fm-group-title.fm-nolink { padding-inline-start: 14.5px; }
.fm-group-links { padding-inline-start: 10px !important; }

/* 8a+. Optional +/- accordion for the groups (Header settings > Wide dropdown groups)
   .fm-mega-acc   = folded everywhere
   .fm-mega-acc-m = folded only in the burger (mobile/tablet) layout */
.fm-group { position: relative; }
.fm-grp-toggle { display: none; }
.fm-mega-acc .fm-grp-toggle,
.fm-compact.fm-mega-acc-m .fm-grp-toggle {
	display: inline-flex; align-items: center; justify-content: center;
	position: absolute; top: 0; inset-inline-start: 6px;
	width: 18px; height: 20px; color: var(--fm-accent) !important; font-size: 16px !important; line-height: 20px !important;
}
.fm-mega-acc .fm-grp-toggle::before,
.fm-compact.fm-mega-acc-m .fm-grp-toggle::before { content: "+"; }
.fm-mega-acc .fm-grp-toggle[aria-expanded="true"]::before,
.fm-compact.fm-mega-acc-m .fm-grp-toggle[aria-expanded="true"]::before { content: "\2212"; }
.fm-mega-acc .fm-group-links,
.fm-compact.fm-mega-acc-m .fm-group-links { display: none; }
.fm-mega-acc .fm-group.is-open > .fm-group-links,
.fm-compact.fm-mega-acc-m .fm-group.is-open > .fm-group-links { display: block; }
/* Room for the +/- button before the group title */
.fm-mega-acc .fm-group,
.fm-compact.fm-mega-acc-m .fm-group { padding-inline-start: 24px; }

/* 8b. Simple dropdown list (UAE SDGs, Open Data) */
.fm-panel-list { inset-inline-start: var(--fm-x); min-width: 215px; padding: 10px 20px; }
.fm-list li { border-bottom: 1px solid var(--fm-accent); }
.fm-list li:last-child { border-bottom: 0; }
.fm-list .fm-item { padding: 13px 0; font-size: 14px; line-height: 20px; text-transform: capitalize; white-space: nowrap; }

/* 9. Compact layout (below the breakpoint) ----------------------------------- */
.fm-compact .fm-nav, .fm-compact .fm-tools { display: none; }
.fm-compact .fm-top .fm-bar { justify-content: flex-start; }
.fm-compact.fm-home .fm-top .fm-bar { border-bottom: 0; }
.fm-compact .fm-sticky .fm-bar { justify-content: flex-start; padding: 0 10px; }

.fm-compact .fm-drawer, .fm-compact .fm-panel {
	inset-inline-start: 0;
	background: var(--fm-navy);
	z-index: 9999999;
}
.fm-compact .fm-drawer { width: 520px; max-height: 90vh; border-top: 0; }
.fm-compact .fm-drawer-head { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 0 0 4px; }
.fm-compact .fm-drawer-head .fm-lang { padding: 10px; color: #fff; }
.fm-close svg { display: block; width: 22px; height: 22px; fill: var(--fm-accent); }
.fm-stuck.fm-compact .fm-close { visibility: hidden; }
.fm-compact .fm-drawer-search { display: block; padding: 0 10px 10px; }
.fm-compact .fm-drawer-search .fm-search { width: 80%; }
.fm-compact .fm-drawer-main { display: block; padding: 10px 10px 0; }
.fm-header.fm-compact .fm-side { padding: 0 10px 30px; }
.fm-drawer-item { border-bottom: 1px solid var(--fm-accent); padding: 8px; padding-inline-end: 20px; }
.fm-drawer-item .fm-link { color: #fff; }
.fm-drawer-item .fm-link .fm-ico { width: 29px; height: 29px; margin-inline: 0 7.25px; }
.fm-drawer-item .fm-link .fm-ico svg { stroke: #fff; }
.fm-drawer-item .fm-link.is-current,
.fm-drawer-item .fm-link.is-current-parent { color: var(--fm-accent); font-weight: 700; }
.fm-acc-btn.is-current-parent { color: var(--fm-accent-soft) !important; font-weight: 700 !important; }
.fm-compact .fm-side-item > .fm-item { padding-inline-start: 10px; }
.fm-compact .fm-side-item:last-child { border-bottom: 0; }

.fm-compact .fm-panel { max-height: 80vh; padding: 20px 20px 10px; }
.fm-compact .fm-panel-mega { width: 60%; }
.fm-compact .fm-panel-list { width: 40%; min-height: 40vh; }
.fm-compact .fm-cols { flex-direction: column; padding: 0; }
.fm-compact .fm-back { display: inline-flex; margin-bottom: 6px; }
.fm-back svg { width: 20px; height: 20px; fill: var(--fm-accent); }
.fm-ar .fm-back svg { transform: scaleX(-1); }

/* 10. Tablets and phones (burger floats, bar becomes part of the page flow) --- */
@media (max-width: 1024px) {
	.fm-header { --fm-pad: 15px; }
	.fm-en .fm-flow { height: 40px; }
	.fm-ar .fm-flow { height: 0; }
	.fm-inner .fm-top { padding: 20px 15px; }
	.fm-home .fm-top { padding: 0 15px; }
	.fm-logos, .fm-home .fm-logos { padding: 15px 0 0; }
	.fm-inner .fm-logos { padding: 15px 0 0; }
	.fm-inner .fm-top .fm-bar { height: 50px; }
	.fm-logo { width: 20%; max-width: 140px; }
	.fm-partner { width: 22%; max-width: 165px; }
	.fm-top .fm-bar, .fm-home .fm-top .fm-bar { padding: 0; height: 0; }
	.fm-top .fm-burger { position: fixed; top: calc(101px + var(--fm-ab, 0px)); inset-inline-start: 35px; z-index: var(--fm-z-bar); }
	.fm-sticky { background: var(--fm-navy); }
	/* --fm-w is the page width (set by JS); safer than 100% if some page content overflows sideways */
	.fm-compact .fm-drawer, .fm-compact .fm-panel-mega, .fm-compact .fm-panel-list { inset-inline-start: 0; width: var(--fm-w, 100%); min-height: 0; }
	.fm-compact .fm-drawer-search { display: none; }
}
@media (min-width: 768px) and (max-width: 1024px) {
	.fm-compact .fm-drawer-search { display: block; }
}
@media (max-width: 767px) {
	.fm-header { --fm-pad: 10px; }
	.fm-en .fm-flow { height: 15px; }
	.fm-ar .fm-flow { margin-bottom: -150px; }
	.fm-inner .fm-top { padding: 15px 10px 10px; }
	.fm-home .fm-top { padding: 15px 10px 10px; }
	.fm-logos, .fm-home .fm-logos, .fm-inner .fm-logos { padding: 0; min-height: 26px; }
	.fm-inner .fm-top .fm-bar { height: 0; }
	.fm-top .fm-burger { top: calc(85px + var(--fm-ab, 0px)); inset-inline-start: 10px; width: 43px; }
	.fm-home .fm-top .fm-burger { top: calc(108px + var(--fm-ab, 0px)); }
	.fm-ar .fm-top .fm-burger { top: calc(88px + var(--fm-ab, 0px)); }
	.fm-top .fm-burger svg, .fm-home .fm-top .fm-burger svg { width: 22px; height: 22px; fill: var(--fm-burger-mobile); }
}

@media (prefers-reduced-motion: reduce) {
	.fm-header *, .fm-header { transition-duration: .01ms !important; }
}
@media print { .fm-sticky, .fm-drawer, .fm-panel, .fm-burger { display: none !important; } }
