/* ==========================================================================
   SINGLE MEMBER FEED POST
   ========================================================================== */

/* --- Astra overrides ---
   DOM chain: #content > .ast-container > #primary.ln-single-feed > .ast-container > article
   Astra applies to both .ast-container elements:
     - #content > .ast-container { display:flex; flex-direction:column-reverse; width:100% }
     - #content .ast-container { padding-left:0.54em; padding-right:0.54em }
     - .ast-container { max-width:1640px; display:flex; flex-direction:column }
   We must use ID-level selectors to beat these. */

/* Outer container: full width, no padding, kill column-reverse */
body.single-memberfeed #content > .ast-container {
    max-width: 100% !important;
    padding: 0 !important;
    flex-direction: column !important;
}

/* #primary: full width, transparent bg so --ln-bg-primary shows through */
body.single-memberfeed #primary {
    width: 100% !important;
    background: transparent !important;
}

/* Inner container: 80vw, centered, reset Astra flex/padding.
   Use #content in selector to beat #content .ast-container specificity. */
body.single-memberfeed #content #primary > .ast-container {
    display: block !important;
    max-width: 80vw !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

/* Kill Astra's white box + padding on the article */
body.single-memberfeed.ast-separate-container .ast-article-single {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Kill Astra's gray background on site-content wrapper */
body.single-memberfeed .site-content,
body.single-memberfeed #content {
    background-color: var(--ln-bg-primary) !important;
}

/* --- Page wrapper --- */
.ln-single-feed {
    padding: 2rem 0 5rem;
}

/* --- Header --- */
.ln-single-feed__header {
    max-width: 800px;
    margin: 0 auto 2rem;
    text-align: center;
}

.ln-back-link {
    display: inline-block;
    color: var(--ln-text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color var(--ln-transition);
}

.ln-back-link:hover {
    color: var(--ln-accent-cyan);
}

.ln-single-feed__title {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 800;
}

.ln-single-feed__date {
    display: block;
    color: var(--ln-text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

/* --- Gallery content (rl_gallery shortcode renders here) --- */
.ln-single-feed__content {
    margin: 0;
}

/* --- Manual gallery grid (for _gallery_images meta) --- */
.ln-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin: 2rem 0;
}

.ln-gallery-grid__item {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--ln-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color var(--ln-transition), box-shadow var(--ln-transition);
}

.ln-gallery-grid__item:hover {
    border-color: var(--ln-accent-cyan);
    box-shadow: 0 0 20px var(--ln-glow-cyan);
}

.ln-gallery-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--ln-transition);
}

.ln-gallery-grid__item:hover img {
    transform: scale(1.05);
}

/* --- Socials --- */
.ln-single-feed__socials {
    margin: 3rem 0 0;
}

.ln-single-feed__socials-heading {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0;
    text-align: center;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    body.single-memberfeed #content #primary > .ast-container {
        max-width: 95vw !important;
    }

    .ln-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}
