:root {
  --eirene-header-nav-bg-solid: #ffffff;
  --eirene-header-glass-bg: rgba(255, 255, 255, 0.75);
  --eirene-overscroll-top-color: var(--eirene-header-nav-bg-solid, #ffffff);
  --eirene-overscroll-bottom-color: var(--eirene-footer-bg-solid, #0d1a41);
  --eirene-overscroll-active-color: var(--eirene-overscroll-top-color, #ffffff);
}

html {
  /* Safari can sample different channels (background-color/background-image, html/body) depending on context.
     Keep every channel tied to one active color that JS flips at top vs bottom edges. */
  background-image:
    linear-gradient(
      to bottom,
      var(--eirene-overscroll-active-color, var(--eirene-overscroll-top-color, #ffffff)) 0%,
      var(--eirene-overscroll-active-color, var(--eirene-overscroll-top-color, #ffffff)) 100%
    );
  background-color: var(--eirene-overscroll-active-color, var(--eirene-overscroll-top-color, #ffffff));
}

.header-wrapper {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: fixed;
  top: 0 !important;
  margin-top: 0 !important;
  left: 0;
  z-index: 100;
  width: 100%;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.header-wrapper::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
  background: var(--eirene-header-glass-bg, rgba(255, 255, 255, 0.75));
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  pointer-events: none;
}

@media (max-width: 1023px) {
  /* Prevent gray tint in iOS elastic pull-down behind the notch area. */
  .header-wrapper::before {
    background: var(--eirene-header-nav-bg-solid, #ffffff);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  @supports (padding-top: env(safe-area-inset-top)) {
    .header-wrapper {
      padding-top: env(safe-area-inset-top);
    }

    .site-wrapper {
      padding-top: calc(60px + env(safe-area-inset-top));
    }
  }
}

@media (prefers-color-scheme: dark-disabled) /* temporarily disabled */ {
  .header-wrapper {
    background: rgba(30, 30, 30, 0.75);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}

.cms-ready .header-wrapper {
  top: 46px;
}



header {
  position: relative;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  margin: 0 auto;
  width: 100%;
  max-width: 128.0rem;
  padding: 0 var(--page-gutter);
  min-height: 60px;
  height: auto;
  padding-bottom: 0px;
}

@media (min-width: 768px) {
  header {
    max-width: 114.6rem;
  }
}

@media (min-width: 1024px) {
  header {
    height: auto;
    border-bottom: 0;
  }
}

@media (min-width: 1280px) {
  header {
    max-width: 144.6rem;
  }
}


/* ---- */
/* Logo */
/* ---- */

.fwt-logo {
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        background-image: url(../assets/eirene_logo_n.svg);
        background-repeat: no-repeat;
  align-content: flex-end;
  background-position: left center;
  width: 14em; /* Limit width precisely to artwork instead of 100% block */
  height: 55px;
  min-height: 55px;
}

@media (min-width: 768px) {
  .fwt-logo {
    height: 90px;
    min-height: 90px;
  }
}

@media (min-width: 1024px) {
  .fwt-logo {
    height: 100px;
    min-height: 100px;
  }
}

.header-logo {
  background-size: 14em;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  -moz-transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  -ms-transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  -o-transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  -webkit-transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@media (min-width: 768px) {
  .header-logo {
    background-size: 22em;
    width: 22em;
  }
}

@media (min-width: 1024px) {
  .header-logo {
    background-size: 26em;
    width: 26em;
  }
}

.header-logo img {
  width: 100%;
  height: 100%;
  min-height: 1.8rem;
  max-width:  20rem;
  display: block;
}








/* ------------------ */
/* Mobile menu button */
/* ------------------ */

.mobile-menu-button:after {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  z-index: -1;
  content: url('../images/icon-menu.svg') url('../images/icon-close.svg');
}

.mobile-menu-button {
  margin-left: auto;
/*  padding: 0;*/
  border: 0;
  cursor: pointer;
  background: url('../images/icon-menu.svg') center no-repeat;
  padding: 2.9rem 4.4rem 2.9rem 2rem;
  margin-right: -2rem;
}

@media (min-width: 1024px) {
  .mobile-menu-button {
    display: none;
  }
}

.menu-active .mobile-menu-button {
  background-image: url('../images/icon-close.svg');
}

/* ---- */
/* Menu */
/* ---- */

.menu {
  text-align: right;
  margin-left: auto;
  height: 100%;
  display: none;
}

@media (min-width: 1024px) {
  .menu {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
  }
}

.menu__item {
    cursor: pointer;
    margin-left: 2.8rem;
    position: relative;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
  }

.menu__item:first-child {
  margin-left: 0;
}

.menu__item--contains-dropdown:after {
  display: block;
  content: '';
  width: 0;
  height: 0;
  border-left: 0.4rem solid transparent;
  border-right: 0.4rem solid transparent;
  border-top: 0.5rem solid #0b1c3f;
  border-bottom: 0.5rem solid transparent;
  margin-left: 0.5rem;
  -webkit-transition: border-color 0.15s;
  -o-transition: border-color 0.15s;
  transition: border-color 0.15s;
  position: relative;
  top: 0.3rem;
}

.menu__item--language-toggle .menu__link {
  margin-left: 2.8rem;
}

.menu__item--language-toggle:before {
  content: '';
  width: 0.1rem;
  height: 1.7rem;
  background-color: #d8d8d8;
  display: block;
  margin-right: 2.4rem;
  position: absolute;
  top: 50%;
  left: 0;
  -webkit-transform: translateY(-50%);
      -ms-transform: translateY(-50%);
          transform: translateY(-50%);
}

.menu__link {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.018888889253139496rem;
  text-align: left;
  color: #0d1a41;
  text-decoration: none;
  display: block;
  -webkit-transition: color 0.15s;
  -o-transition: color 0.15s;
  transition: color 0.15s;
}

.menu__link--active:after {
  content: '';
  width: 100%;
  height: 0.5rem;
  background: #ffc20e;
  position: absolute;
  bottom: 0;
  left: 0;
}

.menu__item:hover .menu__link {
  color: #27aae1;
}

.menu__item--contains-dropdown:hover:after {
  border-top-color: #27aae1;
}

/* ------- */
/* Submenu */
/* ------- */

.submenu {
  text-align: left;
  position: absolute;
  top: -9999px;
  left: -2.6rem;
  z-index: 10;
  border-radius: 3px;
  -webkit-box-shadow: 0 0.5rem 1.5rem 0 rgba(0, 0, 0, 0.3);
          box-shadow: 0 0.5rem 1.5rem 0 rgba(0, 0, 0, 0.3);
  background-color: #ffffff;
  border: solid 1px #dedede;
  padding: 0.4rem 0;
  list-style-type: none;
  opacity: 0;
  display: block;
  -webkit-transition: opacity 0.2s, top 0s 0.2s;
  -o-transition: opacity 0.2s, top 0s 0.2s;
  transition: opacity 0.2s, top 0s 0.2s;
}

.menu__item--contains-dropdown--active .submenu {
  opacity: 1;
  top: calc(50% + 2.6rem);
  -webkit-transition: opacity 0.2s, top 0s;
  -o-transition: opacity 0.2s, top 0s;
  transition: opacity 0.2s, top 0s;
}

.menu__item--language-toggle .submenu {
  left: 0.2rem;
}


.menu__item--language-toggle {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

.submenu:before {
  content: '';
  position: absolute;
  bottom: calc(100% - 1px);
  left: 2.8rem;
  -webkit-transform: translate(0, 0.5rem) rotate(45deg);
      -ms-transform: translate(0, 0.5rem) rotate(45deg);
          transform: translate(0, 0.5rem) rotate(45deg);
  width: 1.4rem;
  height: 1.4rem;
  background: #fff;
  border-radius: 2px;
  border-top: solid 1px #dedede;
  border-left: solid 1px #dedede;
}

.submenu__item {
  position: relative;
}

.submenu__item:after {
  content: '';
  width: calc(100% - 5rem);
  height: 1px;
  background: #e0e0e0;
  position: absolute;
  top: 100%;
  left: 50%;
  -webkit-transform: translateX(-50%);
      -ms-transform: translateX(-50%);
          transform: translateX(-50%);
}

.submenu__item:last-child:after {
  display: none;
}

.submenu__link {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.025rem;
  color: #0d1a41;
  text-decoration: none;
  padding: 1.3rem 2.5rem;
  display: block;
  white-space: nowrap;
  -webkit-transition: color 0.15s;
  -o-transition: color 0.15s;
  transition: color 0.15s;
}

.submenu__link:hover {
  color: #27aae1;
}

@media (prefers-color-scheme: dark-disabled) /* temporarily disabled */ {
  .fwt-logo {
    background-image: url(../assets/eirene_logo_dark.svg) !important;
  }
}


/* Desktop Scrolled header (smooth resize, no horizontal displacement) */
@media (min-width: 768px) {
  /* Restore normal pointer events to prevent clicking through the header */
  .header-wrapper, 
  .header-wrapper header { 
    pointer-events: auto !important; 
    overscroll-behavior: auto; /* Ensure scrolls bubble up */
  }
  
  /* Make sure header has transition */
  header {
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  /* Shrink banner padding */
  .header-wrapper.is-scrolled header { 
    min-height: 55px !important; 
    padding-top: 0 !important; 
    padding-bottom: 0 !important; 
  }
  
  /* Shrink logo heights */
  .header-wrapper.is-scrolled .fwt-logo { 
    height: 60px !important; 
    min-height: 60px !important; 
  }
  .header-wrapper.is-scrolled .header-logo { 
    background-size: 16em; 
    width: 16em; 
  }
}

@media (min-width: 1024px) {
  .header-wrapper.is-scrolled .fwt-logo { 
    height: 70px !important; 
    min-height: 70px !important; 
  }
  .header-wrapper.is-scrolled .header-logo { 
    background-size: 19em; 
    width: 19em; 
  }
}

/* Dynamic Dark Glassmorphism for dark background pages (Apple liquid glass style) */
body.dark-theme .header-wrapper,
.header-wrapper.dark-glass, .header-wrapper[data-glass-tone="dark"] {
  --eirene-header-nav-bg-solid: var(--dynamic-bg-color, #101010);
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.header-wrapper.dark-glass::before, .header-wrapper[data-glass-tone="dark"]::before {
  background: rgba(20, 20, 20, 0.5);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
}

html.dark-theme,
html:has(body.dark-theme),
html:has(.header-wrapper.dark-glass),
html:has(.header-wrapper[data-glass-tone="dark"]) {
  --eirene-overscroll-top-color: var(--dynamic-bg-color, #101010);
  --eirene-overscroll-bottom-color: var(--eirene-footer-bg-solid, #0d1a41);
  background-image:
    linear-gradient(
      to bottom,
      var(--eirene-overscroll-active-color, var(--eirene-overscroll-top-color, #101010)) 0%,
      var(--eirene-overscroll-active-color, var(--eirene-overscroll-top-color, #101010)) 100%
    ) !important;
  background-color: var(--eirene-overscroll-active-color, var(--eirene-overscroll-top-color, #101010)) !important;
}

body.dark-theme .fwt-logo,
.header-wrapper.dark-glass, .header-wrapper[data-glass-tone="dark"] .fwt-logo {
  background-image: url(../assets/eirene_logo_dark.svg);
}

body.dark-theme .menu__link,
.header-wrapper.dark-glass, .header-wrapper[data-glass-tone="dark"] .menu__link,
body.dark-theme .mobile-menu-button,
.header-wrapper.dark-glass, .header-wrapper[data-glass-tone="dark"] .mobile-menu-button {
  color: #f1f1f1;
}

body.dark-theme .menu__item--contains-dropdown:after,
.header-wrapper.dark-glass, .header-wrapper[data-glass-tone="dark"] .menu__item--contains-dropdown:after {
  border-top-color: #f1f1f1;
}

body.dark-theme .menu__link--active:after,
.header-wrapper.dark-glass, .header-wrapper[data-glass-tone="dark"] .menu__link--active:after {
  background: #ffc20e;
}
/* Make animated dots white in dark glass */
.header-wrapper.dark-glass, .header-wrapper[data-glass-tone="dark"] .animated-dots span {
  background-color: #ffffff;
}

/* Glass dots button border/background in dark mode if needed */
.header-wrapper.dark-glass, .header-wrapper[data-glass-tone="dark"] .glass-dots-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}
.header-wrapper.dark-glass, .header-wrapper[data-glass-tone="dark"] .glass-dots-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Menu Lang pill in dark glass */
.header-wrapper.dark-glass, .header-wrapper[data-glass-tone="dark"] .menu-lang-w {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.header-wrapper.dark-glass, .header-wrapper[data-glass-tone="dark"] .menu-lang-w::before {
  background-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.header-wrapper.dark-glass, .header-wrapper[data-glass-tone="dark"] .menu-lang-w a {
  color: rgba(255, 255, 255, 0.7);
}
.header-wrapper.dark-glass, .header-wrapper[data-glass-tone="dark"] .menu-lang-w a.current {
  color: #ffffff;
}
.header-wrapper.dark-glass, .header-wrapper[data-glass-tone="dark"] .menu-lang-w a:hover:not(.current) {
  color: rgba(255, 255, 255, 0.9);
}
