/* CAH 205 Project: Staying informed with me A.I.nd you
   Author: Ethan Stonecipher
   GitHub: EMSEthanS
*/

/* Theme Variable Definitions */
:root[data-theme="dark"] {
    --bg-main: #0f172a;        /* Deep Slate */
    --bg-card: #1e293b;        /* Lighter Slate for cards */
    --accent: #818cf8;         /* Soft Indigo */
    --text-primary: #f8fafc;   /* Off-white */
    --text-muted: #94a3b8;     /* Muted Slate-blue */
    --spacing: 1.75rem;
    --border-color: rgba(255, 255, 255, 0.05);
}

:root[data-theme="light"] {
    --bg-main: #f1f5f9;        /* Light Cool Gray */
    --bg-card: #ffffff;        /* Pure White */
    --accent: #4f46e5;         /* Deeper Indigo for readability */
    --text-primary: #0f172a;   /* Deep Slate for text */
    --text-muted: #475569;     /* Gray-blue */
    --spacing: 1.75rem;
    --border-color: rgba(0, 0, 0, 0.1);
}

/* Global Reset & Base Styles */
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.2rem; 
    line-height: 1.7;
    margin: 0;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition */
}

/* Header & Typography Hierarchy */
header {
    max-width: 850px;
    margin: 0 auto 4rem auto;
    text-align: left;
    width: 100%;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

header nav {
    margin-top: 1.5rem;
    font-weight: 500;
}

header nav a {
    color: var(--accent);
    text-decoration: none;
}

/* Main Content Layout */
main {
    max-width: 850px;
    margin: 0 auto;
    display: grid;
    gap: var(--spacing);
    width: 100%;
    flex: 1; 
}

/* Article Card Styles */
.article-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}

.article-container:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.article-container h3 {
    margin: 0 0 1rem 0; 
    font-size: 1.85rem;
    line-height: 1.3;
}

.article-container h3 a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s ease;
}

.article-container h3 a:hover {
    color: var(--accent);
}

.article-container p {
    color: var(--text-muted);
    margin: 0;
    font-size: 1.15rem;
    font-style: italic;
    letter-spacing: 0.01em;
}

/* Theme Toggle Button Styling */
.theme-switch-wrapper {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

#theme-toggle {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--accent);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s ease;
}

#theme-toggle:hover {
    background-color: var(--accent);
    color: #ffffff;
}

/* Footer Styles */
footer {
    text-align: center;
    margin-top: 6rem;
    padding: 2.5rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 1rem;
    width: 100%;
}

footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
