/* Mascotfun Language Popup v2.3
   Desktop: top utility bar after USD.
   Mobile: uses Journal 3's dedicated mobile-language-wrapper so currency stays visible.
*/
:root{
  --mlp-font-family: inherit;
  --mlp-font-size: 13px;
  --mlp-font-weight: 400;
  --mlp-gold: #B36B00;
  --mlp-gold-hover: #8F5600;
  --mlp-blue: #2459C6;
}

.mlp-header-host{
  display:inline-flex!important;
  align-items:center!important;
  flex:0 0 auto!important;
  position:relative!important;
  vertical-align:middle!important;
  margin:0 8px!important;
  padding:0!important;
  z-index:5!important;
  font-family:var(--mlp-font-family)!important;
  font-size:var(--mlp-font-size)!important;
  font-weight:var(--mlp-font-weight)!important;
}

#mlp-trigger.mlp-trigger{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  min-width:0!important;
  height:36px!important;
  padding:0 6px!important;
  margin:0!important;
  border:0!important;
  outline:0!important;
  border-radius:3px!important;
  background:transparent!important;
  box-shadow:none!important;
  cursor:pointer!important;
  white-space:nowrap!important;
  font-family:inherit!important;
  font-size:13px!important;
  font-weight:500!important;
  line-height:1!important;
  color:var(--mlp-gold)!important;
  opacity:1!important;
}

#mlp-trigger.mlp-trigger .mlp-trigger-label,
#mlp-trigger.mlp-trigger .mlp-trigger-chevron{
  color:var(--mlp-gold)!important;
  opacity:1!important;
}

#mlp-trigger.mlp-trigger:hover,
#mlp-trigger.mlp-trigger:focus,
#mlp-trigger.mlp-trigger:hover .mlp-trigger-label,
#mlp-trigger.mlp-trigger:hover .mlp-trigger-chevron,
#mlp-trigger.mlp-trigger:focus .mlp-trigger-label,
#mlp-trigger.mlp-trigger:focus .mlp-trigger-chevron{
  color:var(--mlp-gold-hover)!important;
}

.mlp-trigger-flag{
  display:block!important;
  width:24px!important;
  height:16px!important;
  flex:0 0 24px!important;
  border-radius:1px!important;
  object-fit:cover!important;
  box-shadow:0 0 0 1px rgba(0,0,0,.12)!important;
}

.mlp-trigger-label{
  display:inline-block!important;
  font:inherit!important;
  line-height:1!important;
}

.mlp-trigger-chevron{
  display:inline-block!important;
  font-family:Arial,sans-serif!important;
  font-size:9px!important;
  line-height:1!important;
  transform:translateY(1px)!important;
}

/* Fallback only if Journal header slot cannot be found. */
.mlp-header-host.mlp-fallback-host{
  position:fixed!important;
  left:12px!important;
  bottom:16px!important;
  margin:0!important;
  padding:2px 4px!important;
  z-index:2147482000!important;
  background:#fff!important;
  border:1px solid rgba(0,0,0,.12)!important;
  border-radius:5px!important;
  box-shadow:0 5px 20px rgba(0,0,0,.16)!important;
}

/* Language panel */
.mlp-popover{
  position:fixed!important;
  display:none!important;
  width:min(1000px,calc(100vw - 24px))!important;
  max-height:min(440px,calc(100vh - 120px))!important;
  background:#fff!important;
  color:#20252a!important;
  border:1px solid rgba(0,0,0,.13)!important;
  border-radius:6px!important;
  box-shadow:0 14px 38px rgba(0,0,0,.20)!important;
  z-index:2147483000!important;
  overflow:auto!important;
  padding:10px 14px!important;
  box-sizing:border-box!important;
  font-family:var(--mlp-font-family)!important;
  font-size:13px!important;
  font-weight:400!important;
}
.mlp-popover.mlp-open{display:block!important}

.mlp-grid{
  display:grid!important;
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  gap:0 14px!important;
  width:100%!important;
}

.mlp-item{
  display:flex!important;
  align-items:center!important;
  gap:7px!important;
  min-width:0!important;
  height:40px!important;
  padding:0 5px!important;
  border-bottom:1px solid #e9ecef!important;
  color:#1d2228!important;
  text-decoration:none!important;
  background:#fff!important;
  cursor:pointer!important;
  box-sizing:border-box!important;
  border-radius:2px!important;
}
.mlp-item:hover{
  background:#f4f7fd!important;
  color:var(--mlp-blue)!important;
  text-decoration:none!important;
}
.mlp-item.is-current{
  font-weight:600!important;
  background:#fff8ea!important;
  color:#8F5600!important;
}
.mlp-item.is-current:after{
  content:'✓'!important;
  margin-left:auto!important;
  font-size:11px!important;
  color:#8F5600!important;
}

.mlp-flag{
  display:block!important;
  width:22px!important;
  height:14px!important;
  flex:0 0 22px!important;
  border-radius:1px!important;
  object-fit:cover!important;
  box-shadow:0 0 0 1px rgba(0,0,0,.10)!important;
}
.mlp-name{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-family:inherit!important;
  font-size:13px!important;
  line-height:1.2!important;
}

.mlp-mobile-head{display:none!important}

/* Hide Google's own UI/banner. */
#google_translate_element_mlp{
  position:fixed!important;
  left:-10000px!important;
  top:-10000px!important;
  width:1px!important;
  height:1px!important;
  overflow:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}
.goog-te-banner-frame.skiptranslate,
.goog-te-banner-frame,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
iframe.goog-te-banner-frame,
body > .skiptranslate iframe{
  display:none!important;
  visibility:hidden!important;
}
html,body{top:0!important}

@media(max-width:1100px){
  .mlp-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  .mlp-popover{max-height:480px!important}
}

@media(max-width:760px){
  /* Important: the selector now occupies Journal 3's language slot, not the currency slot. */
  .mobile-language-wrapper #mlp-header-host,
  .mlp-header-host.mlp-mobile-mounted{
    display:inline-flex!important;
    flex:0 0 auto!important;
    width:auto!important;
    max-width:44px!important;
    margin:0 4px 0 0!important;
    padding:0!important;
  }

  #mlp-trigger.mlp-trigger{
    width:40px!important;
    min-width:40px!important;
    height:34px!important;
    padding:0 7px!important;
    gap:0!important;
    color:var(--mlp-gold)!important;
  }

  /* Compact mobile trigger so USD/currency always remains visible. */
  #mlp-trigger .mlp-trigger-label,
  #mlp-trigger .mlp-trigger-chevron{
    display:none!important;
  }

  .mlp-trigger-flag{
    width:24px!important;
    height:16px!important;
    flex:0 0 24px!important;
  }

  .mlp-popover{
    position:fixed!important;
    box-sizing:border-box!important;
    width:auto!important;
    min-width:0!important;
    margin:0!important;
    padding:0 10px 10px!important;
    max-height:calc(100vh - 16px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    border-radius:8px!important;
    box-shadow:0 10px 35px rgba(0,0,0,.26)!important;
  }

  .mlp-mobile-head{
    position:sticky!important;
    top:0!important;
    z-index:3!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    height:46px!important;
    margin:0 -10px 4px!important;
    padding:0 12px!important;
    background:#fff!important;
    border-bottom:1px solid #e7e9ec!important;
    color:#20252a!important;
    box-sizing:border-box!important;
  }
  .mlp-mobile-head strong{
    font-family:var(--mlp-font-family)!important;
    font-size:14px!important;
    font-weight:600!important;
  }
  .mlp-mobile-close{
    width:34px!important;
    height:34px!important;
    padding:0!important;
    margin:0!important;
    border:0!important;
    border-radius:50%!important;
    background:#f3f4f5!important;
    color:#333!important;
    font:400 24px/32px Arial,sans-serif!important;
    text-align:center!important;
    cursor:pointer!important;
  }
  .mlp-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:0 8px!important;
  }
  .mlp-item{
    height:44px!important;
    min-height:44px!important;
    padding:0 5px!important;
  }
  .mlp-name{
    display:block!important;
    max-width:none!important;
    overflow:visible!important;
    text-overflow:clip!important;
    white-space:nowrap!important;
    font-size:13px!important;
    color:#1d2228!important;
  }
  .mlp-flag{
    width:24px!important;
    height:16px!important;
    flex:0 0 24px!important;
  }
}

@media(max-width:380px){
  .mlp-grid{grid-template-columns:1fr!important}
}


/* v2.4 Classic 1 clickability fix:
   use Journal 3's own language wrapper and keep it above overlapping top-bar items. */
.header-classic .top-bar .language-currency{
  z-index:120!important;
  overflow:visible!important;
  pointer-events:auto!important;
}
.desktop-language-wrapper.mlp-native-slot,
.mobile-language-wrapper.mlp-native-slot{
  position:relative!important;
  z-index:121!important;
  overflow:visible!important;
  pointer-events:auto!important;
  display:flex!important;
  align-items:center!important;
}
.mlp-native-slot > .mlp-native-language-hidden{
  display:none!important;
}
.mlp-native-slot > #mlp-header-host{
  position:relative!important;
  z-index:122!important;
  pointer-events:auto!important;
  margin:0!important;
}
.mlp-native-slot #mlp-trigger{
  position:relative!important;
  z-index:123!important;
  pointer-events:auto!important;
  touch-action:manipulation!important;
}
