.paper {
    background-color: #f8f8f8;
    box-sizing: border-box;
    width: 100%;
    margin: 10px auto;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: row;
}

.paper > div {
    min-width: 0;
}

.paper > .span4 > .publication-image {
    display: block;
}

@media (min-width: 769px) {
    .paper > .span4 {
        align-self: center;
    }
}

.publication-image {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
}

.aspect-ratio-box {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
}

.aspect-ratio-box img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image covers the container */
    display: block;
}

.content {
    flex: 1; /* Take the remaining space */
}

.title {
    color: #333;
    font-size: 24px;
}

.tldr {
    color: #444;
    font-size: 16px;
}

.date, .authors, .publication, .keywords {
    color: #666;
    font-size: 14px;
}

.links a {
    text-decoration: none;
    color: #0066cc;
    font-size: 13px;
}

.links a:hover {
    text-decoration: underline;
}

/* Reserve the image column for publications awaiting a teaser. */
.teaser-placeholder {
    flex-shrink: 0;
}

/* Mobile styles */
@media (max-width: 768px) {
    .teaser-placeholder {
        display: none;
    }

    .paper {
        flex-direction: column;
        width: 90%;
        padding: 10px;
    }

    .publication-image {
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .article-image {
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .content {
        flex: none;
    }

    .typography-title {
        font-size: 20px;
    }

    .title {
        color: #333;
        font-size: 20px;
    }

    .typography-link {
        font-size: 14px;
    }
}
