#webmentions {
    margin: 0;
    position: relative;
    z-index: 100;
    line-height: 1.2em;
}

#webmentions .comments {
    max-height: 20em;
    overflow-x: hidden;
    overflow-y: scroll;
    font-size: 80%;
}

#webmentions h2 {
    font-size: medium;
    margin: 0;
    padding: 2px;
    background: #ccc;
}

#webmentions .reacts img {
    margin: 3px -1ex 1px 0;
}

#webmentions img.missing {
    background: white;
    border: dashed black 1px;
}

#webmentions ul {
    list-style-type: none;
    margin: 0;
    padding: 4px;
}

#webmentions li {
    text-indent: -1em;
    padding-left: 1em;
}

#webmentions a.reaction {
    position: relative;
    text-decoration: none;
    text-shadow: 0px 0px 3px white;
    margin-right: 0;
    letter-spacing: -1ex;
    margin-right: 1ex;
}

#webmentions a.reaction img {
    max-height: 1.3em;
    width: auto;
    margin-right: -1ex;
    border-radius: 25%;
}

#webmentions a.reaction sub {
    font-size: 50%;
}

#webmentions .comments li {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

#webmentions .comments li .text {
    color: #555;
    font-style: italic;
    text-decoration: none;
}

#webmentions .comments li .name {
    color: #111;
}

/* Make the reactions layout horizontal, wrapping into rows gxw */
#webmentions .reacts {
    display: flex;
    flex-wrap: wrap;      /* allow multiple rows */
    gap: 0.25rem;         /* space between avatars */
    list-style: none;
    margin: 0;
    padding: 4px;
}

/* Each reaction as a little tile */
#webmentions a.reaction {
    display: inline-flex;   /* keep the emoji + avatar together */
    align-items: center;
    letter-spacing: 0;      /* override the -1ex so things don’t overlap */
    margin-right: 0;        /* gap is handling spacing now */
}

/* Clean up the reaction image margins for grid layout */
#webmentions .reacts img {
    margin: 0;              /* override the 3px -1ex 1px 0 */
}

#webmentions a.reaction img {
    max-height: 1.3em;
    width: auto;
    margin-right: 0.25rem;  /* small, normal space before the emoji */
    border-radius: 25%;
}
