/* ---------------------------------------------------------------------------
   nadi-nav.css - the Accounting sidebar accordion.

   Kept out of nadi-theme.css deliberately: this is one feature, it can be
   removed by deleting one <link>, and it never has to be merged into a file
   another change may be editing at the same time. It loads after the theme, so
   plain selectors already win; !important appears only where the theme itself
   used !important on the same property.
   --------------------------------------------------------------------------- */

/* -- category row ---------------------------------------------------------- */

/*  A button, unlike the <a> next to it, does not inherit the browser's text
    alignment or full width. These three lines are what make it sit in the
    column exactly like every other row rather than centring itself.  */
.fi-nav-parent-button {
    width: 100%;
    text-align: start;
    font: inherit;
}

.fi-nav-chevron {
    transition: transform 0.2s ease;
}

/*  YOU ARE IN HERE vs YOU ARE HERE. The open category is tinted but never
    filled, because the filled treatment already means "this is the page you
    are on" and is used by the child inside it. Two different states have to
    look different or neither reads.  */
.fi-nav-parent-current > .fi-nav-parent-button {
    color: var(--nadi-blue) !important;
    font-weight: 600;
    background-color: transparent !important;
}

/*  The transparent background above is !important and Tailwind's focus-visible
    utility is not, so without naming :focus-visible here the one row the user is
    most likely operating is the only row in the sidebar with no visible focus at
    all.  */
.fi-nav-parent-current > .fi-nav-parent-button:hover,
.fi-nav-parent-current > .fi-nav-parent-button:focus-visible {
    background-color: var(--nadi-ground-2) !important;
}

/*  The button copies the package's `outline-none`, which removes the browser
    default for every category, not only the current one.  */
.fi-nav-parent-button:focus-visible {
    outline: 2px solid var(--nadi-blue);
    outline-offset: -2px;
}

.fi-nav-parent-current > .fi-nav-parent-button .fi-sidebar-item-icon {
    color: var(--nadi-blue) !important;
}

/* -- submenu --------------------------------------------------------------- */

/*  Indentation comes from the 1.5rem rail each child already draws, the same
    one Filament uses. Nothing here adds width or margin, so the sidebar cannot
    grow wider than it was and there is nothing new to push off a 375px screen.  */

/*  Long report names read in full instead of being cut. "Accounts receivable
    report" truncates to something meaningless in a 20rem sidebar, and a menu
    the user has to guess at is worse than one that takes two lines.  */
.fi-nav-subitems .fi-sidebar-item-label {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}

/* -- not built yet --------------------------------------------------------- */

/*  Muted, and with a default cursor so the pointer never suggests it can be
    clicked. There is no href on this element at all, so it is also not
    reachable by tab and cannot be followed.  */
.fi-nav-soon {
    cursor: default;
    user-select: none;

    /*  A real row is an <a class="fi-sidebar-item-button">, which the theme gives
        .7rem of inline padding and its own radius. This span is not one, so
        without these two lines every Coming Soon row sits 3.2px to the left of
        the rows around it and the connector rail visibly steps.  */
    padding-inline: .7rem;
    border-radius: var(--nadi-r-sm);
}

.fi-nav-soon .fi-sidebar-item-label {
    color: var(--nadi-dim) !important;
    font-weight: 500;
}

.fi-nav-soon-tag {
    flex: none;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--nadi-dim);
    background-color: var(--nadi-ground-2);
    border-radius: 999px;
    padding: 0.1rem 0.4rem;
    line-height: 1.4;
}

/* -- touch ----------------------------------------------------------------- */

/*  The theme sets .52rem of padding on a 20px line, which lands at about 36px.
    That is fine for a mouse and too small for a thumb, and adding a second
    level of rows makes missing one more likely, not less. 44px is the minimum
    both Apple and Android ask for. !important is needed because the theme sets
    the padding it has to beat with !important as well.  */
@media (max-width: 1024px) {
    .fi-sidebar-item-button,
    .fi-nav-parent-button,
    .fi-nav-soon {
        min-height: 44px !important;
        padding-block: 0.6rem !important;
    }

    .fi-nav-soon-tag {
        font-size: 0.62rem;
    }
}

/* -- reduced motion -------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .fi-nav-chevron,
    .fi-nav-parent-button {
        transition: none !important;
    }
}
