:root {
    /* Premium Color Palette - Deep Slate & Vibrant Accents */
    --primary-color: #0f172a;
    /* Slate 900 */
    --primary-light: #334155;
    /* Slate 700 */
    --accent-color: #3b82f6;
    /* Blue 500 */
    --accent-hover: #2563eb;
    /* Blue 600 */
    --highlight-color: #f59e0b;
    /* Amber 500 */

    /* Text Colors */
    --text-primary: #1e293b;
    /* Slate 800 */
    --text-secondary: #475569;
    /* Slate 600 */
    --text-tertiary: #94a3b8;
    /* Slate 400 */
    --text-inverse: #ffffff;

    /* Backgrounds */
    --bg-body: #f8fafc;
    /* Slate 50 */
    --bg-surface: #ffffff;
    --bg-secondary: #f1f5f9;
    /* Slate 100 */
    --bg-glass: rgba(255, 255, 255, 0.8);

    /* Borders */
    --border-light: #e2e8f0;
    /* Slate 200 */
    --border-focus: #94a3b8;
    /* Slate 400 */

    /* Typography */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Lora', Georgia, serif;
    --font-display: 'Outfit', sans-serif;

    /* Layout */
    --container-width: 1280px;
    --header-height: 80px;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Shadows - Soft & Layered */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark Mode Overrides */
:root[data-theme="dark"] {
    --primary-color: #f8fafc;
    /* Slate 50 */
    --primary-light: #e2e8f0;
    /* Slate 200 */
    --accent-color: #60a5fa;
    /* Blue 400 */
    --accent-hover: #3b82f6;
    /* Blue 500 */

    --text-primary: #f1f5f9;
    /* Slate 100 */
    --text-secondary: #cbd5e1;
    /* Slate 300 */
    --text-tertiary: #94a3b8;
    /* Slate 400 */
    --text-inverse: #0f172a;
    /* Slate 900 */

    --bg-body: #0f172a;
    /* Slate 900 */
    --bg-surface: #1e293b;
    /* Slate 800 */
    --bg-secondary: #334155;
    /* Slate 700 */
    --bg-glass: rgba(15, 23, 42, 0.8);

    --border-light: #334155;
    /* Slate 700 */

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    color: var(--text-primary);
    background-color: var(--bg-body);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-base), color var(--transition-base);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2rem;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.5rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 5px;
}

@media (min-width: 768px) {
    .container {
        padding: 5px;
    }
}

/* Header & Navigation */
.site-header {
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-base);
}

.site-header.scrolled {
    background: var(--bg-surface);
    box-shadow: var(--shadow-md);
    opacity: 0.98;
}

.header-inner {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
}

@media (max-width: 1023px) {
    .header-inner {
        padding-left: 0;
        padding-right: 0;
    }
}

.site-logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-logo h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin: 0;
    color: var(--primary-color);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

@media (max-width: 767px) {
    .site-logo h1 {
        font-size: 1.25rem;
    }
}

.site-logo img {
    max-height: 50px;
    width: auto;
    transition: filter var(--transition-base);
}

/* Invert logo colors in dark mode */
:root[data-theme="dark"] .site-logo img {
    filter: brightness(0) invert(1);
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: var(--spacing-sm);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    color: var(--accent-color);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Desktop Navigation */
.site-nav {
    display: none;
}

@media (min-width: 1024px) {
    .site-nav {
        display: block;
    }

    .main-nav-list {
        display: flex;
        gap: var(--spacing-sm);
        list-style: none;
        align-items: center;
    }

    .main-nav-list>li>a {
        font-family: var(--font-main);
        font-weight: 600;
        font-size: 0.95rem;
        color: var(--text-secondary);
        padding: 0.5rem 1rem;
        border-radius: var(--radius-full);
        transition: all var(--transition-fast);
    }

    .main-nav-list>li>a:hover {
        color: var(--accent-color);
        background: var(--bg-secondary);
    }

    /* Mega Menu Trigger */
    .mega-menu-trigger {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        background: var(--primary-color);
        color: var(--text-inverse) !important;
        padding: 0.6rem 1.25rem !important;
        border-radius: var(--radius-full) !important;
        font-weight: 600;
        cursor: pointer;
        border: none;
        font-family: var(--font-main);
        transition: transform var(--transition-fast), background-color var(--transition-fast);
    }

    .mega-menu-trigger:hover {
        background: var(--primary-light);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

    .mega-menu-trigger .arrow {
        font-size: 0.75rem;
        transition: transform var(--transition-base);
    }

    .mega-menu-trigger[aria-expanded="true"] .arrow {
        transform: rotate(180deg);
    }
}

/* Mega Menu Dropdown - Full Screen Overlay */
.mega-menu-dropdown {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
    display: flex;
    flex-direction: column;
}

/* Dark mode support for mega menu */
:root[data-theme="dark"] .mega-menu-dropdown {
    background: rgba(15, 23, 42, 0.98);
}

.mega-menu-dropdown.active {
    opacity: 1;
    visibility: visible;
}

.mega-menu-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.mega-header-content {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0;
}

.mega-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.mega-menu-close-btn {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-xl);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 11;
}

.mega-menu-close-btn:hover {
    background: var(--accent-color);
    color: var(--text-inverse);
    border-color: var(--accent-color);
    transform: rotate(90deg);
}

.mega-menu-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-2xl) var(--spacing-xl);
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spacing-xl);
    max-width: 1400px;
    margin: 0 auto;
}

.mega-column h4 {
    font-family: var(--font-display);
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-md);
    letter-spacing: 0.05em;
}

.mega-column ul {
    list-style: none;
}

.mega-column li {
    margin-bottom: 0.5rem;
}

.mega-column a {
    font-size: 1rem;
    color: var(--text-secondary);
    display: block;
    padding: 0.25rem 0;
    transition: transform var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mega-column a:hover {
    color: var(--accent-color);
    transform: translateX(4px);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 40px;
    height: 40px;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    flex-shrink: 0;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: all var(--transition-base);
}

@media (min-width: 1024px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-surface);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.mobile-menu-overlay.active {
    transform: translateX(0);
}

.mobile-menu-header {
    padding: var(--spacing-md);
    display: flex;
    justify-content: flex-end;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-xl) var(--spacing-md);
}

.mobile-nav ul {
    list-style: none;
    text-align: center;
}

.mobile-nav a {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
}

.mobile-nav a:active {
    background: var(--bg-secondary);
}

/* Main Content */
.site-main {
    padding: var(--spacing-xl) 0;
    min-height: 80vh;
}

/* Featured Article - Hero Style */
.featured-section {
    margin-bottom: var(--spacing-3xl);
}

.featured-article {
    display: grid;
    gap: var(--spacing-lg);
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.featured-article:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.featured-image-wrapper {
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
}

.featured-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.featured-article:hover .featured-image-wrapper img {
    transform: scale(1.05);
}

.featured-content {
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.category-tag {
    display: inline-block;
    background: var(--accent-color);
    color: var(--text-inverse);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-md);
    align-self: flex-start;
}

.featured-title {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
}

.featured-excerpt {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-lg);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    font-weight: 700;
    color: var(--accent-color);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.read-more::after {
    content: '→';
    transition: transform var(--transition-fast);
}

.featured-article:hover .read-more::after {
    transform: translateX(4px);
}

@media (min-width: 768px) {
    .featured-article {
        grid-template-columns: 1.2fr 1fr;
    }

    .featured-image-wrapper {
        aspect-ratio: auto;
        height: 100%;
    }

    .featured-title {
        font-size: 2.5rem;
    }
}

/* Article Grid */
.section-title {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: var(--spacing-xl);
    position: relative;
    padding-left: 1rem;
    border-left: 4px solid var(--accent-color);
}

.articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
}

@media (min-width: 640px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-xl);
    }
}

.article-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
}

.card-image {
    aspect-ratio: 16/9;
    overflow: hidden;
}

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

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

.card-content {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    margin-top: auto;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* Footer */
.site-footer {
    background: var(--primary-color);
    color: var(--text-inverse);
    padding: var(--spacing-3xl) 0 var(--spacing-lg);
    margin-top: var(--spacing-3xl);
}

.footer-content {
    display: grid;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: var(--spacing-md);
    display: block;
}

.footer-desc {
    color: var(--text-tertiary);
    max-width: 400px;
}

.footer-links h3 {
    color: var(--text-inverse);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-lg);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.legal-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.legal-nav a {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    transition: color var(--transition-fast);
    position: relative;
}

.legal-nav a:not(:last-child)::after {
    content: '•';
    margin-left: var(--spacing-md);
    color: var(--text-tertiary);
    opacity: 0.5;
}

.legal-nav a:hover {
    color: var(--accent-color);
}

.copyright {
    margin: 0;
}

/* Single Article */
.article-container {
    max-width: 800px;
    margin: 0 auto;
}

.article-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.article-category {
    color: var(--accent-color);
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-md);
}

.article-title {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-lg);
    line-height: 1.2;
}

.article-meta {
    color: var(--text-tertiary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.article-featured-image {
    margin-bottom: var(--spacing-2xl);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.article-body {
    font-family: var(--font-heading);
    /* Lora for reading */
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.article-body p {
    margin-bottom: 1.5em;
}

.article-body h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin-top: 2em;
    margin-bottom: 1em;
    color: var(--primary-color);
}

.article-tags {
    margin-top: var(--spacing-3xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-light);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.tag {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.tag:hover {
    background: var(--accent-color);
    color: var(--text-inverse);
}

/* Page Grid Layout */
.page-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
}

@media (min-width: 1024px) {
    .page-grid {
        grid-template-columns: 1fr 300px;
        gap: var(--spacing-2xl);
    }
}

/* Sidebar */
.site-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

@media (min-width: 1024px) {
    .site-sidebar {
        position: sticky;
        top: calc(var(--header-height) + var(--spacing-xl));
        height: fit-content;
    }
}

.sidebar-widget {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
}

/* Ad Widget */
.ad-widget {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.ad-placeholder {
    background: var(--bg-secondary);
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-focus);
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Mini Card */
.mini-card {
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: var(--spacing-md);
}

.mini-card:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.mini-card-link {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: var(--spacing-md);
    align-items: start;
}

.mini-card-image {
    aspect-ratio: 1/1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
}

.mini-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-fast);
}

.mini-card-link:hover .mini-card-image img {
    transform: scale(1.1);
}

.mini-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 var(--spacing-xs);
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mini-card-link:hover .mini-card-title {
    color: var(--accent-color);
}

.mini-card-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}