@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Inter:wght@300;400;500;600&display=swap');

/* =========================================
   FEED GRID (New Premium Layout)
   ========================================= */
.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 40px;
    margin-top: 50px;
    padding-bottom: 80px;
}

/* Header & Filters */
.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    /* responsive */
    gap: 20px;
}

.feed-filters {
    display: flex;
    gap: 12px;
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.3);
}

/* --- Card Container --- */
.post-card {
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    /* Subtle initial shadow */
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    height: 100%;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: rgba(255, 87, 34, 0.3);
}

/* --- Image Section --- */
.post-card-image-container {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f1f1f1;
}

.post-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.post-card:hover .post-card-img {
    transform: scale(1.08);
    /* Zoom effect */
}

.post-card-img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e0e0e0, #f5f5f5);
}

/* Date Badge on Image */
.post-date-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.post-date-badge.inline {
    position: static;
    margin-right: 8px;
    box-shadow: none;
    /* simpler look for header */
    background: rgba(0, 0, 0, 0.03);
    /* match reading time */
    color: var(--text-muted);
    font-weight: 600;
    padding: 4px 10px;
}

[data-theme="dark"] .post-date-badge.inline {
    background: rgba(255, 255, 255, 0.05);
    /* match reading time */
    color: var(--text-muted);
}

/* --- Content Section --- */
.post-card-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Author Row */
.post-author-row {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.post-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 1px solid var(--border-color);
}

.post-author-name {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Title */
.post-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    /* Extra bold */
    color: var(--text-main);
    margin: 0 0 12px 0;
    line-height: 1.25;
    cursor: pointer;
    transition: color 0.2s;
}

.post-title:hover {
    color: var(--brand);
}

/* Excerpt text */
.excerpt,
.full-content {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* --- Footer Actions --- */
.post-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Read More Button */
.toggle-read-more {
    font-family: 'Outfit', sans-serif;
    background: transparent;
    color: var(--brand);
    border: 2px solid rgba(255, 87, 34, 0.1);
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    max-width: fit-content;
    transition: all 0.2s;
}

.toggle-read-more:hover {
    background: rgba(255, 87, 34, 0.1);
    transform: translateY(0);
}

/* Icons Group */
.action-icons {
    display: flex;
    gap: 8px;
}

.icon-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    cursor: pointer;
}

.icon-action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

/* Specific button colors on hover/active */
.like-btn:hover,
.like-btn.liked {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.save-btn:hover,
.save-btn.saved {
    color: var(--brand);
    background: rgba(255, 87, 34, 0.1);
}

.comment-btn:hover {
    color: #2196f3;
    background: rgba(33, 150, 243, 0.1);
}

.like-count {
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 4px;
}

/* DARK MODE */
[data-theme="dark"] .post-date-badge {
    background: rgba(30, 30, 30, 0.85);
    color: #fff;
}

[data-theme="dark"] .post-card-img-placeholder {
    background: linear-gradient(135deg, #1e1e1e, #2d2d2d);
}

[data-theme="dark"] .filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .feed-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .post-card-image-container {
        height: 200px;
    }
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes heartPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes bookmarkBounce {
    0% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.2) rotate(10deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* =========================================
   SEARCH BOX (Clean & Modern Glass)
   ========================================= */
.search-container {
    max-width: 680px;
    margin: 30px auto 20px;
    position: relative;
    z-index: 10;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 50px;
    padding: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    border-color: #fff;
    gap: 8px;
    /* Add gap between input and button */
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 20px;
    font-size: 1.05rem;
    background: transparent;
    color: var(--text-main);
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    border-radius: 50px;
    min-width: 0;
    /* Allow input to shrink if needed */
}

.search-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.search-icon {
    background: var(--brand);
    /* Solid brand color */
    color: white;
    border: none;
    border-radius: 50%;
    /* Rounded square, slightly different shape */
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.25);
    flex-shrink: 0;
    /* Prevent shrinking */
}

.search-icon:hover {
    background: #ff7043;
    /* Lighter brand color */
    transform: scale(1.05);
}

/* Dark Mode Overrides */
[data-theme="dark"] .search-box {
    background: rgba(20, 20, 20, 0.4);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .search-box:focus-within {
    background: rgba(30, 30, 30, 0.8);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Author Avatar Placeholder for Cards */
.post-author-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff5722, #ff9800);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    margin-right: 10px;
    border: 1px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
}

/* Post Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.post-tag {
    font-size: 0.75rem;
    color: var(--brand);
    background: rgba(255, 87, 34, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.2s;
}

/* Reading Time Badge */
.reading-time-badge {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.03);
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

[data-theme="dark"] .reading-time-badge {
    background: rgba(255, 255, 255, 0.05);
}

/* Pagination Loader */
.pagination-loader {
    display: flex;
    justify-content: center;
    padding: 20px;
}


/* --- Badges Overlay --- */
.badges-overlay {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    z-index: 10;
}

/* Category Badge (News) */
.category-badge.news {
    background: #ef4444;
    /* Red for News */
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 50px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
    letter-spacing: 0.5px;
}

.category-badge.news.inline {
    padding: 4px 10px;
    font-size: 0.7rem;
    box-shadow: none;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Adjust original Date Badge to work inside overlay */
.badges-overlay .post-date-badge {
    position: static;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}