.entity-header {
    justify-content: center;
}

.entity-header .profile-img {
    width: 120px;
    height: 120px;
}

.entity-header h1 {
    font-size: 1.8rem;
}
.entity-header p {
    margin-top: 0.5rem;
    max-width: 600px;
    font-style: italic;
}
.entity-header p,
.entity-header a {
    color: #444;
}

/* Platform navigation, hidden while X is the only mirrored platform.
.soc-navigation ul {
    display: flex;
    border: solid 1px var(--border-color);
    border-radius: 5px;
    background-color: #fff;
}

.soc-navigation li {
    list-style: none;
}

.soc-navigation a {
    padding: 6px 16px;
    border-right: solid 1px var(--border-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.soc-navigation li:last-child {
    border-right: none;
}

.soc-navigation li:hover {
    box-shadow: 0 0 10px #bbb inset;
}

.soc-navigation .selected {
    box-shadow: 0 0 8px #ccc inset;
}
.soc-navigation .selected:hover {
    box-shadow: 0 0 6px #ddd inset;
}

.soc-navigation img {
    height: 16px;
}
*/

.accounts-container {
    display: flex;
    gap: 16px;
}

/* Profile row and its action buttons side by side, the footer below both. */
.social-account-card {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 15px;
    background-color: #fff;
    padding: 10px 15px;
    border: solid 1px var(--border-color);
    border-radius: var(--border-radius);
}

.social-account-card footer {
    grid-column: 1 / -1;
}

.account-actions {
    display: flex;
    flex-direction: column;
}

.account-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: #fff;
    cursor: pointer;
}

.account-actions button:hover {
    background-color: var(--background-color);
}

.social-account-card > .same-line-centered {
    justify-content: center;
}

.social-account-card .profile-img {
    width: 100px;
}

.social-account-card header {
    gap: 8px;
}

.social-account-card header h3 {
    font-weight: normal;
}

.social-account-card header a {
    color: var(--post-link-color);
    text-decoration: none;
}

.social-account-card p {
    max-width: 400px;
    margin: 0;
    margin-bottom: 5px;
    font-size: .9rem;
    font-style: italic;
}

.social-account-card footer {
    text-align: right;
}

.posts-container {
    list-style: none;
    max-width: 600px;
}

.posts-container li {
    margin: 1rem 0;
}

/* Off-screen posts skip style, layout and paint until scrolled near. Their
   height is a guess until first rendered, then remembered (`auto`). */
.posts-container > li {
    content-visibility: auto;
    contain-intrinsic-block-size: auto 500px;
}

.post {
    background-color: #fff;
    padding: 12px 16px;
}

.post header {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas:
        "avatar label handle logo"
        "avatar time time logo";
    column-gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.post header .profile-img {
    grid-area: avatar;
    width: 42px;
    height: 42px;
}

.post header strong {
    grid-area: label;
}

.post header > a:not(.logo) {
    grid-area: handle;
}

.post header time {
    grid-area: time;
}

.post header .logo {
    grid-area: logo;
}

.post header a {
    text-decoration: none;
    font-size: 0.9rem;
}

.post-content {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
        sans-serif;
}

/* Above the box of the retweeted post, aligned with its content. */
.repost-header {
    font-size: 0.85rem;
    margin: 4px 1rem;
}

/* Repost icon drawn as a mask, so it takes the text color. */
.repost-header::before {
    content: "";
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    margin-right: 0.3em;
    vertical-align: -0.2em;
    background-color: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12V9a3 3 0 0 1 3-3h13M16 2l4 4-4 4M20 12v3a3 3 0 0 1-3 3H4M8 14l-4 4 4 4'/%3E%3C/svg%3E")
        center / contain no-repeat;
}

.post .quote-card {
    margin-top: 12px;
    padding: 10px 12px;
    border: solid 1px var(--border-color);
    border-radius: var(--border-radius);
}

/* A thread: one box, its posts one under the other. As on X, a post's avatar
   in a column on the left, its content on the right, and a line in that
   column joins a post to its single reply (`.continued`). Other posts are
   separated by a border: a post opening a branch, a post whose parent is
   unknown (after a placeholder's line, nothing). A post with several
   replies: each reply opens a branch, indented with a bar on its left. */
.thread .thread-node {
    position: relative;
    border-top: solid 1px var(--border-color);
    margin-top: 12px;
    padding-top: 12px;
}

.thread > .thread-node:first-child,
.thread .thread-node.continued + .thread-node {
    border-top: none;
    padding-top: 0;
}

.thread > .thread-node:first-child {
    margin-top: 0;
}

.thread .thread-node > article {
    position: relative;
    padding-left: 50px;
}

/* The avatar sits in the article's padding, out of the header's grid. */
.thread .thread-node > article > header {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
        "label handle logo"
        "time time logo";
}

.thread .thread-node > article > header .profile-img {
    position: absolute;
    left: 0;
    top: 0;
}

/* Under the avatar (42px), down to the reply's avatar (12px below, the
   reply having no padding-top), 4px short of each. A placeholder has no
   avatar: from its bottom edge. */
.thread .thread-node.continued > article::after,
.thread .thread-node.continued.missing::after {
    content: "";
    position: absolute;
    left: 20px;
    width: 2px;
    bottom: -8px;
    background-color: var(--border-color);
}

.thread .thread-node.continued > article::after {
    top: 46px;
}

.thread .thread-node.continued.missing::after {
    top: 100%;
}

/* No margin of its own: its first post's margin collapses through it, which
   also parts the bars of two branches in a row. */
.thread .thread-branch {
    margin-left: 8px;
    padding-left: 12px;
    border-left: solid 2px var(--border-color);
}

/* Media grid (post.eta): 1 media in its own shape, 2 side by side, 3 as one
   large and two stacked, 4 as 2x2, cropped to fill a 16:9 box (4:3 for 4).
   An item is a link around an image, or a video. */
.post .media {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    gap: 2px;
    aspect-ratio: 16 / 9;
    margin-top: 10px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.post .media[data-count="1"] {
    display: block;
    aspect-ratio: auto;
    container-type: inline-size;
}

/* 1 media: the file's own shape once loaded, a square until then (the
   median shape of single images: 1.01, dev DB 2026-11-05), tall ones capped
   at 3:4 (100cqw: the width of .media), cropped. */
.post .media[data-count="1"] > a.media-item > img,
.post .media[data-count="1"] > video.media-item {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: auto 1 / 1;
    max-height: calc(100cqw * 4 / 3);
}

.post .media[data-count="3"] > :first-child {
    grid-row: span 2;
}

.post .media[data-count="4"] {
    aspect-ratio: 4 / 3;
}

.post .media-item {
    display: block;
    min-width: 0;
    min-height: 0;
    background-color: #eee;
}

/* The image fills its link, sized by the grid alone (never by the image). */
.post a.media-item {
    position: relative;
    overflow: hidden;
}

.post .media-item > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post video.media-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Full-screen viewer (entity.eta, media-viewer.js): a <dialog> over the
   page (hidden while closed), the image whole, arrows between the post's
   images. Closed by Esc, the cross or a click outside the image. */
.media-viewer {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.media-viewer[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-viewer::backdrop {
    background-color: #000d;
}

body:has(.media-viewer[open]) {
    overflow: hidden;
}

.media-viewer img {
    max-width: 95%;
    max-height: 95%;
    cursor: default;
}

/* Without `top`, the arrows stay where the dialog's flex layout puts them:
   vertically centered. */
.media-viewer button {
    position: fixed;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: #fff3;
    color: #fff;
    cursor: pointer;
}

/* The icon (--icon), drawn as a mask in the text color: centered in the
   circle whatever the font. */
.media-viewer button::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background-color: currentColor;
    mask: var(--icon) center / 24px no-repeat;
}

.media-viewer.single .viewer-prev,
.media-viewer.single .viewer-next {
    display: none;
}

.media-viewer .viewer-prev {
    left: 16px;
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E");
}

.media-viewer .viewer-next {
    right: 16px;
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
}

.media-viewer .viewer-close {
    right: 16px;
    top: 16px;
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E");
}

.x-posts {
    color: rgb(15, 20, 25);
}

.x-posts .post {
    border: solid 1px var(--border-color);
    border-radius: var(--border-radius);
}

.x-posts a {
    color: var(--post-link-color);
}

.logo {
    width: 20px;
    height: 20px;
}
.no-posts {
    color: #888;
    font-style: italic;
    margin-top: 1.5rem;
}

.post .unavailable {
    font-size: .9rem;
    color: #666;
    padding: .5rem 1rem;
    border: solid 1px #bbb;
    border-radius: 6px;
    background-color: #eee;
    text-align: center;
}

/* Media without a file (post.eta), after the grid, spaced like it. */
.post .media-pending,
.post .media-unavailable {
    margin-top: 10px;
}
