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

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

margin-top: 2px;

}

/* First avatar – aligned cleanly on the right side */
.topic-avatars .avatar-main {
position: relative;
left: 0;
}

.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;
background: #1e2224;
}

/* Last avatar */
.topic-avatars .avatar-last {
position: absolute;
bottom: -2px;
right: -8px;
}

.topic-avatars .avatar-last img {
width: 24px;
height: 24px;
border-radius: 50%;
object-fit: cover;
object-position: center;
border: 1px solid #f8fafa;
box-shadow: 1px 1.5px 3px rgba(0, 0, 0, 0.08);
background: #fff;
}
html.darkmode .topic-avatars .avatar-last img {
border: 1px solid #1e2224;
box-shadow: 1px 1.5px 3px rgba(0, 0, 0, 0.28);
background: #1e2224;
}
.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: #1e2224;
}

@media (min-width: 769px) and (max-width: 985px) {
dd.lastpost {
position: relative;
width: 234px !important;
right: calc(-18px - (100vw - 769px)) !important;
left: auto !important;
margin-top: 10px !important;
}
ul.topiclist dd.lastpost {
margin-top: 0px !important;
}
}

/* ≤ 768px */
@media (max-width: 768px) {
ul.topiclist dd.lastpost br { display: none !important; }
.topic-avatars {
display: none;
}
}

/* Last-post layout – text right-aligned right up against the avatar */
dd.lastpost > span,
.forabg dd.lastpost > span {
display: block;
position: relative;
min-height: 42px;
padding-left: 0 !important;
padding-right: 52px !important;
padding-top: 8px;
text-align: right;
box-sizing: border-box;
}

/* Avatar stays pinned to the right edge of dd.lastpost */
dd.lastpost .topic-avatars,
.forabg dd.lastpost .topic-avatars {
position: absolute !important;
float: none !important;
left: auto !important;
right: 4px !important;
top: 0;
width: 42px;
height: 42px;
margin: 0 !important;
}

/* 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;
}

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-left: 5px !important;
margin-right: 0 !important;
margin-top: 1px !important;
}

.topic-avatars .avatar-main {
    left: 0;
}

.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,
.forabg dd.lastpost .topic-avatars {
    top: 5px !important;
    left: auto !important;
    right: 2px !important;
    width: 21px !important;
    height: 21px !important;
}

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

dd.lastpost > span,
.forabg dd.lastpost > span {
    min-height: 21px !important;
    padding-left: 0 !important;
    padding-right: 28px !important;
    padding-top: 4px !important;
    text-align: right !important;
    white-space: normal !important;
}

ul.topiclist li.row dd.lastpost,
.forabg dd.lastpost {
    position: absolute !important;
    float: none !important;
    right: 8px !important;
    left: auto !important;
    top: auto !important;
    bottom: -15px !important;
    transform: none !important;
    width: auto !important;
    max-width: 150px !important;
    margin: 0 !important;
    padding: 0 0 5px 0 !important;
    box-sizing: border-box !important;
}
ul.topiclist dd.lastpost,
dd.lastpost {
    white-space: normal !important;
}

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

dd.lastpost time {
    display: block !important;
    margin-top: 0px !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 86px 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: 86px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
}

/* Hide / truncate the word "by" on mobile */
dd.lastpost .lastpost-by {
    display: none !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;
}


}

body.section-index .forumbg .topic-avatars,
body.section-index .forabg .topic-avatars {
left: auto !important;
right: 4px !important;
top: 4px !important;
