:root
{
    --color-bg: #f5f6f8;
    --color-panel: #ffffff;
    --color-border: #c9d0da;
    --color-fg: #202630;
    --color-fg-dim: #566171;
    --color-accent: #3742fa;
    --color-accent-2: #2ed573;
    --color-danger: #ff4757;
    color-scheme: light;
    --link-preview-size: 128px;
}

*
{
    border-radius: 0;
    /* Change font on OS elements (buttons, dropdown menues, etc.) */
    font-family: "Inter Variable", Inter, sans-serif;
}

html
{
    font-family: "Inter Variable", Inter, sans-serif;
    font-size: 15px;
    background-color: var(--color-bg);
    color: var(--color-fg);
}

a
{
    color: var(--color-accent);
    text-decoration: none;
}

textarea, input[type="text"], button, select, a.linkbtn
{
    display: inline-block;
    border: solid 1px var(--color-border);
    background: var(--color-bg);
    font-size: 1rem;
}

textarea, input[type="text"]
{
    background: var(--color-panel);
}

textarea
{
    padding: 1ex;
    font-family: monospace;
}

button, select, a.linkbtn
{
    padding: 0.25ex 1ex;
}

nav
{
    border-bottom: solid 1px var(--color-border);
    padding: 1ex;
}

main
{
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 10px;
}

.page-title
{
    text-transform: uppercase;
    font-size: 1rem;
    font-weight: bold;
    margin: 1em 0;
}

section.composer
{
    float: none;
}

.attachment-lightbox .lightbox-image
{
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100dvh - 8rem);
    object-fit: contain;
}

@media (min-width: 1100px)
{
    main:has(> .sidebar)
    {
        max-width: 1160px;
        display: grid;
        grid-template-columns: 300px minmax(0, 1fr);
        gap: 0 24px;
        align-items: start;
    }

    main:has(> .sidebar) > *
    {
        grid-column: 2;
        min-width: 0;
    }

    main > .sidebar
    {
        grid-column: 1;
        grid-row: 2;
    }

    main > .sidebar input
    {
        max-width: 100%;
    }
}

.thread-row > .thread-guide
{
    border-left: 2px solid var(--color-border, currentColor);
}

article.post
{
    background: var(--color-panel);
    border: solid 1px var(--color-border);

    .post-head
    {
        border-bottom: solid 1px var(--color-border);
        display: flex;
        box-sizing: content-box;
        height: 40px;
        gap: 4px;
        align-items: center;
        padding-right: 0.5ex;

        a.post-avatar-link, .author-copy
        {
            overflow: hidden;
            white-space: nowrap;
        }

        a.post-avatar-link
        {
            flex-shrink: 0;
            line-height: 0;
        }

        .author-copy
        {
            flex: 1 1 0;
            min-width: 0;
            display: flex;
            flex-direction: column;
            justify-content: space-evenly;

            > *
            {
                height: 50%;
                overflow: hidden;
                text-overflow: ellipsis;
            }
        }

        .permalink, .vis
        {
            flex-shrink: 0;
        }
    }

    .content
    {
        padding: 0;
        margin: 1em;
        overflow-wrap: break-word;
        img.emoji
        {
            margin-top: -0.5em;
        }
    }

    .post-sticker
    {
        text-align: center;
    }

    a.link-preview
    {
        display: flex;
        box-sizing: content-box;
        max-height: var(--link-preview-size);

        .link-preview-image
        {
            margin-right: 1ex;

            img
            {
                max-width: var(--link-preview-size);
                max-height: var(--link-preview-size);
            }
        }

        .link-preview-copy
        {
            display: flex;
            flex-direction: column;
            padding: 0.5ex;
            min-width: 0;

            > strong, > small
            {
                text-wrap: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                flex-shrink: 0;
            }

            > span
            {
                flex: 1 1 0;
                color: var(--color-fg);
                overflow: hidden;
                text-overflow: ellipsis;
            }
        }
    }

    .attachments
    {
        align-items: center;
    }

    .actions
    {
        border-top: solid 1px var(--color-border);
        display: flex;
        button, select, a.linkbtn
        {
            border: none;
            border-right: solid 1px var(--color-border);
            background: none;
        }
        button:hover, select:hover, a.linkbtn:hover
        {
            background: var(--color-bg);
        }
    }
}

article.focus
{
    border: 2px solid var(--color-accent-2);
}

.profile-banner
{
    height: 240px;
    width: 100%;
    .profile-banner-effect
    {
        height: 100%;
        width: 100%;
        background: linear-gradient(to bottom, alpha(from var(--color-bg) / 0) 0%, var(--color-bg) 100%);
    }
}

.profile-avatar-container
{
    text-align: center;
    margin-top: -64px;
    img.profile-avatar
    {
        width: 128px;
        height: 128px;
        object-fit: contain;
        border: 1px solid var(--color-border);
        position: relative;
    }
}

.profile-title
{
    text-align: center;
    margin-bottom: 2em;

    h1
    {
        margin-top: 1em;
        margin-bottom: 0;
    }
    .handle
    {
        margin-top: 0;
    }
}

.follow-list
{

    .result
    {
        margin: 1ex 0;
    }

    a.author
    {
        display: flex;
        align-items: center;
    }

    img.result-avatar
    {
        width: 48px;
        height: 48px;
        object-fit: contain;
        margin-right: 5px;
    }

    .result-id
    {
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        min-width: 0;
        flex: 1 1 0;

        span
        {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .handle
        {
            color: var(--color-fg);
        }
    }
}
