/* The band spans the workspace. Its immediate frame aligns everything inside it.
   Pages supply their content width, plus optional insets for split layouts. */
@layer components {
  :where(.app-secondary-bar, .dashboard-starter-banner, .dashboard-sample-banner) {
    box-sizing: border-box;
    width: var(--hh-secondary-band-width, 100%);
    max-width: none;
  }

  :where(
    .app-secondary-bar > .app-secondary-bar__inner,
    .app-secondary-bar > div:only-child,
    .app-secondary-bar > .settings-mobile-nav-trigger,
    .dashboard-starter-banner__inner,
    .dashboard-sample-banner__inner,
    .page-workflow:not(.is-candidate-drawer-open, .is-pipeline-filter-open):not(:has(.wf-filter-drawer.is-open, .wf-add-drawer.is-open)) :is(.wf-head__row--full, .wf-head__tabs)
  ) {
    --hh-secondary-edge: calc((100% - var(--hh-secondary-content-width, var(--hh-directory-content-width))) / 2);

    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin-inline: auto;
    padding-inline: calc(var(--hh-secondary-edge) + var(--hh-secondary-inset-start, 0px))
      calc(var(--hh-secondary-edge) + var(--hh-secondary-inset-end, 0px));
  }

  .jobs-company-strip { --hh-secondary-content-width: min(100% - 40px, var(--jobs-content-width) - 40px); }
  .referral-module__tabs-bar { --hh-secondary-content-width: min(100% - 40px, var(--referral-content-width) - 40px); }
  .create-job-tabs-bar { --hh-secondary-content-width: min(100% - 40px, var(--create-content-max, 1180px) - 40px); }
  .hp-tabs-bar { --hh-secondary-content-width: min(100% - 32px, var(--layout-width, 1660px) - 32px); }
  .files-secondary-bar { --hh-secondary-content-width: min(100%, var(--files-content-width)); }
  .wcal-secondary-bar { --hh-secondary-content-width: min(100%, var(--hub-content-width)); }
  .employees-workspace-subbar { --hh-secondary-content-width: var(--employees-workspace-width); }
  :where(.employees-page:has(> #employees-profile-design)) .employees-workspace-subbar,
  .employees-action-flow__topbar { --hh-secondary-content-width: min(100% - 48px, 1484px); }

  .page-workflow { --hh-secondary-content-width: min(100% - 48px, 1660px); }
  .dashboard-page { --hh-secondary-content-width: min(100% - 64px, 1644px); }

  .page--reports {
    --hh-reports-sidebar-inset: 18px;
    --hh-reports-pane-inset: 28px;
    --hh-secondary-content-width: min(100% - 2 * var(--reports-layout-gutter), var(--hh-workspace-split-max-width));
  }

  .settings-mobile-nav-bar {
    --hh-secondary-band-width: calc(100% + 2 * var(--settings-compact-gutter));
    --hh-secondary-content-width: min(100% - 2 * var(--settings-compact-gutter), var(--settings-content-max));
  }

  @media (min-width: 1024px) {
    .reports-mode-bar {
      --hh-secondary-inset-start: var(--hh-reports-sidebar-inset);
      --hh-secondary-inset-end: var(--hh-reports-pane-inset);
    }
  }

  @media (max-width: 1190px) {
    .dashboard-page { --hh-secondary-content-width: calc(100% - 40px); }
  }

  @media (max-width: 760px) {
    :is(.app-secondary-bar, .dashboard-page, .page-workflow) {
      --hh-secondary-content-width: calc(100% - 2 * var(--hh-mobile-page-gutter));
    }

    .create-job-tabs-bar { --hh-secondary-content-width: calc(100% - 24px); }
    .employees-action-flow__topbar { --hh-secondary-content-width: calc(100% - 32px); }
  }
}
