/* YAMM Mega Menu Styles - Bootstrap 5 compatible */

/* ============================================================
   NAVBAR WRAPPER
   ============================================================ */
#navbarwrapper {
  background-color: #333;
}

.navbar.yamm {
  background-color: #333 !important;
  border-bottom: none;
  min-height: 50px;
  padding: 0 !important;
  margin-top: 0;
  border-top: none;
}

/* ============================================================
   FIRST LEVEL MENU ITEMS - white text on dark navbar
   ============================================================ */
.navbar.yamm .navbar-nav > li > a,
.navbar.yamm .navbar-nav > .nav-item > .nav-link {
  color: #fff !important;
  font-family: "Titillium Web", sans-serif;
  font-weight: 600;
  font-size: 20px;
  padding: 15px 0 !important;
  transition: background-color 0.3s ease;
  background-color: transparent !important;
  white-space: nowrap;
  text-align: center;
}

.navbar.yamm .navbar-nav > li > a:hover,
.navbar.yamm .navbar-nav > li > a:focus,
.navbar.yamm .navbar-nav > .nav-item > .nav-link:hover,
.navbar.yamm .navbar-nav > .nav-item > .nav-link:focus {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Active trail highlight */
.navbar.yamm .navbar-nav > .nav-item.active > .nav-link,
.navbar.yamm .navbar-nav > li.active > a {
  background-color: #096 !important;
}

/* Remove ALL dropdown arrows (caret) */
.yamm .dropdown-toggle::after,
.yamm .nav-link::after {
  display: none !important;
  content: none !important;
  border: none !important;
}

/* ============================================================
   YAMM MEGA-MENU STRUCTURE (desktop: ≥992px)
   ============================================================ */
@media (min-width: 992px) {
  /* Force 6 equal-width nav items on one row */
  .navbar.yamm .navbar-nav {
    width: 100%;
    display: flex !important;
    flex-wrap: nowrap;
  }

  .navbar.yamm .navbar-nav > .nav-item.dropdown {
    width: 16.6666667%;
    flex: 0 0 16.6666667%;
    text-align: center;
  }

  /* Hide top-level leaf items (non-dropdown) — only the 6 dropdown parents are visible */
  .navbar.yamm .navbar-nav > .nav-item:not(.dropdown) {
    display: none !important;
  }

  /* Static positioning for mega menu - dropdown relative to navbar, not parent li */
  .yamm .nav,
  .yamm .dropup,
  .yamm .dropdown {
    position: static;
  }

  .yamm .container {
    position: relative;
  }

  /* YAMM Dropdown menu - hidden by default */
  .yamm .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: 0 6px 12px rgba(0,0,0,0.175) !important;
    background-color: #096 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 1030 !important;
    display: none !important;
    visibility: hidden;
    opacity: 0;
    transition: none !important;
    transform: none !important;
  }

  /* Show dropdown when parent has .open class (custom JS) */
  .yamm .dropdown.open > .dropdown-menu,
  .yamm .dropdown-menu.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
  }

  /* Full-width dropdown spanning entire viewport */
  .yamm .dropdown.yamm-fw .dropdown-menu {
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
  }

  /* YAMM Content wrapper */
  .yamm .yamm-content {
    padding: 20px 15px !important;
    background-color: #096 !important;
    color: #fff !important;
    min-height: 150px;
  }

  .yamm-content .row {
    margin: 0;
  }

  .yamm-content ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }

  /* Items in 3-column layout */
  .yamm-content li {
    flex: 0 0 33.333333% !important;
    max-width: 33.333333% !important;
    padding: 0 15px !important;
    margin-bottom: 10px !important;
  }

  .yamm-content a {
    color: #fff !important;
    text-decoration: none !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    display: block !important;
    padding: 5px 0 !important;
    background: transparent !important;
  }

  .yamm-content a:hover,
  .yamm-content a:focus {
    color: #ccc !important;
    text-decoration: underline !important;
    background: transparent !important;
  }

  /* Items in dropdown that are not inside yamm-content */
  .yamm .dropdown-menu > li > a {
    color: #fff !important;
    padding: 7px 15px;
    position: relative;
    display: block;
    background: transparent !important;
  }

  .yamm .dropdown-menu > li > a:hover,
  .yamm .dropdown-menu > li > a:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
    text-decoration: none;
    color: #fff !important;
  }
}

/* ============================================================
   MOBILE MENU (< 992px)
   ============================================================ */
@media (max-width: 991.98px) {
  /* Hamburger toggler styling */
  .navbar.yamm .navbar-toggler {
    color: #fff;
    border-color: rgba(255,255,255,0.3);
    padding: 8px 12px;
  }

  .navbar.yamm .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
  }

  /* Collapsed navbar panel */
  .navbar.yamm .navbar-collapse {
    background-color: #333;
    padding: 10px 0;
    max-height: 80vh;
    overflow-y: auto;
  }

  /* Menu items stack vertically */
  .navbar.yamm .navbar-nav {
    flex-direction: column;
  }

  .navbar.yamm .navbar-nav > .nav-item > .nav-link {
    padding: 10px 20px !important;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  /* On mobile, show dropdown inline (not absolute) */
  .yamm .dropdown-menu {
    position: static !important;
    width: 100% !important;
    display: none !important;
    visibility: hidden;
    opacity: 0;
    background-color: rgba(0, 153, 102, 0.9) !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
  }

  .yamm .dropdown.open > .dropdown-menu,
  .yamm .dropdown-menu.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* YAMM content on mobile */
  .yamm .yamm-content {
    padding: 10px 0 !important;
    background-color: transparent !important;
    min-height: 0;
  }

  .yamm-content ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-wrap: wrap;
  }

  .yamm-content li {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    padding: 0 10px !important;
    margin-bottom: 5px !important;
  }

  .yamm-content a {
    color: #fff !important;
    text-decoration: none !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    display: block !important;
    padding: 4px 0 !important;
    background: transparent !important;
  }

  .yamm-content a:hover {
    text-decoration: underline !important;
  }

  /* On mobile, show leaf items (hidden on desktop) */
  .navbar.yamm .navbar-nav > .nav-item:not(.dropdown) {
    display: list-item !important;
  }

  /* Full-width override disabled on mobile */
  .yamm .dropdown.yamm-fw .dropdown-menu {
    width: 100% !important;
    margin-left: 0 !important;
  }
}

@media (max-width: 576px) {
  .yamm-content li {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

/* ============================================================
   SUBMENU STYLING (deeper levels)
   ============================================================ */
.menu.submenu {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 5px 10px;
  margin-top: 5px;
  list-style: none;
}

.menu.submenu li {
  margin-bottom: 3px;
  flex: 0 0 100% !important;
  max-width: 100% !important;
}

.menu.submenu li a {
  padding: 3px 5px !important;
  font-size: 13px !important;
  color: #fff !important;
  opacity: 0.85;
}

.menu.submenu li a:hover {
  opacity: 1;
}

/* ============================================================
   HEADER / BRANDING
   ============================================================ */

/* Logo styling */
.logo img {
  max-height: 150px;
  width: auto;
  display: block;
}

.sitename {
  margin: 0;
  line-height: 1.2;
}

.brand.fvg {
  display: block;
  font-size: 0.8em;
  color: #ccc;
  font-weight: normal;
}

/* Top Header Section */
.top-header {
  background-color: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 8px 0;
}

.header-branding {
  display: flex;
  align-items: center;
}

.logo-container {
  margin-right: 20px;
  flex-shrink: 0;
}

.logo-container img {
  max-height: 80px;
  width: auto;
}

.site-info {
  flex-grow: 1;
}

.site-title {
  margin: 0;
  line-height: 1.2;
}

.site-name {
  color: #096;
  text-decoration: none;
  font-size: 28px;
  font-weight: bold;
  font-family: Georgia, serif;
}

.site-name:hover {
  color: #074d4d;
  text-decoration: none;
}

.site-subtitle {
  color: #666;
  font-size: 16px;
  font-style: italic;
  margin-top: 5px;
  line-height: 1.3;
}

.header-search {
  text-align: right;
}

.header-search .form-control {
  border-radius: 20px;
  border: 1px solid #ddd;
  padding: 8px 15px;
}

.header-search .btn {
  background-color: #096;
  border-color: #096;
  color: white;
  border-radius: 20px;
  padding: 8px 20px;
  margin-left: 5px;
}

.header-search .btn:hover {
  background-color: #074d4d;
  border-color: #074d4d;
}

@media (max-width: 767px) {
  .header-branding {
    flex-direction: column;
    text-align: center;
    margin-bottom: 15px;
  }

  .logo-container {
    margin-right: 0;
    margin-bottom: 10px;
  }

  .site-name {
    font-size: 22px;
  }

  .site-subtitle {
    font-size: 14px;
  }

  .header-search {
    text-align: center;
  }
}
