//
// Component: Card
//
// ========================================================================


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

//
// New
//

@card-default-header-border-width:             @global-border-width;
@card-default-header-border:                   @global-border;

@card-default-footer-border-width:             @global-border-width;
@card-default-footer-border:                   @global-border;

@card-default-hover-top:                       0;
@card-primary-hover-top:                       0;
@card-secondary-hover-top:                     0;

@internal-card-hover-mode:                     ; // ripple


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

.hook-card() {
    transition: 0.1s ease-in-out;
    transition-property: color, background-color, background-size, border-color, box-shadow, transform, top;
}

.hook-card() when not (@card-default-hover-top = 0), not (@card-primary-hover-top = 0), not (@card-secondary-hover-top = 0) {
    top: 0;
}

//
// Ripple
//

.hook-card() when (@internal-card-hover-mode = ripple) {
    background-position: 50% 100%;
    background-size: 0% 0%;
    background-repeat: no-repeat;
    transition-duration: 0.5s;
    transition-timing-function: cubic-bezier(.165,.85,.45,1);
}

.hook-card() when (@internal-card-hover-mode = ripple) {

    &:hover { background-size: 150% 150%; }

}


// Sections
// ========================================================================

.hook-card-body() {}

.hook-card-header() {}

.hook-card-footer() {}


// Media
// ========================================================================

.hook-card-media() {}

.hook-card-media-top() {}

.hook-card-media-bottom() {}

.hook-card-media-left() {}

.hook-card-media-right() {}


// Title
// ========================================================================

.hook-card-title() {}


// Badge
// ========================================================================

.hook-card-badge() {}


// Hover modifier
// ========================================================================

.hook-card-hover() when (@internal-card-hover-mode = ripple) {

    &:not(.uk-card-default):not(.uk-card-primary):not(.uk-card-secondary) {
        background-color: transparent;
        background-image: radial-gradient(farthest-side at 50% 100%, @card-hover-background ~'calc(100% - 1px)', transparent 100%);
    }

}



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

.hook-card-default() {}

.hook-card-default-title() {}

.hook-card-default-hover() when not (@card-default-hover-top = 0) {
    top: @card-default-hover-top;
}

.hook-card-default() when (@internal-card-hover-mode = ripple) {
    
    &.uk-card-hover { background-image: radial-gradient(farthest-side at 50% 100%, @card-default-hover-background ~'calc(100% - 1px)', transparent 100%); }

}

.hook-card-default-hover() when (@internal-card-hover-mode = ripple) {
    background-color: @card-default-background;
}

.hook-card-default-header() { border-bottom: @card-default-header-border-width solid @card-default-header-border; }

.hook-card-default-footer() { border-top: @card-default-footer-border-width  solid @card-default-footer-border; }

//
// Primary
//

.hook-card-primary() {}

.hook-card-primary-title() {}

.hook-card-primary-hover() when not (@card-primary-hover-top = 0) {
    top: @card-primary-hover-top;
}

.hook-card-primary() when (@internal-card-hover-mode = ripple) {

    &.uk-card-hover { background-image: radial-gradient(farthest-side at 50% 100%, @card-primary-hover-background ~'calc(100% - 1px)', transparent 100%); }
    
}

.hook-card-primary-hover() when (@internal-card-hover-mode = ripple) {
    background-color: @card-primary-background;
}

//
// Secondary
//

.hook-card-secondary() {}

.hook-card-secondary-title() {}

.hook-card-secondary-hover() when not (@card-secondary-hover-top = 0) {
    top: @card-secondary-hover-top;
}

.hook-card-secondary() when (@internal-card-hover-mode = ripple) {

    &.uk-card-hover { background-image: radial-gradient(farthest-side at 50% 100%, @card-secondary-hover-background ~'calc(100% - 1px)', transparent 100%); }

}

.hook-card-secondary-hover() when (@internal-card-hover-mode = ripple) {
    background-color: @card-secondary-background;
}


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

.hook-card-misc() {

    /*
     * Default
     */

    .uk-card-body > .uk-nav-default {
        margin-left: -@card-body-padding-horizontal;
        margin-right: -@card-body-padding-horizontal;
    }
    .uk-card-body > .uk-nav-default:only-child {
        margin-top: (-@card-body-padding-vertical + 15px);
        margin-bottom: (-@card-body-padding-vertical + 15px);
    }

    .uk-card-body .uk-nav-default > li > a,
    .uk-card-body .uk-nav-default .uk-nav-header,
    .uk-card-body .uk-nav-default .uk-nav-divider {
        padding-left: @card-body-padding-horizontal;
        padding-right: @card-body-padding-horizontal;
    }

    .uk-card-body .uk-nav-default .uk-nav-sub { padding-left: @nav-sublist-deeper-padding-left + @card-body-padding-horizontal; }


    /* Desktop and bigger */
    @media (min-width: @breakpoint-large) {

        .uk-card-body > .uk-nav-default {
            margin-left: -@card-body-padding-horizontal-l;
            margin-right: -@card-body-padding-horizontal-l;
        }
        .uk-card-body > .uk-nav-default:only-child {
            margin-top: (-@card-body-padding-vertical-l + 15px);
            margin-bottom: (-@card-body-padding-vertical-l + 15px);
        }

        .uk-card-body .uk-nav-default > li > a,
        .uk-card-body .uk-nav-default .uk-nav-header,
        .uk-card-body .uk-nav-default .uk-nav-divider {
            padding-left: @card-body-padding-horizontal-l;
            padding-right: @card-body-padding-horizontal-l;
        }

        .uk-card-body .uk-nav-default .uk-nav-sub { padding-left: @nav-sublist-deeper-padding-left + @card-body-padding-horizontal-l; }

    }

    /*
     * Small
     */

    .uk-card-small > .uk-nav-default {
        margin-left: -@card-small-body-padding-horizontal;
        margin-right: -@card-small-body-padding-horizontal;
    }
    .uk-card-small > .uk-nav-default:only-child {
        margin-top: (-@card-small-body-padding-vertical + 15px);
        margin-bottom: (-@card-small-body-padding-vertical + 15px);
    }

    .uk-card-small .uk-nav-default > li > a,
    .uk-card-small .uk-nav-default .uk-nav-header,
    .uk-card-small .uk-nav-default .uk-nav-divider {
        padding-left: @card-small-body-padding-horizontal;
        padding-right: @card-small-body-padding-horizontal;
    }

    .uk-card-small .uk-nav-default .uk-nav-sub { padding-left: @nav-sublist-deeper-padding-left + @card-small-body-padding-horizontal; }

    /*
     * Large
     */

    /* Desktop and bigger */
    @media (min-width: @breakpoint-large) {

        .uk-card-large > .uk-nav-default { margin: 0; }
        .uk-card-large > .uk-nav-default:only-child { margin: 0; }

        .uk-card-large .uk-nav-default > li > a,
        .uk-card-large .uk-nav-default .uk-nav-header,
        .uk-card-large .uk-nav-default .uk-nav-divider {
            padding-left: 0;
            padding-right: 0;
        }

        .uk-card-large .uk-nav-default .uk-nav-sub { padding-left: @nav-sublist-deeper-padding-left; }

    }

}


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

.hook-inverse-card-badge() {}
