/* Blog Preview and Display Styles - Shared between admin and public views */
.blog-content {
    line-height: 1.6;
}

.blog-content-body {
    font-size: 1.1rem;
    overflow-x: hidden;
    word-wrap: break-word;
}

.blog-content-body h1,
.blog-content-body h2,
.blog-content-body h3,
.blog-content-body h4,
.blog-content-body h5,
.blog-content-body h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

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

.blog-content-body img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 0.5rem;
}

.blog-content-body blockquote {
    border-left: 4px solid #007bff;
    padding-left: 1rem;
    margin: 2rem 0;
    font-style: italic;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.25rem;
}

.blog-content-body pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #dee2e6;
    overflow-x: auto;
}

.blog-content-body code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

.blog-content-body ul,
.blog-content-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.blog-content-body li {
    margin-bottom: 0.5rem;
}

/* Handle Bootstrap rows within blog content - fixes overflow issues */
.blog-content-body .row {
    margin-left: -15px;
    margin-right: -15px;
    max-width: calc(100% + 30px);
}

.blog-content-body .row > [class*="col-"] {
    padding-left: 15px;
    padding-right: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive behavior for mobile */
@media (max-width: 991.98px) {
    .blog-content-body .col-lg-4,
    .blog-content-body .col-lg-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
}

/* Handle image cropping containers */
.blog-content-body .image-crop {
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.blog-content-body .image-crop img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Blog Listing Page - Card Layout Consistency */
.blog-listing-row {
    display: flex;
    flex-wrap: wrap;
}

.blog-listing-row .col-lg-4 {
    display: flex;
    flex-direction: column;
}

.blog-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card > a {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-decoration: none;
}

.blog-card-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
}

.blog-card-image-container::before {
    content: '';
    display: block;
    padding-top: 60%; /* 5:3 aspect ratio */
}

.blog-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.blog-card-title {
    flex-grow: 1;
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.blog-card-title p {
    margin: 0;
    line-height: 1.3;
    /* Limit title to 3 lines for consistency */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
}

.blog-card-meta {
    margin-top: auto;
}
