.module {
    >.page-header {
        margin-top: 0px;
    }

    > .module-content{
        &:nth-child(2n){
            padding-top: $grid-gutter-width;
        }
    }
}

.module-heading {
    @include clearfix;
    margin: 0;
    padding: math.div($grid-gutter-width,3) $gutterX;
    font-size: $font-size-base;
    line-height: 1.3;
    background-color: $moduleHeadingBackgroundColor;
    border-top: 1px solid $moduleHeadingBorderColor;
    border-bottom: 1px solid $moduleHeadingBorderColor;
}

.module-content {
    padding: $grid-gutter-width;

    .add-to-group{
      .btn-primary{
        margin-bottom: $grid-gutter-width;
      }
    }

    p a:link {
      text-decoration: underline;
    }
}

.module:first-child .module-heading {
    @include border-radius(3px 0 0 0);
    border-top-width: 0;
}

.module-footer {
    padding: 7px $gutterX 7px;
    margin: 0;
    border-top: 1px dotted $genericBorderColor;
}

.module .read-more {
    font-weight: bold;
    color: $layoutBoldColor;
}

.pagination-wrapper{
    text-align: center;
    border-top: 1px solid $hr-color;
    padding-top: math.div($grid-gutter-width,3);
}

.module h1 {
    margin-top: 0;
    margin-bottom: 20px;
}

// Module Shallow
.module-shallow .module-content {
    padding: 10px;
    margin: 0;
}

.module-shallow .module-tags {
    margin-top: 0;
    margin-bottom: 0;
}

.module-shallow .module-content:first-child {
    padding-top: 10px;
}

.module-shallow .module-content:last-child {
    padding-bottom: 10px;
}

// Secondary column specific
.module-narrow {
    .module-heading,
    .module-content,
    .module-footer {
        padding-left: $gutterSmallX;
        padding-right: $gutterSmallX;
    }
}

// Module Grid
.module-grid {
    @include list-unstyled;
    @extend .media-grid; // @extend media-wide;
}

.module-item {
    @extend .media-item;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-right: 50px;
    overflow: hidden;
    position: relative;
}

.module-item.first {
    clear: left;
}

// GROUP
.group .content img {
    margin: 0 -5px 5px;
    max-width: initial;
}

.group .content h3 {
    font-size: 14px;
    line-height: 1.3;
}

.group-listing {
    margin-left: -20px; // Same as .row
}

// PREVIEW
.ckanext-datapreview {
    position: relative;
    clear: both;
    padding-top: 15px;
    margin-top: 0;
    &>iframe {
        min-height: 650px;
    }
    &>img {
        max-height: 500px;
        max-width: 100%;
        overflow: hidden;
    }
}

.package-info {
    h4 {
        margin-bottom: 10px;
    }
}

.module-resource {
    z-index: 5; // Fixes overlapping .secondary on the Resource view page
    position: relative; // Fixes overlapping .secondary on the Resource view page
    background-color: $layoutTrimBackgroundColor;
    border-bottom: 1px solid $genericBorderColor;
    margin-top: 0;
    margin-bottom: 0;
    @include border-radius(3px 3px 0 0);
    .actions {
        position: relative;
        float: right;
        top: -10px;
        right: 0;
        li {
            margin-right: 0px;
        }
    }
}

.module .module-tags {
    padding-bottom: 8px;
}

.no-nav .module:last-child {
    margin-top: 0;
}

.module-image {
    float: left;
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    margin-right: 15px;
    img {
        max-width: 50px;
        max-height: 50px;
        vertical-align: middle;
    }
}
