.link {
    position: relative;

    display: flex;
    width: 100%;
    max-width: 100%;
    margin-bottom: var(--space-medium);

    flex-direction: column;
    flex-grow: 1;

    background-color: var(--color-white);
    box-shadow: 0 0 3px 0 var(--color-grey-3);
    border-radius: var(--border-radius);

    transition: box-shadow 0.5s ease-in-out;
}

.link:focus-within {
    box-shadow: 0 1px 4px 1px var(--color-grey-3);
}

@media (min-width: 800px) {
    .link {
        max-width: 31%;
        margin-right: 1%;
        margin-left: 1%;
    }
}

.link__meta {
    display: flex;
    padding: var(--space-smaller);

    align-items: flex-start;

    pointer-events: none;
}

@media (min-width: 800px) {
    .link:not(.link--compact) .link__meta {
        position: absolute;
        right: 0;
        left: 0;
    }
}

.link__meta-warning,
.link__meta-date {
    padding: 0 var(--space-small);

    font-size: var(--size-small);
    font-style: italic;

    border-radius: var(--radius);

    pointer-events: initial;
}

.link__meta-warning {
    color: var(--color-text-warning);
    text-align: left;

    background-color: var(--color-back-warning);
    border: none;
}

.link__meta-warning:hover,
.link__meta-warning:focus {
    background-color: var(--color-back-warning);
}

.link__meta-warning span {
    white-space: nowrap;
}

.link__meta-separator {
    flex-grow: 1;
}

.link__meta-date {
    background-color: var(--color-accent-bg-subtle);
}

@media (min-width: 800px) {
    .link--compact .link__meta-warning,
    .link--compact .link__meta-date {
        font-size: var(--size-smaller);
    }
}

.link__body {
    display: flex;
    padding: var(--space-smaller);

    flex: 1;
}

.link__meta + .link__body {
    margin-top: calc(-1 * var(--space-smaller));
}

@media (min-width: 800px) {
    .link:not(.link--compact) .link__body {
        padding: 0;

        flex-direction: column;
    }

    .link:not(.link--compact) .link__meta + .link__body {
        margin-top: 0;
    }
}

.link__image-container {
    overflow: hidden;

    width: 75px;
    height: 75px;

    flex-shrink: 0;

    border-radius: var(--radius);
}

.link__image {
    width: 100%;
    height: 100%;

    border-radius: var(--radius);

    object-fit: cover;
}

@media (min-width: 800px) {
    .link:not(.link--compact) .link__image-container {
        width: 100%;
        height: 156px;

        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }

    .link:not(.link--compact) .link__image {
        border-radius: 0;
    }
}

.link__content {
    min-width: 0;
    margin-left: var(--space-small);
}

@media (min-width: 800px) {
    .link:not(.link--compact) .link__content {
        margin-left: 0;
        padding: var(--space-small);
    }
}

.link__title {
    margin-top: 0;
    margin-bottom: var(--space-medium);

    font-size: var(--size-normal);
    font-weight: bold;
    line-height: 1.25;
}

.link__title a {
    overflow: hidden;

    display: block;

    text-decoration: none;
    text-overflow: ellipsis;
}

@media (min-width: 800px) {
    .link--compact .link__title {
        font-size: var(--size-small);
    }
}

.link__tags {
    display: flex;

    gap: var(--space-smaller);

    flex-wrap: wrap;
}

.link__tags--center {
    justify-content: center;
}

.link__text {
    margin-top: var(--space-small);
    margin-bottom: var(--space-small);

    color: var(--color-text-secondary);
    font-size: var(--size-small);
    overflow-wrap: anywhere;
}

@media (min-width: 800px) {
    .link--compact .link__text {
        font-size: var(--size-smaller);
    }
}

.link__text--oneline {
    display: flex;

    align-items: baseline;

    white-space: nowrap;
}

.link__ellipsis {
    overflow: hidden;

    text-overflow: ellipsis;
}

.link__actions {
    display: flex;
    padding: var(--space-smaller);

    align-items: center;
    justify-content: space-between;

    background-color: var(--color-pampas);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

@media (min-width: 800px) {
    .link:not(.link--compact) .link__actions {
        padding: var(--space-small);
    }
}

.link__actions-group {
    display: flex;

    align-items: center;
}

.link__actions-group > * + * {
    margin-left: var(--space-small);
}
