/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bgcolor: #f7f8f5;
    --fgcolor: #19093f;
    --bg: var(--bgcolor);
    --fg: #333;
    --link: var(--fgcolor);
    --link-hover: #2a1457;
    --border: #e8e9e6;
    --shadow: rgba(25, 9, 63, 0.1);
    --code-bg: #f0f1ee;
    --max-width: 800px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--fg);
    background: var(--bg);
    font-size: 16px;
}

/* Layout */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
}

.center {
    text-align: center;
    margin: 0 auto;
    display: block;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.header-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.site-title a {
    color: var(--fgcolor);
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--link);
    text-decoration: none;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--link-hover);
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1rem;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* Page headers */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.page-description {
    color: #666;
    font-size: 1.1rem;
}

/* Post entries (homepage/lists) */
.post-entry {
    background: white;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px var(--shadow);
    position: relative;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.post-entry::after,
.post-entry::before {
    content: "";
    width: 0px;
    height: 0px;
    position: absolute;
    border: 0px solid var(--link);
    transition: all 0.4s ease;
}

.post-entry::after {
    top: -2px;
    left: -2px;
    border-top: 2px solid var(--link);
    border-left: 2px solid var(--link);
}

.post-entry::before {
    bottom: -2px;
    right: -2px;
    border-bottom: 2px solid var(--link);
    border-right: 2px solid var(--link);
}

.post-entry:hover::before {
    width: calc(100% + 2px);
    height: calc(100% + 2px);
}

.post-entry:hover::after {
    width: calc(100% + 2px);
    height: calc(100% + 2px);
}

.post-entry-link {
    display: block;
    padding: 1.5rem;
    color: inherit;
    text-decoration: none;
    position: relative;
    z-index: 2;
}


.entry-header h2 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}


.entry-content {
    margin: 1rem 0;
    color: #666;
}

.entry-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.post-entry-tags {
    padding: 0 1.5rem 1.5rem;
    margin-top: -0.5rem;
    position: relative;
    z-index: 3;
}

.entry-date {
    font-weight: 500;
}

/* Single posts */
.post-single {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px var(--shadow);
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.post-title {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.post-description {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #666;
    font-size: 0.95rem;
}

.post-date {
    font-weight: 500;
}

/* Tags */
.tag-links,
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-links a,
.post-tags a,
.tag {
    background: var(--code-bg);
    color: var(--fg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background-color 0.2s ease;
}

.tag-links a:hover,
.post-tags a:hover,
.tag:hover {
    background: #e8e8e8;
}

.post-tags {
    list-style: none;
}

.post-tags li {
    display: inline;
}

.post-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}


/* Post content */
.post-content,
.page-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--fg);
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin: 2rem 0 1rem 0;
    line-height: 1.3;
}

.post-content h1 { font-size: 2rem; }
.post-content h2 { font-size: 1.7rem; }
.post-content h3 { font-size: 1.4rem; }
.post-content h4 { font-size: 1.2rem; }

.post-content p {
    margin: 1rem 0;
}

.post-content a {
    color: var(--link);
    text-decoration: underline;
}

.post-content a:hover {
    color: var(--link-hover);
}

.post-content ul,
.post-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.post-content li {
    margin: 0.25rem 0;
}

.post-content blockquote {
    border-left: 4px solid var(--link);
    margin: 1.5rem 0;
    padding-left: 1.25rem;
    font-style: italic;
    color: #555;
}

.post-content hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 2rem 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

/* Tags list page */
.tags-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.tag-entry {
    display: flex;
    align-items: center;
}

.tag-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.tag-link:hover {
    background: var(--code-bg);
}

.tag-count {
    font-size: 0.9rem;
    color: #666;
}

/* Archives */
.archive-entry {
    display: flex;
    margin-bottom: 0.5rem;
}

.archive-date {
    min-width: 4rem;
    margin-right: 1rem;
    color: #666;
}

.archive-link {
    flex: 1;
}

/* Code */
.post-content code {
    background: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: "Monaco", "Consolas", monospace;
}

.post-content pre {
    background: var(--code-bg);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
}

/* Tables */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

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

.post-content th {
    background: var(--code-bg);
    font-weight: 600;
}

.post-content tr:hover {
    background: #f9f9f9;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
}

.pagination a {
    background: white;
    color: var(--link);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 2px 4px var(--shadow);
    transition: transform 0.2s ease;
}

.pagination a:hover {
    transform: translateY(-1px);
    color: var(--link-hover);
}

/* Responsive design */
@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .main {
        padding: 1rem;
    }

    .post-single,
    .post-entry {
        padding: 1.5rem;
        border-radius: 0;
        margin-left: -1rem;
        margin-right: -1rem;
    }

    .post-title {
        font-size: 1.8rem;
    }

    .post-meta,
    .entry-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .post-entry-tags {
        padding: 0 1.5rem 1.5rem;
    }

    .pagination {
        flex-direction: column;
        gap: 1rem;
    }
}