/* Generated by scripts/vendor-aristo from WebSTEP b463c34; edit there, not here. */

/* WSButton.css */
.ws-button {
& {
    box-sizing: border-box;
    white-space: nowrap;
    border: 1px solid var(--default-border-color);
    user-select: none;
    cursor: pointer;
    width: fit-content;   /* a width set on it (a .xib's frame) wins */
    /* Its height, by --button-height (a .xib's frame sets it): the title's
       size follows it down (a .xib's 21px bezel: 13px, as Cocoa's), never up
       past 16px (a 32px one's), so small and mini buttons get small titles;
       or --button-title-size (a .xib's: the size in IB's bezel). Without
       one, as tall as its title needs (33px for a 16px
       title, as Mosaic's). */
    height: var(--button-height, auto);
    background-color: var(--default-background-color);
    position: relative;
    line-height: 100%;
    transition: background-color 0.1s, color 0.1s, opacity 0.1s;
    border-radius: 4px;
    font-family: var(--font-family, inherit);
    font-size: var(--button-title-size, min(16px, calc(var(--button-height, 32px) * 0.62)));
    padding: 1px 19px 1px 10px;
    color: var(--default-foreground-color);
    fill: var(--default-foreground-color);
}

& > div {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 100%;
    /* A button smaller than the default can lower this through its own root, so the
       row fits inside it and the content stays centred. (Mosaic's.) */
    min-height: var(--button-row-min-height, calc(var(--button-height, 32px) - 3px));
    overflow: visible;
    box-sizing: border-box;
    padding: 0;
    line-height: 120%;
}

& span {
    flex: 1;
    pointer-events: none;
}

&.is-disabled {
    cursor: not-allowed !important;
    opacity: var(--opacity-disable);
}

& .icon {
    flex: none;
    width: 0.9em;
    height: 0.9em;
    margin-right: 5px;

    font-size: var(--button-icon-size, 24px);
    max-height: 100%;

    background: var(--icon) no-repeat center / contain;
}

&.tintedIcon .icon,
&.templateIcon .icon {
    background: none;
    background-color: currentColor;
    -webkit-mask: var(--icon) no-repeat center / contain;
    mask: var(--icon) no-repeat center / contain;
}

& .icon svg {
    max-width: 100%;
}

&.iconOnly > div {
    justify-content: center;
}

&.iconRight > div {
    flex-direction: row-reverse;
}

&.iconRight .icon {
    margin-right: 0;
    margin-left: 5px;
}

&.iconAbove > div,
&.iconBelow > div {
    flex-direction: column;
    justify-content: center;
    padding: 3px 0;
}

&.iconBelow > div {
    flex-direction: column-reverse;
}

&.iconAbove .icon {
    margin: 0 0 3px;
}

&.iconBelow .icon {
    margin: 3px 0 0;
}

&.iconAbove span,
&.iconBelow span {
    flex: none;
    text-align: center;
}

/* The padding is the left icon's, narrow on its side: mirrored for a right one, so
   the pair sits as far from the edges as a left-icon button's does. */
&.iconRight {
    padding-left: 19px;
    padding-right: 10px;
}

/* Above or below the title, neither side is the icon's: the same padding both
   ways (the same total), so the column is centred in the button rather than off
   to the left of it. */
&.iconAbove,
&.iconBelow {
    padding-left: 14.5px;
    padding-right: 14.5px;
    /* And as tall as the column needs: the icon and the title one above the other
       don't fit a button's usual 32px, which clipped them. A height given it (a
       .xib's frame, by --button-height) still wins. */
    height: var(--button-height, auto);
    min-height: var(--button-height, 32px);
}

&.alignCenter > div {
    justify-content: center;
}

&.alignCenter span {
    flex: none;
}

&.alignLeft .icon,
&.alignRight .icon {
    margin-right: 3px;
}

&.alignLeft.iconRight .icon,
&.alignRight.iconRight .icon {
    margin-right: 0;
    margin-left: 3px;
}

&.alignLeft.iconAbove > div,
&.alignLeft.iconBelow > div {
    align-items: flex-start;
}

&.alignRight.iconAbove > div,
&.alignRight.iconBelow > div {
    align-items: flex-end;
    justify-content: center;
}

&.alignLeft span {
    text-align: left;
}

&.alignCenter span {
    text-align: center;
}

&.alignRight span {
    text-align: right;
}

&.customBezel {
    background-color: var(--bezel-color) !important;
    background-image: none !important;
    border-color: var(--bezel-color) !important;
    color: var(--bezel-text-color) !important;
    fill: var(--bezel-text-color) !important;
}

&.customBezel:not(.is-disabled):not(.no-hover):hover {
    filter: brightness(1.08);
}

&.customBezel.is-active:not(.is-disabled) {
    filter: brightness(0.9);
}

&.iconNone .icon {
    display: none;
}

&.iconNone {
    padding: 1px 20px;
}

&:not(.is-disabled):focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 1px;
}

&.noIcon {
    padding: 1px 20px;   /* its title centred in its height, any height (Mosaic's) */
}

&.iconNone.alignLeft:not(.noIcon) {
    padding-left: 10px;
}

&.alignRight:not(.noIcon),
&.iconNone.alignRight:not(.noIcon) {
    padding-right: 10px;
}

&.iconOnly {
    padding: 2px;
}

&.iconOnly .icon {
    margin: 0;
    justify-content: center;
    align-items: center;
    display: flex;
}

&.iconOnly .label {
    display: none;
}

&.is-active:not(.is-disabled) {
    background-color: var(--default-background-color-active);
}

&:not(.is-active):not(.is-disabled):not(.no-hover):hover {
    background-color: var(--default-background-color-hover);
}

&.primary {
    background-color: var(--primary-background-color);
    border-color: var(--primary-border-color);
    color: var(--primary-foreground-color);
    fill: var(--primary-foreground-color);
}

&.primary:not(.is-active):not(.is-disabled):not(.no-hover):hover {
    background-color: var(--primary-background-color-hover);
}

&.primary.is-active:not(.is-disabled) {
    background-color: var(--primary-background-color-active);
}

&.danger {
    background-color: var(--danger-background-color);
    border-color: var(--danger-border-color);
    color: var(--danger-foreground-color);
    fill: var(--danger-foreground-color);
}

&.danger:not(.is-active):not(.is-disabled):not(.no-hover):hover {
    background-color: var(--danger-background-color-hover);
}

&.danger.is-active:not(.is-disabled) {
    background-color: var(--danger-background-color-active);
}

&.success {
    background-color: var(--success-background-color);
    border-color: var(--success-border-color);
    color: var(--success-foreground-color);
    fill: var(--success-foreground-color);
}

&.success:not(.is-active):not(.is-disabled):not(.no-hover):hover {
    background-color: var(--success-background-color-hover);
}

&.success.is-active:not(.is-disabled) {
    background-color: var(--success-background-color-active);
}

&.info {
    background-color: var(--info-background-color);
    border-color: var(--info-border-color);
    color: var(--info-foreground-color);
    fill: var(--info-foreground-color);
}

&.info:not(.is-active):not(.is-disabled):not(.no-hover):hover {
    background-color: var(--info-background-color-hover);
}

&.info.is-active:not(.is-disabled) {
    background-color: var(--info-background-color-active);
}

&.warning {
    background-color: var(--warning-background-color);
    border-color: var(--warning-border-color);
    color: var(--warning-foreground-color);
    fill: var(--warning-foreground-color);
}

&.warning:not(.is-active):not(.is-disabled):not(.no-hover):hover {
    background-color: var(--warning-background-color-hover);
}

&.warning.is-active:not(.is-disabled) {
    background-color: var(--warning-background-color-active);
}

&.inverse {
    background-color: var(--inverse-background-color);
    border-color: var(--inverse-border-color);
    color: var(--inverse-foreground-color);
    fill: var(--inverse-foreground-color);
}

&.inverse:not(.is-active):not(.is-disabled):not(.no-hover):hover {
    background-color: var(--inverse-background-color-hover);
}

&.inverse.is-active:not(.is-disabled) {
    background-color: var(--inverse-background-color-active);
}

&&&.plain,
&&&.plain:active,
&&&.plain:not(.is-active):not(.is-disabled):not(.no-hover):hover,
&&&.plain.is-active:not(.is-disabled) {
    background: transparent;
    background-image: none;
    border-color: transparent;
    box-shadow: none;
    color: var(--text-color);
    fill: var(--text-color);
}

&&&.plain:not(.is-active):not(.is-disabled):not(.no-hover):hover {
    background-color: var(--wash-hover, rgba(0, 0, 0, 0.06));
}

&&&.plain:not(.is-active):not(.is-disabled):active,
&&&.plain.is-active:not(.is-disabled) {
    background-color: var(--wash-press, rgba(0, 0, 0, 0.12));
}

/* A WSLinkButton (.link-button): only its title, in the link colour,
   underlined on hover and darker while pressed; no face, border, shadow,
   focus ring or padding, and no shift when pressed. */
&&&&.link-button,
&&&&.link-button:hover,
&&&&.link-button:active,
&&&&.link-button:focus,
&&&&.link-button.is-active {
    background: none;
    background-image: none;
    border: none;
    box-shadow: none;
    outline: none;
    filter: none;
    transform: none;
    padding: 0;
    height: auto;
    color: var(--link-color);
    fill: var(--link-color);
}

&&&&.link-button > div {
    min-height: 0;
}

&&&&.link-button:not(.is-disabled):hover .label {
    text-decoration: underline;
    text-underline-offset: 2px;
}

&&&&.link-button:not(.is-disabled):active,
&&&&.link-button.is-active:not(.is-disabled) {
    color: var(--link-color-active);
    fill: var(--link-color-active);
}

/* A loading button's spinner (WSLoadingButton): in the row where an icon
   goes, shown once it's been busy a moment (.is-loading). A ring with a
   quarter missing, turning, in the title's colour; fixed in size (a shape,
   not a glyph). */
& .button-loader {
    display: none;
    flex: none;
    margin-right: 6px;
    width: 16px;
    height: 16px;
    box-sizing: border-box;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    animation: ws-button-loader 1s linear infinite;
}

&.is-loading .button-loader {
    display: block;
}

&.is-loading .icon {
    display: none;
}



@media (prefers-reduced-motion: reduce) {
    & .button-loader {
        animation: none;
    }
}
}

@keyframes ws-button-loader {
    to {
        transform: rotate(1turn);
    }
}

/* WSTextField.css */
.ws-text-field {
& {
    box-sizing: border-box;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    width: 200px;
    min-height: 22px;
    padding: 2px 1px;
    border-radius: 3px;
    border: 1px solid var(--default-border-color);
    background-color: var(--field-background);
    box-shadow: inset 0 1px 3px #ddd;
    outline: 0.15rem solid transparent;
    font-family: var(--font-family, inherit);
    font-size: 13pt;
    line-height: 1.25;
    vertical-align: middle;
    cursor: text;
}

& > input {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    height: 100%;
    margin: 0;
    padding: 0 3px;
    border: 0;
    outline: 0;
    background: none;
    -webkit-appearance: none;
    appearance: none;
    color: inherit;
    font: inherit;
    text-align: inherit;
    caret-color: var(--caret-color, auto);
}

& > input::placeholder {
    color: var(--placeholder-color, var(--field-placeholder-foreground));
}

& > input::-webkit-search-cancel-button,
& > input::-webkit-search-decoration {
    -webkit-appearance: none;
    display: none;
}

& > .affix {
    flex: none;
    margin: 0 2px;
    opacity: 0.65;
    white-space: nowrap;
    user-select: none;
}

& > .affix:empty:not(.masked) {
    display: none;
}

& > .affix.masked {
    height: calc(58% + 3.5px);
    min-height: 14px;
    aspect-ratio: 1;
    margin: 0 3px;
    opacity: 0.65;
    background-color: currentColor;
    -webkit-mask: var(--icon) no-repeat center / contain;
    mask: var(--icon) no-repeat center / contain;
}

& > .suffix {
    margin-right: 6px;
}

&:focus-within {
    outline-offset: 0;
    outline-color: var(--focus-ring);
    border-color: var(--focus-ring);
}

&.is-disabled {
    opacity: var(--opacity-disable);
    cursor: default;
}

&.is-disabled > input {
    color: var(--field-disabled-foreground);
    cursor: not-allowed;
}
}
