/* EllisDon-inspired menu for MITA */

.ed-header {
  position: fixed;
  z-index: 200;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
}
.ed-header-bar {
  position: relative;
  z-index: 210;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 48px);
  max-width: 1120px;
  margin: 16px auto 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(18, 20, 42, 0.08);
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
body:not(.inner-page) .ed-header-bar {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
body:not(.inner-page) .ed-logo-img--dark { display: none; }
body:not(.inner-page) .ed-logo-img--light { display: block; }
body:not(.inner-page) .ed-toplink { color: #fff; }
body:not(.inner-page) .ed-toplink:hover { background: rgba(255,255,255,0.12); }
body.inner-page .ed-logo-img--light { display: none; }
body.inner-page .ed-logo-img--dark { display: block; }

/* Scrolled: solid EllisDon blue bar */
.ed-header.is-scrolled .ed-header-bar,
body.ed-scrolled .ed-header-bar {
  background: var(--navy, #0032a0);
  backdrop-filter: none;
  box-shadow: 0 10px 32px rgba(0, 8, 57, 0.28);
  border: 1px solid transparent;
}
.ed-header.is-scrolled .ed-logo-img--dark,
body.ed-scrolled .ed-logo-img--dark { display: none !important; }
.ed-header.is-scrolled .ed-logo-img--light,
body.ed-scrolled .ed-logo-img--light { display: block !important; }
.ed-header.is-scrolled .ed-toplink,
body.ed-scrolled .ed-toplink { color: #fff; }
.ed-header.is-scrolled .ed-toplink:hover,
body.ed-scrolled .ed-toplink:hover { background: rgba(255, 255, 255, 0.12); }
.ed-header.is-scrolled .ed-burger,
body.ed-scrolled .ed-burger {
  background: rgba(255, 255, 255, 0.18);
}
.ed-header.is-scrolled .ed-burger .ed-ham span,
body.ed-scrolled .ed-burger .ed-ham span {
  background: #fff;
}
.ed-header.is-scrolled .ed-burger:hover,
.ed-header.is-scrolled .ed-burger.is-active,
body.ed-scrolled .ed-burger:hover,
body.ed-scrolled .ed-burger.is-active {
  background: #021f7b;
}
.ed-header.is-scrolled .ed-cta,
body.ed-scrolled .ed-cta {
  background: rgba(255, 255, 255, 0.16);
}
.ed-header.is-scrolled .ed-cta:hover,
body.ed-scrolled .ed-cta:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Open: bar dissolves into the navy panel (EllisDon pattern) */
body.ed-menu-open .ed-header-bar {
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  border-color: transparent;
}
body.ed-menu-open .ed-logo-img--dark { display: none !important; }
body.ed-menu-open .ed-logo-img--light { display: block !important; }
body.ed-menu-open .ed-toplink { color: #fff; }
body.ed-menu-open .ed-toplink:hover { background: rgba(255,255,255,0.12); }
body.ed-menu-open .ed-cta {
  background: rgba(255, 255, 255, 0.14);
}
body.ed-menu-open .ed-cta:hover {
  background: rgba(77, 127, 224, 0.4);
}

.ed-burger {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #e7ecf6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  position: relative;
  z-index: 5;
}
.ed-burger:hover,
.ed-burger.is-active {
  background: var(--navy, #0032a0);
}
.ed-burger .ed-ham {
  width: 18px;
  height: 12px;
  position: relative;
}
.ed-burger .ed-ham span {
  position: absolute;
  left: 50%;
  width: 18px;
  height: 1.7px;
  border-radius: 10px;
  background: #000;
  transform: translateX(-50%);
  transform-origin: center;
  transition: all 0.2s ease;
}
.ed-burger .ed-ham span:nth-child(1) { top: 0; }
.ed-burger .ed-ham span:nth-child(2) { top: 5px; }
.ed-burger .ed-ham span:nth-child(3) { top: 10px; }
.ed-burger:hover .ed-ham span,
.ed-burger.is-active .ed-ham span {
  background: #fff;
}
.ed-burger.is-active .ed-ham span:nth-child(1),
.ed-burger.is-active .ed-ham span:nth-child(2) {
  top: 6px;
}
.ed-burger.is-active .ed-ham span:nth-child(1) {
  transform: translateX(-50%) rotate(45deg);
}
.ed-burger.is-active .ed-ham span:nth-child(2) {
  transform: translateX(-50%) rotate(-45deg);
}
.ed-burger.is-active .ed-ham span:nth-child(3) {
  display: none;
}

.ed-logo {
  display: flex;
  align-items: center;
  margin-left: 4px;
  text-decoration: none;
}
.ed-logo img {
  height: 36px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.ed-toplinks {
  display: none;
  list-style: none;
  margin: 0 0 0 18px;
  padding: 0;
  gap: 4px;
  align-items: center;
}
.ed-toplink {
  display: block;
  padding: 8px 12px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--navy, #0032a0);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease;
}
.ed-toplink:hover {
  background: rgba(0, 50, 160, 0.08);
}

.ed-cta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--navy, #0032a0);
  color: #fff !important;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background 0.2s ease;
}
.ed-cta:hover { background: #021f7b; }
.ed-cta svg { width: 18px; height: 18px; }

@media (min-width: 900px) {
  .ed-toplinks { display: flex; }
}

/* Expanding panel (EllisDon sub-navigation vibe) */
.ed-panel {
  position: fixed;
  z-index: 190;
  left: 50%;
  top: 16px;
  width: calc(100% - 48px);
  max-width: 1120px;
  height: 56px;
  max-height: min(750px, calc(100vh - 32px));
  transform: translateX(-50%);
  border-radius: 14px;
  background: var(--navy, #0032a0);
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 24px 60px rgba(0, 8, 57, 0.35);
}
.ed-panel.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

/* Soft page dim while menu is open */
body.ed-menu-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 180;
  background: rgba(0, 8, 57, 0.45);
  pointer-events: auto;
}
.ed-panel-inner {
  display: flex;
  height: 100%;
  justify-content: space-between;
  gap: 24px;
  padding: 96px 36px 32px;
  opacity: 0;
}
.ed-panel-nav {
  flex: 1 1 auto;
  max-width: 720px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px 16px;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}
.ed-panel-nav li {
  width: calc(50% - 8px);
  opacity: 0;
  transform: translateY(12px);
}
.ed-panel-nav a {
  display: block;
  padding: 16px;
  border-radius: 16px;
  color: #fff;
  text-decoration: none;
  font-size: clamp(1.15rem, 2.2vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  transition: background 0.2s ease;
}
.ed-panel-nav a:hover {
  background: rgba(77, 127, 224, 0.28);
}
.ed-panel-nav a small {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.7;
  letter-spacing: 0;
}
.ed-panel-visual {
  width: min(42%, 480px);
  flex-shrink: 0;
  border-radius: 16px;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.96);
  background: #000839;
}
.ed-panel-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 280px;
}

@media (max-width: 899px) {
  .ed-header-bar {
    width: calc(100% - 20px);
    max-width: none;
    margin: 12px auto 0;
    padding: 8px 10px;
    gap: 8px;
  }
  .ed-panel {
    width: calc(100% - 20px);
    max-width: none;
    top: 12px;
  }
  .ed-logo img {
    height: 30px;
    max-width: 140px;
  }
  .ed-cta {
    padding: 8px 12px;
    font-size: 0.7rem;
  }
  .ed-cta svg { display: none; }
  .ed-panel-inner {
    flex-direction: column;
    padding: 88px 16px 20px;
  }
  .ed-panel-nav li { width: 100%; }
  .ed-panel-nav a {
    font-size: 1.2rem;
    padding: 12px;
  }
  .ed-panel-visual {
    width: 100%;
    max-height: 140px;
  }
  .ed-panel-visual img { min-height: 120px; }
}

@media (max-width: 480px) {
  .ed-cta span,
  .ed-cta {
    /* keep Contact Us but tighter */
    letter-spacing: 0;
  }
}

body.ed-menu-open {
  overflow: hidden;
}

/* Hide legacy headers when Ellis menu is present */
body.has-ed-menu #header,
body.has-ed-menu .lc-topbar,
body.has-ed-menu .lc-site-header,
body.has-ed-menu .mobile-nav,
body.has-ed-menu .lc-mobile-nav,
body.has-ed-menu .toggle-mobile {
  display: none !important;
}

/* Offset inner page content under floating header */
body.inner-page.has-ed-menu .lc-page-hero {
  padding-top: 7rem;
}
