@import url("./styles/reset.css");
@import url("./styles/variables.css");
@import url("./styles/global.css");

.cards {
    padding: 0;
}

.card {
    display: block;
    position: relative;
    list-style: none;
    padding: 1em;
    margin: 0 -1em;
    font-size: 0.9em;
    border-radius: 5px;
    container-type: inline-size;
    container-name: card;
}

.card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    margin-top: 0;
    margin-bottom: 0.5em;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 0.5em;
}

.card a {
    text-decoration: none;
    color: inherit;
}

.card:focus-within a:focus {
    text-decoration: none;
}

/* turn the whole card into the clickable area */
.card h3 a::after {
    display: block;
    position: absolute;
    content: "";
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* make byline links clickable */
.card small {
    position: relative;
    z-index: 10;
    color: var(--text-color-mute);
}

.card small a {
    text-decoration: underline;
}

.card small a:hover {
    color: var(--text-color);
}

/* for hero cards (full width), move the image to the left */
@container card ( min-width: 500px ) {
    .card img {
        float: left;
        width: calc(50% - 1em);
        height: 200px;
        margin-top: 0;
        margin-right: 2em;
        margin-bottom: 0;
    }
}
