/*
 * MWI language switcher, concept 03 "Medallion cascade" (2026-10-24, owner's pick of three).
 * Loader: novamira-sandbox/mwi-lang-flags.php, which re-renders the Polylang widget in the
 * header as .mwi-langx: one gilded flag medallion, and on a click the languages fall
 * below it on a thin gold chain. Flags only, no names (owner, 2026-10-24).
 *
 * Three-id selectors (3,2,x) because mwi-header-v2.css owns .mwi-lang-card at (3,1,x) !important,
 * and mwi-hardedge.css clips .mwi-lang-card, which would cut the cascade off.
 */

/* the old segmented pill around the switcher goes; the medallion stands bare */
#mwi-header#mwi-header#mwi-header .mwi-lang-card.mwi-lang-card{
  background:transparent!important;border:0!important;padding:0!important;
  -webkit-clip-path:none!important;clip-path:none!important;overflow:visible!important;
}
#mwi-header#mwi-header#mwi-header .mwi-lang-card.mwi-lang-card::before,
#mwi-header#mwi-header#mwi-header .mwi-lang-card.mwi-lang-card::after{display:none!important}

.mwi-langx{position:relative;display:inline-block;font-family:"Frank Ruhl Libre",Georgia,serif}

/* trigger: the current language's medallion and a small gold chevron */
#mwi-header#mwi-header#mwi-header .mwi-langx.mwi-langx .mwi-langx-trig{
  display:flex!important;align-items:center;gap:6px;margin:0;padding:6px!important;
  background:none!important;border:0!important;box-shadow:none!important;cursor:pointer;color:#B9924E;
}
#mwi-header#mwi-header#mwi-header .mwi-langx.mwi-langx .mwi-langx-trig:focus-visible{outline:2px solid #B9924E;outline-offset:2px}
.mwi-langx-chev{display:block;width:9px;height:9px;transition:transform .45s cubic-bezier(.16,1,.3,1)}
.mwi-langx.is-open .mwi-langx-chev{transform:rotate(180deg)}

/* medallion: a gilded rim, the flag set in it, a soft highlight */
.mwi-langx-medal{
  position:relative;display:block;flex:none;width:28px;height:28px;padding:3px;border-radius:50%!important;
  background:conic-gradient(from 210deg,#9A7639,#E3CB96,#B9924E,#F3E4C2,#A8823F,#E3CB96,#9A7639);
  box-shadow:0 4px 10px -3px rgba(36,26,18,.45);
}
.mwi-langx-medal::after{content:"";position:absolute;inset:3px;border-radius:50%!important;pointer-events:none;
  background:radial-gradient(110% 80% at 32% 20%,rgba(255,255,255,.4),rgba(255,255,255,0) 45%)}
.mwi-langx-flag{display:block;width:100%;height:100%;border-radius:50%!important;overflow:hidden;
  box-shadow:0 0 0 1px rgba(36,26,18,.35);filter:saturate(.82) sepia(.12);transition:filter .35s}
.mwi-langx-flag svg{display:block;width:100%;height:100%}
.mwi-langx-trig:hover .mwi-langx-flag,.mwi-langx-list a:hover .mwi-langx-flag{filter:none}

/* the cascade: a zero-width column centred exactly under the trigger's medallion
   (6px padding + half of 28px = 20px), so every medallion and the chain share one axis */
#mwi-header#mwi-header#mwi-header .mwi-langx.mwi-langx .mwi-langx-list{
  position:absolute!important;top:100%;left:20px;width:0!important;min-width:0!important;height:auto!important;
  display:grid!important;justify-items:center;gap:10px!important;margin:0!important;padding:14px 0 0!important;
  list-style:none!important;background:none!important;border:0!important;pointer-events:none;z-index:5;
}
#mwi-header#mwi-header#mwi-header .mwi-langx.mwi-langx .mwi-langx-list::before{
  content:"";position:absolute;left:0;top:0;width:1px;height:0;transform:translateX(-.5px);
  background:linear-gradient(#B9924E,rgba(185,146,78,.2));transition:height .5s cubic-bezier(.16,1,.3,1);
}
#mwi-header#mwi-header#mwi-header .mwi-langx.mwi-langx .mwi-langx-list li{
  /* a 34px medallion hung on a zero-width column: pull it back by half so its centre sits on the chain */
  position:relative;left:-17px;margin:0!important;padding:0!important;
  opacity:0;transform:translateY(-16px);transition:opacity .45s cubic-bezier(.16,1,.3,1),transform .55s cubic-bezier(.16,1,.3,1);
}
#mwi-header#mwi-header#mwi-header .mwi-langx.mwi-langx .mwi-langx-list li:nth-child(2){transition-delay:.08s}
#mwi-header#mwi-header#mwi-header .mwi-langx.mwi-langx .mwi-langx-list li:nth-child(3){transition-delay:.16s}
#mwi-header#mwi-header#mwi-header .mwi-langx.mwi-langx.is-open .mwi-langx-list{pointer-events:auto}
#mwi-header#mwi-header#mwi-header .mwi-langx.mwi-langx.is-open .mwi-langx-list::before{height:calc(100% - 18px)}
#mwi-header#mwi-header#mwi-header .mwi-langx.mwi-langx.is-open .mwi-langx-list li{opacity:1;transform:none}


#mwi-header#mwi-header#mwi-header .mwi-lang-card .mwi-langx-list a,
#mwi-header#mwi-header#mwi-header .mwi-langx.mwi-langx .mwi-langx-list a{
  position:relative!important;display:block!important;width:34px!important;min-width:0!important;height:34px!important;padding:0!important;
  background:none!important;clip-path:none!important;-webkit-clip-path:none!important;text-decoration:none!important;
}
#mwi-header#mwi-header#mwi-header .mwi-langx.mwi-langx .mwi-langx-list .mwi-langx-medal{width:34px;height:34px}
#mwi-header#mwi-header#mwi-header .mwi-langx.mwi-langx .mwi-langx-list .current-lang .mwi-langx-medal{
  box-shadow:0 0 0 2px #FBF8F3,0 0 0 3px #B9924E,0 4px 10px -3px rgba(36,26,18,.45)}

/* hard-edge squares every corner at (0,2,1) !important; the medallions are shapes, not corners */
body.mwi-hardedge .mwi-langx .mwi-langx-medal,body.mwi-hardedge .mwi-langx .mwi-langx-flag,
body.mwi-hardedge .mwi-hv-fs-lang .mwi-langx-medal,body.mwi-hardedge .mwi-hv-fs-lang .mwi-langx-flag{border-radius:50%!important}

/* phone menu: header-v2 clones the list into the ivory sheet (top right, beside the logo);
   there it is two bare medallions side by side, the current one ringed in gold */
#mwi-header#mwi-header#mwi-header .mwi-hv-fs-lang ul.mwi-langx-list{display:flex!important;gap:10px;padding:0!important;background:none!important;border:0!important}
#mwi-header#mwi-header#mwi-header .mwi-hv-fs-lang .mwi-langx-list a{display:block!important;min-width:0;width:28px;height:28px;padding:0!important;background:none!important;-webkit-clip-path:none!important;clip-path:none!important}
#mwi-header#mwi-header#mwi-header .mwi-hv-fs-lang .current-lang .mwi-langx-medal{box-shadow:0 0 0 2px #FBF8F3,0 0 0 3px #B9924E,0 4px 10px -3px rgba(36,26,18,.45)}

@media (prefers-reduced-motion:reduce){
  .mwi-langx *,.mwi-langx-list::before{transition:none!important}
}
