/*------------------------*/
/* mastodon comments
/*
/* Rendered by layouts/shortcodes/brick_comments.html from the Mastodon
/* status named in the post's params.toot_id. Selectors below follow the
/* markup that shortcode actually emits:
/*
/*   .mastodon-comment > .avatar img
/*                     > .content > .author > a > span[.disabled]
/*                                          > a.date
/*                              > .mastodon-comment-content
/*
/* Tokens are the theme's own (base.css / style.css). See DESIGN.md.
/*------------------------*/

#mastodon-comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.mastodon-comment {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: var(--light);
    border: 0.1rem solid var(--borderLight);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    color: var(--textMedium);
}

/*------------------------*/
/* avatar
/*------------------------*/

.mastodon-comment .avatar {
    flex: 0 0 auto;
}
.mastodon-comment .avatar img {
    width: 3rem;
    height: 3rem;
    border-radius: 0.4rem;
    object-fit: cover;
    margin: 0;
}

/*------------------------*/
/* body column
/*------------------------*/

.mastodon-comment > .content {
    flex: 1 1 auto;
    min-width: 0;
}

/*------------------------*/
/* author line
/*------------------------*/

/* grid, not flex: the date stays pinned top-right even when a long
   display name or handle wraps onto a second line */
.mastodon-comment .author {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
    padding-top: 0;
    margin-bottom: 0.5rem;
}
.mastodon-comment .author > a {
    text-decoration: none;
    color: var(--textDark);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
    min-width: 0;
}
.mastodon-comment .author > a:hover span:first-child {
    text-decoration: underline;
}
.mastodon-comment .author > a > span:first-child {
    font-weight: bold;
}
.mastodon-comment .author span.disabled {
    font-weight: normal;
    color: var(--textMedium);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}
.mastodon-comment .author a.date {
    font-size: 0.85rem;
    color: var(--textMedium);
    text-decoration: none;
    white-space: nowrap;
}
.mastodon-comment .author a.date:hover {
    text-decoration: underline;
}
.mastodon-comment .author a:focus-visible {
    outline: 0.125rem solid var(--accentDarker);
    outline-offset: 0.125rem;
    border-radius: 0.25rem;
}

/* custom emoji in display names */
.mastodon-comment .author img {
    display: inline-block;
    vertical-align: -0.15em;
    margin: 0;
    border-radius: 0;
}

/*------------------------*/
/* comment body
/*------------------------*/

.mastodon-comment .mastodon-comment-content {
    overflow-wrap: anywhere;
}
.mastodon-comment .mastodon-comment-content > :last-child {
    margin-bottom: 0;
}
.mastodon-comment .mastodon-comment-content p {
    margin-bottom: 0.75em;
}
.mastodon-comment .mastodon-comment-content a {
    color: var(--textDark);
}
/* Mastodon shortens long URLs with .invisible / .ellipsis spans */
.mastodon-comment .mastodon-comment-content .invisible {
    display: none;
}
/* keep inline emoji and images inside comment prose off the article scale */
.mastodon-comment .mastodon-comment-content p img {
    display: inline-block;
    vertical-align: -0.15em;
    border-radius: 0;
    margin-block: 0;
}
.mastodon-comment .mastodon-comment-content img:not(.emojione) {
    max-width: 100%;
    border-radius: 0.4rem;
}

/*------------------------*/
/* narrow screens
/*------------------------*/

@media (max-width: 600px) {
    .mastodon-comment {
        padding: 1rem;
        gap: 0.75rem;
    }
    .mastodon-comment .avatar img {
        width: 2.25rem;
        height: 2.25rem;
    }
    .mastodon-comment .author {
        grid-template-columns: minmax(0, 1fr);
    }
}

/*------------------------*/
/* loading / empty / error state
/*------------------------*/

.comments-status {
    color: var(--textMedium);
    font-style: italic;
    margin-bottom: 0;
}
