/* ==========================================================
   Mobile drawer — slide up from bottom, two-panel drilldown
   ========================================================== */

/* ── Drawer shell: slides up from bottom ── */
.tosa-mobile-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: var(--color-off-white);
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.tosa-mobile-drawer.is-open {
  transform: translateY(0);
  margin-top: 90px;
}

body.tosa-drawer-open {
  overflow: hidden;
}

/* ── Top bar inside drawer (logo + search + close) ── */
.tosa-mobile-drawer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 2px solid var(--color-light-blue);
}

.tosa-mobile-brand img {
  width: 160px;
}

.tosa-mobile-drawer-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tosa-mobile-drawer-actions button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

/* ── Panels container: viewport for the two sliding panels ── */
.tosa-mobile-panels {
  position: relative;
  height: calc(100% - 64px); /* minus top bar */
  overflow: hidden;
}

.tosa-mobile-panel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 5px 24px 40px;
  transition: transform 0.35s ease;
}

/* Root panel starts in place, slides left when sub panel opens */
.tosa-mobile-panel--root {
  transform: translateX(0);
}

.tosa-mobile-panels.is-sub-open .tosa-mobile-panel--root {
  transform: translateX(-100%);
}

/* Sub panel starts off-screen right, slides in to 0 */
.tosa-mobile-panel--sub {
  transform: translateX(100%);
}

.tosa-mobile-panels.is-sub-open .tosa-mobile-panel--sub {
  transform: translateX(0);
}

/* ── Back button in sub panel ── */
.tosa-mobile-back {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 0 0px;
  font-family: var(--font-family-tiktok);
  font-weight: var(--fw-semibold);
  font-size: 13px;
  letter-spacing: 1.95px;
  text-transform: uppercase;
  color: var(--color-dark-blue);
}

.tosa-mobile-back svg path {
  stroke: var(--color-light-blue, #4fb8c7);
}

/* ── Root-level nav list ── */
.tosa-mobile-nav {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}

.tosa-mobile-nav > li > a,
.tosa-mobile-nav > li > .tosa-mobile-trigger {
  font-family: var(--font-family-tiktok);
  font-weight: var(--fw-bold);
  font-size: 20px;
  color: var(--color-dark-blue);
  text-decoration: none;
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  background: none;
  border: none;
  padding: 10px 0;
  cursor: pointer;
  text-align: left;
  transition:
    color 0.2s,
    padding-left 0.2s;
}

.tosa-mobile-trigger-icon {
  color: var(--color-dark-blue);
  flex-shrink: 0;
  margin-left: 10px;
}

.tosa-mobile-nav a:hover,
.tosa-mobile-trigger:hover {
  color: var(--color-light-green);
  padding-left: 8px;
}

/* Sub-menus are hidden in the root panel (JS moves a copy into the sub panel) */
.tosa-mobile-nav .sub-menu {
  display: none;
}

/* ── Sub panel content (injected submenu) ── */
.tosa-mobile-sub-content .sub-menu {
  display: block;
  list-style: none;
  margin: 0;
  padding: 0;
  padding-left: 22px;
}

.tosa-mobile-sub-content .sub-menu a,
.tosa-mobile-sub-content .sub-menu .tosa-mobile-trigger {
  font-family: var(--font-family-tiktok);
  font-weight: var(--fw-semibold);
  font-size: 16px;
  color: var(--color-dark-blue);
  text-decoration: none;
  display: flex;
  align-items: center;
  /* justify-content: space-between; */
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  padding: 12px 0 0px;
  cursor: pointer;
  text-align: left;
}

/* Nested sub-sub-menus (e.g. "Open Government" expandable group) */
.tosa-mobile-sub-content .sub-menu .sub-menu {
  display: none;
  padding: 4px 0 0px 15px;
}

.tosa-mobile-sub-content .sub-menu li.submenu-expanded > .sub-menu {
  display: block;
}

.tosa-mobile-sub-content .sub-menu .sub-menu a {
  font-weight: var(--fw-semibold);
  font-size: 16px;
  padding: 10px 0 0px;
  font-family: var(--font-family-tiktok);
  color: var(--color-dark-blue);
}

.tosa-mobile-sub-content .sub-menu .tosa-mobile-trigger-icon {
  transition: transform 0.25s ease;
}

.tosa-mobile-sub-content
  .sub-menu
  li.submenu-expanded
  > .tosa-mobile-trigger
  .tosa-mobile-trigger-icon {
  transform: rotate(90deg);
}

/* ── Mobile utility links + search (root panel) ── */
.tosa-mobile-util {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0 0 24px;
  padding: 0;
}

.tosa-mobile-util a {
  font-family: var(--font-family-tiktok);
  font-size: 13px;
  letter-spacing: 1.95px;
  text-transform: uppercase;
  color: var(--color-dark-blue);
  text-decoration: none;
  font-weight: var(--fw-semibold);
}

/* ── Overlay behind the drawer ── */
.tosa-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1050; /* below the drawer (1100), above page content */
  background: rgb(0 0 0 / 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.tosa-mobile-overlay.is-visible {
  opacity: 1;
  display: block;
}

/* Depth 1+ expand icon: plus -> rotates 45deg into an X when open */
.tosa-mobile-trigger-icon--expand {
  transition: transform 0.25s ease;
}

.tosa-mobile-sub-content
  .sub-menu
  li.submenu-expanded
  > .tosa-mobile-trigger
  .tosa-mobile-trigger-icon--expand {
  transform: rotate(180deg);
}

.tosa-mobile-sub-content .sub-menu li.submenu-expanded .tosa-mobile-trigger {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.tosa-mobile-sub-content
  .sub-menu
  li.submenu-expanded
  .tosa-mobile-trigger:before {
  content: "";
  background-image: url("/wp-content/uploads/2026/06/Vector-7.svg");
  margin-left: -25px;
  display: block;
  height: 15px;
  width: 15px;
  background-repeat: no-repeat;
}

.tosa-primary-nav .sub-menu {
  display: none;
}

@media (min-width: 1120px) {
  .tosa-search-toggle.mobile-search {
    display: none;
  }
}

/* ── Show drawer / toggle only on mobile breakpoints ── */
@media (max-width: 1120px) {
  .tosa-mobile-toggle {
    display: flex;
  }
  .tosa-mobile-drawer {
    display: block;
  }
  .tosa-mobile-util {
    display: grid;
  }
  .tosa-mobile-nav {
    margin: 0 0 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tosa-mobile-drawer,
  .tosa-mobile-panel {
    transition: none;
  }
}

@media (max-width: 425px) {
  .tosa-search-toggle {
    padding: 10px;
  }
  .tosa-search-toggle svg,
  .tosa-mobile-close svg {
    width: 17px;
    height: 18px;
  }
  .tosa-header-wrap {
    padding: 0 10px;
  }
}
