//
// Component: Button
//
// ========================================================================


// Variables
// ========================================================================

@button-font-size:                              @global-small-font-size;
@button-large-font-size:                        13px;

@button-default-background:                     transparent;
@button-default-color:                          @global-color;
@button-default-hover-background:               @button-default-background;
@button-default-active-background:              @button-default-background;
@button-default-active-color:                   fade(@button-default-hover-color, 80%);

@button-primary-background:                     transparent;
@button-primary-color:                          @global-emphasis-color;
@button-primary-hover-background:               @button-primary-background;
@button-primary-hover-color:                    @button-primary-color;
@button-primary-active-background:              @button-primary-background;
@button-primary-active-color:                   fade(@button-primary-hover-color, 80%);

@button-secondary-background:                   @global-secondary-background;
@button-secondary-color:                        @global-inverse-color;
@button-secondary-hover-background:             lighten(@button-secondary-background, 4%);
@button-secondary-hover-color:                  fade(@button-secondary-color, 70%);
@button-secondary-active-background:            darken(@button-secondary-background, 4%);
@button-secondary-active-color:                 @button-secondary-color;

@button-danger-background:                      @global-danger-background;
@button-danger-color:                           @global-inverse-color;
@button-danger-hover-background:                lighten(@button-danger-background, 4%);
@button-danger-hover-color:                     fade(@button-danger-color, 70%);
@button-danger-active-background:               darken(@button-danger-background, 4%);
@button-danger-active-color:                    @button-danger-color;

//
// Master
//

@button-letter-spacing:                         3px;

@button-background-size:                        160%;
@button-background-position-x:                  ~'calc(100% + 1px)';
@button-hover-background-position-x:            0;

@internal-button-default-gradient:              linear-gradient(90deg, fade(@global-secondary-background, 5%) 62.5%, transparent 62.5%);
@internal-button-default-hover-gradient:        linear-gradient(90deg, fade(@global-secondary-background, 5%) 62.5%, transparent 62.5%);
@internal-button-default-active-gradient:       linear-gradient(90deg, fade(@global-secondary-background, 8%) 62.5%, transparent 62.5%);

@internal-button-primary-gradient:              linear-gradient(90deg, @global-primary-background 62.5%, transparent 62.5%);
@internal-button-primary-hover-gradient:        linear-gradient(90deg, @global-primary-background 62.5%, transparent 62.5%);
@internal-button-primary-active-gradient:       linear-gradient(90deg, darken(@global-primary-background, 4%) 62.5%, transparent 62.5%);

@button-text-border:                            @global-primary-background;
@button-text-mode:                              line; // none, line, arrow, em-dash
@button-text-border-width:                      5px;


// Component
// ========================================================================

.hook-button() {}

.hook-button-hover() {}

.hook-button-focus() {}

.hook-button-active() {}


// Style modifiers
// ========================================================================

.hook-button-default() {}

.hook-button-default-hover() {  }

.hook-button-default-active() {}

//
// Primary
//

.hook-button-primary() {}

.hook-button-primary-hover() {}

.hook-button-primary-active() {}

//
// Secondary
//

.hook-button-secondary() {}

.hook-button-secondary-hover() {}

.hook-button-secondary-active() {}

//
// Danger
//

.hook-button-danger() {}

.hook-button-danger-hover() {}

.hook-button-danger-active() {}


// Disabled
// ========================================================================

.hook-button-disabled() {}


// Size modifiers
// ========================================================================

.hook-button-small() {}

.hook-button-large() {}


// Text modifier
// ========================================================================

.hook-button-text() {}

.hook-button-text() when (@button-text-mode = line) {

    &::before { bottom: 2px; }

}

.hook-button-text-hover() {}

.hook-button-text-disabled() {}


// Link modifier
// ========================================================================

.hook-button-link() {}


// Miscellaneous
// ========================================================================

.hook-button-misc() {}


// Inverse
// ========================================================================

@inverse-button-default-background:            @inverse-global-muted-background;
@inverse-button-default-color:                 @inverse-global-color;
@inverse-button-default-hover-background:      fade(@global-inverse-color, 12%);
@inverse-button-default-hover-color:           @inverse-global-emphasis-color;
@inverse-button-default-active-background:     fade(@global-inverse-color, 15%);
@inverse-button-default-active-color:          @inverse-global-muted-color;

@inverse-button-primary-background:            fade(@global-inverse-color, 90%);
@inverse-button-primary-color:                 @inverse-global-inverse-color;
@inverse-button-primary-hover-background:      @global-inverse-color;
@inverse-button-primary-hover-color:           @inverse-global-inverse-color;
@inverse-button-primary-active-background:     @global-inverse-color;
@inverse-button-primary-active-color:          fade(@inverse-global-inverse-color, 70%);

@inverse-button-secondary-background:          darken(@global-secondary-background, 5%);
@inverse-button-secondary-color:               @global-inverse-color;
@inverse-button-secondary-hover-background:    darken(@global-secondary-background, 8%);
@inverse-button-secondary-hover-color:         @inverse-global-color;
@inverse-button-secondary-active-background:   darken(@global-secondary-background, 3%);
@inverse-button-secondary-active-color:        fade(@inverse-global-color, 70%);

.hook-inverse-button-default() {}
.hook-inverse-button-default-hover() {}
.hook-inverse-button-default-active() {}

.hook-inverse-button-primary() {}
.hook-inverse-button-primary-hover() {}
.hook-inverse-button-primary-active() {}

.hook-inverse-button-secondary() {}
.hook-inverse-button-secondary-hover() {}
.hook-inverse-button-secondary-active() {}

.hook-inverse-button-text() {}
.hook-inverse-button-text-hover() {}
.hook-inverse-button-text-disabled() {}

.hook-inverse-button-link() {}
