article {
    display: flex;
    flex-direction: column;
}

article header {
    display: flex;
    width: 100%;
    max-width: var(--article-body-text-max-width);
    flex-direction: column-reverse;
    align-items: center;
    gap: 1em;
    margin-bottom: 1em;

    @media (min-width: 420px) {
        justify-content: center;
    }
}

article header time {
    font-size: smaller;
    grid-area: time;
}

article header:has([rel='author']) {
    display: grid;
    grid-template-areas:
        'heading'
        'author'
        'time';
    justify-items: center;
    justify-content: space-between;
    align-self: center;
    align-items: flex-start;
    max-width: var(--article-body-text-max-width);

    @media (min-width: 420px) {
        grid-template-areas:
            'heading heading'
            'author time';
        grid-template-columns: 1fr 1fr;
        justify-content: center;
        justify-items: unset;
        gap: 1em;
        margin-left: 1em;
        margin-right: 1em;
        margin-bottom: initial;
    }

    @media (min-width: 1126px) {
        max-width: initial;
        grid-template-columns: minmax(auto, 11em) max-content minmax(auto, 11em);
        grid-template-areas: 'author heading time';
        max-width: 1200px;
        gap: 1.5em;
    }

    [rel='author'] {
        display: flex;
        font-size: small;
        gap: 1em;
        border-bottom: initial;
        background-color: initial;
        grid-area: author;

        img {
            width: 3em;
            height: 3em;
            object-fit: cover;
            border-radius: 50%;
            margin: initial;
        }

        div {
            display: flex;
            flex-direction: column;
            gap: 0.25em;
            line-height: normal;
        }

        .name {
            font-weight: 600;
            transition: color 250ms ease;
            color: var(--secondary-text-color);

            @media (prefers-color-scheme: dark) {
                color: var(--secondary-highlight-text-color-dark);
            }

            &:hover {
                color: var(--primary-text-color);

                @media (prefers-color-scheme: dark) {
                    color: var(--secondary-text-color-dark);
                }
            }
        }

        .position {
            font-weight: 400;
            color: var(--secondary-heading-color);
            transition: color 250ms ease;

            @media (prefers-color-scheme: dark) {
                color: var(--secondary-heading-color-dark);
            }
            &:hover {
                color: var(--text-link-hover-color);

                @media (prefers-color-scheme: dark) {
                    color: var(--text-link-hover-color-dark);
                }
            }
        }
    }
    time {
        @media (min-width: 420px) {
            justify-self: end;
        }
    }
}

article h1 {
    text-align: center;
    grid-area: heading;
    justify-self: center;
    margin-bottom: initial;
}

.lemmy-graphic {
    align-self: center;
    width: 600px;
    max-width: 100%;
}

@media (prefers-color-scheme: dark) {
    /** logo */
    svg.lemmy-graphic path[fill='black'] {
        fill: white;
    }
    /** everything else */
    svg.lemmy-graphic path[stroke='black'] {
        stroke: white;
    }
}
