/* Loading spinner component - Loading state indicator (v1.1) */

/* 
 * INITIAL LOAD FIX: Spinner is visible by default (before JS loads)
 * JS will hide it by adding 'loaded' class to body when content is ready
 * This prevents the "dead" 0 articles state during initial page load
 */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

/* Hide spinner when body has 'loaded' class (JS applies this after content renders) */
body.loaded .loading-spinner {
    display: none;
}

/* Allow JS to explicitly show spinner even after initial load (e.g., for infinite scroll) */
body.loaded .loading-spinner.active {
    display: flex;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}
