/* Import professional fonts from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Merriweather:wght@300;400;700&display=swap');

/* CSS Variables for consistent theming */
:root {
    --primary-color: #000000;
    --secondary-color: #0d6233;
    --accent-color: #f51414;
    --text-color: #333333;
    --link-color: #2f1aba;
    --background-color: #ffffff;
    --header-bg: #000000;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-heading: 'Merriweather', Georgia, 'Times New Roman', serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    width: 70%;
    margin: 0 auto;
    padding: 20px 0;
}

/* Home page layout - override body styles */
body:has(.sidebar) {
    display: flex;
    width: 100%;
    margin: 10px 30px 30px;
    padding: 0;
    min-height: 100vh;
}

.content {
    flex-grow: 1;
    padding: 20px;
    background-color: var(--background-color);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    color: var(--primary-color);
}

h1 {
    font-size: 2em;
    margin-top: 0;
}

h2 {
    font-size: 1.5em;
}

h3 {
    font-size: 1.25em;
}

h4 {
    font-size: 1.25em;
}

h5 {
    font-size: 1.1em;
}

h6 {
    font-size: 1em;
    font-weight: 600;
}

p {
    margin-bottom: 1.5em;
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

a:hover {
    text-decoration: underline;
    color: var(--secondary-color);
}

a:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Navigation Styles */
nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    background-color: var(--header-bg);
}

nav ul li {
    margin-right: 20px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 500;
    padding: 10px 15px;
    display: inline-block;
    transition: background-color 0.3s ease;
}

nav ul li a:hover {
    background-color: var(--secondary-color);
    text-decoration: none;
}

/* Content Container */
.container-lg {
    max-width: 100%;
    padding: 2em 1em;
}

.markdown-body {
    font-family: var(--font-main);
}

/* Article Styles */
article {
    text-align: left;
    max-width: 750px;
    margin: 0 auto;
    padding: 2em 1em;
}

.article-content {
    margin: 0;
}

article header {
    margin-bottom: 2em;
}

.article-meta {
    color: #666;
    font-size: 0.9em;
    margin-top: 0.5em;
    font-style: italic;
}

article section {
    margin-bottom: 2.5em;
    text-align: left;
}

/* Subtle separators between article sections */
article section + section {
    border-top: 1px solid #e0e0e0;
    padding-top: 2em;
}

/* Lists */
ul, ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
}

li {
    margin-bottom: 0.5em;
}

/* Better spacing for article lists */
article ul li,
article ol li {
    margin-bottom: 0.75em;
}

/* Mark/Highlight */
mark {
    background-color: #fff3cd;
    padding: 2px 5px;
    border-radius: 3px;
}

/* Sections */
section {
    margin-bottom: 2em;
}

/* Code blocks */
code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

pre {
    background-color: #f5f5f5;
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 1em;
}

pre code {
    background-color: transparent;
    padding: 0;
}

/* Blockquotes */
blockquote {
    border-left: 4px solid var(--secondary-color);
    padding-left: 1em;
    margin: 1em 0;
    font-style: italic;
    color: #666;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em 0;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

tr:hover {
    background-color: #f5f5f5;
}

/* Sidebar Styles (for home page) */
.sidebar {
    width: 250px;
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    height: 100vh;
    box-sizing: border-box;
}

.sidebar img {
    max-width: 100%;
    height: auto;
    border-radius: 50%;
}

.sidebar h2, 
.sidebar p {
    text-align: center;
}

.links {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
}

.links a {
    color: white;
    text-decoration: none;
    padding: 10px;
    text-align: center;
    transition: background-color 0.3s ease;
}

.links a:hover {
    background-color: var(--secondary-color);
}

/* Home page content sections */
main {
    display: flex;
    justify-content: space-around;
    padding: 2em;
    flex-wrap: wrap;
    gap: 1em;
}

/* Only center-align category sections on home page, not articles list */
main section#agenticai,
main section#startups,
main section#ecp {
    padding: 1em;
    margin: 0 1em;
    border-radius: 8px;
    flex: 1;
    text-align: center;
    min-width: 200px;
}

/* Popular articles section - left aligned */
main section#popular {
    padding: 1em;
    margin: 0 1em;
    border-radius: 8px;
    flex: 1;
    text-align: left;
    min-width: 200px;
}

/* Article sections should be left-aligned */
article section {
    text-align: left;
    padding: 0;
    margin: 2.5em 0;
    border-radius: 0;
}

#agenticai,
#startups,
#ecp {
    background-color: var(--primary-color);
    color: white;
}

#agenticai a,
#startups a,
#ecp a {
    color: white;
    font-weight: 600;
    font-size: 1.2em;
}

#popular {
    text-align: left;
    color: var(--text-color);
}

#popular a {
    color: var(--text-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    body {
        width: 85%;
    }
}

@media (max-width: 768px) {
    body {
        width: 95%;
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    h2 {
        font-size: 1.75em;
    }
    
    h3 {
        font-size: 1.5em;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav ul li {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    main {
        flex-direction: column;
        padding: 1em;
    }
    
    main section {
        margin: 0.5em 0;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5em; }
.mt-2 { margin-top: 1em; }
.mt-3 { margin-top: 1.5em; }
.mt-4 { margin-top: 2em; }

.mb-1 { margin-bottom: 0.5em; }
.mb-2 { margin-bottom: 1em; }
.mb-3 { margin-bottom: 1.5em; }
.mb-4 { margin-bottom: 2em; }

.accent-text {
    color: var(--accent-color);
}

.custom-color {
    color: var(--text-color);
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Print Styles */
@media print {
    body {
        width: 100%;
        color: black;
    }
    
    nav,
    .sidebar,
    #header,
    #footer {
        display: none;
    }
    
    a {
        text-decoration: underline;
        color: black;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
}
