/* ============================================
   HOMEPAGE LAYOUT FIXES
   ============================================ */
.split-container {
    display: flex !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 2rem !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 1rem !important;
    flex-wrap: wrap !important;
}

.notifications-section,
.browse-section {
    flex: 1;
    min-width: 300px;
    max-width: 600px;
    display: flex;
    flex-direction: column;
}

.notifications-slideshow {
    height: auto !important;
    min-height: 500px;
    flex: 1;
}

@media (max-width: 768px) {
    .split-container {
        flex-direction: column !important;
    }

    .notifications-section,
    .browse-section {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ============================================
   ARTICLE IMAGE FIXES
   ============================================ */
.imagediv img {
    object-fit: contain !important;
    background-color: #f8f9fa;
}

.blogpic {
    margin: 1rem auto !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
}

/* ============================================
   CONTENT FRESHNESS BADGES
   ============================================ */
.freshness-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    margin-left: 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.freshness-badge.fresh {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.freshness-badge.aging {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.freshness-badge.stale {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

@media (max-width: 768px) {
    .freshness-badge {
        display: block;
        margin-left: 0;
        margin-top: 0.5rem;
        text-align: center;
    }
}

/* ============================================
   RELATED POSTS MODULE
   ============================================ */
.related-posts {
    max-width: 1200px;
    margin: 4rem auto 2rem;
    padding: 2rem 1rem;
    background-color: var(--bg-secondary, #f8f9fa);
    border-radius: 12px;
}

.related-posts-title {
    text-align: center;
    color: #33bdef;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.related-post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e2e8f0;
}

.related-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border-color: #33bdef;
}

.related-post-image {
    height: 200px;
    overflow: hidden;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.related-post-content {
    padding: 1.5rem;
}

.related-post-title {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    line-height: 1.4;
}

.related-post-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-post-title a:hover {
    color: #33bdef;
}

.related-post-excerpt {
    color: #666;
    line-height: 1.6;
    margin: 0 0 1rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #888;
}

.related-post-date {
    font-weight: 500;
}

.related-post-reading-time {
    color: #33bdef;
}

/* ============================================
   BLOG POST GRID (Global)
   ============================================ */
.blog-posts-container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.blog-posts-container h2 {
    text-align: center;
    color: #33bdef;
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.blog-post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e1e5e9;
    display: flex;
    flex-direction: column;
}

.blog-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.post-image {
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

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

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

.post-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-content h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    line-height: 1.4;
}

.post-content h3 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-content h3 a:hover {
    color: #33bdef;
}

.post-description {
    color: #666;
    line-height: 1.6;
    margin: 0 0 1rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #888;
    margin-top: auto;
}

.post-meta time {
    font-weight: 500;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: #33bdef;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Dark Mode Support for Grid */
[data-theme="dark"] .blog-post-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .post-content h3 a {
    color: var(--text-primary);
}

[data-theme="dark"] .post-content h3 a:hover {
    color: var(--accent-color);
}

[data-theme="dark"] .post-description {
    color: var(--text-secondary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .related-posts {
        margin: 2rem 0;
        padding: 1.5rem 1rem;
    }

    .related-posts-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .related-post-image {
        height: 180px;
    }
}

/* ============================================
   WHAT'S HOT TABS
   ============================================ */
.section-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-button {
    background: transparent;
    border: 2px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button:hover {
    border-color: #33bdef;
    color: #33bdef;
}

.tab-button.active {
    background: #33bdef;
    border-color: #33bdef;
    color: white;
    box-shadow: 0 4px 12px rgba(51, 189, 239, 0.3);
}

.tab-content {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   FREE TOOLS SECTION
   ============================================ */
.tools-resources-band {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    margin: 2rem 0;
}

.tools-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.tools-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tools-header h2 {
    font-size: 2.5rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.tool-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: #33bdef;
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.tool-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.tool-description {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

@media (max-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   QUICK INSIGHTS PANEL
   ============================================ */
.insights-panel {
    padding: 4rem 0;
    background: white;
}

.insights-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.insight-item {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.insight-item:hover {
    border-color: #33bdef;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.insight-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-right: 1.5rem;
    min-width: 100px;
    text-align: center;
}

.insight-badge.update {
    background: #dbeafe;
    color: #1e40af;
}

.insight-badge.resource {
    background: #dcfce7;
    color: #166534;
}

.insight-badge.community {
    background: #f3e8ff;
    color: #6b21a8;
}

.insight-content {
    flex: 1;
}

.insight-content h3 {
    font-size: 1.1rem;
    margin: 0 0 0.25rem 0;
    color: #1e293b;
}

.insight-content p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

.insight-link {
    color: #33bdef;
    font-weight: 600;
    text-decoration: none;
    margin-left: 1.5rem;
    white-space: nowrap;
}

.insight-link:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .insight-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .insight-badge {
        margin-right: 0;
    }

    .insight-link {
        margin-left: 0;
        align-self: flex-end;
    }
}