/* ========================================
   Homepage Feed Styles
   ======================================== */

/* Make all turbo-frames in feed act as grid containers matching parent row */
#feed-container turbo-frame {
    display: grid;
    gap: 1.5rem; /* matches Bootstrap g-4 */
    width: 100%;
}

/* Load More button styling */
#feed-container turbo-frame > div > .btn-lg {
    border-radius: 2rem;
    padding: 0.75rem 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all var(--transition-normal);
}

#feed-container turbo-frame > div > .btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Scroll to top button - sticky at bottom */
.scroll-to-top-btn {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1030;
    padding: 0.75rem 1.25rem;
    background: var(--bs-primary);
    color: white;
    border: none;
    border-radius: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-normal);
}

.scroll-to-top-btn:hover {
    background: var(--bs-primary);
    filter: brightness(1.1);
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.scroll-to-top-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Avoid overlap with cookie banner */
.cookie-consent-visible .scroll-to-top-btn {
    bottom: 8rem;
}

/* Feed Card Mobile Improvements */
@media (max-width: 575.98px) {
    /* Reduce card body padding on mobile */
    #feed-container .card .card-body {
        padding: 0.75rem;
    }

    /* Stack metadata and actions vertically on small screens */
    #feed-container .card .card-body > .mt-auto {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    /* Full-width buttons on mobile */
    #feed-container .card .card-body > .mt-auto > .d-flex {
        justify-content: stretch;
        width: 100%;
    }

    #feed-container .card .card-body > .mt-auto > .d-flex .btn {
        flex: 1;
        justify-content: center;
        display: inline-flex;
        align-items: center;
    }

    /* Smaller title text on mobile */
    #feed-container .card .card-title {
        font-size: 0.9rem;
    }

    /* Compact summary on mobile */
    #feed-container .card .card-text {
        font-size: 0.8rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}
