/* Fury Social.
 *
 * One column of cards at a readable width, pictures given the room they
 * deserve, and everything else kept quiet around them. Loads after
 * /styles.css for the palette and the controls, and /assets/composer.css for
 * the box at the top -- which the profile page has as well. */

.social-main {
    max-width: 640px;
    margin: 0 auto;
    padding: clamp(12px, 3vw, 24px) 20px 90px;
}

.social-head { margin-bottom: 22px; }

.social-kicker {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}
.social-head h1 {
    margin: 0 0 6px;
    font-size: clamp(1.8rem, 5vw, 2.4rem);
    letter-spacing: -0.02em;
}
.social-head p { margin: 0; font-size: 0.92rem; }

#composer { margin-bottom: 24px; }

/* ----- A post -------------------------------------------------------------- */

.social-feed { display: flex; flex-direction: column; gap: 20px; }

.post-card {
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: rgba(34, 39, 50, 0.92);
    overflow: hidden;
}

/* Arrived from a link on somebody's profile. Fades back to the normal border
   rather than staying lit, so it says "this one" without shouting. */
.post-card.is-target {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.post-head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 16px;
}

.post-face {
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid var(--panel-border);
}

.post-by { min-width: 0; }

.post-who {
    display: block;
    color: var(--text);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.post-who:hover { color: var(--accent); }
.post-when { color: var(--muted); font-size: 0.74rem; }

.post-remove {
    margin-left: auto;
    flex-shrink: 0;
    padding: 4px 11px;
    font-size: 0.75rem;
}

/* pre-wrap: the line breaks somebody typed are part of what they wrote. */
.post-text {
    padding: 0 16px 14px;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ----- Pictures -----------------------------------------------------------
   The reason to open this page, so they run the full width of the card with
   no padding around them. One is shown whole, up to a tall-ish limit; several
   share a grid and are cropped square, which is what keeps a row even. */

.post-images { display: grid; gap: 2px; background: var(--panel-2); }
.post-images.is-2, .post-images.is-4 { grid-template-columns: 1fr 1fr; }
.post-images.is-3 { grid-template-columns: 1fr 1fr 1fr; }

.post-images a { display: block; line-height: 0; }
.post-images img { width: 100%; display: block; }

.post-images.is-1 img { max-height: 620px; object-fit: contain; }
.post-images:not(.is-1) img { aspect-ratio: 1; object-fit: cover; }

/* ----- Under it ------------------------------------------------------------ */

.post-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
}

.like, .to-comments, .like-count {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
}
.like:hover, .to-comments:hover { background: var(--panel-2); color: var(--text); }
.like .icon, .to-comments .icon { font-size: 1.05rem; line-height: 1; }
.like.is-on { color: var(--accent-bright); }

/* The count next to the star: its own control, because pressing it opens the
   list of who rather than starring anything. Sits tight against the star so
   the two still read as one thing. */
.like-count { padding: 5px 8px; margin-left: -8px; }
.like-count:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.like-count[aria-expanded="true"] { color: var(--accent); }

/* Nobody has starred it, so there is nothing behind the number. */
.like-count:disabled { cursor: default; opacity: 0.75; }

.post-likers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 2px 14px 12px;
}

.liker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    font-size: 0.8rem;
    text-decoration: none;
}

.liker:hover { color: var(--accent); }
.liker img { border-radius: 50%; }

.liker-blank {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--panel-2);
}

.post-likers .hint { padding: 0; }

.post-count { margin-left: auto; color: var(--muted); font-size: 0.76rem; padding-right: 6px; }

/* ----- Comments ------------------------------------------------------------ */

.comments {
    display: grid;
    gap: 12px;
    padding: 12px 16px 14px;
    border-top: 1px solid var(--panel-border);
    background: rgba(28, 32, 41, 0.5);
}

.comment { display: flex; align-items: flex-start; gap: 9px; }
.comment-face { border-radius: 50%; flex-shrink: 0; margin-top: 1px; }
.comment-body { flex: 1; min-width: 0; }

.comment-who { font-size: 0.83rem; font-weight: 600; color: var(--text); text-decoration: none; }
.comment-who:hover { color: var(--accent); }
.comment-when { color: var(--muted); font-size: 0.71rem; margin-left: 7px; }
.comment-text {
    font-size: 0.88rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-remove {
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1;
    padding: 0 4px;
    opacity: 0;
}
.comment:hover .comment-remove, .comment-remove:focus-visible { opacity: 1; }
.comment-remove:hover { color: var(--danger); }

.comment-add { display: flex; align-items: center; gap: 8px; }
.comment-add input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.87rem;
}
.comment-add button { border-radius: 999px; font-size: 0.8rem; padding: 7px 14px; }

/* ----- Emoji and mentions, as everywhere else on the site ------------------ */

.post-text .emoji, .comment-text .emoji {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    vertical-align: -0.2em;
}
.post-text .mention, .comment-text .mention {
    padding: 0 4px;
    border-radius: 4px;
    background: rgba(217, 164, 65, 0.16);
    color: var(--accent-bright);
}
.post-text .mention-unknown, .comment-text .mention-unknown {
    background: none;
    color: var(--muted);
}
.post-text .md-link, .comment-text .md-link { color: var(--accent); }

/* On a phone the card may as well use the whole width. */
@media (max-width: 560px) {
    .social-main { padding-left: 0; padding-right: 0; }
    .social-head, #composer, .page-state { padding-left: 16px; padding-right: 16px; }
    .post-card { border-radius: 0; border-left: 0; border-right: 0; }
}

/* A video in a post sits in the same box a picture does, and is bounded the
   same way -- an un-capped one would be as tall as the clip happens to be. */
.post-images video {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    background: #000;
    border-radius: 8px;
}

.composer-image video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}
