@import url("https://www.nerdfonts.com/assets/css/webfont.css");

:root
{
    --attachment-size: 240px;
    --sticker-size: 140px;
}

*
{
    line-height: 1.4;
    box-sizing: border-box;
}

p
{
    margin: 1em 0;
}

li > p
{
    margin: 0.5em 0;
}

h1, h2, h3, h4
{
    margin: 2em 0;
}

h3
{
    font-size: 1.2rem;
}

h2
{
    font-size: 1.44rem;
}

h1
{
    font-size: 1.728rem;
}

ul, ol
{
    list-style-position: outside;
    margin-left: 1.5em;
}

ul
{
    list-style-type: square;
}

ol
{
    list-style-type: decimal;
}

code, pre
{
    font-family: monospace;
}

em
{
    font-style: italic;
}

strong
{
    font-weight: bold;
}

form.inline
{
    display: inline-block;
}

nav
{
    display: flex;
    padding: 0.5ex;
    align-items: baseline;
    gap: 0.5ex;

    a.brand
    {
        flex-grow: 1;
        text-align: center;
    }
}

main
{
}

.thread-row
{
    --thread-indent: 16px;
    display: flex;
    min-width: 0;

    > .thread-guide
    {
        flex: 0 0 var(--thread-indent);
    }

    > article.post
    {
        flex: 1;
        min-width: 0;
    }

    .thread-parent
    {
        display: block;
        font-size: 0.8em;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 480px)
{
    .thread-row
    {
        --thread-indent: 12px;
    }
}

img.emoji
{
    max-height: 1.5em;
    vertical-align: middle;
}

article.post
{
    margin: 1em 0;
    text-spacing-trim: normal;
    text-autospace: normal;     /* TODO: use `replace` when widely supported. */

    .post-avatar
    {
        width: 40px;
        height: 40px;
    }

    .content
    {
        margin: 0.5em 0;
    }

    .post-sticker img
    {
        max-width: var(--sticker-size);
        max-height: var(--sticker-size);
        object-fit: contain;
    }

    .attachments
    {
        display: flex;
        flex-wrap: wrap;

        > *
        {
            width: var(--attachment-size);
        }

        a
        {
            display: block;
            max-height: var(--attachment-size);

            img
            {
                object-fit: contain;
                max-width: var(--attachment-size);
                max-height: var(--attachment-size);
            }
        }
    }
}

.composer
{
    textarea[name="content"]
    {
        width: 100%;
    }

    .composer-row
    {
        margin: 0.5ex 0;
    }
}

/* ── Emoji picker ──────────────────────────────────────────── */
.emoji-picker-trigger[hidden],
.emoji-picker-panel[hidden] { display: none; }
.emoji-picker-panel {
    position: fixed;
    z-index: 20;
    width: min(400px, calc(100vw - 24px));
    max-height: min(320px, calc(100dvh - 24px));
    overflow: auto;
    padding: 8px;
    background-color: white;
}
.emoji-tabs {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    margin-bottom: 7px;
    padding-bottom: 5px;
}
.emoji-tab {
    flex: 0 0 auto;
    background: transparent;
    border: 1px solid transparent;
    padding: 3px 7px;
    font-size: 1.2em;
}
.emoji-tab.active {
}
.js .emoji-tab-panel { display: none; }
.js .emoji-tab-panel.active { display: block; }
.emoji-subgroup { margin-top: 6px; }
.emoji-subgroup:first-child { margin-top: 0; }
.emoji-subgroup-label {
    font-size: 0.78em;
    margin: 4px 0;
}
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    gap: 4px;
}
.emoji-choice {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 3px;
    font-size: 1.25rem;
    line-height: 1;
}
.emoji-choice:hover,
.emoji-choice:focus {
    filter: none;
}
.emoji-choice img.emoji {
    max-width: 24px;
    max-height: 24px;
}
.emoji-copy {
    margin-left: 4px;
    font-size: 0.72rem;
}
.js .emoji-copy { display: none; }

.pager { margin-top: 14px; }

.sidebar
{
    min-width: 0;
    overflow-wrap: anywhere;
}

.notifications h2
{
    font-size: 1.1rem;
    margin: 1.5em 0 0.75em;
}

.notification-list
{
    list-style: none;
    margin: 0;
    padding: 0;
}

.notification-list li
{
    padding: 0.75em 0;
    border-bottom: 1px solid var(--color-border, currentColor);
}

.notification-list time
{
    display: block;
    font-size: 0.8rem;
    color: var(--color-fg-dim, inherit);
}

nav.notification-pager
{
    display: flex;
    flex-wrap: wrap;
    gap: 0.75em;
    padding: 0.75em 0;
    border: 0;
}

.notifications a:focus-visible
{
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Local post editing. */
.post-edit-form
{
    margin: 1em;
}

.post-edited
{
    font-size: 0.85em;
    white-space: nowrap;
}

.sticker-picker
{
    #sticker-panel button
    {
        padding: 0;
        line-height: 0;
    }
    img
    {
        max-width: var(--sticker-size);
        max-height: var(--sticker-size);
        object-fit: contain;
    }
}
