/**
 * WordPress bridge styles for Appearance menus + custom logo.
 */

/* Primary nav — wp_nav_menu outputs ul/li */
header nav ul {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
header nav li {
  margin: 0;
  padding: 0;
}
/* Our Flavors dropdown */
#header nav .menu-item-has-children {
  position: relative;
}
#header nav .menu-item-has-children > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#header nav .menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -2px;
  opacity: 0.75;
  transition: transform 0.2s ease;
}
#header nav .menu-item-has-children:hover > a::after,
#header nav .menu-item-has-children:focus-within > a::after,
#header nav .menu-item-has-children.open > a::after {
  transform: rotate(225deg);
  margin-top: 2px;
}
#header nav .menu .sub-menu {
  display: block;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 200px;
  margin: 0;
  padding: 10px 0;
  list-style: none;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  background: #161114f5;
  border: 1px solid #c5a47333;
  border-radius: 12px;
  box-shadow: 0 18px 40px #0008;
  z-index: 10050;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}
/* Invisible hover bridge — keeps menu open while moving pointer down */
#header nav .menu .sub-menu::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -18px;
  height: 18px;
}
#header nav .menu-item-has-children:hover > .sub-menu,
#header nav .menu-item-has-children:focus-within > .sub-menu,
#header nav .menu-item-has-children.open > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(10px);
}
#header nav .menu .sub-menu li {
  margin: 0;
  padding: 0;
  width: 100%;
}
#header nav .menu .sub-menu a {
  display: block !important;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 22px !important;
  font-size: 11px !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted, #bdafa8) !important;
  border-bottom: 0 !important;
  text-align: left;
}
#header nav .menu .sub-menu a:hover,
#header nav .menu .sub-menu a:focus {
  color: var(--gold, #c5a473) !important;
  background: #c5a47312;
  border-bottom-color: transparent !important;
}
@media (max-width: 900px) {
  #header nav .menu-item-has-children {
    width: 100%;
  }
  #header nav .menu .sub-menu {
    position: static;
    transform: none !important;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 4px 0 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: none;
  }
  #header nav .menu .sub-menu::before {
    display: none;
  }
  /* Click toggle only — :focus-within kept the submenu open after close */
  #header nav .menu-item-has-children.open > .sub-menu {
    display: block;
  }
  #header nav .menu-item-has-children:focus-within > .sub-menu {
    display: none;
  }
  #header nav .menu-item-has-children.open:focus-within > .sub-menu {
    display: block;
  }
  #header nav .menu .sub-menu a {
    padding: 12px 16px 12px 20px !important;
  }
  #header nav .menu-item-has-children > a {
    display: inline-flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  #header nav .menu-item-has-children > a::after,
  #header nav .menu-item-has-children:hover > a::after,
  #header nav .menu-item-has-children:focus-within > a::after {
    width: 8px;
    height: 8px;
    transform: rotate(45deg);
    margin-top: 0;
  }
  #header nav .menu-item-has-children.open > a::after {
    transform: rotate(225deg);
    margin-top: 4px;
  }
}

/* Custom logo sizing — .brand is the logo link itself */
header a.brand,
footer a.brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
header a.brand img,
header a.brand .custom-logo {
  width: 88px;
  height: auto;
  max-height: 60px;
  object-fit: contain;
}
footer .footer-brand a.brand img,
footer .footer-brand a.brand .custom-logo {
  width: 96px;
  height: auto;
  max-height: 64px;
  object-fit: contain;
}

/* Footer menu columns */
.footer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-menu li {
  margin: 0 0 10px;
}
.footer-menu a {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.footer-menu a:hover {
  color: var(--text);
}

.footer-legal .footer-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
  align-items: center;
}
.footer-legal .footer-menu li {
  margin: 0;
}
.footer-legal .footer-menu a {
  display: inline;
  font-size: 9px !important;
  margin: 0 !important;
}

@media (max-width: 900px) {
  header nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
  header nav a {
    font-size: 14px;
    padding: 7px 0;
  }
}

@media (max-width: 1150px) {
  header nav ul {
    gap: 16px;
  }
}
