/*This is the site.*/

/* Override base font size */
html, body {
    font-size: 16px;
}

@media (min-width: 992px) {
    html, body {
        font-size: 16px;
    }
}

#search {
    margin-bottom: 30px;
    margin-top: 10px;
}

h1 {
    margin-top: 10px;
}

.content {
    padding-top: 1rem;
    /*background: yellow;*/
}

/* Wider, centered content for non-mobile views */
@media (min-width: 768px) {
    .content {
        /* 80% of the content area (viewport minus sidebar) */
        width: calc((100vw - 16rem) * 0.8);
        max-width: none;
        /* Center by setting equal margins: 10% of remaining space on each side */
        margin-left: calc(16rem + ((100vw - 16rem) * 0.1));
        margin-right: calc((100vw - 16rem) * 0.1);
    }
}

/* Post meta (date, tags, reading time) on single line */
.post__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.post__meta br {
    display: none;
}

.post-list__item.home {
    .item__title--big {
        font-size: 1.5em;
    }
}


.social {
    font-size: .7em;
}

.social-img {
    display: inline-block;
    font-size: inherit;
    height: 1.1em;
    vertical-align: -0.15em;
    overflow: visible;
    vertical-align: -1.4em;
}

/* Fix for posts list date wrapping */
.posts {
    list-style: none;
    padding: 0;
}

.posts li {
    display: block;
    margin-bottom: 0.75rem;
    clear: both;
}

.posts .list__title--small {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: baseline;
    width: 100%;
}

.posts .list__title--small a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0; /* Important for grid items */
}

.posts .list__title--small time {
    white-space: nowrap;
    grid-column: 2;
}

/* Override the pull-right styles in this context */
.posts .list__title--small .pull-right {
    float: none;
    position: static;
    margin-left: 0;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .posts .list__title--small {
        grid-template-columns: 1fr auto;
        gap: 0.5rem;
    }
    
    .posts .list__title--small a {
        white-space: normal; /* Allow wrapping on mobile */
    }
    
    .posts .list__title--small time {
        font-size: 0.9em;
    }
}

/* ============================================
   CODE BLOCK IMPROVEMENTS - Prism.js Styling
   ============================================ */

/* Hide Chroma/Hugo styled code blocks initially to prevent flash */
div.highlight {
    opacity: 0;
    transition: opacity 0.1s;
}

/* Show Prism.js styled code blocks */
pre[class*="language-"] {
    opacity: 1;
}

/* Base code block styling */
pre[class*="language-"] {
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    overflow: auto;
    line-height: 1.5;
    font-size: 0.9rem;
    border: 1px solid #e1e4e8;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Code within pre blocks */
pre[class*="language-"] code {
    padding: 0;
    background: transparent;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
    line-height: inherit;
    display: block;
}

/* Inline code */
code:not([class*="language-"]) {
    padding: 0.2em 0.4em;
    font-size: 0.9em;
    background-color: #f6f8fa;
    border-radius: 4px;
    color: #24292f;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    border: 1px solid #e1e4e8;
}

/* Line numbers styling */
.line-numbers .line-numbers-rows {
    border-right: 1px solid #d1d5da;
    padding-right: 0.8rem;
    margin-right: 1rem;
}

.line-numbers-rows > span:before {
    color: #6e7681;
}

/* Better scrollbar for code blocks */
pre[class*="language-"]::-webkit-scrollbar {
    height: 8px;
}

pre[class*="language-"]::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

pre[class*="language-"]::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

pre[class*="language-"]::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Ensure proper spacing around code blocks in content */
.content pre[class*="language-"] {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Mobile responsiveness for code blocks */
@media (max-width: 768px) {
    pre[class*="language-"] {
        padding: 1rem;
        font-size: 0.85rem;
        margin: 1rem -0.5rem;
        border-radius: 0;
    }
}
