/* css styles */

/* Mobile-first responsive layout */
html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

h1, h2, h3, h4, h5, h6 {
    text-transform: none;
}

.post-title {
    text-transform: none;
}

/* Ensure content doesn't overflow on mobile */
.quarto-container {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Responsive content padding */
#quarto-content {
    padding-left: 1rem;
    padding-right: 1rem;
    max-width: 100%;
    box-sizing: border-box;
}

@media (min-width: 576px) {
    #quarto-content {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 768px) {
    #quarto-content {
        padding-left: 3rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1024px) {
    #quarto-content {
        padding-left: 5rem;
        padding-right: 4rem;
    }
}

@media (min-width: 1280px) {
    #quarto-content {
        padding-left: 7.5rem;
        padding-right: 5rem;
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Fix listing grid on mobile */
.quarto-listing {
    max-width: 100%;
}

.quarto-post {
    max-width: 100%;
    overflow: hidden;
}

/* Responsive images */
.quarto-post img,
.thumbnail img {
    max-width: 100%;
    height: auto;
}

/* Add spacing between post title and categories in feed */
.quarto-post .listing-title {
    margin-bottom: 0.5rem;
}

.quarto-post .listing-categories {
    margin-top: 0.5rem;
}

/* Smaller font sizes in the feed listing */
.quarto-post .listing-title {
    font-size: 1.1rem;
}

.quarto-post .listing-description {
    font-size: 0.85rem;
}

.quarto-post .listing-categories {
    font-size: 0.7rem;
}

.quarto-post .listing-reading-time,
.quarto-post .listing-date {
    font-size: 0.75rem;
}

/* Add padding under preview images to ensure whitespace before dividers */
.quarto-post .thumbnail img,
.quarto-post .listing-item-img-placeholder {
    margin-bottom: 0.75rem;
}

/* Ensure consistent spacing at bottom of each post card */
.quarto-post {
    padding-bottom: 0.5rem;
}

/* Add spacing between post title and description on blog post pages */
#title-block-header .title {
    margin-bottom: 0.75rem;
}

#title-block-header .description {
    margin-top: 0.5rem;
}

/* === Horizontal scrolling for long content on mobile === */
@media (max-width: 767px) {
    /* Math equations */
    mjx-container[jax="CHTML"][display="true"],
    .MathJax_Display,
    .katex-display {
        overflow-x: auto;
        overflow-y: hidden;
        max-width: 100%;
        padding: 0.25rem 0;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Blockquotes (proofs) */
    blockquote {
        overflow-x: auto;
        max-width: 100%;
    }
    
    /* Images and GIFs in post content - scale to fit */
    #quarto-content img {
        max-width: 100%;
        height: auto;
    }
    
    /* Code cell outputs - scrollable container for plots/GIFs */
    .cell-output-display {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    
    /* Folium/Leaflet maps - taller on mobile for usability */
    .cell-output-display iframe[srcdoc] {
        min-height: 450px !important;
    }
}

/* Reusable scroll wrapper for any content */
.scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}
