@import url("https://rsms.me/inter/inter.css");

/* Base typography */
html {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@supports (font-variation-settings: normal) {
    html {
        font-family: "Inter var", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    }
}

body {
    background: #ffffff;
    color: #333333;
    line-height: 1.7;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: 80px;
}

/* Post container */
.post-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 60px 24px;
}

/* Site header */
.site-header {
    display: block;
    color: #999999;
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 16px;
    transition: color 0.2s;
}

.site-header:hover {
    color: #666666;
}

/* Back link */
.back-link {
    display: inline-block;
    color: #666666;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 48px;
    transition: color 0.2s;
}

.back-link:hover {
    color: #333333;
}

/* Post header */
.post-header {
    margin-bottom: 48px;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 32px;
}

.post-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    color: #111111;
    letter-spacing: -0.02em;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #666666;
    font-size: 14px;
}

.meta-separator {
    color: #cccccc;
}

.substack-link {
    margin-top: 16px;
}

.substack-link a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #ff6719;
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
}

.substack-link a:hover {
    text-decoration: underline;
}

/* Post content - HackMD inspired */
.post-content {
    color: #333333;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    color: #111111;
    font-weight: 600;
    margin-top: 2em;
    margin-bottom: 0.75em;
    line-height: 1.3;
}

.post-content h1 { font-size: 28px; }
.post-content h2 { font-size: 24px; border-bottom: 1px solid #eaeaea; padding-bottom: 8px; }
.post-content h3 { font-size: 20px; }
.post-content h4 { font-size: 18px; }

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

.post-content a {
    color: #0070f3;
    text-decoration: none;
}

.post-content a:hover {
    text-decoration: underline;
}

.post-content strong {
    font-weight: 600;
    color: #111111;
}

.post-content em {
    font-style: italic;
}

/* Lists */
.post-content ul,
.post-content ol {
    margin-bottom: 1.5em;
    padding-left: 24px;
}

.post-content ul {
    list-style-type: disc;
}

.post-content ol {
    list-style-type: decimal;
}

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

.post-content li > ul,
.post-content li > ol {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* Blockquotes - HackMD style */
.post-content blockquote {
    border-left: 4px solid #0070f3;
    padding-left: 20px;
    margin: 1.5em 0;
    color: #555555;
    font-style: italic;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Code - inline */
.post-content code {
    background: #f6f8fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "SF Mono", "Fira Code", "Monaco", "Consolas", monospace;
    font-size: 0.9em;
    color: #e01e5a;
}

/* Code blocks */
.post-content pre {
    background: #f6f8fa;
    border-radius: 8px;
    padding: 16px 20px;
    overflow-x: auto;
    margin: 1.5em 0;
    border: 1px solid #eaeaea;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 14px;
    line-height: 1.6;
}

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

/* Tables - HackMD style */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 15px;
}

.post-content th,
.post-content td {
    border: 1px solid #eaeaea;
    padding: 12px 16px;
    text-align: left;
}

.post-content th {
    background: #f6f8fa;
    font-weight: 600;
}

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

/* Horizontal rule */
.post-content hr {
    border: none;
    border-top: 1px solid #eaeaea;
    margin: 3em 0;
}

/* Followup section */
.followup-section {
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid #eaeaea;
}

.followup-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: #111111;
    margin-bottom: 16px;
}

.followup-list {
    list-style: none;
    padding: 0;
}

.followup-list li {
    margin-bottom: 12px;
}

.followup-list a {
    color: #0070f3;
    text-decoration: none;
    font-size: 16px;
}

.followup-list a:hover {
    text-decoration: underline;
}

/* Fixed reading footer - Kindle style */
.reading-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #eaeaea;
    padding: 12px 24px;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 100;
}

.reading-footer.visible {
    opacity: 1;
    transform: translateY(0);
}

.footer-content {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #666666;
}

.footer-separator {
    color: #cccccc;
}

.current-progress {
    font-weight: 500;
    color: #333333;
}

/* Loading and error states */
.loading {
    text-align: center;
    color: #666666;
    padding: 48px 0;
}

.error {
    text-align: center;
    color: #e01e5a;
    padding: 48px 0;
}

.error a {
    color: #0070f3;
}

/* Blog listing page styles */
.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 48px;
    color: #111111;
}

.post-list {
    list-style: none;
    padding: 0;
}

.post-list li {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eaeaea;
}

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

.post-list a {
    text-decoration: none;
    display: block;
}

.post-list-title {
    font-size: 20px;
    font-weight: 600;
    color: #111111;
    margin-bottom: 8px;
    transition: color 0.2s;
}

.post-list a:hover .post-list-title {
    color: #0070f3;
}

.post-list-meta {
    font-size: 14px;
    color: #666666;
}

.post-list-description {
    margin-top: 8px;
    color: #555555;
    font-size: 15px;
    line-height: 1.5;
}

/* Responsive adjustments */
@media (max-width: 720px) {
    .post-container {
        padding: 40px 20px;
    }

    .post-title {
        font-size: 28px;
    }

    .post-content {
        font-size: 16px;
    }

    .post-content pre {
        padding: 12px 16px;
        border-radius: 0;
        margin-left: -20px;
        margin-right: -20px;
    }
}
