@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Inter:wght@400;600;700&family=DM+Sans:wght@400;500;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&family=Noe+Display:wght@400;500;600;700&display=swap');

/* Code block styling */
pre {
    font-size: 0.9em !important;
    border-radius: 8px !important;
    background-color: #a681d126 !important;
    border: 1px solid rgba(151, 199, 207, 0.3) !important;
    padding: 1.2em !important;
    margin: 1.5em 0 0.5em 0 !important;
    overflow-x: auto !important;
    backdrop-filter: blur(8px) !important;
}

figure {
    margin: 1.5em 0 !important;
}

figcaption {
    font-family: var(--font-sans) !important;
    font-size: 0.9em !important;
    color: var(--text-light) !important;
    font-style: normal !important;
    text-align: left !important;
    margin-top: 0.5em !important;
    display: block !important;
    width: 100% !important;
}

/* Ensure figcaptions are always left-aligned, overriding any inline styles */
figure figcaption {
    text-align: left !important;
}

code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace !important;
    font-size: 0.7em !important;
    line-height: 1 !important;
    color: #181616 !important;
}

pre code {
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border: none !important;
}

:root {
    --accent-color: #2563EB;
    --accent-hover: #1D4ED8;
    --text-color: #1F2937;
    --text-light: #4B5563;
    --background: #F8FAFC;
    --border-color: #E2E8F0;
    --gradient-start: #2563EB;
    --gradient-end: #3B82F6;
    --content-width: 550px;
    --content-margin: 6rem;
    --font-sans: 'Plus Jakarta Sans', 'Outfit', 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --font-primary: 'Merriweather', 'Georgia', 'Times New Roman', serif;
    --font-display: 'Noe Display', 'Merriweather', 'Georgia', 'Times New Roman', serif;
    --left-margin: 40px;
}

body {
    font-family: var(--font-primary);
    background: var(--background);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 680px;
    margin: 0 auto 0 var(--left-margin);
    padding: 0 20px 0 0;
    flex: 1;
}

.navbar {
    background: var(--background);
    padding: 16px 0;
    border-bottom: none;
    margin-bottom: 20px;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 0;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    font-family: var(--font-sans);
}

.logo:hover {
    color: var(--accent-color);
    text-decoration: none;
}

.nav-links a {
    margin-left: 24px;
    color: var(--text-color);
    text-decoration: none;
    font-family: var(--font-sans);
}

.nav-links a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

h1,
h2,
h3 {
    color: #222222;
    font-weight: 700;
    line-height: 1.1;
}

h1 {
    font-size: 40px;
    margin-bottom: 16px;
    font-family: var(--font-display);
}

h2 {
    font-size: 32px;
    margin-bottom: 12.8px;
    font-family: var(--font-display);
}

h3 {
    font-size: 24px;
    margin-bottom: 9.6px;
    font-family: var(--font-display);
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Touch-friendly tap targets for mobile - only for navigation and buttons */
@media (hover: none) and (pointer: coarse) {
    .nav-links a {
        min-height: 44px;
        padding: 12px 8px;
        display: inline-flex;
        align-items: center;
    }

    .social-link {
        min-height: 44px;
        min-width: 44px;
        padding: 8px;
    }

    button {
        min-height: 44px;
        min-width: 44px;
        padding: 8px;
    }
}

.blog-list {
    margin-top: 32px;
}

.hero-heading {
    font-family: var(--font-sans);
    font-size: 44px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 32px;
    color: var(--text-color);
}

.site-footer {
    margin-top: auto;
    padding: 2rem 0;
    color: var(--text-light);
    font-family: var(--font-sans);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left,
.footer-right {
    font-size: 0.7em;
}

.site-footer a {
    color: var(--accent-color);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Mobile Optimization - Responsive Design */
@media (max-width: 768px) {
    :root {
        --left-margin: 20px;
        --content-margin: 2rem;
    }

    body {
        font-size: 14px;
        line-height: 1.5;
    }

    .container {
        max-width: 100%;
        margin: 0 auto;
        padding: 0 16px;
    }

    /* Typography adjustments for mobile - smaller sizes */
    h1 {
        font-size: 20px;
        line-height: 1.1;
        margin-bottom: 12px;
    }

    h2 {
        font-size: 18px;
        line-height: 1.1;
        margin-bottom: 10px;
    }

    h3 {
        font-size: 16px;
        line-height: 1.1;
        margin-bottom: 8px;
    }

    .hero-heading {
        font-size: 20px;
        line-height: 1.3;
        margin-bottom: 20px;
    }

    /* Navigation responsive */
    .navbar {
        padding: 12px 0;
        margin-bottom: 12px;
    }

    .nav-content {
        flex-wrap: wrap;
        gap: 10px;
    }

    .logo {
        font-size: 18px;
    }

    .nav-links {
        display: flex;
        gap: 14px;
    }

    .nav-links a {
        margin-left: 0;
        font-size: 13px;
    }

    /* Code blocks responsive */
    pre {
        font-size: 0.8em !important;
        padding: 0.9em !important;
        margin: 1em 0 !important;
    }

    code {
        font-size: 0.8em !important;
    }

    /* Figures and images - make them bigger */
    figure {
        margin: 1.2em 0 !important;
        width: 100%;
    }

    /* Make all images full width on mobile */
    figure img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    /* Make formula images larger on mobile */
    figure img[style*="max-width: 70%"],
    figure img[style*="max-width: 60%"] {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Override main figure images for mobile - change 80% to 100% */
    figure img[style*="max-width: 80%"] {
        max-width: 100% !important;
        width: 100% !important;
    }

    figcaption {
        font-size: 0.9em !important;
        padding: 0 4px;
    }

    /* Footer responsive */
    .site-footer {
        padding: 1.5rem 0;
    }

    .footer-content {
        justify-content: center;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    :root {
        --left-margin: 14px;
    }

    body {
        font-size: 13px;
        line-height: 1.5;
    }

    .container {
        padding: 0 14px;
    }

    h1 {
        font-size: 18px;
        line-height: 1.1;
    }

    h2 {
        font-size: 16px;
        line-height: 1.1;
    }

    h3 {
        font-size: 15px;
        line-height: 1.1;
    }

    .hero-heading {
        font-size: 18px;
        margin-bottom: 18px;
    }

    /* Make all images full width on small mobile */
    figure img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    /* Make formula images even larger on small mobile */
    figure img[style*="max-width: 70%"],
    figure img[style*="max-width: 60%"] {
        max-width: 100% !important;
        width: 100% !important;
    }

    .logo {
        font-size: 17px;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-links a {
        font-size: 12px;
    }

    pre {
        font-size: 0.75em !important;
        padding: 0.8em !important;
    }

    figcaption {
        font-size: 0.9em !important;
    }
}