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

    > .module-content{
        &:nth-child(2n){
            padding-top: $grid-gutter-width;
        }
    }
    > .module-header {
        font-size: 48px;
        line-height: 48px;
        font-weight: 600;
        color: #153084;
    }
}

.module-heading {
    @include clearfix;
    margin: 0;
    padding: $accordion-button-padding-y 0.9em;
    font-size: $font-size-base;
    background-color: $gray-100;
    border-radius: 8px;
}

.module-content {
    padding: $grid-gutter-width;
    .add-to-group{
      .btn-primary{
        margin: $grid-gutter-width 0;
      }
    }

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

.module-footer {
    padding: 7px 7px;
    margin: 0;
    text-align: center;
    font-weight: 500;
}

.pagination-wrapper {
    text-align: center;
    border-top: 1px solid $hr-color;
    padding-top: math.div($grid-gutter-width,3);
    .page-item {
        margin: 0 4px;
    }
    .page-link {
        border-radius: $pagination-border-radius;
        font-weight: 500;
    }
}

.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;
}

.module-shallow {
    margin-bottom: 1rem;
    clear: both;
}

// Secondary column specific
.module-narrow {
    .module-group {
        border: 1px solid $gray-300;
        border-radius: $border-radius;
        .module-heading {
            border-radius: 8px 8px 0 0;
            border-bottom: 1px solid $gray-200;
        }
        .nav-simple > li:not(:last-of-type), .nav-aside > li:not(:last-of-type) {
            border-radius: 0;
        }
        .nav-item > a, .list-group-item {
            border-radius: 0;
        }
        .list-group-item > a.flex-fill {
            max-width: 80%;
            overflow-wrap: break-word;
        }
    }
    .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 {
    padding: 16px;
    border: 1px solid $gray-100;
    border-radius: $border-radius;
    margin: 6px 0;
    border: 1px solid $gray-300;
    .nums {
        dt {
            font-size: 16px;
            font-weight: 500;
        }
        dd {
            font-size: 48px;
            font-weight: 500;
        }
    }
    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;
    margin-top: 0;
    margin-bottom: 0;
    @include border-radius(3px 3px 0 0);
    .actions {
        position: relative;
        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: 64px;
        max-height: 64px;
        vertical-align: middle;
    }
}
