/* X-style feed and repost presentation override. */

@media (min-width: 701px) {
    .feed .post-card,
    .post-card,
    .post-card-main,
    .post-card-repost-entry.post-card-main,
    .reply-card-root {
        background: transparent;
        border-bottom: 1px solid var(--social-border);
        transition: background 0.12s ease;
    }

    .feed .post-card:hover,
    .post-card:hover,
    .post-card-main:hover,
    .reply-card-root:hover {
        background: rgba(255, 255, 255, 0.02);
    }

    body.social-home .post-card,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 0 10px;
        padding: 8px 16px 6px;
    }

    body.social-home .post-meta-row,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-meta-row {
        gap: 6px;
        align-items: center;
        margin: 0;
    }

    body.social-home .post-meta-names,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-meta-names {
        gap: 4px;
        font-size: 15px;
        line-height: 1.2;
    }

    body.social-home .post-author,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-author {
        font-weight: 800;
    }

    body.social-home .post-handle,
    body.social-home .post-time,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-handle,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-time {
        font-size: 15px;
    }

    body.social-home .post-text,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-text {
        margin: -2px 0 0;
        font-size: 15px;
        line-height: 1.4;
    }

    body.social-home .post-text-block,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-text-block,
    body.social-home .post-text-block .post-text,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-text-block .post-text {
        margin: 0;
    }

    body.social-home .post-actions,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-actions {
        margin: 4px -8px 0;
        gap: 0;
    }

    body.social-home .post-actions-btn,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-actions-btn {
        padding: 5px 8px;
        min-height: 34px;
    }

    body.social-home .post-actions-icon svg,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-actions-icon svg {
        width: 17px;
        height: 17px;
    }

    body.social-home .post-actions-count,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-actions-count {
        font-size: 12px;
    }

    .post-avatar-link .author-avatar,
    .author-avatar {
        width: 36px;
        height: 36px;
        margin-top: 2px;
    }

    .post-card-main {
        padding: 0;
    }

    .post-card-main .post-body,
    .post-card-repost-entry .post-body {
        min-width: 0;
    }

    .post-card-main .post-media,
    .post-card-main .post-media img,
    .post-card-main .post-media video {
        border-radius: 16px;
    }

    .post-card-repost-entry:not(.post-card-expanded) {
        cursor: pointer;
    }

    .post-card-repost-entry.post-card-expanded,
    .post-card-repost-entry.post-card-main {
        cursor: default;
    }

    .post-card-quote-repost .repost-quote-text {
        margin: 0 0 8px;
        font-size: 16px;
        line-height: 22px;
        letter-spacing: -0.01em;
    }

    .post-repost-badge {
        margin: 0 0 6px;
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.01em;
        color: var(--text-muted);
    }

    .post-repost-embed {
        margin: 4px 0 6px;
    }

    .post-repost-inner {
        border: 1px solid rgba(47, 51, 54, 0.75);
        border-radius: 14px;
        overflow: hidden;
        background: transparent;
    }

    .post-repost-inner:hover {
        border-color: rgba(71, 75, 78, 0.95);
        background: rgba(255, 255, 255, 0.01);
    }

    .post-card-embedded {
        padding: 10px 12px 8px;
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 0 8px;
    }

    .post-card-embedded .post-avatar-link .author-avatar,
    .post-card-embedded .author-avatar {
        width: 28px;
        height: 28px;
    }

    .post-card-embedded .post-meta-names {
        font-size: 13px;
        line-height: 1.2;
    }

    .post-card-embedded .post-text {
        font-size: 13px;
        line-height: 1.4;
        margin-bottom: 6px;
    }

    .post-card-embedded .post-media {
        border-radius: 12px;
        max-height: 240px;
    }

    .post-card-embedded .post-media img,
    .post-card-embedded .post-media video {
        max-height: 240px;
        object-fit: cover;
    }

    .post-card-repost-entry .post-actions-repost-own {
        margin-top: 6px;
        padding-top: 6px;
        border-top: 1px solid rgba(47, 51, 54, 0.45);
    }

    /* ── Simple reposts: X-style layout ───────────────────────────────── */

    /* Banner row spans both grid columns */
    .post-card-simple-repost {
        grid-template-rows: auto auto;
    }

    .post-card-simple-repost > .post-repost-banner {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 4px;
        font-size: 13px;
        font-weight: 600;
        color: var(--text-muted);
    }

    .post-repost-banner-icon {
        display: grid;
        place-items: center;
        width: 16px;
        height: 16px;
        color: var(--social-repost, #00ba7c);
        flex-shrink: 0;
    }

    .post-repost-banner-icon svg {
        width: 14px;
        height: 14px;
    }

    .post-repost-banner-user {
        color: var(--text-muted);
        text-decoration: none;
        font-weight: 700;
    }

    .post-repost-banner-user:hover {
        text-decoration: underline;
    }

    .post-repost-banner-text {
        flex: 1;
    }

    /* Move the 3-dot menu to the right inside the banner */
    .post-repost-banner > .post-menu {
        margin-left: auto;
    }

    /* Hide the reposter's avatar — they're identified in the banner */
    .post-card-simple-repost > .post-avatar-link {
        display: none;
    }

    /* Keep repost content aligned to the same content column as normal posts. */
    .post-card-simple-repost > .post-body {
        grid-column: 2 / -1;
        min-width: 0;
    }

    /* Hide the redundant reposter name/handle/time row */
    .post-card-simple-repost > .post-body > .post-meta-row {
        display: none;
    }

    /* Remove the box from simple repost — show original post flat */
    .post-card-simple-repost .post-repost-inner {
        border: none !important;
        background: transparent !important;
        border-radius: 0;
        overflow: visible;
    }

    .post-card-simple-repost .post-repost-embed {
        margin: 0;
    }

    /* Style the embedded original post like a regular feed card */
    .post-card-simple-repost .post-card-embedded {
        padding: 0 0 2px;
        grid-template-columns: 35px minmax(0, 1fr);
        gap: 0 10px;
        cursor: pointer;
    }

    .post-card-simple-repost .post-card-embedded .author-avatar {
        width: 35px;
        height: 35px;
    }

    .post-card-simple-repost .post-card-embedded .post-meta-names {
        font-size: 14px;
        line-height: 1.2;
        gap: 4px;
    }

    .post-card-simple-repost .post-card-embedded .post-author {
        font-weight: 700;
    }

    .post-card-simple-repost .post-card-embedded .post-text {
        font-size: 14px;
        line-height: 1.35;
        margin-top: 1px;
        margin-bottom: 0;
    }

    /* Keep simple repost actions aligned exactly like regular post actions */
    .post-card-simple-repost .post-actions-repost-own {
        margin: 4px -8px 0 !important;
        padding-top: 0 !important;
        border-top: none !important;
        gap: 0 !important;
        align-items: center;
    }

    .post-card-simple-repost .post-actions-repost-own .post-actions-reply,
    .post-card-simple-repost .post-actions-repost-own .post-actions-repost,
    .post-card-simple-repost .post-actions-repost-own .post-actions-like,
    .post-card-simple-repost .post-actions-repost-own .post-actions-views {
        flex: 1 1 0;
        max-width: 92px;
    }

    .post-card-simple-repost .post-actions-repost-own .post-actions-bookmark {
        margin-left: auto;
        flex: 0 0 auto;
    }

    .post-detail-thread .post-card-repost-entry.post-card-main {
        padding: 14px 16px;
    }

    .post-detail-thread .post-card-repost-entry.post-card-main .repost-quote-text {
        font-size: 20px;
        line-height: 1.2;
    }

    .post-detail-thread .post-card-repost-entry.post-card-main .post-avatar-link .author-avatar,
    .post-detail-thread .post-card-repost-entry.post-card-main .author-avatar {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 700px) {
    body.social-home .post-card,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 0 9px;
        padding: 7px 12px 5px;
    }

    body.social-home .post-meta-row,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-meta-row {
        margin: 0;
        gap: 5px;
        align-items: center;
    }

    body.social-home .post-meta-names,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-meta-names {
        gap: 3px;
        font-size: 14px;
        line-height: 1.15;
    }

    body.social-home .post-handle,
    body.social-home .post-time,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-handle,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-time {
        font-size: 14px;
    }

    body.social-home .post-text,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-text {
        margin: -1px 0 0;
        font-size: 14px;
        line-height: 1.36;
    }

    body.social-home .post-text-block,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-text-block,
    body.social-home .post-text-block .post-text,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-text-block .post-text {
        margin: 0;
    }

    body.social-home .post-actions,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-actions {
        margin: 5px -8px 0;
        gap: 0;
    }

    body.social-home .post-actions-btn,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-actions-btn {
        padding: 5px 8px;
        min-height: 30px;
    }

    body.social-home .post-actions-icon svg,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-actions-icon svg {
        width: 17px;
        height: 17px;
    }

    body.social-home .post-actions-count,
    .feed .post-card:not(.post-card-expanded):not(.post-card-embedded) .post-actions-count {
        font-size: 12px;
    }

    .post-avatar-link .author-avatar,
    .author-avatar {
        width: 36px;
        height: 36px;
        margin-top: 1px;
    }

    .post-repost-inner {
        border-radius: 14px;
    }

    .post-card-embedded .post-media {
        border-radius: 12px;
    }

    /* Simple reposts on mobile should visually match normal posts below the repost banner. */
    .post-card-simple-repost {
        grid-template-rows: auto auto;
    }

    .post-card-simple-repost > .post-repost-banner {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 4px;
        font-size: 13px;
        font-weight: 600;
        color: var(--text-muted);
    }

    .post-card-simple-repost > .post-repost-banner > .post-menu {
        margin-left: auto;
    }

    .post-card-simple-repost > .post-avatar-link {
        display: none;
    }

    .post-card-simple-repost > .post-body {
        grid-column: 2 / -1;
        min-width: 0;
    }

    .post-card-simple-repost > .post-body > .post-meta-row {
        display: none;
    }

    .post-card-simple-repost .post-repost-inner {
        border: none !important;
        background: transparent !important;
        border-radius: 0;
        overflow: visible;
    }

    .post-card-simple-repost .post-repost-embed {
        margin: 0;
    }

    .post-card-simple-repost .post-card-embedded {
        padding: 0 0 2px;
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 0 9px;
        cursor: pointer;
    }

    .post-card-simple-repost .post-card-embedded .author-avatar {
        width: 36px;
        height: 36px;
    }

    .post-card-simple-repost .post-card-embedded .post-meta-names {
        font-size: 14px;
        line-height: 1.15;
        gap: 3px;
    }

    .post-card-simple-repost .post-card-embedded .post-text {
        margin: -1px 0 0;
        font-size: 14px;
        line-height: 1.36;
    }
}

/* Thread empty state polish: prevent ultra-narrow word stacking on some layouts. */
.post-thread-empty {
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    padding: 22px 16px;
    box-sizing: border-box;
}

.post-thread-empty p {
    margin: 0 auto;
    max-width: 34ch;
    line-height: 1.45;
    text-wrap: balance;
}