/* Eric Migicovsky-inspired Hugo Theme - Enhanced with Chivo Mono */

/* Base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Chivo Mono', monospace;
    line-height: 1.5;
    color: #374151;
    background-color: #ffffff;
    font-weight: 300;
    font-size: 0.9375rem; /* 15px */
    text-align: left;
    font-feature-settings: "liga" 0, "clig" 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 56rem;
    margin: 0;
    padding: 0 2rem 2rem 2rem;
    min-height: calc(100vh - 6rem); /* Ensure content pushes footer down */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.5rem;
    color: #111827;
}

h1 {
    font-size: 2rem; /* 32px */
    font-weight: 600; /* semi-bold - changed from 700 */
    margin-bottom: 0.5rem; /* mb-2 equivalent (0.5rem = 8px) */
    padding-bottom: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: manual; /* prefer space breaks */
    max-width: 33ch; /* Wrap at about half the content width (65ch / 2 ≈ 33ch) */
}

h2 {
    font-size: 1.375rem; /* 22px - reduced from 24px */
    font-weight: 600; /* semi-bold */
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.125rem; /* 18px - reduced from 20px */
    font-weight: 600; /* semi-bold */
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

/* Links */
a {
    color: #4f46e5;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #3730a3;
    text-decoration: underline;
}

/* Header */
.site-header {
    margin-bottom: 1rem;
    padding: 1rem 0 0 0;
}

.site-title {
    font-size: 1.5rem; /* 24px */
    font-weight: 400; /* regular weight */
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 1rem;
}

.site-title a {
    color: #111827;
}

.site-title a:hover {
    color: #111827; /* Keep the same color on hover instead of changing to indigo */
    text-decoration: none;
}

/* Custom Links */
.custom-links {
    margin-bottom: 1.5rem;
}

.custom-links ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.custom-links li {
    margin: 0;
    padding: 0;
}

.custom-links li:not(:last-child) {
    margin-right: 1.5rem;
}

.custom-links a {
    font-size: 0.875rem; /* 14px */
    color: #4f46e5;
    text-decoration: none;
    padding: 0;
    transition: color 0.2s ease;
    display: inline-block;
}

.custom-links a:hover {
    color: #3730a3;
    text-decoration: underline;
}

.link-icon {
    margin-right: 0.25rem;
    font-weight: 500;
}

/* Navigation */
.site-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.site-nav li {
    margin: 0;
}

.site-nav a {
    font-size: 1rem; /* 16px */
    color: #6b7280;
}

.site-nav a:hover {
    color: #4f46e5;
}

/* Main content */
.main-content {
    margin-bottom: 3rem;
}

/* Blog post list */
.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.post-item {
    margin-bottom: 0.25rem; /* Reduced from 1.5rem to 1rem */
    position: relative;
    padding-left: 1.25rem;
}

.post-item::before {
    content: "—";
    position: absolute;
    left: 0;
    color: #9ca3af;
}

.post-title {
    font-size: 1rem; /* 16px */
    font-weight: 400;
    display: inline; /* Make title inline */
    margin-right: 0.05rem; /* Add space between title and date */
}

.post-date {
    font-size: 0.875rem; /* 14px */
    color: #6b7280;
    font-weight: 400;
    display: inline; /* Make date inline */
}

.post-link {
    display: inline-block;
    margin-right: 0.05rem;
}

/* Content prose */
.content {
    max-width: 58ch;
    text-rendering: optimizeLegibility;
    hyphens: manual;
    letter-spacing: 0.01em;
}

.content p {
    margin-bottom: 1.1em;
    margin-top: 1.1em;
    orphans: 3;
    widows: 3;
    text-indent: 0;
}

/* Improve link readability within content */
.content a {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Better spacing for lists */
.content ul, .content ol {
    margin-bottom: 1.1em;
    margin-top: 1.1em;
}

.content li {
    margin-bottom: 0.4em;
}

.content ul, .content ol {
    margin-bottom: 1.25em;
    margin-top: 1.25em;
    padding-left: 1.625em;
}

.content li {
    margin-bottom: 0.5em;
    margin-top: 0.5em;
}

/* Light gray bullet points for unordered lists */
.content ul {
    list-style: none;
    padding-left: 1.25em;
}

.content ul li::before {
    content: "•";
    color: #d1d5db; /* Lighter gray color - changed from #9ca3af */
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.content code {
    background-color: #f3f4f6;
    padding: 0.125em 0.25em;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: 'Chivo Mono', monospace;
}

.content pre {
    background-color: #1f2937;
    color: #e5e7eb;
    padding: 1em;
    border-radius: 0.375rem;
    overflow-x: auto;
    margin-bottom: 1.7142857em;
    margin-top: 1.7142857em;
}

.content pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    font-size: 0.875rem;
}

/* Footer */
.site-footer {
    margin-top: 4rem;
    padding: 2rem 0 3rem 0;
    border-top: 1px solid #d1d5db;
    color: #6b7280;
    font-size: 0.875rem;
}

.footer-text {
    text-align: center;
    line-height: 1.4;
    opacity: 0.8;
}

.footer-text a {
    color: #6b7280;
    text-decoration: underline;
}

.footer-text a:hover {
    color: #4f46e5;
}

/* Caption styling */
.caption {
    font-size: 0.8125rem; /* 13px */
    color: #6b7280;
    line-height: 1.4;
    margin: 0.5rem 0 1.5rem 0;
    padding: 0.5rem 0;
    border-top: 1px solid #e5e7eb;
    font-style: italic;
    text-align: center;
    max-width: 100%;
}

.caption p {
    margin: 0;
}

/* Caption for images */
.content img + .caption {
    margin-top: -1rem;
    border-top: none;
    padding-top: 0;
}

/* Utilities */
.text-sm {
    font-size: 0.875rem;
}

.back-home-link {
    color: #4f46e5;
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-home-link:hover {
    color: #3730a3;
    text-decoration: underline;
}

/* Image styling */
.content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem 0;
    border-radius: 0.375rem; /* Matches code block border radius */
}

.img-small {
    width: 300px;
    height: auto;
}

.img-medium {
    width: 500px;
    height: auto;
}

.img-large {
    width: 800px;
    height: auto;
}

.img-full {
    width: 100%;
    height: auto;
}

.text-gray {
    color: #6b7280;
}

.font-light {
    font-weight: 300;
}

.font-regular {
    font-weight: 400;
}

.font-medium {
    font-weight: 500;
}

.font-bold {
    font-weight: 700;
}

/* Responsive design */
@media (max-width: 640px) {
    .container {
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 1.875rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .site-nav ul {
        gap: 0.75rem;
    }
    
    .post-item {
        padding-left: 1rem;
    }
    
    .post-title {
        font-size: 1rem;
    }
}

/* Section spacing */
.section {
    margin-bottom: 1.5rem;
}

.section:last-child {
    margin-bottom: 0;
}
