/* Education Malta V111 | One full-width header that becomes ONE floating pill after scrolling.
   Deliberately leaves the approved logo, footer, hero news and page templates intact. */
:root{--em111-admin-top:0px;--em111-red:#B51221}
.admin-bar{--em111-admin-top:32px}
html:has(#wpadminbar){--em111-admin-top:32px}
@media(max-width:782px){.admin-bar,html:has(#wpadminbar){--em111-admin-top:46px}}

/* The header is centred in BOTH modes; this makes width morph smoothly instead of jumping. */
.em109-shell .em109-header{
 left:50%;right:auto;width:100%;transform:translateX(-50%);
 border-radius:0;top:var(--em111-admin-top);
 transition:
  width .66s cubic-bezier(.22,1,.36,1),
  top .66s cubic-bezier(.22,1,.36,1),
  height .66s cubic-bezier(.22,1,.36,1),
  padding .66s cubic-bezier(.22,1,.36,1),
  border-radius .66s cubic-bezier(.22,1,.36,1),
  background .35s ease,border-color .35s ease,box-shadow .55s ease,opacity .35s ease;
 will-change:width,height,top,border-radius;
}
/* This is a single element morph, never two headers fading across one another. */
body.em111-condensed .em109-shell .em109-header{
 top:calc(var(--em111-admin-top) + 14px)!important;
 width:min(1240px,calc(100vw - 44px));
 height:64px;
 padding:0 clamp(17px,2vw,29px);
 border-radius:100px;
 background:rgba(255,255,255,.97)!important;
 border:1px solid rgba(206,213,223,.85)!important;
 box-shadow:0 12px 40px rgba(9,23,42,.16),0 2px 8px rgba(9,23,42,.06)!important;
 -webkit-backdrop-filter:blur(17px) saturate(1.35);
 backdrop-filter:blur(17px) saturate(1.35);
}
body.em111-condensed .em109-shell .em109-brand{height:64px;gap:8px}
body.em111-condensed .em109-shell .em109-brand img{width:43px;height:43px}
body.em111-condensed .em109-shell .em109-brand span{font-size:13px!important;text-shadow:none!important;color:#11253a!important}
body.em111-condensed .em109-shell .em109-brand b{color:var(--em111-red)!important;text-shadow:none!important}
body.em111-condensed .em109-shell .em109-bar-links{gap:clamp(10px,1.3vw,19px)}
body.em111-condensed .em109-shell .em109-bar-links a{
 height:64px;font-size:clamp(11px,.86vw,13px)!important;color:#344558!important;
 text-shadow:none!important;
}
body.em111-condensed .em109-shell .em109-bar-links a::after{bottom:15px}
body.em111-condensed .em109-shell .em109-menu-toggle{height:38px;gap:10px;color:#11253a!important;border-color:#dbe0e6!important;text-shadow:none!important}
body.em111-condensed .em109-shell .em109-menu-lines{width:24px}
body.em111-condensed .em109-shell .em109-brand img{filter:none!important}
body.em111-condensed .em109-shell .em109-panel{
 top:calc(var(--em111-admin-top) + 90px)!important;
 right:max(22px,calc((100vw - 1240px)/2));
 max-height:calc(100dvh - var(--em111-admin-top) - 106px);
}
/* The button remains part of the header, not a second disconnected floating pill. */
body.em111-condensed .em109-shell.is-open .em109-header{
 background:#fff!important;
}
/* Existing loader visibility rule always wins; header cannot flash as the page loads. */
body.em109-loading .em109-shell,
body.em109-loading .em109-shell .em109-header{opacity:0!important;visibility:hidden!important;pointer-events:none!important}
/* Preserve page anchor readability below the floating header. */
html{scroll-padding-top:110px}

@media(max-width:1280px){
 body.em111-condensed .em109-shell .em109-header{width:calc(100vw - 36px)}
 body.em111-condensed .em109-shell .em109-panel{right:18px}
}
@media(max-width:850px){
 body.em111-condensed .em109-shell .em109-header{
  top:calc(var(--em111-admin-top) + 10px)!important;
  height:60px;width:calc(100vw - 26px);padding:0 17px;
 }
 body.em111-condensed .em109-shell .em109-brand{height:60px}
 body.em111-condensed .em109-shell .em109-brand img{width:42px;height:42px}
 body.em111-condensed .em109-shell .em109-panel{
  top:calc(var(--em111-admin-top) + 80px)!important;
  right:13px;width:calc(100vw - 26px);
  max-height:calc(100dvh - var(--em111-admin-top) - 93px);
 }
}
@media(max-width:520px){
 body.em111-condensed .em109-shell .em109-header{height:56px;padding:0 13px;width:calc(100vw - 20px)}
 body.em111-condensed .em109-shell .em109-brand{height:56px}
 body.em111-condensed .em109-shell .em109-brand img{width:39px;height:39px}
 body.em111-condensed .em109-shell .em109-brand span{font-size:12px!important}
 body.em111-condensed .em109-shell .em109-menu-toggle{height:36px;font-size:12px!important}
 body.em111-condensed .em109-shell .em109-panel{
  top:calc(var(--em111-admin-top) + 75px)!important;
  right:10px;width:calc(100vw - 20px);
  max-height:calc(100dvh - var(--em111-admin-top) - 87px);
 }
}
@media(prefers-reduced-motion:reduce){
 .em109-shell .em109-header,
 body.em111-condensed .em109-shell .em109-brand img,
 body.em111-condensed .em109-shell .em109-bar-links a{transition:none!important}
}
