/* Minimalist CSS - Very little formatting, but looks good */

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

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #333;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #fff;
}

/* Layout */
body {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    margin-bottom: 3em;
    padding-bottom: 1em;
    border-bottom: 1px solid #eee;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

nav > a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    margin-right: 2em;
}

.nav-search {
    margin-left: auto;
    margin-right: 1em;
}

.nav-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
}

.nav-tag {
    font-size: 0.85em;
    color: #666;
    text-decoration: none;
    padding: 0.2em 0.6em;
    border: 1px solid #ddd;
    border-radius: 3px;
    transition: all 0.2s;
}

.nav-tag:hover {
    color: #333;
    border-color: #999;
    background: #f9f9f9;
}

.nav-tag-all {
    font-weight: 500;
    border-color: #999;
}

/* Main content */
main {
    min-height: 60vh;
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
    margin: 1.5em 0 0.5em;
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.2em; }

p {
    margin-bottom: 1em;
}

/* Links */
a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Lists */
ul, ol {
    margin: 0 0 1em 1.5em;
}

li {
    margin-bottom: 0.5em;
}

/* Code */
code {
    background: #f5f5f5;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

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

pre code {
    background: none;
    padding: 0;
}

/* Blockquote */
blockquote {
    border-left: 3px solid #ddd;
    padding-left: 1em;
    margin: 0 0 1em;
    color: #666;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
}

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

th, td {
    text-align: left;
    padding: 0.5em;
    border-bottom: 1px solid #eee;
}

th {
    font-weight: 600;
}

/* Footer */
footer {
    margin-top: 4em;
    padding-top: 2em;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 0.9em;
}

.footer-tags {
    margin-bottom: 2em;
}

.footer-tags h3 {
    font-size: 1.1em;
    margin-bottom: 1em;
    color: #333;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
}

.tag-cloud .tag {
    font-size: 0.85em;
}

/* Article list */
.article-list {
    margin: 0;
}

/* Article boxes on homepage */
.article-box {
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 1.5em;
    margin-bottom: 2em;
    transition: border-color 0.2s;
}

.article-box:hover {
    border-color: #ccc;
}

.article-title {
    font-size: 1.5em;
    margin: 0 0 0.5em 0;
}

.article-title a {
    color: #333;
    text-decoration: none;
}

.article-title a:hover {
    color: #0066cc;
}

.article-meta {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 1em;
}

.article-meta .tag {
    margin-left: 0.5em;
}

.article-excerpt {
    margin-bottom: 1em;
}

.read-more {
    color: #0066cc;
    font-size: 0.9em;
    text-decoration: none;
}

.read-more:hover {
    text-decoration: underline;
}

/* Tags */
.article-tags {
    margin-top: 2em;
}

.tag {
    display: inline-block;
    background: #f0f0f0;
    color: #333;
    padding: 0.3em 0.8em;
    border-radius: 3px;
    margin-right: 0.5em;
    margin-bottom: 0.5em;
    font-size: 0.9em;
}

.tag:hover {
    background: #e0e0e0;
    text-decoration: none;
}

.tag-list {
    list-style: none;
    margin: 0;
}

.tag-list li {
    display: inline-block;
    margin-right: 1em;
    margin-bottom: 1em;
}

.tag-link {
    color: #333;
}

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

/* Related posts */
.related-posts {
    margin-top: 3em;
    padding-top: 2em;
    border-top: 1px solid #eee;
}

.related-posts h2 {
    font-size: 1.3em;
    margin-bottom: 1em;
}

.related-list {
    display: grid;
    gap: 1.5em;
}

.related-item h3 {
    font-size: 1.1em;
    margin: 0 0 0.3em 0;
}

.related-item h3 a {
    color: #333;
}

.related-item h3 a:hover {
    color: #0066cc;
}

.related-item time {
    color: #666;
    font-size: 0.9em;
}

/* Search form */
.search-form {
    margin: 2em 0;
    display: flex;
    gap: 0.5em;
    max-width: 500px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 0.5em;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 1em;
}

.search-form button {
    padding: 0.5em 1.5em;
    background: #333;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 1em;
}

.search-form button:hover {
    background: #555;
}

/* Pagination */
.pagination {
    margin-top: 3em;
    padding: 1.5em 0;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1em;
}

.pagination-info {
    color: #666;
    font-size: 0.9em;
}

.pagination-prev,
.pagination-next {
    padding: 0.5em 1em;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination-prev:hover,
.pagination-next:hover {
    border-color: #999;
    background: #f9f9f9;
}

/* Mobile responsiveness */
@media (max-width: 720px) {
    body {
        font-size: 15px;
        padding: 15px;
    }
    
    h1 { font-size: 1.75em; }
    h2 { font-size: 1.4em; }
    h3 { font-size: 1.15em; }
    
    nav {
        flex-direction: column;
        align-items: flex-start;
    }
    
    nav > a {
        margin-bottom: 1em;
    }
    
    .nav-tags {
        width: 100%;
    }
}

/* RSS feed links */
.rss-link {
    display: inline-block;
    background: #ff6600;
    color: white;
    font-size: 0.7em;
    padding: 0.2em 0.6em;
    border-radius: 3px;
    text-decoration: none;
    margin-left: 0.5em;
    font-weight: normal;
    vertical-align: middle;
}

.rss-link:hover {
    background: #e55500;
    color: white;
}

/* Print styles */
@media print {
    /* Hide navigation and footer elements */
    .skip-link,
    header,
    footer,
    nav,
    .nav-tags,
    .read-more,
    .footer-tags,
    .pagination,
    .related-posts,
    .rss-link {
        display: none !important;
    }
    
    /* Reset colors for print */
    body {
        color: #000;
        background: #fff;
        font-size: 12pt;
        line-height: 1.5;
        max-width: 100%;
    }
    
    /* Ensure links are visible */
    a {
        color: #000;
        text-decoration: underline;
    }
    
    /* Show link URLs after links in content */
    article a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.9em;
        color: #666;
    }
    
    /* But not for internal anchors */
    article a[href^="#"]:after {
        content: "";
    }
    
    /* Page breaks */
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    p, li, blockquote {
        page-break-inside: avoid;
    }
    
    /* Article styling */
    article {
        page-break-before: auto;
    }
    
    /* Code blocks */
    pre {
        white-space: pre-wrap;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    /* Images */
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    /* Tags styling for print */
    .tag {
        border: 1px solid #000;
        padding: 2px 6px;
        background: none;
    }
}