@layer components {
    .luna-x-section {
        border-block: 1px solid rgba(212, 175, 55, 0.16);
        background: var(--night-900);
    }

    .luna-x-section__inner {
        display: grid;
        gap: 2rem;
    }

    .luna-x-section__header {
        max-width: 760px;
    }

    .luna-x-section__header > p:not(.section-label) {
        margin-top: 0.9rem;
        color: var(--ink-soft);
    }

    .luna-x-section__header .luna-x-section__note {
        margin-top: 0.45rem;
        color: var(--ink-muted);
        font-size: 0.92rem;
    }

    .luna-x-feed {
        display: grid;
        min-height: 24rem;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
        align-items: stretch;
    }

    .luna-x-feed__loading,
    .luna-x-feed__fallback {
        display: grid;
        min-height: 13rem;
        padding: 1.5rem;
        grid-column: 1 / -1;
        place-items: center;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: rgba(13, 26, 43, 0.72);
        color: var(--ink-muted);
        text-align: center;
    }

    .luna-x-feed__fallback a {
        color: var(--gold-light);
        text-decoration: underline;
        text-underline-offset: 0.22em;
    }

    .luna-x-feed__card {
        display: flex;
        min-width: 0;
        min-height: 18rem;
        padding: 1.4rem;
        flex-direction: column;
        gap: 1rem;
        border: 1px solid rgba(212, 175, 55, 0.22);
        border-radius: 8px;
        background: rgba(13, 26, 43, 0.82);
        box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
        transition: border-color 180ms ease, transform 180ms ease, background-color 180ms ease;
    }

    .luna-x-feed__card:hover {
        border-color: rgba(241, 223, 160, 0.5);
        background: rgba(20, 36, 56, 0.9);
        transform: translateY(-2px);
    }

    .luna-x-feed__meta {
        display: grid;
        min-width: 0;
        grid-template-columns: 1fr;
        gap: 0.2rem 1rem;
        align-items: start;
    }

    .luna-x-feed__account {
        min-width: 0;
    }

    .luna-x-feed__account strong,
    .luna-x-feed__account span {
        display: block;
        overflow-wrap: anywhere;
    }

    .luna-x-feed__account strong {
        color: var(--ink);
        font-family: var(--font-serif);
        font-size: 1rem;
        font-weight: 500;
    }

    .luna-x-feed__account span,
    .luna-x-feed__meta time {
        color: var(--ink-muted);
        font-size: 0.78rem;
        line-height: 1.55;
    }

    .luna-x-feed__meta time {
        white-space: nowrap;
    }

    .luna-x-feed__text {
        display: -webkit-box;
        min-width: 0;
        overflow: hidden;
        color: var(--ink-soft);
        font-size: 0.95rem;
        line-height: 1.85;
        overflow-wrap: anywhere;
        white-space: pre-wrap;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 7;
    }

    .luna-x-feed__link {
        display: inline-flex;
        min-height: 44px;
        margin-top: auto;
        align-items: center;
        align-self: flex-start;
        color: var(--gold-light);
        font-size: 0.88rem;
        font-weight: 600;
    }

    .luna-x-feed__link:hover {
        text-decoration: underline;
        text-underline-offset: 0.22em;
    }

    .luna-x-feed__expand {
        display: flex;
        justify-content: center;
    }

    .luna-x-feed__expand-button {
        min-height: 48px;
        padding: 0.65rem 1rem;
        border: 1px solid rgba(212, 175, 55, 0.34);
        border-radius: 8px;
        color: var(--gold-light);
        background: transparent;
        font: inherit;
        font-size: 0.92rem;
        font-weight: 600;
        cursor: pointer;
        transition: border-color 180ms ease, background-color 180ms ease;
    }

    .luna-x-feed__expand-button:hover {
        border-color: rgba(241, 223, 160, 0.68);
        background: rgba(212, 175, 55, 0.08);
    }

    .luna-x-section__updated {
        color: var(--ink-muted);
        font-size: 0.78rem;
    }

    .luna-x-section__more {
        display: flex;
        justify-content: flex-end;
    }

    .luna-x-section__more a {
        display: inline-flex;
        min-height: 48px;
        padding: 0.65rem 1rem;
        align-items: center;
        border: 1px solid rgba(212, 175, 55, 0.34);
        border-radius: 8px;
        color: var(--gold-light);
        font-size: 0.92rem;
        font-weight: 600;
        transition: border-color 180ms ease, background-color 180ms ease;
    }

    .luna-x-section__more a:hover {
        border-color: rgba(241, 223, 160, 0.68);
        background: rgba(212, 175, 55, 0.08);
    }
}

@layer responsive {
    @media (max-width: 940px) {
        .luna-x-feed {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    @media (max-width: 768px) {
        .luna-x-section__inner {
            gap: 1.5rem;
        }

        .luna-x-feed {
            min-height: 22rem;
            grid-template-columns: 1fr;
        }

        .luna-x-feed__card {
            min-height: 0;
            padding: 1.2rem;
        }

        .luna-x-feed__meta time {
            white-space: normal;
        }

        .luna-x-section__more {
            justify-content: stretch;
        }

        .luna-x-section__more a {
            width: 100%;
            justify-content: center;
        }

        .luna-x-feed__expand-button {
            width: 100%;
        }
    }
}

@layer motion {
    @media (prefers-reduced-motion: reduce) {
        .luna-x-feed__card,
        .luna-x-section__more a {
            transition: none;
        }

        .luna-x-feed__expand-button {
            transition: none;
        }
    }
}
