:root {
    --bg-main: #060913;
    --bg-card: rgba(16, 22, 35, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(59, 130, 246, 0.3);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-gradient: linear-gradient(135deg, #3b82f6, #2563eb);
    --header-bg: rgba(6, 9, 19, 0.85);
    
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Ambient Background Blobs for Premium feel */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
    animation: float 20s infinite ease-in-out alternate;
}
body::before {
    background: #3b82f6;
    width: 600px; height: 600px;
    top: -200px; left: -200px;
}
body::after {
    background: #2563eb;
    width: 500px; height: 500px;
    bottom: -100px; right: -200px;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    line-height: 1.2;
    color: var(--text-primary);
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--accent);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    padding: 16px 0;
    transition: var(--transition);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav-brand .accent { 
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
    align-items: center;
}
.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
    position: relative;
}
.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
    border-radius: 2px;
}
.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

.nav-links .btn-admin {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}
.nav-links .btn-admin:hover {
    background: var(--text-primary);
    color: var(--bg-main);
}
.nav-links .btn-admin::after { display: none; }

/* Mobile Menu Toggle */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
}

/* Featured Header */
.featured-header {
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
}
.featured-header h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.featured-header p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Grid Layouts */
.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
}
.hero-grid .hero-large {
    min-height: 400px;
}
.hero-grid .hero-small-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
    padding: 20px 0 80px;
}

.article-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.article-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 2px;
    background: var(--accent-gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
}
.article-card:hover::before {
    opacity: 1;
}

.card-image-wrapper {
    width: 100%;
    height: 220px;
    background: rgba(0,0,0,0.5);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.article-card:hover .card-image-wrapper img {
    transform: scale(1.08);
}

.card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.card-tag {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-hover);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.card-title {
    font-size: 1.4rem;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.card-excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    line-height: 1.7;
}

.card-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.read-more-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
    font-weight: 500;
}
.article-card:hover .read-more-btn {
    color: var(--accent-hover);
}

/* Single Article Reading View */
.reader-wrapper {
    max-width: 800px;
    margin: 60px auto;
    padding: 0 20px;
}

.reader-header {
    text-align: center;
    margin-bottom: 40px;
}
.reader-header .card-tag {
    display: inline-block;
    margin-bottom: 24px;
}
.reader-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -1px;
}
.reader-subtitle {
    font-size: 1.4rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.6;
    font-weight: 300;
}
.reader-meta {
    color: var(--text-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    font-size: 0.95rem;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.article-hero-image {
    width: 100%;
    height: 450px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
}
.article-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reader-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.9);
}
.reader-content p {
    margin-bottom: 28px;
}
.reader-content h2 {
    font-size: 2rem;
    margin-top: 48px;
    margin-bottom: 24px;
    color: #fff;
    font-weight: 700;
}
.reader-content h3 {
    font-size: 1.5rem;
    margin-top: 40px;
    margin-bottom: 20px;
    color: #fff;
}
.reader-content ul, .reader-content ol {
    margin-bottom: 28px;
    padding-left: 24px;
}
.reader-content li {
    margin-bottom: 10px;
}
.reader-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 32px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
}

.reader-footer {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.source-references {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}
.source-references::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: var(--accent-gradient);
}

.source-references h3 {
    font-size: 1.3rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.source-references ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-left: 0;
}
.source-references li a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 1rem;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: var(--transition);
}
.source-references li a:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.08);
    border-color: var(--border-color);
}

/* Footer */
footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding: 60px 0 40px;
    background: rgba(0,0,0,0.2);
}
.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
}
.footer-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-logo .accent {
    color: var(--accent);
}
.footer-links {
    display: flex;
    gap: 24px;
}
.footer-links a {
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.footer-copyright {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 20px;
    opacity: 0.7;
}

/* Markdown specific styling overrides */
.reader-content a { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 4px; }
.reader-content a:hover { text-decoration: none; color: #fff; }
.reader-content strong { color: #fff; font-weight: 600; }
.reader-content blockquote {
    border-left: 4px solid var(--accent);
    background: rgba(59, 130, 246, 0.05);
    padding: 24px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--text-primary);
    margin: 32px 0;
}

/* Responsive */
@media (max-width: 768px) {
    /* Nav */
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--header-bg);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-color);
        gap: 8px;
    }
    .nav-links.active {
        display: flex;
    }
    .nav-links li {
        width: 100%;
    }
    .nav-links a {
        display: block;
        padding: 10px 0;
        font-size: 1rem;
    }
    .nav-links .btn-admin {
        text-align: center;
        margin-top: 8px;
    }
    .mobile-menu-btn {
        display: block;
    }
    .navbar {
        padding: 12px 0;
    }
    .nav-brand {
        font-size: 1.4rem;
    }

    /* Container */
    .container {
        padding: 0 16px;
    }

    /* Hero Header */
    .featured-header {
        padding: 40px 0 30px;
    }
    .featured-header h1 {
        font-size: 2rem;
        margin-bottom: 12px;
        letter-spacing: -0.5px;
    }
    .featured-header p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    /* News Grid */
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 16px 0 60px;
    }

    /* Hero Grid — single column on mobile */
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 24px;
    }
    .hero-grid .hero-large {
        min-height: 260px;
    }
    .hero-grid .hero-large .card-title {
        font-size: 1.3rem !important;
    }
    .hero-grid .hero-small .card-title {
        font-size: 1rem !important;
    }

    /* Article Cards */
    .card-image-wrapper {
        height: 180px;
    }
    .card-content {
        padding: 16px;
    }
    .card-title {
        font-size: 1.15rem;
        margin-bottom: 8px;
    }
    .card-meta {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }
    .card-tag {
        font-size: 0.65rem;
        padding: 4px 10px;
    }
    .card-excerpt {
        font-size: 0.9rem;
        -webkit-line-clamp: 2;
    }
    .card-footer {
        padding-top: 12px;
        font-size: 0.85rem;
    }

    /* Article card hover — disable on touch */
    .article-card:hover {
        transform: none;
    }

    /* Reader / Article Detail */
    .reader-wrapper {
        padding: 20px 0;
    }
    .reader-header {
        margin-bottom: 24px;
    }
    .reader-title {
        font-size: 1.6rem;
        line-height: 1.3;
    }
    .reader-subtitle {
        font-size: 1rem;
    }
    .reader-meta {
        flex-direction: column;
        gap: 6px;
        font-size: 0.85rem;
    }
    .article-hero-image {
        height: 200px;
        margin: 0 -16px;
        border-radius: 0;
    }
    .reader-content {
        font-size: 1rem;
        line-height: 1.7;
    }
    .reader-content h2 {
        font-size: 1.3rem;
        margin-top: 28px;
    }
    .reader-content h3 {
        font-size: 1.1rem;
    }
    .reader-content blockquote {
        padding: 16px;
        margin: 20px 0;
    }

    /* Source references */
    .source-references {
        padding: 20px 16px;
    }
    .source-references li a {
        font-size: 0.85rem;
        padding: 10px 12px;
    }

    /* Footer */
    footer {
        padding: 40px 0 30px;
    }
    .footer-logo {
        font-size: 1.2rem;
    }
    .footer-links {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    .footer-links a {
        font-size: 0.9rem;
    }
    .footer-copyright {
        font-size: 0.8rem;
    }

    /* Dropdown menu */
    .dropdown-content {
        position: static !important;
        background: rgba(16, 22, 35, 0.9);
        box-shadow: none;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        margin-top: 4px;
    }
    .dropdown-content a {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    /* Search input */
    .nav-links input[type="text"] {
        width: 100%;
        box-sizing: border-box;
    }
}

/* Extra small screens (iPhone SE etc.) */
@media (max-width: 380px) {
    .featured-header h1 {
        font-size: 1.7rem;
    }
    .reader-title {
        font-size: 1.4rem;
    }
    .card-title {
        font-size: 1.05rem;
    }
    .nav-brand {
        font-size: 1.2rem;
    }
}
