/* Changa font is loaded globally by the theme - no need to import here */

.hm-header {
  width: 100%;
  margin: 0;
  padding: 0;
}

.hm-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 3%;
  max-width: 1400px;
  margin: 0 auto;
}

.hm-header__logo {
  text-decoration: none;
}

.hm-header__logo img {
  display: block;
  max-height: 80px;
  max-width: 280px;
  height: auto;
  width: auto;
  object-fit: contain;
}

.hm-header__brand {
  font-weight: 700;
  font-size: 1.1rem;
}

.hm-header__toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  position: relative;
  cursor: pointer;
}

.hm-header__toggle::before,
.hm-header__toggle::after,
.hm-header__toggle span {
  content: "";
  display: block;
  height: 2px;
  width: 24px;
  background: currentColor;
  position: absolute;
  left: 8px;
}

.hm-header__toggle::before {
  top: 12px;
}

.hm-header__toggle::after {
  top: 26px;
}

.hm-header__toggle span {
  top: 19px;
}

.hm-header__nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 24px;
  font-family: 'Changa', sans-serif;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hm-header__nav > li {
  position: relative;
}

.hm-header__nav a {
  text-decoration: none;
  font-family: 'Changa', sans-serif;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  transition: opacity 0.3s ease;
  color: inherit;
}

.hm-header__nav a:hover {
  opacity: 0.7;
}

.hm-header__nav ul {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 12px 0;
  display: none;
  position: absolute;
  background: var(--hm-menu-bg, white);
  border: 1px solid rgba(0, 0, 0, .08);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  z-index: 1000;
}

.hm-header__nav li:hover > ul {
  display: block;
}

.hm-header__nav ul li {
  padding: 8px 16px;
  white-space: nowrap;
}

.hm-header__nav ul a {
  font-size: 11px;
}

/* Force full-width for the header block */
.wp-block-hostmap-header,
[data-type="hostmap/header"] {
  max-width: none !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Make header stretch full width when inside any container */
.entry-content .hm-header,
.wp-block-group .hm-header,
main .hm-header,
article .hm-header {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* Remove WordPress global padding from header and its parent containers */
.wp-block-hostmap-header.has-global-padding,
[data-type="hostmap/header"].has-global-padding,
.has-global-padding > .wp-block-hostmap-header,
.has-global-padding > [data-type="hostmap/header"],
.has-global-padding:has(.hm-header),
.wp-block-group.has-global-padding:has(.hm-header) {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Hide hamburger when nav is empty */
.hm-header__nav:empty + .hm-header__toggle,
.hm-header__nav:not(:has(li)) + .hm-header__toggle {
  display: none !important;
}

@media (max-width: 768px) {
  .hm-header__toggle {
    display: block;
  }

  .hm-header__nav {
    display: none;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--hm-menu-bg, white);
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 999;
  }

  .hm-header__inner {
    position: relative;
  }

  .hm-header__nav.is-open {
    display: flex;
  }

  .hm-header__nav ul {
    position: static;
    border: 0;
    margin: 0;
    padding-left: 16px;
    box-shadow: none;
    display: block;
  }

  .hm-header__logo img {
    max-height: 112px;
    max-width: 410px;
  }
}
