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

:root {
    --bg: #0a0a0a;
    --text: #d4d4d4;
    --text-secondary: #888;
    --text-muted: #555;
    --accent: #00ff00;
    --border: #222;
    --border-light: #333;
    --surface: #111;
    --surface-hover: #1a1a1a;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Courier New', Courier, monospace;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a:hover {
    text-decoration: underline;
}

/* === Navigation === */
.nav {
    border-bottom: 1px solid var(--border-light);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-prompt {
    color: var(--accent);
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
}

.nav-hamburger {
    display: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    background: none;
    border: none;
}

/* === Hero === */
.hero {
    padding: 48px 32px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.hero-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid #444;
    object-fit: cover;
    flex-shrink: 0;
}

.hero-name {
    font-size: 24px;
    color: #fff;
    margin-bottom: 8px;
}

.hero-tagline {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.hero-tagline::before {
    content: "> ";
}

/* === Social Links === */
.social-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.social-link {
    color: var(--accent);
    font-size: 12px;
    border: 1px solid var(--border-light);
    padding: 4px 12px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.social-link:hover {
    background-color: var(--surface-hover);
    text-decoration: none;
}

/* === Sections === */
.section {
    padding: 0 32px 32px;
}

.section-header {
    color: var(--accent);
    font-size: 14px;
    margin-bottom: 16px;
}

/* === Post List === */
.post-list {
    border: 1px solid var(--border);
    border-radius: 4px;
}

.post-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: block;
    color: var(--text);
}

.post-item:last-child {
    border-bottom: none;
}

.post-item:hover {
    background-color: var(--surface-hover);
    text-decoration: none;
}

.post-title {
    color: #fff;
    font-size: 15px;
}

.post-meta {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

.post-excerpt {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 6px;
}

/* === Blog Post Content === */
.post-content {
    max-width: 720px;
    padding: 24px 32px;
    line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    color: #fff;
    margin: 24px 0 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
}

.post-content h1 { font-size: 22px; }
.post-content h2 { font-size: 18px; }
.post-content h3 { font-size: 16px; }

.post-content p {
    margin-bottom: 16px;
}

.post-content code {
    color: var(--accent);
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 14px;
}

.post-content pre {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 16px;
    overflow-x: auto;
    margin: 16px 0;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: var(--text);
}

.post-content ul, .post-content ol {
    margin: 0 0 16px 24px;
}

.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 16px;
    color: var(--text-secondary);
    margin: 16px 0;
}

.post-content img {
    max-width: 100%;
    border-radius: 4px;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.post-content th, .post-content td {
    border: 1px solid var(--border-light);
    padding: 8px 12px;
    text-align: left;
}

.post-content th {
    background: var(--surface);
    color: var(--accent);
    font-weight: bold;
}

.post-content tr:hover {
    background: var(--surface);
}

/* === Pagination === */
.pagination {
    color: var(--text-muted);
    font-size: 13px;
    padding: 16px 0;
    text-align: center;
}

.pagination a {
    color: var(--text-secondary);
}

/* === Post Navigation === */
.post-nav {
    border-top: 1px solid var(--border);
    margin-top: 32px;
    padding-top: 16px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
}

/* === Footer === */
.footer {
    border-top: 1px solid var(--border);
    padding: 16px 32px;
    color: #444;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    margin-top: auto;
}

/* === Main Content Area === */
.content {
    flex: 1;
}

/* === Responsive === */
@media (max-width: 768px) {
    .nav {
        padding: 12px 16px;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 48px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border-light);
        padding: 16px;
        gap: 12px;
        z-index: 100;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-hamburger {
        display: block;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding: 32px 16px;
    }

    .hero-photo {
        width: 90px;
        height: 90px;
    }

    .social-links {
        justify-content: center;
    }

    .section {
        padding: 0 16px 24px;
    }

    .post-content {
        padding: 16px;
    }

    .footer {
        padding: 12px 16px;
        flex-direction: column;
        gap: 4px;
    }
}

/* === Image Gallery === */
.image-gallery-section {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 16px;
}

.image-gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.image-gallery-title {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
}

.image-upload-btn {
    color: var(--accent);
    font-size: 12px;
    border: 1px solid var(--accent);
    padding: 4px 12px;
    border-radius: 3px;
    background: none;
    font-family: inherit;
    cursor: pointer;
}

.image-upload-btn:hover {
    background: rgba(0, 255, 0, 0.1);
}

.image-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.image-gallery-item {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
}

.image-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-gallery-item:hover {
    border-color: var(--accent);
}

.image-gallery-item .delete-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    color: #ff4444;
    background: rgba(10, 10, 10, 0.8);
    border: none;
    font-size: 14px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-gallery-item:hover .delete-btn {
    opacity: 1;
}

.image-gallery-empty {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    padding: 16px;
}

.image-copied-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--accent);
    color: var(--bg);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1000;
}

.image-copied-toast.show {
    opacity: 1;
}

/* === EasyMDE Dark Theme Overrides === */
.EasyMDEContainer .CodeMirror {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-light);
}

.EasyMDEContainer .CodeMirror-cursor {
    border-left-color: var(--accent);
}

.EasyMDEContainer .editor-toolbar {
    background: var(--bg);
    border-color: var(--border-light);
}

.EasyMDEContainer .editor-toolbar button {
    color: var(--text) !important;
}

.EasyMDEContainer .editor-toolbar button:hover {
    background: var(--surface-hover);
    border-color: var(--border-light);
}

.EasyMDEContainer .editor-toolbar button.active {
    background: var(--surface);
    border-color: var(--accent);
}

.EasyMDEContainer .editor-toolbar i.separator {
    border-left-color: var(--border-light);
    border-right-color: var(--border);
}

.EasyMDEContainer .editor-preview {
    background: var(--surface);
    color: var(--text);
}

.EasyMDEContainer .editor-preview pre {
    background: var(--bg);
}

.EasyMDEContainer .editor-statusbar {
    color: var(--text-muted);
}

.EasyMDEContainer .CodeMirror-selected {
    background: #264f78;
}

.EasyMDEContainer .CodeMirror-focused .CodeMirror-selected {
    background: #264f78;
}
