/* ============================================
   SEO-Optimized, Ultra-Lightweight Stylesheet
   ============================================ */

:root {
    --text: #1a1a1a;
    --text-muted: #555;
    --bg: #ffffff;
    --bg-alt: #f9f9f9;
    --accent: #0066cc;
    --accent-hover: #0052a3;
    --border: #e5e5e5;
    --max-width: 720px;
    --radius: 8px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 100;
    text-decoration: none;
    font-size: 0.875rem;
}
.skip-link:focus { top: 0; }

/* Layout */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

.site-header nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.site-title:hover { color: var(--accent); }

.site-desc {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

/* Main */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    min-height: 60vh;
}

/* Typography */
h1, h2, h3, h4 {
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
}

h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.75rem; margin-top: 2.5rem; }
h3 { font-size: 1.375rem; margin-top: 2rem; }

p { margin-bottom: 1.5rem; }

a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}
a:hover { color: var(--accent-hover); }

/* Post */
.post-header { margin-bottom: 2rem; }
.post-header h1 { margin-bottom: 0.5rem; }

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.post-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8125rem;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.15s;
}

.tag:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Featured Image */
.post-featured-image {
    margin: 2rem 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Content */
.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.post-content h2,
.post-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.post-content p { margin-bottom: 1.5rem; }

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.post-content li { margin-bottom: 0.5rem; }

.post-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1.25rem;
    margin: 2rem 0;
    color: var(--text-muted);
    font-style: italic;
}

.post-content pre {
    background: #f4f4f4;
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.post-content code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9em;
    background: #f4f4f4;
    padding: 0.15em 0.3em;
    border-radius: 4px;
}

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

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

/* Breadcrumbs */
.breadcrumb {
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumb li { display: inline; }
.breadcrumb li:not(:last-child)::after {
    content: " / ";
    color: #999;
    margin: 0 0.25rem;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb .active { color: var(--text); font-weight: 500; }

/* Post List (Home/Tag) */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.75rem; }

.post-list { display: grid; gap: 2.5rem; }

.post-card h2 {
    font-size: 1.375rem;
    margin-bottom: 0.25rem;
    margin-top: 0;
}

.post-card h2 a {
    color: var(--text);
    text-decoration: none;
}

.post-card h2 a:hover { color: var(--accent); text-decoration: underline; }

.post-card time {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.post-card .p-summary {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9375rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

/* Microformats / h-entry */
.h-entry .p-name { font-weight: 700; }
.h-entry .dt-published { font-size: 0.875rem; }

/* Responsive */
@media (max-width: 640px) {
    body { font-size: 1rem; }
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.375rem; }
    .post-content { font-size: 1rem; }
    .site-header nav { flex-direction: column; gap: 0.25rem; }
}

/* Print */
@media print {
    .site-header, .site-footer, .breadcrumb, .post-tags { display: none; }
    main { max-width: 100%; padding: 0; }
    a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }
}
