/* The box takes the site's text box look, as the filter bar's search box has it: a thin border,
   rounded corners, a darker fill, and a gold border on keyboard focus or while its picker is open. */
.month-picker-box
{
    display: inline-flex;
    align-items: center;
    grid-column: 2;
    justify-self: start;
    gap: 0.4rem;
    padding: 0.1rem 0.4rem;
    border: 1px solid var(--neutral-highest-emphasis-surface-color);
    border-radius: 0.375rem;
    outline: none;
    background: var(--neutral-lower-emphasis-surface-color);
    color: var(--neutral-surface-medium-emphasis-contrast-color);
    font: inherit;
    cursor: pointer;

    &:focus-visible,
    &[aria-expanded="true"]
    {
        border-color: var(--primary-higher-emphasis-color);
    }

    &:active
    {
        filter: brightness(130%);
    }

    /* Usable only while its option is picked. */
    &:disabled
    {
        opacity: 0.5;
        cursor: default;
    }
}

/* The month picker, floating below its box over the page as the site's dropdown lists do. Its
   popover is drawn at the end of the page's body, so it is styled here rather than in the form. */
.month-picker-popup
{
    .month-picker
    {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
    }

    .month-picker-year
    {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-weight: 600;
    }

    .month-picker-grid
    {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.25rem;
    }

    .month-picker-step,
    .month-picker-month,
    .month-picker-action
    {
        padding: 0.15rem 0.3rem;
        border: 1px solid transparent;
        border-radius: 0.375rem;
        background: none;
        color: inherit;
        font: inherit;
        cursor: pointer;

        &:hover:not(:disabled),
        &:focus-visible
        {
            border-color: var(--neutral-highest-emphasis-surface-color);
        }

        &:active:not(:disabled)
        {
            filter: brightness(130%);
        }

        &:disabled
        {
            opacity: 0.5;
            cursor: default;
        }
    }

    .month-picker-step
    {
        display: inline-flex;
        align-items: center;
    }

    /* The picked month shows quietly, in gold text with a gold border rather than a fill. */
    .month-picker-month-picked
    {
        border-color: var(--primary-higher-emphasis-color);
        color: var(--primary-higher-emphasis-color);
    }

    .month-picker-actions
    {
        display: flex;
        justify-content: space-between;
    }

    .month-picker-action
    {
        color: var(--primary-higher-emphasis-color);
    }

    /* A month before the earliest that can be picked sits in a holder that takes its tooltip. */
    .month-picker-month-holder
    {
        display: flex;

        > .month-picker-month
        {
            flex: 1;
        }
    }
}
