/* CSS Variables for theming */
:root {
    --bg-color: white;
    --text-color: #111;
    --link-color: blue;
    --border-color: gray;
    --shadow-color: rgba(0,0,0,0.2);
    --hover-shadow: rgba(0,0,0,0.3);
    --publication-bg: transparent;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --link-color: #6bb6ff;
    --border-color: #555;
    --shadow-color: rgba(0,0,0,0.5);
    --hover-shadow: rgba(0,0,0,0.7);
    --publication-bg: rgba(255,255,255,0.05);
}

/* Pelican Basic Theme CSS */
body {
    font-family: monospace;
    font-size: 14px;
    color: var(--text-color);
    background-color: var(--bg-color);
    width: 80%;
    min-width: 400px;
    min-height: 200px;
    margin: 5% 10%;
    padding: 1em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

a:hover {
    text-decoration: underline;
}

a:visited {
    color: var(--link-color);
}

h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
    color: inherit;
}

/* Navigation */
nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav li {
    display: inline;
    margin-right: 1em;
}

nav a {
    font-weight: bold;
}

/* Dark mode toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--text-color);
    color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 12px;
    font-family: monospace;
    font-size: 16px;
    cursor: pointer;
    z-index: 1000;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.theme-toggle:hover {
    opacity: 0.8;
}

/* Layout */
.about {
    display: flex;
    align-items: flex-start;
    gap: 1em;
}

.about .bio {
    max-width: 700px;
}

.profile {
    max-width: 225px;
    flex-shrink: 0;
}

.profile img {
    width: 100%;
}

.publications {
    clear: both;
    margin-top: 2em;
}

.publication {
    margin-bottom: 2em;
    overflow: hidden;
}

.publication {
    background-color: var(--publication-bg);
    padding: 0.5em;
    transition: background-color 0.3s ease;
}

.publication img {
    float: left;
    width: 112px;
    height: 112px;
    object-fit: cover;
    margin-right: 1em;
}

.publication-content {
    overflow: hidden;
}

/* Project and Art Grids */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 0.2em;
    margin-top: 1em;
}

.comics-grid {
    grid-template-columns: repeat(3, 1fr);
}

.comics-grid .tile img {
    width: 100%;
    height: auto;
    min-height: 375px;
    object-fit: contain;
    margin-bottom: 0.5em;
}

.illustrations-grid {
    width: 100%;
    margin-top: 1em;
}

.tile {
    text-align: center;
    text-decoration: none;
}

.tile img {
    width: 100%;
    max-height: 225px;
    object-fit: cover;
    margin-bottom: 0.5em;
}

.tile h3 {
    margin: 0.5em 0;
    font-size: 1.5em;
}

/* Art categories */
.category {
    margin-top: 2em;
    margin-bottom: 1em;
    border-bottom: thin solid #ccc;
    padding-bottom: 0.5em;
}

/* Video embeds */
.video-container {
    text-align: center;
    margin: 2em 0;
}

iframe {
    max-width: 100%;
}

/* Project pages */
.project-content {
    width: 70%;
    margin: 0 auto;
}

.project-content img {
    margin: auto;
    display: block;
    max-width: 375px;
    width: 75%;
    height: auto;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.3em;
    margin: 1em 0;
}

/* Contact icons */
.contact-icons {
    margin-top: 1em;
}

.contact-icons a {
    margin-right: 1em;
    text-decoration: none;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    body {
        width: 95%;
        margin: 2% 2.5%;
        padding: 0.5em;
    }
    
    .profile {
        float: none;
        margin: 0 auto 1em;
        max-width: 300px;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .comics-grid {
        grid-template-columns: 1fr;
    }
    
    .illustrations-grid {
        width: 100%;
    }
    
    nav li {
        display: block;
        margin-bottom: 0.5em;
    }
    
    .publication img {
        width: 120px;
        height: 90px;
    }
    
    .theme-toggle {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 10px;
    }
    
    .about {
        flex-direction: column;
        align-items: center;
    }
    
    .profile {
        order: -1;
    }
}

/* Code blocks */
pre, code {
    font-family: monospace;
    background-color: #f5f5f5;
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

pre {
    padding: 1em;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* Post lists */
.post-list {
    margin: 1em 0;
}

.post-list li {
    margin-bottom: 1em;
}