//
// Component: Table
//
// ========================================================================


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

//
// New
//

@table-divider-header-border-width:             0;
@table-divider-header-border:                   transparent;

@table-striped-border-width:                    0;
@table-striped-border:                          transparent;


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

.hook-table-header-cell() {}

.hook-table-cell() {}

.hook-table-footer() {}

.hook-table-caption() {}

.hook-table-row-active() {}


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

.hook-table-divider() {}

.hook-table-striped() when not (@table-striped-border-width = 0) {
    border-top: @table-striped-border-width solid @table-striped-border;
    border-bottom: @table-striped-border-width solid @table-striped-border;
}

.hook-table-hover() {}


// Size modifier
// ========================================================================

.hook-table-small() {}

.hook-table-large() {}


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

.hook-table-misc() when not (@table-divider-header-border-width = 0) {

    .uk-table-divider > tr:first-child,
    .uk-table-divider > :first-child > tr,
    .uk-table-divider > :first-child > tr:first-child { border-bottom: @table-divider-header-border-width solid @table-divider-header-border; }

}

.hook-table-misc() when not (@table-striped-border-width = 0) {

    .uk-table-striped > tr:nth-of-type(even):last-child,
    .uk-table-striped tbody tr:nth-of-type(even):last-child { border-bottom: @table-striped-border-width solid @table-striped-border; }

}


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

@inverse-table-divider-header-border:          @inverse-global-border;

@inverse-table-striped-border:                 @inverse-global-border;

.hook-inverse-table-header-cell() {}
.hook-inverse-table-caption() {}
.hook-inverse-table-row-active() {}

.hook-inverse-table-divider() {}

.hook-inverse-table-striped() when not (@table-striped-border-width = 0) {
    border-top-color: @inverse-table-striped-border;
    border-bottom-color: @inverse-table-striped-border;
}

.hook-inverse-table-hover() {}

.hook-inverse() when not (@table-divider-header-border-width = 0) {
    .uk-table-divider > tr:first-child,
    .uk-table-divider > :first-child > tr,
    .uk-table-divider > :first-child > tr:first-child { border-bottom-color: @inverse-table-divider-header-border; }
}

.hook-inverse() when not (@table-striped-border-width = 0) {
    .uk-table-striped > tr:nth-of-type(even):last-child,
    .uk-table-striped tbody tr:nth-of-type(even):last-child { border-bottom-color: @inverse-table-striped-border; }
}