a{
    text-decoration:none;
}

.blog-s1 {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    margin:20px;
    display:flex;
    flex-wrap:wrap;
}

.blog-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 20px;
    border: 2px solid var(--secondary-color);
    box-shadow: 0 8px 17px rgba(0, 0, 0, 0.15);
}

.blog-item {
    background: var(--accent-color);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
    transition: 0.3s;
    margin-bottom: 15px;
}

.blog-item:hover {
    transform: translateY(-5px);
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.15);
}

.blog-item p{
    margin-bottom: 10px;
}

.blog-title {
    text-decoration:none;
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 15px;
}

.blog-title-2{
    margin-bottom: 15px;
}

.blog-meta {
    color: var(--secondary-color);
    font-weight: bold;
    margin-bottom: 6px;
}


.blogpost-container{
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 20px;
    border: 2px solid var(--secondary-color);
    box-shadow: 0 8px 17px rgba(0, 0, 0, 0.15);
}

.blog-content {
    font-size: 1.1rem;
    background: var(--accent-color);
    padding: 20px;
    margin-top: 10px;
    border-radius: 30px;
}

.blog-body {
    padding: 20px 0;
    font-size: 1.1rem;
    text-align: justify;
    overflow-x: hidden;
}
.blog-body h1 { font-size: 1.8rem; margin-top: 1.5rem; }
.blog-body h2 { font-size: 1.6rem; margin-top: 1.4rem; }
.blog-body p { margin-bottom: 1.2em; }

/* Meta Info and Title inside blog-content */
.blog-content h1.mt-0 {
    font-size: 2rem;
    margin-bottom: 5px;
}

/* 1. Global Reset for Embedded Content */
.blog-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: auto;
    border-radius: 8px;
}

/* 3. Table Responsiveness */
.blog-body table {
    width: 100% !important;
    max-width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    overflow-x: auto;
    display: block;
}
.blog-body table td, .blog-body table th {
    padding: 10px;
    border: 1px solid #ddd;
}

/* 4. Code Blocks & Pre-formatted Text */
.blog-body pre {
    background: #f4f4f4;
    padding: 15px;
    border-left: 4px solid var(--primary-color);
    overflow-x: auto;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* 5. Blockquotes */
.blog-body blockquote {
    margin: 20px 0;
    padding: 10px 20px;
    border-left: 5px solid var(--secondary-color);
    background: #f9f9f9;
    font-style: italic;
    color: #666;
}

.blog-body .image-style-align-left,
.blog-body .align-left {
    float: left;
    margin-right: 1.5em; /* Space between image and text */
    margin-bottom: 1em;
    max-width: 40%; /* Control image width when floating */
    min-width: 200px;
}

.blog-body .image-style-align-right,
.blog-body .align-right {
    float: right;
    margin-left: 1.5em; /* Space between text and image */
    margin-bottom: 1em;
    max-width: 40%; /* Control image width when floating */
    min-width: 200px;
}

/* Fix 2: Full-width Image Style (often used by CKEditor) */
.blog-body .image-style-full {
    float: none !important;
    width: 100% !important;
    margin-left: 0;
    margin-right: 0;
}

/* Fix 3: Center Image Style */
.blog-body .image-style-center {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
}

/* Ensure subsequent content clears the float */
.blog-body::after {
    content: "";
    display: table;
    clear: both;
}

.blog-btn {
    text-decoration: none;
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
    width: fit-content;
}

.blog-btn:hover {
    background: var(--secondary-color);
}

.blog-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: #5a6268;
    color: #fff;
}

.blog-btn.disabled{
    opacity: 0.6;
    cursor: not-allowed;
    border-color: #5a6268;
    color: #fff;
}

.blog-btn a{
    color: white;
}

.cblog-btn{
    margin: 0px;
}

.sub-btn {
    background-color: #cc0000;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
}

.sub-btn.subscribed {
    background-color: #f2f2f2;
    color: #333;
    border: 1px solid #ccc;
}

.sub-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.author-info-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.cmore{
    display: flex;
    gap: 30px;
    align-items: center;
    margin-top: 11px;
}

.blog-comment{
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-color);
    text-align: justify;
    padding: 20px;
    margin-top: 30px;
}

.blog-comment h1 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
}

.comment-list{
    max-width: 76%;
}

.comment{
    border-bottom: 2px dashed gray;
}

.ccomment{
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.new_comment{
    flex-grow: 1; /* Allows textarea to take maximum width */
    min-height: 80px;
    font-family: inherit;
    font-size: 1rem; /* Reduced size for better fit */
    font-weight: 350;
    border: none;
    border-bottom: 2px solid var(--primary-color);
    resize: vertical; /* Allow resizing vertically */
    padding: 5px 0;
}

@media only screen and (max-width: 833px){
    .comment-list{max-width: none;}
}

@media only screen and (max-width: 768px) {
    .blog-container {
        padding: 15px;
        margin: 10px;
        border-radius: 10px;
    }

    .blog-title {
        font-size: 1.8rem;
    }

    .blog-content {
        font-size: 1rem;
    }

    .new_comment {
        width: 100%; /* Full width on mobile */
        font-size: 1.1rem;
    }
}

@media only screen and (max-width: 600px) {
    .blog-body .align-left,
    .blog-body .align-right,
    .blog-body .image-style-align-left,
    .blog-body .image-style-align-right {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        display: block;
    }
}
