/* ===== Avatars bloc ===== */

.topic-avatars {
    float: left;
    position: relative;
    width: 42px;
    height: 42px;
    margin-right: 10px;   
    margin-top: 2px;     
}

/* First avatar */
.topic-avatars .avatar-main img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
	border: 1px solid #C8D0D3;
    display: block;
    background: #fff;
}
html.darkmode .topic-avatars .avatar-main img {
	border: 1px solid #2b2f32 !important;
}
/* Last avatar */
.topic-avatars .avatar-last {
    position: absolute;
    bottom: -2px;
    right: -2px;
}

.topic-avatars .avatar-last img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 1px solid var(--body-bg, #fff);
    box-shadow: 0 0 0 1px rgba(0,0,0,.15);
    background: #fff;
}

.topic-avatars img {
    transition: transform .15s ease;
}

dd.lastpost {
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dark theme backgrounds */
html.darkmode .topic-avatars .avatar-main img,
html.darkmode .topic-avatars .avatar-last img {
    background: #111;
}

/* ≤ 985px */
@media (max-width: 768px) {

    ul.topiclist dd.lastpost br { display: none !important; }
	.topic-avatars {
		display: none;
	}
}
/* Last-post layout */
dd.lastpost > span {
    display: block;
    position: relative;
    min-height: 42px;
    padding-left: 50px;
    box-sizing: border-box;
}

/* Avatar stays on the left within the existing column */
dd.lastpost .topic-avatars {
    position: absolute;
    left: 0;
    top: 0;
    width: 42px;
    height: 42px;
    margin: 0;
}

/* Keep "by" and username aligned */
dd.lastpost dfn {
    display: none;
}

dd.lastpost .username {
    display: inline;
    vertical-align: baseline;
}

/* Put time on its own line */
dd.lastpost br {
    display: block;
}

/* Center the two-line text group vertically */
dd.lastpost > span {
    padding-top: 8px;
}

dd.lastpost time {
    display: inline-block;
    margin-top: 2px;
}
.forumbg dd.lastpost > span {
    transform: translateX(92px);
}
@media (max-width: 768px) {
    .topic-avatars {
        display: block !important; /* override the hide rule */
        width: 21px !important;
        height: 21px !important;
        margin-right: 5px !important;
        margin-top: 1px !important;
    }

    .topic-avatars .avatar-main img {
        width: 21px !important;
        height: 21px !important;
    }

    .topic-avatars .avatar-last img {
        width: 12px !important;
        height: 12px !important;
    }
	dd.lastpost .topic-avatars {
		top: 5px;

	}
    /* Adjust the absolute positioning of the last avatar so it still sits correctly */
    .topic-avatars .avatar-last {
        bottom: -1px !important;
        right: -1px !important;
    }

    /* If lastpost uses absolute avatars, shrink those too */
    dd.lastpost .topic-avatars {
        width: 21px !important;
        height: 21px !important;
    }

    dd.lastpost > span {
        min-height: 21px !important;
        padding-left: 26px !important; /* roughly half of the original 50px */
        padding-top: 4px !important;
    }
	    ul.topiclist dd.lastpost {
        margin-top: -20px !important;
		margin-right: -180px !important;
    }
	    ul.topiclist dd.lastpost,
    dd.lastpost {
        white-space: normal !important;
    }

    ul.topiclist dd.lastpost br,
    dd.lastpost br {
        display: block !important;
    }

    dd.lastpost > span {
        white-space: normal !important;
    }

    dd.lastpost time {
        display: block !important;
        margin-top: 2px !important;
    }
    .forumbg dd.lastpost > span {
        transform: none !important;
    }

    .forumbg dd.lastpost > span > a[title="Go to last post"] {
        margin-left: 0 !important;
        padding-left: 0 !important;
        text-indent: 0 !important;
    }

    .forumbg dd.lastpost > span > a[title="Go to last post"] time {
        margin-left: 0 !important;
        padding-left: 0 !important;
        text-indent: 0 !important;
    }
	/* Truncate username to 50px with ellipsis, keep the go-to-post icon */
dd.lastpost .username,
dd.lastpost a.username,
.forumbg dd.lastpost .username {
    display: inline-block !important;
    max-width: 42px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    vertical-align: -2px !important;
}

/* Make sure the go-to-last-post icon stays visible and isn’t truncated */
.forumbg dd.lastpost > span > a[title="Go to last post"],
dd.lastpost a[title="Go to last post"] {
    display: inline-block !important;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    margin-left: 2px !important;
}
}