/* Add underlines to menu items */
/* Mega Menus */
.yk-mainmenu-item {
  text-decoration: none;
  position: relative;
  background-image: linear-gradient(
    rgba(179, 180, 112, 0.8),
    rgba(179, 180, 112, 0.8)
  );
  background-repeat: no-repeat;
  background-size: 0% 6px;
  background-position: left bottom;
  transition: background-size 0.3s ease;
}

.blog-button {
  background-position: left bottom 8px !important;
}

/* Hover effect */
.yk-mainmenu-item:hover,
.yk-dropdown-parent a:hover {
  background-size: 100% 6px !important;
}

/* Active state for dropdown items (Services, cmt DNA) */
.yk-dropdown-wrapper[data-active="true"] .yk-mainmenu-item,
.yk-dropdown-wrapper[data-active="true"] .yk-mainmenu-item:hover {
  background-size: 100% 6px !important;
}

/* Active state for regular items (Blog, Kontakt) */
.yk-mainmenu-item[data-active="true"],
.yk-mainmenu-item[data-active="true"]:hover {
  background-size: 100% 6px !important;
}

.yk-mainmenu-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#react-yk-mainmenu,
nav.yk-mainmenu {
  height: 13vh !important; /* Do not change this */
}

nav .yk-dropdown-content {
  margin-top: 2.5rem !important;
}

nav .yk-dropdown-content-scroll {
  margin-top: 2.5rem !important;
}

nav.yk-mainmenu .yk-logo {
  flex-shrink: 0;
}

nav.yk-mainmenu .yk-mainmenu-logo svg {
  width: 3rem !important;
}

.yk-mainmenu-nav {
  display: flex !important;
  align-items: center;
  gap: 3rem;
  flex: 1;
  justify-content: center;
}

.yk-mainmenu-nav > * + * {
  margin-left: 0 !important;
}

nav.yk-mainmenu .yk-mainmenu-nav .kontakt-button {
  position: absolute;
  right: 1rem;
  padding: 1.3rem 1.3rem !important; /* Smaller than py-2 px-4 */
}

nav.yk-mainmenu .kontakt-button {
  flex-shrink: 0;
}

.kontakt-button:hover {
  opacity: 0.8;
  cursor: pointer; /* Recommended for better UX */
  transition: opacity 0.2s ease-in-out; /* Makes the fade smooth */
}

/* Center align and resize dropdown container */
nav.yk-mainmenu .absolute.left-0.w-screen.bg-primary {
  left: 50% !important;
  right: auto !important;
  width: 50vw !important;
  transform: translateX(-50%) translateY(0.25rem) !important;
  background-color: white;
}

nav.yk-mainmenu .yk-fullwidth-dropdown-grid {
  max-width: none !important;
  width: auto !important;
}

nav.yk-mainmenu .yk-fullwidth-dropdown-grid > .grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5rem !important;
  width: auto !important;
  min-width: 200px !important;
}

nav.yk-mainmenu .yk-fullwidth-dropdown-grid .flex.flex-col {
  width: 100% !important;
  justify-content: center !important;
}

nav.yk-mainmenu .yk-dropdown-parent {
  margin-bottom: 0 !important;
  display: block !important;
}

nav.yk-mainmenu .yk-dropdown-parent a {
  color: var(--wp--preset--color--black) !important;
  font-family: "akkurat", sans-serif;
  font-size: var(--wp--preset--font-size--medium) !important;
  font-weight: 900 !important;
  /* text-align: center !important; */
  letter-spacing: 0.1rem;
  text-transform: none !important;
  display: block !important;
  /* width: 100% !important; */
}

/* nav.yk-mainmenu .yk-dropdown-parent a:hover {
  color: rgb(179, 180, 112);
} */

nav.yk-mainmenu .yk-fullwidth-dropdown-grid .pt-2 {
  padding-top: 0 !important;
}

/* Fixes header size issue */
.yk-mainmenu-nav .yk-mainmenu-item,
.yk-mainmenu-nav .yk-dropdown-button {
  font-size: var(
    --wp--preset--font-size--medium
  ) !important; /* text-base = 16px, always */
  line-height: 1.5rem !important;
}

/* ----- Desktop View (>1366px) ----- */
@media screen and (min-width: 1050px) {
  /* Dropdown Menus */
  .yk-dropdown-parent a {
    display: inline !important;
    width: fit-content !important;
    height: fit-content !important;
    padding: 0;
    margin: auto;
    text-decoration: none !important;
    position: relative;
    background-image: linear-gradient(
      rgba(179, 180, 112, 0.8),
      rgba(179, 180, 112, 0.8)
    ) !important;
    background-repeat: no-repeat !important;
    background-size: 0% 6px !important;
    background-position: left bottom 28px !important;
    transition: background-size 0.3s ease;
  }
}

/* ----- Tablet and Mobile View (<1366px) ----- */
/* @media screen and (max-width: 1366px) { */
@media screen and (max-width: 1049px) {
  #react-yk-mainmenu.yk-mainmenu {
    height: 90px !important; /* Do not change this */
  }

  nav.yk-mainmenu {
    height: auto; /* Do not change this */
  }

  nav .yk-dropdown-content {
    margin-top: 1rem !important;
  }

  nav .yk-dropdown-content-scroll {
    margin-top: 1rem !important;
  }

  .yk-mobile-menu-item .yk-mobile-menu-link {
    text-transform: none;
  }

  nav.yk-mainmenu .yk-dropdown-parent a {
    display: block !important;
    width: 100% !important;
  }

  /* Force all submenus open */
  .yk-mobile-submenu {
    position: relative !important;
    visibility: visible !important;
    padding: 1rem !important;
    height: auto !important;
    opacity: 1 !important;
    z-index: 1 !important;
  }

  /* Hide the toggle buttons */
  .yk-mobile-menu-toggle {
    display: none !important;
  }

  .yk-mobile-menu-item {
    background-image: unset;
  }

  /* Move the toggle button to the left side of menu items */
  .yk-mobile-menu-item-header {
    flex-direction: row-reverse;
  }

  .yk-mobile-menu a:hover {
    color: var(--color-white) !important;
  }

  /* Main Menus */
  .yk-mobile-menu-item-header:has(.yk-mobile-menu-toggle)
    > a.yk-mobile-menu-link {
    padding-left: var(--wp--preset--spacing--50) !important;
    padding-bottom: 0;
  }

  /* .yk-mobile-menu-items .yk-mobile-menu-toggle-icon {
    font-size: 2.25rem !important;
    padding-left: 1rem;
    color: var(--color-white) !important;
  } */

  /* Blog Button */
  .yk-mobile-menu-item.blog-button a {
    padding-left: 2rem !important;
    padding-top: 1rem !important;
    padding-bottom: 1.5rem !important;
  }

  .yk-mobile-menu-item.blog-button {
    padding-bottom: var(--wp--preset--spacing--50) !important;
  }

  /* Contact Button */
  .yk-mobile-menu-item.kontakt-button {
    margin-left: 2rem !important;
    max-width: fit-content !important;
    padding: unset !important;
  }

  .yk-mobile-menu-item.kontakt-button:hover {
    transform: scale(1.05);
  }

  .yk-mobile-submenu--open .yk-mobile-menu-item-header a {
    padding-left: 4rem !important;
  }

  .yk-mobile-menu-item:nth-child(2)
    .yk-mobile-submenu-content
    .yk-dropdown-parent:nth-child(n + 2):nth-child(-n + 5) {
    display: none !important;
  }
}

@media screen and (min-width: 768px) and (max-width: 1049px) {
  .yk-mobile-submenu {
    padding-left: var(--wp--preset--spacing--50) !important;
  }

  .yk-mobile-menu-item.blog-button {
    padding-left: var(--wp--preset--spacing--40) !important;
    padding-bottom: var(--wp--preset--spacing--20) !important;
  }

  .yk-mobile-menu-item.kontakt-button {
    margin-left: 3rem !important;
    max-width: fit-content !important;
    padding: unset !important;
  }
}

/* ----- Mobile View (<768px) ----- */
@media screen and (max-width: 767px) {
  #react-yk-mainmenu,
  nav.yk-mainmenu {
    height: 90px !important; /* Do not change */
  }
}
