@hdeng-table-border-color-header: @hdeng-body-bg-separator-primary-color;
@hdeng-table-border-color: @hdeng-body-bg-separator-color;
@hdeng-table-bg-hover: @hdeng-body-bg-separator-primary-color;
@hdeng-table-bg-active: @hdeng-body-bg-separator-color;
@hdeng-table-bg-accent: @hdeng-body-bg-separator-color;

@hdeng-table-cell-padding: floor(@hdeng-spacing / 2);
@hdeng-table-condensed-cell-padding: floor(@hdeng-spacing / 4);

//== Generates
.hdeng-table-critical-generate() {
    // Silence
}

.hdeng-table-generate() {
    table {
        // Reset for nesting within parents with `background-color`.
        background-color: transparent;
    }

    caption {
        padding-top: @hdeng-table-cell-padding;
        padding-bottom: @hdeng-table-cell-padding;
        color: #ccc;
        text-align: left;
        caption-side: bottom;
    }

    th {
        // Centered by default, but left-align-ed to match the `td`s below.
        text-align: left;
    }

    // Baseline styles
    .table {
        width: 100%;
        max-width: 100%;
        margin-bottom: @hdeng-base-line-height-computed;

        th,
        td {
            padding: @hdeng-table-cell-padding;
            line-height: @hdeng-base-line-height;
            vertical-align: top;
            border-top: 1px solid @hdeng-table-border-color;
        }

        thead th {
            vertical-align: bottom;
            border-bottom: 2px solid @hdeng-table-border-color-header;
        }

        // Remove top border from thead by default
        caption + thead,
        colgroup + thead,
        thead:first-child {
            tr:first-child {
                th,
                td {
                    border-top: 0;
                }
            }
        }

        tbody + tbody {
            border-top: 2px solid @hdeng-table-border-color;
        }

        // Nesting
        .table {
            background-color: @hdeng-body-bg-default-color;
        }
    }

    .table--condensed {
        th,
        td {
            padding: @hdeng-table-condensed-cell-padding;
        }
    }

    .table--bordered {
        border: 1px solid @hdeng-table-border-color;

        th,
        td {
            border: 1px solid @hdeng-table-border-color;
        }

        thead {
            th,
            td {
                border-bottom-width: 2px;
            }
        }
    }

    .table--striped {
        tbody tr:nth-child(odd) {
            background-color: @hdeng-table-bg-accent;
        }
    }

    .table--hover {
        tbody tr:hover {
            background-color: @hdeng-table-bg-hover;
        }
    }

    // Wrap your tables in `.table-responsive` and we'll make them mobile friendly
    // by enabling horizontal scrolling.
    .table-responsive {
        display: block;
        width: 100%;
        min-height: 0.01%; // Workaround for IE9 bug (see https://github.com/twbs/bootstrap/issues/14837)
        overflow-x: auto;

        -ms-overflow-style: -ms-autohiding-scrollbar;
    }
}
