:root {
    /* Primary Brand Palette */
    --c1: #0E21A0;
    /* Deep Royal Blue */
    --c2: #4D2FB2;
    /* Deep Purple */
    --c3: #B153D7;
    /* Orchid Purple */
    --c4: #F375C2;
    /* Neon Pink */

    /* Functional UI Shades */
    --bg-main: #f8f7ff;
    --card-border: #e2dfff;
    --text-dark: #120f3a;
    --text-muted: #6b668d;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-main);
    color: var(--text-dark);
}

/* ── Header ── */
.main-header {
    /* Smooth gradient transition across your brand colors */
    background: linear-gradient(135deg, var(--c1) 0%, var(--c2) 50%, var(--c3) 100%);
    height: 66px;
    display: flex;
    align-items: center;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(14, 33, 160, 0.15);
}

.header-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.site-logo {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.site-name {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: white;
}

.site-name small {
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--c4);
    /* Pop of pink for the sub-brand */
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: -2px;
}

/* ── Article Grid ── */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

main h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--c1);
    margin-bottom: 32px;
    letter-spacing: -0.8px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 28px;
}

.article-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.article-card:hover {
    transform: translateY(-6px);
    border-color: var(--c3);
    /* Shadow uses a tint of the purple for a "glow" effect */
    box-shadow: 0 15px 35px rgba(77, 47, 178, 0.15);
}

.article-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-image {
    width: 100%;
    height: 210px;
    object-fit: cover;
    background-color: var(--c1);
    /* Fallback color */
}

.card-body {
    padding: 22px;
    flex-grow: 1;
}

.card-tag {
    display: inline-block;
    background: rgba(177, 83, 215, 0.12);
    /* Subtle tint of C3 */
    color: var(--c2);
    font-size: 11px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

.card-title {
    margin: 0 0 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    transition: color 0.2s ease;
}

/* Interaction: Title changes to the orchid purple on hover */
.article-link:hover .card-title {
    color: var(--c3);
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.card-excerpt {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Category Filter ── */
.category-filter {
    background: white;
    border-bottom: 1px solid var(--card-border);
    padding: 16px 28px;
    position: sticky;
    top: 66px;
    z-index: 100;
}

.filter-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 16px;
    border: 2px solid var(--card-border);
    background: white;
    color: var(--text-dark);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.category-btn:hover {
    border-color: var(--c3);
    color: var(--c3);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--c2) 0%, var(--c3) 100%);
    color: white;
    border-color: transparent;
}

.category-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 8px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    min-width: 180px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 1000;
    margin-top: 8px;
}

.category-dropdown:hover .dropdown-menu,
.category-dropdown:focus-within .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: var(--bg-main);
    color: var(--c3);
}

.dropdown-item.active {
    background: rgba(177, 83, 215, 0.12);
    color: var(--c3);
    font-weight: 600;
}


.sponsored-badge {
    display: inline-block;
    background: #fff;
    color: var(--c3);
    font-size: 10px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 1.2px;
    border: 1px solid var(--c3);
    margin: 0 22px 18px;
    opacity: 0.8;
}