/* 
 * Homepage CSS - Deferred Loading
 * Optimized for Mobile & Performance
 */
/* ===== MULTILINGUAL FONT SUPPORT ===== */
/* Base font stack for all languages */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
}

/* Language-specific font classes */
.hindi-font,
.lang-hi .section-description,
.lang-hi .post-badge,
.lang-hi .btn-text,
.lang-hi .no-posts p {
    font-family: 'Noto Sans Devanagari', sans-serif !important;
    font-display: swap;
}

.english-font,
.lang-en .section-description,
.lang-en .post-badge,
.lang-en .btn-text,
.lang-en .no-posts p {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.odia-font,
.lang-or .section-description,
.lang-or .post-badge,
.lang-or .btn-text,
.lang-or .no-posts p {
    font-family: 'Noto Sans Odia', sans-serif !important;
    font-display: swap;
}

.marathi-font,
.lang-mr .section-description,
.lang-mr .post-badge,
.lang-mr .btn-text,
.lang-mr .no-posts p {
    font-family: 'Noto Sans Devanagari', sans-serif !important;
    font-display: swap;
}

.bengali-font,
.lang-bn .section-description,
.lang-bn .post-badge,
.lang-bn .btn-text,
.lang-bn .no-posts p {
    font-family: 'Noto Sans Bengali', sans-serif !important;
    font-display: swap;
}

/* Ensure text doesn't overflow in different languages */
.section-description,
.post-badge,
.btn-text,
.no-posts p,
.category-desktop-hindi,
.category-compact-hindi {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Adjust line-height for different scripts */
.hindi-font,
.odia-font,
.marathi-font,
.bengali-font {
    line-height: 1.8;
}
/* ===== CSS VARIABLES ===== */
:root {
    /* Colors */
    --primary: #7c3aed;
    --primary-light: #8b5cf6;
    --primary-dark: #5b21b6;
    --secondary: #f59e0b;
    --secondary-light: #fbbf24;
    --secondary-dark: #d97706;
    --dark: #1e293b;
    --dark-light: #334155;
    --light: #f8fafc;
    --light-alt: #f1f5f9;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 6px 12px -2px rgba(0, 0, 0, 0.1), 0 3px 6px -1px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 10px -2px rgba(0, 0, 0, 0.05);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius: 16px;
    --radius-lg: 24px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 300ms ease;
    --transition-slow: 500ms ease;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
}

/* ===== BASE STYLES ===== */
* {
    box-sizing: border-box;
}

.homepage-hero,
.homepage-section,
.posts-grid,
.category-grid-compact {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.posts-grid.loaded {
    opacity: 1;
    animation: none;
}

/* ===== CATEGORIES - FIXED GRID ===== */
/* MOBILE FIRST - 2 columns */
.category-grid-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1.5rem;
    width: 100%;
    max-width: 100%;
}

.category-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    background: white;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    min-height: 100px;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.category-compact:hover,
.category-compact:focus {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #7c3aed;
    outline: none;
}

.category-compact-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.category-compact:hover .category-compact-icon {
    transform: scale(1.1);
}

.icon-emoji {
    font-size: 1.5rem;
    display: block;
    line-height: 1;
}

.category-compact-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    text-align: center;
    width: 100%;
}

.category-compact-hindi {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    font-family: 'Noto Sans Devanagari', sans-serif;
    margin-bottom: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.category-compact-english {
    display: block;
    font-size: 0.65rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* SMALL MOBILE - 2 columns (already set) */
@media (max-width: 374px) {
    .category-grid-compact {
        gap: 0.625rem;
    }
    
    .category-compact {
        padding: 0.75rem 0.375rem;
        min-height: 90px;
    }
    
    .category-compact-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 0.375rem;
    }
    
    .icon-emoji {
        font-size: 1.25rem;
    }
    
    .category-compact-hindi {
        font-size: 0.8125rem;
    }
    
    .category-compact-english {
        font-size: 0.6rem;
    }
}



/* MOBILE - 3 columns */
@media (min-width: 375px) and (max-width: 767px) {
    .category-grid-compact {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    
    .category-compact {
        padding: 0.875rem 0.5rem;
        min-height: 95px;
    }
    
    .category-compact-icon {
        width: 42px;
        height: 42px;
        margin-bottom: 0.5rem;
    }
    
    .icon-emoji {
        font-size: 1.375rem;
    }
    
    .category-compact-hindi {
        font-size: 0.8125rem;
    }
    
    .category-compact-english {
        font-size: 0.6rem;
    }
}

/* TABLET - 3 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .category-grid-compact {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .category-compact {
        padding: 1.25rem 0.75rem;
        min-height: 120px;
    }
    
    .category-compact-icon {
        width: 55px;
        height: 55px;
        margin-bottom: 0.75rem;
    }
    
    .icon-emoji {
        font-size: 1.75rem;
    }
    
    .category-compact-hindi {
        font-size: 1rem;
    }
    
    .category-compact-english {
        font-size: 0.75rem;
    }
}

/* DESKTOP - 6 COLUMNS (2 rows) */
@media (min-width: 1024px) {
    .category-grid-compact {
        grid-template-columns: repeat(6, 1fr);
        gap: 1rem;
        margin-top: 2rem;
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .category-compact {
        padding: 1.5rem 0.75rem;
        min-height: 140px;
    }
    
    .category-compact-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }
    
    .icon-emoji {
        font-size: 2rem;
    }
    
    .category-compact-hindi {
        font-size: 1.125rem;
    }
    
    .category-compact-english {
        font-size: 0.875rem;
    }
}

/* LARGE DESKTOP - 6 columns with larger spacing */
@media (min-width: 1440px) {
    .category-grid-compact {
        gap: 1.5rem;
    }
    
    .category-compact {
        padding: 1.75rem 1rem;
        min-height: 150px;
    }
    
    .category-compact-icon {
        width: 70px;
        height: 70px;
    }
    
    .icon-emoji {
        font-size: 2.25rem;
    }
    
    .category-compact-hindi {
        font-size: 1.25rem;
    }
}


/* Category Filter Container */
.category-filter-container {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Category Tree (Left Side) */
.category-tree-wrapper {
    width: 300px;
    flex-shrink: 0;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 1.5rem;
}

.tree-header {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.tree-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.tree-subtitle {
    font-size: 0.875rem;
    color: #64748b;
}

/* Filtered Posts (Right Side) */
.filtered-posts-wrapper {
    flex-grow: 1;
    padding: 1.5rem;
}

.filtered-posts-header {
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.filtered-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.selected-category-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.selected-category-name {
    font-size: 1rem;
    color: #7c3aed;
    font-weight: 500;
}

.selected-category-count {
    font-size: 0.875rem;
    background: #7c3aed10;
    color: #7c3aed;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    border: 1px solid #7c3aed20;
}

/* Initial Message */
.initial-message {
    text-align: center;
    padding: 4rem 2rem;
}

.message-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.initial-message h4 {
    font-size: 1.25rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.initial-message p {
    color: #64748b;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Filtered Posts Grid */
.filtered-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    min-height: 400px;
}

.filtered-post-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.filtered-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #7c3aed40;
}

.filtered-post-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.filtered-post-content {
    padding: 1.25rem;
}

.filtered-post-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.filtered-post-excerpt {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.filtered-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #94a3b8;
}

.filtered-post-category {
    background: #7c3aed10;
    color: #7c3aed;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

/* Loading State */
.filtered-posts-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.loading-content {
    text-align: center;
}

.loading-content .loading-spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
    margin: 0 auto 1rem;
}

.loading-content p {
    color: #64748b;
    font-size: 0.875rem;
}

/* No Posts State */
.no-posts-found {
    text-align: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
}

.no-posts-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.no-posts-found h4 {
    font-size: 1.25rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.no-posts-found p {
    color: #64748b;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .category-filter-container {
        flex-direction: column;
        gap: 0;
    }
    
    .category-tree-wrapper {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .filtered-posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .filtered-posts-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== HERO SECTION ===== */
.homepage-hero {
    position: relative;
    background: linear-gradient(135deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.8) 100%);
    color: white;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--space-2xl) var(--space-md);
    text-align: center;
    overflow: hidden;
}

.floating-bg-element {
    position: absolute;
    width: min(500px, 90vw);
    height: min(500px, 90vw);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, rgba(124, 58, 237, 0) 70%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

.floating-bg-element:nth-child(1) {
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.floating-bg-element:nth-child(2) {
    bottom: 10%;
    right: 5%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0) 70%);
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(180deg); }
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    line-height: 1.6;
    margin-bottom: var(--space-2xl);
    opacity: 0.9;
    font-weight: 300;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-2xl);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.125rem;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
    position: relative;
    overflow: hidden;
    min-height: 44px;
}

.hero-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.hero-btn:hover,
.hero-btn:focus {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(124, 58, 237, 0.4);
    outline: none;
}

.hero-btn:hover::before {
    left: 100%;
}

.hero-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1.25rem;
}

/* ===== SECTIONS ===== */
.homepage-section {
    padding: var(--space-2xl) var(--space-md);
    max-width: 1200px;
    margin: 0 auto;
    animation-delay: 0.2s;
    width: 100%;
}

.homepage-section.bg-light {
    background: linear-gradient(135deg, var(--light) 0%, var(--light-alt) 100%);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--dark);
    margin-bottom: var(--space-sm);
    line-height: 1.2;
}

.section-description {
    font-size: 1.125rem;
    color: var(--dark-light);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

.title-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 2px;
    margin: 0 auto;
}

.wave-divider {
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom, transparent, #f8fafc);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120'%3E%3Cpath fill='white' d='M0,64L80,58.7C160,53,320,43,480,48C640,53,800,75,960,74.7C1120,75,1280,53,1360,42.7L1440,32L1440,120L1360,120C1280,120,1120,120,960,120C800,120,640,120,480,120C320,120,160,120,80,120L0,120Z'%3E%3C/path%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120'%3E%3Cpath fill='white' d='M0,64L80,58.7C160,53,320,43,480,48C640,53,800,75,960,74.7C1120,75,1280,53,1360,42.7L1440,32L1440,120L1360,120C1280,120,1120,120,960,120C800,120,640,120,480,120C320,120,160,120,80,120L0,120Z'%3E%3C/path%3E%3C/svg%3E");
    mask-size: cover;
    -webkit-mask-size: cover;
    margin-top: -1px;
}

/* ===== HINDI TYPOGRAPHY ===== */
.hindi-font {
    font-family: 'Noto Sans Devanagari', 'Mangal', 'Nirmala UI', 'Sanskrit Text', 'Segoe UI', sans-serif;
    font-weight: 600;
    font-display: swap;
}

/* ===== POSTS GRID ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.post-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    position: relative;
    border: 1px solid var(--gray-200);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.post-card:hover,
.post-card:focus-within {
    transform: translateY(-8px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
}

.post-image-wrapper {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--gray-100);
}

.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
    background: var(--gray-200);
}

.post-card:hover .post-image {
    transform: scale(1.05);
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.bhajan-placeholder {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
}

.aarti-placeholder {
    background: linear-gradient(135deg, var(--secondary-light), var(--secondary));
    color: white;
}

.stotra-placeholder {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: white;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
    cursor: pointer;
}

.post-card:hover .play-overlay,
.post-card:focus-within .play-overlay {
    opacity: 1;
}

.play-icon {
    font-size: 3rem;
    color: white;
    transform: scale(0.8);
    transition: transform var(--transition);
}

.post-card:hover .play-icon,
.post-card:focus-within .play-icon {
    transform: scale(1);
}

.post-badge {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: var(--primary);
    color: #d74141;
    padding: var(--space-xs) var(--space-sm);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.aarti-badge {
    background: var(--secondary);
}

.stotra-badge {
    background: #10b981;
}

.post-content {
    padding: var(--space-lg);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: var(--space-sm);
    line-height: 1.4;
    flex-grow: 1;
}

.post-meta {
    margin-top: auto;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--dark-light);
}

/* ===== CLICKABLE CARDS ===== */
.post-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition);
    outline: none;
}

.post-card-link:hover .post-card,
.post-card-link:focus .post-card {
    transform: translateY(-8px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
}

.post-card-link:focus {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
    border-radius: var(--radius);
}

/* Remove default link styles from card titles */
.post-card-link .post-title {
    color: var(--dark);
    text-decoration: none;
}

.post-card-link:hover .post-title,
.post-card-link:focus .post-title {
    color: var(--primary);
}

/* ===== LOAD MORE BUTTON ===== */
.load-more-wrapper {
    text-align: center;
    margin-top: var(--space-xl);
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-2xl);
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition);
    min-width: 200px;
    min-height: 44px;
}

.load-more-btn:hover,
.load-more-btn:focus {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    outline: none;
}

.load-more-btn:active {
    transform: translateY(0);
}

.load-more-btn.loading {
    opacity: 0.8;
    pointer-events: none;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== NO POSTS ===== */
.no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-2xl);
    color: var(--dark-light);
}

.no-posts-icon {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
    display: block;
    opacity: 0.5;
}

.simple-link {
    display: inline-block;
    margin-top: var(--space-md);
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.simple-link:hover,
.simple-link:focus {
    border-bottom-color: var(--primary);
    outline: none;
}

/* ===== LAZYLOADING ===== */
.lazyload,
.lazyloading {
    opacity: 0;
    transition: opacity 400ms;
}

.lazyloaded {
    opacity: 1;
}

/* Blur-up technique for images */
.lazyload {
    filter: blur(10px);
    transform: scale(1.1);
}

.lazyloaded {
    filter: blur(0);
    transform: scale(1);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet */
@media (max-width: 1023px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }
    
    .homepage-section {
        padding: var(--space-xl) var(--space-md);
    }
    
    .wave-divider {
        height: 80px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .hero-title {
        font-size: clamp(2rem, 5vw, 2.5rem);
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 2vw, 1.125rem);
    }
    
    .hero-btn {
        padding: var(--space-md) var(--space-xl);
        font-size: 1rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .section-title {
        font-size: clamp(1.5rem, 4vw, 2rem);
    }
    
    .homepage-section {
        padding: var(--space-xl) var(--space-sm);
    }
    
    .post-content {
        padding: var(--space-md);
    }
    
    .load-more-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .wave-divider {
        height: 60px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .homepage-hero {
        min-height: 70vh;
        padding: var(--space-xl) var(--space-sm);
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .post-card,
    .category-compact {
        border-radius: var(--radius-sm);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .category-compact,
    .hero-btn,
    .load-more-btn,
    .post-card-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    .play-overlay {
        opacity: 0.7;
    }
    
    .category-compact:hover,
    .post-card:hover,
    .hero-btn:hover,
    .load-more-btn:hover {
        transform: none;
    }
    
    .category-compact:active,
    .post-card:active,
    .hero-btn:active,
    .load-more-btn:active {
        transform: scale(0.98);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .homepage-hero,
    .homepage-section,
    .posts-grid,
    .category-grid-compact {
        animation: none;
        opacity: 1;
    }
    
    .floating-bg-element,
    .loading-spinner {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .homepage-hero,
    .wave-divider,
    .play-overlay,
    .load-more-wrapper,
    .floating-bg-element {
        display: none;
    }
    
    .homepage-section {
        page-break-inside: avoid;
        padding: 0;
        margin: 2rem 0;
    }
    
    .post-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .hero-title {
        background: none;
        -webkit-text-fill-color: black;
        color: black;
    }
    
    .category-compact {
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}
/* Language-specific adjustments */
@media (max-width: 767px) {
    .hindi-font,
    .odia-font,
    .marathi-font,
    .bengali-font {
        font-size: 95%;
    }
    
    .category-compact-hindi {
        font-size: 0.8rem;
    }
}