/**
 * Styles for the resource card and the grid that holds it.
 *
 * These rules previously only existed in resource_filter_and_listing.css and
 * media-resources.css, which meant a card was only styled on the pages that
 * happened to load one of those two components. Now that cards also render on
 * single resources and on the topic archive, the card component carries its own
 * styles so that it is correct wherever it is used.
 *
 * The rules below intentionally duplicate the declarations in those two files
 * rather than removing them from there, so that nothing about the existing
 * resource listing or the media resources component changes.
 */

.collection-of-resources,
.collection-of-resources > li {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.collection-of-resources {
    display: flex;
    flex-wrap: wrap;
    font-size: 0;
}

.single-resource {
    box-sizing: border-box;
    display: inline-block;
    font-size: var(--font-body);
    vertical-align: top;
    width: 33.333%;
}

.single-resource a {
    text-decoration: none;
}

.single-resource a .link {
    color: var(--theme-color-link);
    cursor: pointer;
}

.single-resource a .link:hover {
    color: var(--theme-color-link-hover);
    text-decoration: underline;
}

.single-resource.media-resource {
    flex-basis: 33.333%;
    overflow: hidden;
}

.single-resource .media-resource-container {
    background-position: bottom center;
    box-sizing: content-box;
    padding-top: 150px;
    position: relative;
}

.single-resource .media-resource-content {
    cursor: pointer;
}

.single-resource .media-resource-verbage {
    background-color: rgba(255, 255, 255, 0.85);
    bottom: 0;
    box-sizing: border-box;
    display: block;
    left: 0;
    padding: 2rem 3rem;
    position: absolute;
    width: 100%;
    z-index: 1;
}

.single-resource .media-resource-verbage h4 {
    font-size: 2.5rem;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    width: 90%;
}

.single-resource .media-resource-hover {
    background-color: transparent;
    bottom: 0;
    box-sizing: border-box;
    display: block;
    padding: 2rem 0;
    position: absolute;
    right: 0;
    transition: all 0.5s ease-out 0s;
    width: 5%;
    z-index: 2;
}

.single-resource .media-resource-content:hover .media-resource-hover {
    padding: 2rem 3rem;
    width: 100%;
}

.single-resource .media-resource-link-text {
    box-sizing: border-box;
    color: var(--color-primary-white);
    font-size: 2.25rem;
    opacity: 0;
    position: absolute;
    right: 2rem;
    text-align: left;
    text-indent: -99999px;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
}

.single-resource .media-resource-content:hover .media-resource-link-text {
    opacity: 1;
    text-align: right;
}

/**
 * The accent color of the hover panel is keyed off the post type, so that a
 * video and a white paper stay visually distinguishable in a mixed grid.
 */
.single-resource .media-resource-hover.resource-type-post {
    background-color: var(--resource-color-blog);
}

.single-resource .media-resource-hover.resource-type-case-study {
    background-color: var(--resource-color-case-study);
}

.single-resource .media-resource-hover.resource-type-video {
    background-color: var(--resource-color-video);
}

.single-resource .media-resource-hover.resource-type-webinar {
    background-color: var(--resource-color-webinar);
}

.single-resource .media-resource-hover.resource-type-white-paper {
    background-color: var(--resource-color-white-paper);
}

@media (max-width: 1200px) {

    .single-resource.media-resource {
        flex-basis: 50%;
        width: 50%;
    }
}

@media (max-width: 768px) {

    .single-resource.media-resource {
        flex-basis: 100%;
        width: 100%;
    }
}
