/* 
 * FinanceFirst Modern CSS
 * Mobile-first, speed-focused, premium aesthetic.
 */

:root {
    /* Colors - Deep Emerald & Royal Blue Theme */
    --color-primary: #064e3b;    /* Deep Emerald - Trust */
    --color-primary-light: #059669; 
    --color-secondary: #334155;  /* Slate 700 */
    --color-accent: #2563eb;     /* Royal Blue - Action */
    --color-accent-hover: #1d4ed8;
    
    --color-bg: #ffffff;
    --color-bg-alt: #f8fafc;     /* Slate 50 */
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    
    --color-text: #1e293b;       /* Slate 800 */
    --color-text-muted: #64748b; /* Slate 500 */
    --color-text-light: #94a3b8;

    /* Spacing - Generous Whitespace */
    --spacing-xs: 0.5rem;   /* 8px */
    --spacing-sm: 1rem;     /* 16px */
    --spacing-md: 1.5rem;   /* 24px */
    --spacing-lg: 2.5rem;   /* 40px - Increased */
    --spacing-xl: 5rem;     /* 80px - Increased */

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-serif: 'Lora', serif;
    
    --line-height-base: 1.7;
    --line-height-heading: 1.25;

    /* Shadows & Radius */
    --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);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;

    /* Layout */
    --max-width-content: 720px;
    --max-width-container: 1200px;
    --header-height: 70px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: var(--line-height-base);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: all 0.2s ease;
}

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

/* Utilities */
.container {
    width: 100%;
    max-width: var(--max-width-container);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    color: var(--color-primary);
    line-height: var(--line-height-heading);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

h1 {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-top: var(--spacing-lg);
}

h3 {
    font-size: 1.5rem;
    font-family: var(--font-sans); /* Keep card titles modern */
    font-weight: 600;
    letter-spacing: -0.01em;
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--color-secondary);
}

/* Header & Nav */
.site-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}

.nav-links {
    display: none; /* Mobile first hidden */
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
        gap: var(--spacing-md);
        align-items: center;
    }
    
    .nav-links a {
        color: var(--color-secondary);
        font-weight: 500;
        font-size: 0.95rem;
    }

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

/* Mobile Menu Button */
.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    z-index: 1002;
    width: 40px;
    height: 40px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

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

/* Mobile Menu Drawer */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-lg);
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
}

.mobile-menu-overlay.active {
    transform: translateY(0);
    opacity: 1;
}

.mobile-menu-overlay a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
    font-family: var(--font-serif);
}

/* Hero Section */
.hero {
    padding: var(--spacing-xl) 0;
    background: linear-gradient(to bottom, var(--color-bg-alt), white);
}

.hero-grid {
    display: grid;
    gap: var(--spacing-xl);
    align-items: center;
}

@media (min-width: 768px) {
    .hero-grid {
        grid-template-columns: 1.2fr 1fr;
        text-align: left;
    }
}

.hero-text h1 {
    margin-bottom: var(--spacing-md);
}

.hero-text p {
    font-size: 1.25rem;
    color: var(--color-secondary);
    max-width: 90%;
    margin-bottom: var(--spacing-lg);
}

.hero-image {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: transform 0.5s ease;
}

.hero-image:hover {
    transform: translateY(-5px);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    background: var(--color-accent);
    color: white;
    border-radius: 50px; /* Pill shape */
    font-weight: 600;
    font-size: 1rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
    text-decoration: none;
}

/* Article Grid */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

article {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-bg-alt);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

article:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-border);
}

article img {
    height: 200px;
    width: 100%;
    object-fit: cover;
}

article div {
    padding: var(--spacing-md);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

article h3 a {
    color: var(--color-primary);
}

article h3 a:hover {
    color: var(--color-accent);
    text-decoration: none;
}

/* Article Template specific */
.article-content {
    max-width: var(--max-width-content);
    margin: 0 auto;
    font-size: 1.125rem;
}

.article-content p {
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

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

.site-footer p {
    color: rgba(255,255,255,0.8);
}

.footer-links a {
    color: white;
    opacity: 0.8;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}
