/* ============================================================================
   PREMIUM BLOG STYLE ENHANCEMENTS v2.2
   (UI/UX Pro Max: Enhanced visual hierarchy, glassmorphism, and interactions)
   ============================================================================ */

/* --- 1. TRENDING TICKER --- */
.trending-ticker {
    background: #0f172a;
    color: white;
    font-size: 0.85rem;
    padding: 10px 0;
    overflow: hidden;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ticker-content {
    display: inline-block;
    padding-left: 100%;
    animation: ticker 30s linear infinite;
}

.ticker-label {
    background: var(--color-coral, #FF4757);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
    margin-right: 12px;
    vertical-align: middle;
}

.ticker-item a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.ticker-item a:hover {
    color: #fff;
    text-decoration: underline;
}

.ticker-separator {
    color: #475569;
    margin: 0 1rem;
}

@keyframes ticker {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-100%, 0, 0);
    }
}

/* --- 2. HERO & CONTROLS --- */
.blog-hero {
    text-align: center;
    padding: 5rem 1.5rem 3rem;
    background: linear-gradient(to bottom, #fafafa 0%, #f1f5f9 100%);
    /* Subtle gradient */
    position: relative;
    overflow: hidden;
}

/* Optional background pattern */
.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.5;
    pointer-events: none;
}

.blog-hero .container {
    position: relative;
    /* Ensure content is above pattern */
    z-index: 1;
}

.blog-hero__title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 1.25rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-wrap: balance;
}

.blog-hero__subtitle {
    font-size: 1.25rem;
    color: #64748b;
    max-width: 640px;
    margin: 0 auto 3.5rem;
    line-height: 1.7;
    text-wrap: pretty;
}

.blog-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* --- 3. SEARCH BAR (ENHANCED) --- */
.search-container {
    position: relative;
    width: 100%;
    max-width: 550px;
}

.search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.5rem;
    pointer-events: none;
    z-index: 10;
    transition: color 0.3s ease;
}

#searchInput {
    width: 100%;
    padding: 18px 24px 18px 60px;
    border-radius: 99px;
    border: 2px solid rgba(226, 232, 240, 0.8);
    font-size: 1.15rem;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
    /* Softer shadow */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    /* Glassmorphism */
    outline: none;
    color: #334155;
    font-family: inherit;
}

#searchInput:focus {
    border-color: var(--color-green, #10B981);
    box-shadow: 0 10px 30px -5px rgba(16, 185, 129, 0.2);
    background: white;
    transform: translateY(-1px);
}

#searchInput:focus+.search-icon {
    color: var(--color-green, #10B981);
}

/* --- 4. FILTER BUTTONS (REFINED) --- */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.cat-btn {
    padding: 12px 28px;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.cat-btn:hover {
    border-color: var(--color-green, #10B981);
    color: var(--color-green, #10B981);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.1);
}

.cat-btn.active {
    background: var(--color-green, #10B981);
    color: white;
    border-color: var(--color-green, #10B981);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.theme-toggle {
    background: white;
    border: 1px solid #e2e8f0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.theme-toggle:hover {
    color: #1e293b;
    transform: rotate(15deg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* --- 5. GRID & CARDS (MODERNIZED) --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    /* Increased min width */
    gap: 2rem;
    /* Increased gap */
    padding: 1rem 0;
}

.article-card {
    background: white;
    border-radius: 20px;
    /* More rounded */
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    /* Diffuse shadow */
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    border: 1px solid rgba(241, 245, 249, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-6px) scale(1.005);
    box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    /* Lift effect */
    border-color: rgba(226, 232, 240, 1);
    z-index: 10;
}

.article-image-container {
    height: 240px;
    /* Taller images */
    overflow: hidden;
    position: relative;
    background: #f1f5f9;
}

.article-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .article-image-container img {
    transform: scale(1.05);
}

/* New Gradient Placeholders */
.gradient-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3.5rem;
}

.gradient-featured {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

.gradient-hipp {
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
}

.gradient-holle {
    background: linear-gradient(135deg, #22c55e 0%, #86efac 100%);
}

.gradient-kendamil {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

.gradient-guides {
    background: linear-gradient(135deg, #14b8a6 0%, #2dd4bf 100%);
}

.gradient-education {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
}

.reading-time {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    color: white;
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.article-content {
    padding: 2rem;
    /* More padding */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-meta {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--color-green, #10B981);
    /* Use primary color */
    margin-bottom: 0.75rem;
    letter-spacing: 0.1em;
}

.article-title {
    font-size: 1.4rem;
    /* Increased size */
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 1rem;
    line-height: 1.35;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.01em;
}

.article-excerpt {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 2rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- 6. DARK MODE --- */
body.dark-mode {
    background: #0f172a;
    color: #f1f5f9;
}

.dark-mode .blog-hero {
    background: #0f172a;
}

.dark-mode .blog-hero::before {
    background-image: radial-gradient(#334155 1px, transparent 1px);
    opacity: 0.2;
}

.dark-mode .blog-hero__title,
.dark-mode .article-title {
    color: #f1f5f9;
}

.dark-mode .article-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.dark-mode .article-excerpt,
.dark-mode .blog-hero__subtitle {
    color: #94a3b8;
}

.dark-mode #searchInput {
    background: rgba(30, 41, 59, 0.8);
    border-color: #334155;
    color: white;
}

.dark-mode #searchInput:focus {
    background: #1e293b;
    border-color: var(--color-green, #10B981);
}

.dark-mode .cat-btn {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

.dark-mode .theme-toggle {
    background: #1e293b;
    border-color: #334155;
    color: white;
}

/* ============================================================================
   BLOG INTERACTION STYLES (Views, Likes, Load More)
   ============================================================================ */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1.25rem;
    border-top: 1px solid #f1f5f9;
}

.dark-mode .card-footer {
    border-top-color: #334155;
}

.btn-text {
    color: var(--color-green, #10B981);
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.btn-text:hover {
    gap: 8px;
    color: var(--color-green-dark, #059669);
}

.engagement-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.like-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.like-btn:hover {
    color: var(--color-coral, #FF4757);
    background: rgba(255, 71, 87, 0.1);
    transform: scale(1.1);
}

.like-btn.liked {
    color: var(--color-coral, #FF4757);
    animation: heartPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.like-btn.liked i::before {
    content: "\ec8f";
    /* bxs-heart */
}

@keyframes heartPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
    }

    100% {
        transform: scale(1);
    }
}

/* Load More Button Container */
.load-more-container {
    text-align: center;
    margin: 4rem 0 6rem;
}

#loadMoreBtn {
    background: white;
    color: #1e293b;
    border: 2px solid #e2e8f0;
    padding: 16px 36px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

#loadMoreBtn:hover {
    border-color: var(--color-green, #10B981);
    color: var(--color-green, #10B981);
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.1);
}

.dark-mode #loadMoreBtn {
    background: #1e293b;
    border-color: #334155;
    color: white;
}

.dark-mode #loadMoreBtn:hover {
    background: #1e293b;
    border-color: var(--color-green, #10B981);
    color: var(--color-green, #10B981);
}

/* ============================================================================
   NEWSLETTER SECTION (NEW)
   ============================================================================ */
.newsletter-inline {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    color: white;
    margin: 4rem 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Decorative background elements */
.newsletter-inline::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.newsletter-inline::after {
    content: '';
    position: absolute;
    bottom: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 71, 87, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.newsletter-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--color-green, #10B981);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.newsletter-inline h3 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: white;
    font-family: 'Outfit', sans-serif;
}

.newsletter-inline p {
    font-size: 1.1rem;
    color: #cbd5e1;
    max-width: 500px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.newsletter-form {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}

.newsletter-form input {
    flex: 1;
    min-width: 250px;
    padding: 16px 24px;
    border-radius: 99px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.newsletter-form input::placeholder {
    color: #94a3b8;
}

.newsletter-form input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-green, #10B981);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.newsletter-form button {
    padding: 16px 32px;
    border-radius: 99px;
    border: none;
    background: var(--color-green, #10B981);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.newsletter-form button:hover {
    background: var(--color-green-dark, #059669);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

/* Response message styling (if added via JS) */
.newsletter-message {
    margin-top: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.newsletter-message.success {
    color: #4ade80;
}

.newsletter-message.error {
    color: #f87171;
}

@media (max-width: 640px) {
    .newsletter-inline {
        padding: 2.5rem 1.5rem;
        margin: 3rem 0;
    }

    .newsletter-inline h3 {
        font-size: 1.75rem;
    }

    .newsletter-form input {
        width: 100%;
    }

    .newsletter-form button {
        width: 100%;
    }
}