/* Default content item styles */

.content-item {
    display: flex;
    gap: var(--wp--preset--spacing--x-small);
}

.content-item__image {
    border: 1px solid var(--wp--preset--color--border-light);
    border-radius: 10px;
    overflow: clip;
    position: relative;
}

.content-item__image img {
    display: block;
    height: 100%;
    inset: 0;
    object-fit: cover;
    object-position: center;
    position: absolute;
    transition: transform var(--transition);
    width: 100%;
}

.content-item:hover .content-item__image img {
    transform: scale(1.03);
}

.content-item__image-placeholder {
    background-color: var(--wp--preset--color--tertiary);
    background-image: url(../../images/GSI_CircleLogo_white.svg);
    background-size: 50% 50%;
    background-position: center;
    background-repeat: no-repeat;
    display: block;
    height: 100%;
    width: 100%;
}

.content-item__type,
.content-item__label {
    font-family: var(--wp--preset--font-family--secondary);
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1;
    margin: 0;
    text-transform: uppercase;
}

.content-item__label {
    color: var(--wp--preset--color--primary) !important;
}

.content-item__type-link {
    text-decoration: none;
}

.content-item__details {
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--xx-small);
}

.content-item__title {
    font-size: var(--wp--preset--font-size--base);
    line-height: 1.5;
    margin: 0;
}

.content-item__title a {
    color: var(--wp--preset--color--main);
    display: block;
    font-family: var(--wp--preset--font-family--primary);
    text-decoration: none;
}

.content-item:hover .content-item__title a {
    text-decoration: underline;
}

.content-item__byline {
    margin: 0;
}

.content-item__description {
    font-size: var(--wp--preset--font-size--small);
    margin: 0;
}

.content-item__more {
    margin: 0;
}

/* Vertical layout */

.content-item--vertical {
    flex-direction: column;
}

.content-item--vertical .content-item__image {
    aspect-ratio: 2 / 1;
}

/* Horizontal layout */

.content-item--horizontal {
    align-items: flex-start;
    flex-direction: row;
}

.content-item--horizontal .content-item__image {
    aspect-ratio: 1 / 1;
    min-width: 100px;
}

.content-item--horizontal .content-item__title {
    font-size: var(--wp--preset--font-size--base);
}

@media (max-width: 580px) {
    .content-item--horizontal.content-item--with-image {
        flex-direction: column;
    }

    .content-item--horizontal.content-item--with-image .content-item__image {
        aspect-ratio: 2 / 1;
        min-width: 0;
        width: 100%;
    }
}

/* With large image */

.content-item--with-large-image {
    gap: var(--wp--preset--spacing--medium) var(--wp--preset--spacing--x-large);
}

.content-item--with-large-image .content-item__image {
    border-radius: 10px;
    min-width: 33.3333%;
    overflow: clip;
    width: 33.3333%;
}

.content-item--with-large-image .content-item__image img {
    display: block;
    height: auto;
    width: 100%;
}

.content-item--with-large-image .content-item__details {
    padding-block: var(--wp--preset--spacing--medium);
}

.content-item--with-large-image .content-item__summary {
    margin-block: var(--wp--preset--spacing--small);
}

@media (max-width: 768px) {
    .content-item--with-large-image {
        flex-direction: column;
    }
    .content-item--with-large-image .content-item__details {
        padding-block: 0;
    }
}

@media (max-width: 580px) {
    .content-item--with-large-image .content-item__image {
        min-width: 0;
        width: 100%;
    }
}

/* Large title content items */

.content-item--large-title .content-item__title {
    font-size: var(--wp--preset--font-size--large);
    line-height: 1.4;
}

.content-item--large-title .content-item__title a {
    font-weight: 400;
}

/* With image vertical content items get type badge over image */

.content-item--vertical.content-item--with-image {
    position: relative;
}

.content-item--vertical.content-item--with-image :where(.content-item__label, .content-item__type) {
    background-color: var(--wp--preset--color--primary);
    border-radius: 5px;
    left: var(--wp--preset--spacing--xx-small);
    padding: 0.25em 0.5em;
    position: absolute;
    top: var(--wp--preset--spacing--xx-small);
}

.content-item--vertical.content-item--with-image .content-item__type a,
.content-item--vertical.content-item--with-image .content-item__label {
    color: var(--wp--preset--color--base) !important;
}

@media (max-width: 580px) {
    .content-item--horizontal.content-item--with-image {
        position: relative;
    }

    .content-item--horizontal.content-item--with-image :where(.content-item__label, .content-item__type) {
        background-color: var(--wp--preset--color--primary);
        border-radius: 5px;
        left: var(--wp--preset--spacing--xx-small);
        padding: 0.25em 0.5em;
        position: absolute;
        top: var(--wp--preset--spacing--xx-small);
    }

    .content-item--horizontal.content-item--with-image .content-item__type a,
    .content-item--horizontal.content-item--with-image .content-item__label {
        color: var(--wp--preset--color--base) !important;
    }
}

/* With image vertical content items large title get different margins */

.content-item--vertical.content-item--with-image.content-item--large-title {
    gap: var(--wp--preset--spacing--small);
}
