/* ==========================================================================
   Inula Texla static site — single clean responsive navigation.
   Replaces the tangled/overlapping Joomla menus (split "white" menu +
   megamenu + offcanvas) with ONE menu:
     - >= 992px : horizontal bar with hover dropdowns
     - < 992px  : hamburger button -> slide-down panel with accordion submenus
   Scoped under .statnav so it can't collide with template styles.
   ========================================================================== */

/* Hide the original Joomla header/menus (kept in DOM, just not shown) */
#sp-header,
#sp-menu,
.offcanvas-menu { display: none !important; }
body.offcanvas { overflow: auto !important; }
/* Helix injects this 90px spacer to reserve room for its fixed header;
   our nav is in normal flow, so the spacer would leave an empty gap. */
.nav-placeholder { display: none !important; }

/* ---- base bar ---- */
.statnav, .statnav * { box-sizing: border-box; }
.statnav {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: #7e8446;
  font-family: Overlock, "Segoe UI", sans-serif;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.statnav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.statnav-brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.statnav-brand img { height: 46px; width: auto; display: block; }

/* ---- menu list ---- */
.statnav-menu { flex: 1 1 auto; }
.statnav-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; justify-content: flex-end; flex-wrap: wrap;
}
.statnav-list li { position: relative; margin: 0; }
.statnav-list a {
  display: block;
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  line-height: 1.2;
  padding: 13px 11px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.statnav-list > li.has-sub > a { padding-right: 6px; }
.statnav-list > li > a:hover,
.statnav-list > li.active > a { background: rgba(0,0,0,.14); color: #fff; }

/* caret for items with submenu */
.statnav-caret {
  display: none;              /* shown only on mobile */
  background: none; border: 0; cursor: pointer;
}
.statnav-list > li.has-sub > a::after {
  content: ""; display: inline-block; margin-left: 7px;
  border: 5px solid transparent; border-top-color: currentColor;
  vertical-align: middle; position: relative; top: 2px;
}

/* ---- desktop dropdowns ---- */
.statnav-sub {
  list-style: none; margin: 0; padding: 6px 0;
  position: absolute; left: 0; top: 100%;
  min-width: 230px;
  background: #fff;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 10px 26px rgba(0,0,0,.18);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .15s, transform .15s, visibility .15s;
  z-index: 10;
}
.statnav-list > li:last-child .statnav-sub { left: auto; right: 0; }
.statnav-list > li.has-sub:hover > .statnav-sub,
.statnav-list > li.has-sub:focus-within > .statnav-sub {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.statnav-sub a {
  color: #47473a; font-size: 15.5px; padding: 9px 18px; white-space: normal;
}
.statnav-sub a:hover { background: #f4f0e6; color: #d07a35; }

/* ---- hamburger button ---- */
.statnav-toggle {
  display: none;
  flex: 0 0 auto;
  width: 46px; height: 40px;
  background: none; border: 0; cursor: pointer; padding: 8px;
}
.statnav-toggle span {
  display: block; height: 3px; border-radius: 2px; background: #fff;
  margin: 5px 0; transition: transform .25s, opacity .2s;
}
.statnav.open .statnav-toggle span:nth-child(1){ transform: translateY(8px) rotate(45deg); }
.statnav.open .statnav-toggle span:nth-child(2){ opacity: 0; }
.statnav.open .statnav-toggle span:nth-child(3){ transform: translateY(-8px) rotate(-45deg); }

/* ==========================================================================
   MOBILE / TABLET  (< 992px) : hamburger + slide-down panel
   ========================================================================== */
@media (max-width: 991.98px) {
  .statnav-toggle { display: block; }

  .statnav-menu {
    position: absolute; left: 0; right: 0; top: 100%;
    background: #757b41;
    max-height: 0; overflow: hidden;
    transition: max-height .3s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,.2);
  }
  .statnav.open .statnav-menu { max-height: 85vh; overflow-y: auto; }

  .statnav-list { display: block; }
  .statnav-list li { border-top: 1px solid rgba(255,255,255,.12); }
  .statnav-list > li { display: flex; flex-wrap: wrap; align-items: center; }
  .statnav-list > li > a { flex: 1 1 auto; padding: 15px 18px; font-size: 18px; }

  /* caret becomes an accordion toggle */
  .statnav-list > li.has-sub > a::after { display: none; }
  .statnav-caret {
    display: block; width: 54px; align-self: stretch;
  }
  .statnav-caret::after {
    content: ""; display: inline-block;
    border: 6px solid transparent; border-top-color: #fff;
    position: relative; top: 3px; transition: transform .2s;
  }
  .statnav-list > li.open > .statnav-caret::after { transform: rotate(180deg); }

  .statnav-sub {
    position: static; opacity: 1; visibility: visible; transform: none;
    width: 100%; box-shadow: none; border-radius: 0; padding: 0;
    background: #f4f0e6;
    max-height: 0; overflow: hidden; transition: max-height .28s ease;
  }
  .statnav-list > li.open > .statnav-sub { max-height: 600px; }
  .statnav-sub a { padding: 12px 30px; font-size: 16px; border-top: 1px solid #e6ddc8; }
}
