/* Avalaine - Tech Journal Theme
   Minimal, High-Contrast, Professional */

/* Variables Architecture */
:root {
    /* Light Mode - The "Paper" Palette */
    --color-bg: #ffffff;
    --color-surface: #ffffff;
    --color-text: #111111;
    --color-text-muted: #666666;
    --color-accent: #0070f3; /* Electric Blue */
    --color-link: #111111;
    --color-link-hover: #0070f3;
    --color-border: #eeeeee;
    --color-code-bg: #f5f5f5;
    
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;
    
    --max-width: 720px;
    --spacing-unit: 1rem;
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    /* Dark Mode - The "Deep Ink" Palette */
    --color-bg: #0a0a0a;
    --color-surface: #0a0a0a;
    --color-text: #ededed;
    --color-text-muted: #a1a1a1;
    --color-accent: #3291ff;
    --color-link: #ffffff;
    --color-link-hover: #3291ff;
    --color-border: #222222;
    --color-code-bg: #111111;
}
/* Theme Toggle Button Styling */
#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text); /* Icons use this color */
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

#theme-toggle:hover {
    transform: scale(1.1);
}

/* Logic to show/hide icons */
#sun-icon { display: none; }
#moon-icon { display: block; }

[data-theme="dark"] #sun-icon { display: block; }
[data-theme="dark"] #moon-icon { display: none; }
/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/* Ensure the header container spreads out */
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Group the logo and main links together */
.nav-group {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* Minimalist Toggle Styling */
#theme-toggle {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 0.4rem 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.8;
}

#theme-toggle:hover {
    opacity: 1;
    border-color: var(--color-accent);
    background-color: var(--color-code-bg);
}



/* Base */
html {
    font-size: 18px;
    line-height: 1.6; /* Tighter leading for Journal feel */
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    transition: background-color var(--transition), color var(--transition);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}


#theme-toggle {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-family: var(--font-mono); /* Technical look */
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    margin-left: 1.5rem;
    transition: var(--transition);
    text-transform: uppercase;
}

#theme-toggle:hover {
    color: var(--color-text);
    border-color: var(--color-text);
}

/* Typography Enhancements */
h1, h2, h3, h4 {
    line-height: 1.2;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.03em; /* Tighter tracking for impactful headings */
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; border-bottom: 1px solid var(--color-border); padding-bottom: 0.5rem; }
h3 { font-size: 1.35rem; }

p { margin-bottom: 1.5rem; }

a {
    color: var(--color-link);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
    transition: var(--transition);
}

a:hover {
    color: var(--color-link-hover);
    border-bottom-color: var(--color-link-hover);
}

/* Header - Sleek & Sticky */
.site-header {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(var(--color-bg), 0.8);
}

.site-logo {
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
}

/* Article Grid - Journal Style */
.article-grid {
    display: flex;
    flex-direction: column;
    gap: 0; /* Stacked with borders */
}

.article-card {
    padding: 2rem 0;
    border-bottom: 1px solid var(--color-border);
    transition: transform var(--transition);
}

.article-card:hover {
    transform: translateX(4px); /* Subtle "slide" on hover */
}

.article-card h2 a {
    border: none;
}

.article-card time {
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

/* TLDR & Notices - Technical Boxes */
.tldr, .affiliate-notice, .table-of-contents {
    border: 1px solid var(--color-border);
    background: var(--color-code-bg);
    border-radius: 0; /* Sharp corners for Tech vibe */
    padding: 1.5rem;
    margin: 2rem 0;
}

.tldr {
    border-left: 4px solid var(--color-text);
}

/* Tables - Data Precision */
.article-content table {
    border: 1px solid var(--color-border);
}

.article-content th {
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 0.75rem;
    background: var(--color-code-bg);
    color: var(--color-text-muted);
}

/* Theme Toggle Button Styling */
#theme-toggle {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    text-transform: uppercase;
    transition: var(--transition);
}

#theme-toggle:hover {
    background: var(--color-text);
    color: var(--color-bg);
}

/* Footer */
.site-footer {
    margin-top: 4rem;
    padding: 3rem 0;
    background: var(--color-code-bg);
    border-top: 1px solid var(--color-border);
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    h1 { font-size: 2rem; }
    .site-header .container { flex-direction: row; }
}
