/* --- RESET & GLOBAL VARIABLES (Category Scope) --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-light: #f4f6f9;
    --bg-white: #ffffff;
    --brand-blue: #0d6efd;
    --brand-blue-hover: #0b5ed7;
    --brand-gold: #ffc107;
    --text-dark: #111827;
    --text-muted: #666666;
    --border-color: #e5e7eb;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
}

/* --- MAIN LAYOUT CONTAINER --- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 24px;
    padding: 24px 20px;
    align-items: flex-start;
}

.main {
    width: 70%;
    display: flex;
    flex-direction: column;
}

/* --- CATEGORY NAVIGATION BOXES (Exact Style & Design Preserved) --- */
.categories {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.cat-box {
    flex: 1;
    background: var(--bg-white);
    padding: 16px 12px;
    text-align: center;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border: 2px solid transparent;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cat-box a {
    text-decoration: none;
    color: var(--text-dark);
    display: block;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.cat-box:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
    border-color: var(--brand-blue);
}

.cat-box:hover a {
    color: var(--brand-blue);
}

/* Active Category Highlight */
.cat-box.active-cat {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
}

.cat-box.active-cat a {
    color: #ffffff;
}

/* Category Title Heading */
.category-heading {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--brand-blue);
    display: inline-block;
}

/* --- POST CARDS (Exact Style & Design Preserved) --- */
.card {
    background: var(--bg-white);
    padding: 20px;
    margin-bottom: 16px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
}

.card:hover {
    box-shadow: var(--hover-shadow);
    transform: translateY(-2px);
    border-color: rgba(13, 110, 253, 0.2);
}

.card h3 {
    margin: 0 0 10px;
    font-size: 1.25rem;
    line-height: 1.45;
}

.card h3 a {
    color: #133c9d;
    text-decoration: none;
    transition: color 0.2s ease;
}

.card h3 a:hover {
    color: var(--text-dark);
}

/* Card Date / Metadata */
.card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.meta-icon {
    width: 16px;
    height: 16px;
    color: var(--brand-blue);
}

/* BUTTON (Exact #0d6efd color preserved with modern icon touch) */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: var(--brand-blue);
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn:hover {
    background: var(--brand-blue-hover);
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3);
}

.btn-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* Empty State Styling */
.empty-state-card {
    background: var(--bg-white);
    padding: 40px 20px;
    text-align: center;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-state-card svg {
    width: 48px;
    height: 48px;
    color: var(--brand-gold);
}


/* ========================================================
   --- TABLET RESPONSIVE (Max-Width: 1024px) --- 
======================================================== */
@media (max-width: 1024px) {
    .container {
        gap: 20px;
        padding: 20px 16px;
    }

    .main {
        width: 65%; /* Adjusted balance with 35% sidebar on tablets */
    }

    .categories {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .cat-box {
        padding: 14px 10px;
    }

    .cat-box a {
        font-size: 0.9rem;
    }

    .card {
        padding: 16px;
    }

    .card h3 {
        font-size: 1.15rem;
    }
}


/* ========================================================
   --- MOBILE RESPONSIVE (Max-Width: 540px) --- 
======================================================== */
@media (max-width: 540px) {
    .container {
        flex-direction: column;
        padding: 16px 12px;
        gap: 16px;
    }

    .main {
        width: 100%; /* Stacks full width on mobile screens */
    }

    /* Stack category boxes into a clean 2x2 grid on phones */
    .categories {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 20px;
    }

    .cat-box {
        padding: 12px 8px;
        border-radius: 8px;
    }

    .cat-box a {
        font-size: 0.85rem;
    }

    .category-heading {
        font-size: 1.4rem;
        margin-bottom: 14px;
    }

    .card {
        padding: 15px;
        border-radius: 10px;
    }

    .card h3 {
        font-size: 1.08rem;
    }

    .card-meta {
        font-size: 0.8rem;
        margin-bottom: 14px;
    }

    /* Full width tap target button for mobile screens */
    .btn {
        width: 100%;
        justify-content: center;
        padding: 10px;
    }
}