/* Blog post image styling */
/* In snippets/previews: small thumbnail with float */
.snippet img,
.card-body img {
    max-width: 120px !important;
    max-height: 120px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    float: left !important;
    margin: 0 1rem 0.5rem 0 !important;
}

/* Prevent text from wrapping under floated images in snippets */
.snippet p,
.card-body p {
    overflow: hidden;
}

/* In full blog post: full-size responsive images */
.blog-content img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    margin: 1rem 0 !important;
    float: none !important;
    object-fit: contain !important;
}

/* Ensure paragraphs containing images don't restrict width */
.blog-content p:has(img) {
    max-width: 100%;
}

/* For featured images that are floated */
.hs-featured-image-wrapper {
    max-width: 120px !important;
    max-height: 120px !important;
    overflow: hidden !important;
    float: left !important;
    margin: 0 1rem 0.5rem 0 !important;
}

.hs-featured-image-wrapper img,
.hs-featured-image-wrapper a img {
    max-width: 120px !important;
    max-height: 120px !important;
    width: auto !important;
    height: auto !important;
    object-fit: cover !important;
    float: none !important;
    margin: 0 !important;
}

/* Blog post content styling */
.blog-content {
    line-height: 1.6;
    margin: 1.5rem 0;
}

.blog-content p {
    margin-bottom: 1rem;
}

/* Version notice styling */
.version-notice {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.version-notice strong {
    color: #856404;
}

/* Category badges */
.categories {
    margin-top: 1rem;
}

.categories .badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: #e9ecef;
    border-radius: 3px;
    font-size: 0.875rem;
}

/* Blog footer */
.blog-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

/* Version comparison */
.version-compare {
    margin: 2rem 0;
}

.version-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.version-box {
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
}

.version-box.older {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.version-box.newer {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.version-box h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.version-box time {
    font-size: 0.875rem;
    color: #666;
}

/* Diff sections */
.diff-section {
    margin-bottom: 2rem;
}

.diff-section h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dee2e6;
}

.diff-content {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

/* Word-level diff styling */
.diff-content .diff-text {
    line-height: 1.8;
    white-space: pre-wrap;
    font-family: inherit;
}

.diff-content del {
    background-color: #ffc0c0;
    text-decoration: line-through;
}

.diff-content ins {
    background-color: #a0f0a0;
    text-decoration: none;
}

.diff-legend {
    display: flex;
    gap: 2rem;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 0.875rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 1.5rem;
    height: 1rem;
    border-radius: 2px;
}

.legend-color.removed {
    background-color: #ffc0c0;
}

.legend-color.added {
    background-color: #a0f0a0;
}
