/**
 * Persistent site sidebar + full-width search bar + nav-chip row.
 * Pairs with template-parts/site-sidebar.php and the header markup in
 * header-new-menu.php. Loaded as its own stylesheet (this theme's other
 * header/nav styling lives in the combined new-layout.min.css bundle,
 * but adding a large new component there in minified form is riskier
 * than a small dedicated file).
 */

:root {
  --ex-sidebar-width: 220px;
  --ex-sidebar-width-collapsed: 60px;
}

/* ---- Sidebar ---- */
.ex-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--ex-sidebar-width);
  background: #fff;
  display: flex;
  flex-direction: column;
  z-index: 500;
  transition: width 0.2s ease;
  overflow-x: hidden;
}

.ex-sidebar.is-collapsed {
  width: var(--ex-sidebar-width-collapsed);
}

.ex-sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px;
  border-bottom: 1px solid #f0f0f2;
}

.ex-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #181d27;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}

.ex-sidebar-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #750ef7;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
}

.ex-sidebar.is-collapsed .ex-sidebar-logo-text,
.ex-sidebar.is-collapsed .ex-sidebar-label {
  display: none;
}

.ex-sidebar-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #e9eaeb;
  background: #fff;
  color: #414651;
  cursor: pointer;
  flex: 0 0 auto;
}

.ex-sidebar.is-collapsed .ex-sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

.ex-sidebar-nav {
  flex: 1 1 auto;
  padding: 12px 8px;
  overflow-y: auto;
}

.ex-sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ex-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #414651;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.ex-sidebar-link:hover {
  background: #f5f0ff;
  color: #750ef7;
}

.ex-sidebar-link.is-current {
  background: #f3eaff;
  color: #750ef7;
  font-weight: 600;
}

.ex-sidebar-icon {
  display: inline-flex;
  flex: 0 0 auto;
}

.ex-sidebar-bottom {
  padding: 12px 8px;
  border-top: 1px solid #f0f0f2;
}

/* Desktop: shift page content right of the sidebar. */
@media (min-width: 951px) {
  body.ex-has-sidebar .ex-app-main {
    margin-left: var(--ex-sidebar-width);
    transition: margin-left 0.2s ease;
  }

  body.ex-has-sidebar.ex-sidebar-collapsed .ex-app-main {
    margin-left: var(--ex-sidebar-width-collapsed);
  }
}

/* Mobile: sidebar becomes a hamburger-triggered overlay; page content is
   never shifted. Matches this theme's existing 950px mobile breakpoint
   (see assets/js/footer-new-script.js's editor-desktop/editor-mobile
   check). */
@media (max-width: 950px) {
  .ex-sidebar {
    left: 0;
    width: 260px;
    max-width: 80vw;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 0 0 24px rgba(20, 10, 40, 0.15);
  }

  .ex-sidebar.is-mobile-open {
    transform: translateX(0);
  }

  .ex-sidebar-collapse-btn {
    display: none;
  }

  .ex-sidebar-logo-text,
  .ex-sidebar-label {
    display: inline !important;
  }

  body.ex-has-sidebar .ex-app-main {
    margin-left: 0;
  }
}

/**
 * Full-width search bar. Height 51px / radius 8px per spec, and every
 * other header-owned interactive element (icon buttons, sidebar collapse
 * button) matches the same 8px radius for visual consistency — the
 * nav-chip row itself is intentionally excluded: it now reuses the
 * existing .lp-filter-tab component (assets/new-css/home-page.css) as-is
 * rather than getting a new radius imposed on it.
 */
:root {
  --ex-header-radius: 8px;
}

.ex-search-wrap {
  width: 100%;
}

.ex-search-wrap .ex-search-form {
  display: flex;
  align-items: center;
  width: 100%;
  height: 51px;
  box-sizing: border-box;
  padding: 0 16px;
  border: 1px solid #e9eaeb;
  border-radius: var(--ex-header-radius);
  background: #fff;
}

.ex-search-wrap .ex-search-input {
  flex: 1 1 auto;
  height: 100%;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  color: #42454b;
}

.ex-search-wrap .ex-search-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #717680;
  background: none;
  border: none;
  cursor: pointer;
  order: 2;
}

.ex-mobile-search-trigger,
.ex-sidebar-collapse-btn {
  border-radius: var(--ex-header-radius);
}
