/* ============================================
   Blog CMS - Enhanced Theme with Animations
   Mobile-first, accessible, all-device support
   ============================================ */

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.12);
    --secondary: #64748b;
    --accent: #f43f5e;
    --accent-light: #fb7185;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e1b4b;
    --darker: #0f0a2e;
    --light: #faf5ff;
    --white: #ffffff;
    --gray-50: #faf8ff;
    --gray-100: #f1eeff;
    --gray-200: #e4e0f5;
    --gray-300: #c7c2dc;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --text-primary: #1e1b4b;
    --text-secondary: #4c4678;
    --text-muted: #7c7aa0;
    --bg-body: #f5f3ff;
    --bg-card: #ffffff;
    --border: #e9e5f5;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 3px rgba(99,102,241,0.04), 0 1px 2px rgba(0,0,0,0.03);
    --shadow: 0 4px 16px rgba(99,102,241,0.08), 0 2px 4px rgba(0,0,0,0.03);
    --shadow-lg: 0 14px 36px rgba(99,102,241,0.12), 0 4px 8px rgba(0,0,0,0.04);
    --shadow-xl: 0 24px 56px rgba(99,102,241,0.16);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s ease;
    --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background: var(--bg-body);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ============ NAVBAR ============ */
.navbar {
    padding: 0.8rem 0;
    background: var(--white) !important;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.navbar-brand {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.brand-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.nav-link {
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.5rem 1rem !important;
    color: var(--text-secondary) !important;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    position: relative;
}
.nav-link:hover {
    color: var(--primary) !important;
    background: var(--primary-glow);
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
    transform: translateX(-50%);
}
.nav-link:hover::after { width: 60%; }

/* ============ CARDS ============ */
.card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
}
.article-card {
    transition: transform var(--transition), box-shadow var(--transition);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    background: var(--white);
}
.article-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-glow);
}
.article-card .card-img-top {
    transition: transform 0.5s ease;
}
.article-card:hover .card-img-top {
    transform: scale(1.05);
}
.article-card .card-title {
    font-size: 0.95rem;
    line-height: 1.45;
    font-weight: 600;
    color: var(--text-primary);
}
.article-card .card-title a {
    color: var(--text-primary);
    transition: color var(--transition-fast);
}
.article-card .card-title a:hover {
    color: var(--primary) !important;
}
.article-card .card-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.article-card .card-footer {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ============ BADGES (Fix color contrast) ============ */
.badge.bg-light {
    background: var(--gray-100) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--gray-200);
    font-weight: 500;
}
.badge.bg-primary {
    background: var(--primary) !important;
    color: #fff !important;
}
.badge.bg-success {
    background: var(--success) !important;
    color: #fff !important;
}
.badge.bg-info {
    background: #0ea5e9 !important;
    color: #fff !important;
}
.badge.bg-warning {
    background: var(--warning) !important;
    color: #1e293b !important;
}
.badge.bg-secondary {
    background: var(--gray-600) !important;
    color: #fff !important;
}

/* ============ FEATURED SECTION ============ */
.featured-card, .featured-card-sm {
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow);
}
.featured-card:hover {
    transform: scale(1.015);
    box-shadow: var(--shadow-xl);
}
.featured-card-sm:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}
.featured-overlay {
    background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
}
.featured-overlay h1, .featured-overlay h2, .featured-overlay h3,
.featured-overlay h6, .featured-overlay p, .featured-overlay small,
.featured-overlay a {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ============ ARTICLE CONTENT PAGE ============ */
.article-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}
.article-meta { color: var(--text-muted); }
.article-body {
    font-size: 1.1rem;
    line-height: 1.85;
    color: var(--text-primary);
}
.article-body h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--dark);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-glow);
}
.article-body h3 {
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-primary);
}
.article-body p { margin-bottom: 1.3rem; color: var(--text-secondary); }
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 1.5rem 0;
    box-shadow: var(--shadow);
}
.article-body ul, .article-body ol {
    margin-bottom: 1.3rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}
.article-body li { margin-bottom: 0.6rem; }
.article-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 1.2rem 1.8rem;
    margin: 2rem 0;
    background: linear-gradient(135deg, var(--primary-glow), var(--gray-50));
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-primary);
}
.article-body strong { color: var(--text-primary); }
.article-body a { color: var(--primary); text-decoration: underline; }
.article-body a:hover { color: var(--primary-dark); }
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.article-body th {
    background: var(--gray-100);
    color: var(--text-primary);
    font-weight: 600;
}
.article-body td, .article-body th {
    padding: 12px 16px;
    border: 1px solid var(--gray-200);
    color: var(--text-secondary);
}

/* ============ SIDEBAR ============ */
.list-group-item {
    border-left: 0;
    border-right: 0;
    color: var(--text-secondary);
    transition: background var(--transition-fast);
}
.list-group-item:hover {
    background: var(--primary-glow);
    color: var(--primary);
}
.card-header {
    background: var(--white);
    color: var(--text-primary);
    font-weight: 600;
}

/* ============ FOOTER ============ */
footer {
    background: var(--darker) !important;
    color: var(--gray-300);
}
footer h5, footer h6 {
    color: var(--white) !important;
}
footer p, footer li, footer small {
    color: var(--gray-400) !important;
}
footer a {
    color: var(--gray-400) !important;
    transition: color var(--transition-fast);
}
footer a:hover {
    color: var(--primary-light) !important;
}
footer hr { border-color: var(--gray-700); }
footer .text-muted { color: var(--gray-500) !important; }

/* ============ AD CONTAINER ============ */
.ad-container {
    padding: 10px;
    margin: 15px 0;
    min-height: 50px;
    border-radius: var(--radius-sm);
}

/* ============ PAGINATION ============ */
.page-link {
    border-radius: var(--radius-sm) !important;
    margin: 0 3px;
    border: 1px solid var(--gray-200);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}
.page-link:hover {
    background: var(--primary-glow);
    color: var(--primary);
    border-color: var(--primary);
}
.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ============ SHARE BUTTONS ============ */
.share-buttons .btn {
    width: 38px;
    height: 38px;
    padding: 0;
    line-height: 38px;
    border-radius: 50%;
    transition: transform var(--transition-bounce), box-shadow var(--transition);
}
.share-buttons .btn:hover {
    transform: scale(1.15);
    box-shadow: var(--shadow);
}

/* ============ BREADCRUMB ============ */
.breadcrumb { background: transparent; padding: 0; }
.breadcrumb-item a { color: var(--primary); text-decoration: none; }
.breadcrumb-item.active { color: var(--text-muted); }

/* ============ SEARCH ============ */
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ============ ANIMATIONS ============ */

/* Fade In Up - Article Cards */
.article-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.article-card:nth-child(1) { animation-delay: 0.05s; }
.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.15s; }
.article-card:nth-child(4) { animation-delay: 0.2s; }
.article-card:nth-child(5) { animation-delay: 0.25s; }
.article-card:nth-child(6) { animation-delay: 0.3s; }
.article-card:nth-child(7) { animation-delay: 0.35s; }
.article-card:nth-child(8) { animation-delay: 0.4s; }

/* Fade In - Featured Section */
.featured-card {
    animation: fadeIn 0.8s ease forwards;
}
.featured-card-sm {
    animation: slideInRight 0.6s ease forwards;
    opacity: 0;
}
.featured-card-sm:nth-child(1) { animation-delay: 0.2s; }
.featured-card-sm:nth-child(2) { animation-delay: 0.35s; }
.featured-card-sm:nth-child(3) { animation-delay: 0.5s; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Slide In Left - Sidebar */
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
.col-lg-4 > .card {
    animation: slideInLeft 0.5s ease forwards;
    opacity: 0;
}
.col-lg-4 > .card:nth-child(1) { animation-delay: 0.3s; }
.col-lg-4 > .card:nth-child(2) { animation-delay: 0.45s; }
.col-lg-4 > .card:nth-child(3) { animation-delay: 0.6s; }

/* Pulse animation for badges */
.badge.bg-primary {
    animation: subtlePulse 3s ease-in-out infinite;
}
@keyframes subtlePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* Smooth image loading */
img {
    transition: opacity 0.3s ease;
}
img[loading="lazy"] {
    opacity: 0;
    animation: imgFadeIn 0.5s ease forwards;
}
@keyframes imgFadeIn {
    to { opacity: 1; }
}

/* Link hover underline animation */
.article-card .card-title a {
    background-image: linear-gradient(var(--primary), var(--primary));
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size var(--transition), color var(--transition-fast);
}
.article-card .card-title a:hover {
    background-size: 100% 2px;
}

/* Category section slide up */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}
section.mt-5 > .mb-5 {
    animation: slideUp 0.6s ease forwards;
    opacity: 0;
}
section.mt-5 > .mb-5:nth-child(1) { animation-delay: 0.1s; }
section.mt-5 > .mb-5:nth-child(2) { animation-delay: 0.25s; }
section.mt-5 > .mb-5:nth-child(3) { animation-delay: 0.4s; }
section.mt-5 > .mb-5:nth-child(4) { animation-delay: 0.55s; }
section.mt-5 > .mb-5:nth-child(5) { animation-delay: 0.7s; }

/* ============ RESPONSIVE ============ */
@media (max-width: 991.98px) {
    .article-title { font-size: 1.7rem; }
    .article-body { font-size: 1rem; }
    .featured-card { height: 300px !important; }
}

@media (max-width: 767.98px) {
    .article-title { font-size: 1.4rem; }
    .navbar-brand { font-size: 1.1rem; }
    .featured-card { height: 240px !important; }
    .featured-card-sm { height: 140px !important; }
    .article-card .card-title { font-size: 0.9rem; }
}

@media (max-width: 575.98px) {
    .container { padding-left: 12px; padding-right: 12px; }
    .article-meta { font-size: 0.82rem; }
    .featured-card { height: 200px !important; }
}

/* ============ SAFARI / iOS FIXES ============ */
@supports (-webkit-touch-callout: none) {
    .article-card img { -webkit-transform: translateZ(0); }
    body { -webkit-text-size-adjust: 100%; }
    .featured-card, .featured-card-sm { -webkit-transform: translateZ(0); }
}

/* ============ DARK MODE (Proper Contrast) ============ */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #0f0a2e;
        --bg-card: #1e1b4b;
        --white: #1e1b4b;
        --text-primary: #e8e5f5;
        --text-secondary: #c7c2dc;
        --text-muted: #8a85aa;
        --border: #312e81;
        --gray-50: #1e1b4b;
        --gray-100: #1e1b4b;
        --gray-200: #312e81;
        --shadow: 0 4px 12px rgba(0,0,0,0.3);
        --shadow-lg: 0 12px 32px rgba(0,0,0,0.4);
        --primary-glow: rgba(99, 102, 241, 0.2);
    }

    body { background: var(--bg-body); }
    .navbar { background: #1e1b4b !important; border-bottom-color: #312e81; }
    .card { background: var(--bg-card); border-color: var(--border); }
    .article-card, .article-grid-item { background: var(--bg-card); border-color: var(--border); }
    .form-control { background: #1e1b4b; color: #e8e5f5; border-color: #312e81; }
    .form-control:focus { background: #1e1b4b; color: #e8e5f5; }
    .badge.bg-light { background: #312e81 !important; color: #c7c2dc !important; border-color: #4338ca; }
    .list-group-item { background: var(--bg-card); color: var(--text-secondary); border-color: var(--border); }
    .card-header { background: var(--bg-card); border-color: var(--border); }
    .card-footer { color: var(--text-muted); }
    .page-link { background: var(--bg-card); color: var(--text-secondary); border-color: var(--border); }
    .text-dark { color: var(--text-primary) !important; }
    .text-muted { color: var(--text-muted) !important; }
    .bg-white { background: var(--bg-card) !important; }
    .border-bottom { border-color: var(--border) !important; }
    .article-body blockquote { background: rgba(99, 102, 241, 0.1); }
    .article-body p { color: var(--text-secondary); }
    .article-body h2 { color: var(--text-primary); border-bottom-color: rgba(99,102,241,0.3); }
    .article-body td, .article-body th { border-color: var(--border); color: var(--text-secondary); }
    .article-body th { background: #312e81; color: var(--text-primary); }
    .hero-side-content { background: var(--bg-card); }
    .trending-section { background: var(--bg-card); border-color: var(--border); }
    .trending-item { background: #312e81; border-color: #4338ca; color: var(--text-secondary); }
    .featured-article-card { background: var(--bg-card); border-color: var(--border); }
    .cat-side-item { background: var(--bg-card); border-color: var(--border); }
    .cat-main-article { background: var(--bg-card); border-color: var(--border); }
    .input-group-text { background: #312e81; color: var(--text-secondary); border-color: #4338ca; }
}

/* ============ SMOOTH SCROLL & PRINT ============ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    .navbar, footer, .sidebar, .share-buttons, .ad-container, .pagination { display: none !important; }
    .article-body { font-size: 12pt; color: #000; }
    .article-card { box-shadow: none; animation: none; opacity: 1; }
}

/* ============ UTILITY HELPERS ============ */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hover-lift { transition: transform var(--transition); }
.hover-lift:hover { transform: translateY(-4px); }
.hover-glow:hover { box-shadow: 0 0 20px var(--primary-glow); }

/* ============================================================
   HOMEPAGE - ENHANCED COMPONENTS
   ============================================================ */

/* ===== HERO SECTION ===== */
.hero-section {
    padding: 1.5rem 0;
}
.hero-main {
    display: block;
    height: 440px;
    position: relative;
    text-decoration: none;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition), box-shadow var(--transition);
}
.hero-main:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-xl);
}
.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.hero-main:hover .hero-img { transform: scale(1.05); }
.hero-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    font-size: 4rem;
    color: rgba(255,255,255,0.2);
}
.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.5rem;
    background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
    color: #fff;
}
.hero-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--primary);
    color: #fff;
    margin-bottom: 12px;
}
.hero-title {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 10px;
    color: #fff;
    letter-spacing: -0.3px;
}
.hero-excerpt {
    font-size: 0.95rem;
    opacity: 0.85;
    margin-bottom: 12px;
    line-height: 1.5;
    color: #e2e8f0;
}
.hero-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    opacity: 0.75;
    color: #cbd5e1;
}
.hero-meta i { margin-right: 4px; }

/* Hero Side Cards */
.hero-side {
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    min-height: 135px;
}
.hero-side:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-lg);
}
.hero-side-img {
    width: 40%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.hero-side:hover .hero-side-img { transform: scale(1.08); }
.hero-side-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    background: var(--bg-card);
}
.hero-side-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin-bottom: 6px;
}
.hero-side-title {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}
.hero-side-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== TRENDING BAR ===== */
.trending-section {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    margin-bottom: 0;
}
.trending-header {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 20px;
    white-space: nowrap;
}
.trending-icon {
    background: linear-gradient(135deg, var(--accent), #fb923c);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    animation: pulse 2s ease infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
.trending-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.trending-scroll {
    display: inline-flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: none;
}
.trending-scroll::-webkit-scrollbar { display: none; }
.trending-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    white-space: nowrap;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--gray-100);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
}
.trending-item:hover {
    background: var(--primary-glow);
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}
.trending-cat {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.7rem;
    text-transform: uppercase;
}

/* ===== PAGE HEADING ===== */
.page-heading {
    padding: 1.5rem 0;
    margin-bottom: 1rem;
}
.page-heading h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.page-heading h1 i { color: var(--primary); margin-right: 8px; }
.page-heading p { color: var(--text-muted); margin: 0; font-size: 0.9rem; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}
.section-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}
.section-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #fb923c);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}
.section-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--gray-100);
    padding: 4px 12px;
    border-radius: 20px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 2px dashed var(--border);
}
.empty-icon { font-size: 3.5rem; color: var(--gray-300); margin-bottom: 1rem; }
.empty-state h4 { color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); max-width: 400px; margin: 0 auto; }

/* ===== FEATURED ARTICLE CARD ===== */
.featured-article-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    transition: box-shadow var(--transition), transform var(--transition);
}
.featured-article-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}
.featured-article-img-wrap {
    position: relative;
    display: block;
    height: 100%;
    min-height: 260px;
    overflow: hidden;
}
.featured-article-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.featured-article-card:hover .featured-article-img { transform: scale(1.06); }
.featured-article-overlay {
    position: absolute;
    inset: 0;
    background: rgba(37,99,235,0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    opacity: 0;
    transition: all var(--transition);
}
.featured-article-card:hover .featured-article-overlay {
    background: rgba(37,99,235,0.3);
    opacity: 1;
}
.featured-article-body {
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}
.featured-article-meta-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.cat-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--primary);
    color: #fff;
}
.read-time {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.featured-article-title {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 10px;
}
.featured-article-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.featured-article-title a:hover { color: var(--primary); }
.featured-article-excerpt {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
}
.featured-article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}
.author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}
.author-name { font-weight: 600; font-size: 0.82rem; color: var(--text-primary); display: block; }
.publish-date { font-size: 0.72rem; color: var(--text-muted); }
.read-more-btn {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: gap var(--transition), color var(--transition-fast);
}
.read-more-btn:hover { gap: 10px; color: var(--primary-dark); }

/* ===== ARTICLE GRID ===== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}
.grid-ad { grid-column: 1 / -1; }
.article-grid-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.article-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(37,99,235,0.2);
}
.article-grid-img-wrap {
    position: relative;
    display: block;
    overflow: hidden;
    height: 175px;
}
.article-grid-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.article-grid-item:hover .article-grid-img { transform: scale(1.08); }
.article-grid-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    color: var(--gray-300);
    font-size: 2rem;
}
.img-overlay-hover {
    position: absolute;
    inset: 0;
    background: rgba(37,99,235,0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    opacity: 0;
    transition: all var(--transition);
}
.article-grid-item:hover .img-overlay-hover {
    background: rgba(37,99,235,0.25);
    opacity: 1;
}
.article-grid-body { padding: 1.2rem; }
.article-grid-meta-top { margin-bottom: 8px; }
.cat-badge-sm {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    background: var(--primary-glow);
    padding: 3px 10px;
    border-radius: 12px;
}
.article-grid-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}
.article-grid-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.article-grid-title a:hover { color: var(--primary); }
.article-grid-excerpt {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}
.article-grid-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.article-grid-footer i { margin-right: 4px; }

/* ===== CATEGORY SHOWCASE SECTIONS ===== */
.category-showcase { margin-top: 3rem; }
.cat-section {
    margin-bottom: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.cat-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.cat-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.cat-section-title h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}
.view-all-btn {
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: gap var(--transition);
}
.view-all-btn:hover { gap: 10px; }

.cat-section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.cat-main-article {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
}
.cat-main-article:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.cat-main-img-wrap {
    display: block;
    height: 200px;
    overflow: hidden;
}
.cat-main-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.cat-main-article:hover .cat-main-img-wrap img { transform: scale(1.06); }
.cat-main-body {
    padding: 1.2rem;
}
.cat-main-body h4 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}
.cat-main-body h4 a { color: var(--text-primary); text-decoration: none; }
.cat-main-body h4 a:hover { color: var(--primary); }
.cat-main-body p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.cat-main-date { font-size: 0.75rem; color: var(--text-muted); }

.cat-side-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cat-side-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all var(--transition-fast);
}
.cat-side-item:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
    transform: translateX(4px);
}
.cat-side-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.cat-side-item h5 {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}
.cat-side-item span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ===== PAGINATION ===== */
.pagination-wrapper { margin-top: 2.5rem; }

/* ===== RESPONSIVE GRID ===== */
@media (max-width: 767.98px) {
    .hero-main { height: 280px !important; }
    .hero-title { font-size: 1.3rem; }
    .hero-content { padding: 1.5rem; }
    .hero-side { min-height: 100px; }
    .hero-side-img { width: 35%; }
    .articles-grid { grid-template-columns: 1fr; }
    .cat-section-grid { grid-template-columns: 1fr; }
    .featured-article-img-wrap { min-height: 200px; }
    .trending-section .container { overflow-x: auto; white-space: nowrap; display: flex; align-items: center; }
}
@media (max-width: 575.98px) {
    .hero-section { padding: 0.8rem 0; }
    .hero-main { height: 220px !important; }
    .hero-title { font-size: 1.1rem; }
    .section-header h2 { font-size: 1.1rem; }
    .featured-article-body { padding: 1.2rem; }
    .featured-article-title { font-size: 1.1rem; }
}

/* ===== SITE FOOTER (New Design) ===== */
.site-footer {
    margin-top: 4rem;
}
.footer-top {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
    padding: 3.5rem 0 2.5rem;
    color: #c7c2dc;
}
.footer-logo {
    font-weight: 800;
    font-size: 1.4rem;
    background: linear-gradient(135deg, #818cf8, #f43f5e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}
.footer-desc {
    color: #a5a0c4;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
}
.footer-social {
    display: flex;
    gap: 10px;
}
.footer-social a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #c7c2dc;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all var(--transition);
    border: 1px solid rgba(255,255,255,0.1);
}
.footer-social a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(99,102,241,0.4);
}
.footer-heading {
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.2rem;
    position: relative;
    padding-bottom: 10px;
}
.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-light), var(--accent));
    border-radius: 3px;
}
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links li { margin-bottom: 10px; }
.footer-links a {
    color: #a5a0c4;
    text-decoration: none;
    font-size: 0.88rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}
.footer-links a:hover {
    color: #fff;
    padding-left: 6px;
}
.footer-links a i {
    font-size: 0.75rem;
    color: var(--primary-light);
}
.footer-desc-sm {
    color: #8a85aa;
    font-size: 0.82rem;
    line-height: 1.5;
}
.footer-bottom {
    background: #0f0a2e;
    padding: 1.2rem 0;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.footer-bottom p {
    color: #7c7aa0;
    font-size: 0.82rem;
    margin: 0;
}
.footer-bottom-links {
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-bottom-links a {
    color: #7c7aa0;
    text-decoration: none;
    font-size: 0.82rem;
    transition: color var(--transition-fast);
}
.footer-bottom-links a:hover { color: var(--primary-light); }
.footer-bottom-links span { color: #4c4678; }

/* ===== NAVBAR ACTIVE STATE ===== */
.nav-link.active {
    color: var(--primary) !important;
    background: var(--primary-glow);
    font-weight: 600;
}

/* ===== SEARCH FORM ===== */
.search-form .form-control {
    border-radius: 25px 0 0 25px;
    border: 1px solid var(--border);
    padding: 8px 16px;
    font-size: 0.88rem;
}
.search-form .btn {
    border-radius: 0 25px 25px 0;
    padding: 8px 16px;
}

/* ═══════════════════════════════════════════════
   LANDING PAGE - SUGGESTED CONTENT STYLES
   ═══════════════════════════════════════════════ */

/* ===== SUGGESTED FOR YOU - Horizontal Scroll ===== */
.suggested-section {
    padding: 1.5rem 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}
.suggested-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}
.suggested-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}
.suggested-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}
.suggested-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.suggested-scroll::-webkit-scrollbar { display: none; }
.suggested-card {
    display: flex;
    gap: 12px;
    min-width: 280px;
    max-width: 300px;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    text-decoration: none;
    scroll-snap-align: start;
    transition: all var(--transition-fast);
    background: var(--bg-card);
}
.suggested-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}
.suggested-thumb {
    width: 75px;
    height: 75px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}
.suggested-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.suggested-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}
.suggested-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}
.suggested-cat {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 0.5px;
}
.suggested-info h6 {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
    color: var(--text-primary);
}
.suggested-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ===== LANDING CATEGORY SECTIONS ===== */
.landing-category-section {
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--border);
}
.landing-category-section:nth-child(even) {
    background: var(--gray-50);
}
.landing-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.8rem;
}
.landing-cat-title {
    display: flex;
    align-items: center;
    gap: 14px;
}
.landing-cat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
}
.landing-cat-title h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
}
.landing-cat-title p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}
.landing-view-all {
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 25px;
    border: 2px solid;
    transition: all var(--transition);
}
.landing-view-all:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

/* ===== Landing Featured Post ===== */
.landing-cat-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.landing-featured-post {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.landing-featured-post:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}
.landing-featured-img {
    display: block;
    position: relative;
    height: 220px;
    overflow: hidden;
}
.landing-featured-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.landing-featured-post:hover .landing-featured-img img {
    transform: scale(1.06);
}
.landing-featured-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.landing-featured-body {
    padding: 1.3rem;
}
.landing-featured-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}
.landing-featured-body h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.landing-featured-body h3 a:hover { color: var(--primary); }
.landing-featured-body p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}
.landing-featured-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.landing-read-btn {
    margin-left: auto;
    padding: 6px 14px;
    border-radius: 20px;
    color: #fff !important;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
}
.landing-read-btn:hover {
    opacity: 0.9;
    transform: translateX(3px);
}

/* ===== Landing Headlines Grid ===== */
.landing-headlines-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.landing-headline-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    text-decoration: none;
    transition: all var(--transition-fast);
}
.landing-headline-card:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}
.landing-headline-thumb {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.landing-headline-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.landing-headline-nothumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.2rem;
}
.landing-headline-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}
.landing-headline-info h5 {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 4px 0;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.landing-headline-meta {
    display: flex;
    gap: 12px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ===== YOU MAY ALSO LIKE ===== */
.also-like-section {
    padding: 2.5rem 0;
    background: var(--gray-50);
}
.also-like-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.also-like-card {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    text-decoration: none;
    transition: all var(--transition);
}
.also-like-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.also-like-thumb {
    height: 130px;
    overflow: hidden;
}
.also-like-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.also-like-card:hover .also-like-thumb img {
    transform: scale(1.08);
}
.also-like-body {
    padding: 12px;
}
.also-like-cat {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 0.5px;
}
.also-like-body h5 {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 4px 0 6px 0;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.also-like-meta {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* ===== RESPONSIVE - Landing Page ===== */
@media (max-width: 991.98px) {
    .landing-cat-content { grid-template-columns: 1fr; }
    .also-like-grid { grid-template-columns: repeat(2, 1fr); }
    .suggested-card { min-width: 240px; }
}
@media (max-width: 767.98px) {
    .landing-cat-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .also-like-grid { grid-template-columns: repeat(2, 1fr); }
    .landing-cat-title h2 { font-size: 1.2rem; }
    .landing-featured-img { height: 180px; }
}
@media (max-width: 575.98px) {
    .also-like-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .also-like-thumb { height: 100px; }
    .suggested-card { min-width: 220px; }
    .landing-headline-thumb { width: 65px; height: 50px; }
}

/* ============ AD LABEL (AdSense policy: ads must be distinguishable) ============ */
.ad-container {
    border: 1px solid #ececec;
    background: #fafafa;
}
.ad-label {
    display: block;
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #9aa0a6;
    text-align: center;
    margin-bottom: 6px;
}
