/* Blog Custom Styles */

/* ============ BREADCRUMB / PAGE HEADER FIXES ============ */
/* Ensure title doesn't go behind the header image */
.page-header__inner {
    position: relative;
    z-index: 1;
}

.page-header__inner h3 {
    max-width: 60%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.page-header__img-1 {
    z-index: 0;
}

/* ============ BLOG USER BADGE / AUTHOR NAME ============ */
/* Fix "By Sanaa-Admin" button width on blog listing and details */
.blog-one__user p,
.blog-details__user p {
    white-space: nowrap;
    padding: 8px 16px;
    min-width: fit-content;
}

.blog-one__user {
    min-width: 150px;
}

.blog-details__user {
    min-width: 160px;
    flex-shrink: 0;
}

.blog-details__user-and-meta {
    flex-wrap: wrap;
    gap: 10px;
}

/* ============ TAGS AND SHARE SECTION FIX ============ */
.blog-details__tag-and-share {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.blog-details__tag {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
}

/* Keep "Tags:" label on same line, not wrapping */
.blog-details__tag > span:first-child,
.blog-details__tag > p:first-child,
.blog-details__tag-title {
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0;
    line-height: 32px; /* Match tag button height */
}

.blog-details__tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 8px; /* row-gap column-gap - adds vertical spacing */
    margin: 0;
    padding: 0;
    align-items: center;
}

.blog-details__tag-list li {
    margin: 0 !important;
}

.blog-details__share-box {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============ BLOG IMAGE SIZE NORMALIZATION ============ */
/* Keep blog listing images uniform regardless of uploaded dimensions. */
.blog-page .blog-one__img {
    aspect-ratio: 16 / 10;
}

.blog-page .blog-one__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Keep "Recent Posts" sidebar thumbnails consistent too. */
.sidebar__post-image {
    height: 102px;
    overflow: hidden;
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
}

.sidebar__post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* ============ RICH TEXT CONTENT STYLING ============ */
/* Ensure CKEditor content displays properly on frontend */
.blog-details__content-text {
    line-height: 1.8;
}

.blog-details__content-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 1.5rem 0 1rem;
    color: #1a1a1a;
}

.blog-details__content-text h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 1.4rem 0 0.9rem;
    color: #1a1a1a;
}

.blog-details__content-text h3 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 1.3rem 0 0.8rem;
    color: #1a1a1a;
}

.blog-details__content-text h4 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.2rem 0 0.7rem;
    color: #1a1a1a;
}

.blog-details__content-text h5 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.1rem 0 0.6rem;
    color: #1a1a1a;
}

.blog-details__content-text h6 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    color: #1a1a1a;
}

.blog-details__content-text p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.blog-details__content-text ul,
.blog-details__content-text ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.blog-details__content-text ul {
    list-style-type: disc;
}

.blog-details__content-text ol {
    list-style-type: decimal;
}

.blog-details__content-text ul ul {
    list-style-type: circle;
}

.blog-details__content-text ul ul ul {
    list-style-type: square;
}

.blog-details__content-text li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.blog-details__content-text blockquote {
    border-left: 4px solid #f5a623;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: #f8f9fa;
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

.blog-details__content-text blockquote p {
    margin-bottom: 0;
}

.blog-details__content-text code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

.blog-details__content-text pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.blog-details__content-text pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.blog-details__content-text a {
    color: #0066cc;
    text-decoration: underline;
}

.blog-details__content-text a:hover {
    color: #004499;
}

.blog-details__content-text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.blog-details__content-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.blog-details__content-text th,
.blog-details__content-text td {
    border: 1px solid #dee2e6;
    padding: 12px;
    text-align: left;
}

.blog-details__content-text th {
    background: #f8f9fa;
    font-weight: 600;
}

.blog-details__content-text tr:nth-child(even) {
    background: #f8f9fa;
}

.blog-details__content-text strong,
.blog-details__content-text b {
    font-weight: 700;
}

.blog-details__content-text em,
.blog-details__content-text i {
    font-style: italic;
}

.blog-details__content-text u {
    text-decoration: underline;
}

.blog-details__content-text s,
.blog-details__content-text strike {
    text-decoration: line-through;
}

/* ============ COMMENT FORM STYLING ============ */
.comment-form {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid #e9ecef;
}

.comment-form__title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.comment-form__text {
    color: #6c757d;
    margin-bottom: 30px;
}

.comment-form__input-box {
    margin-bottom: 20px;
}

.comment-form__input-box input,
.comment-form__input-box textarea {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.comment-form__input-box input:focus,
.comment-form__input-box textarea:focus {
    outline: none;
    border-color: #f5a623;
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

.comment-form__input-box textarea {
    min-height: 150px;
    resize: vertical;
}

.comment-form__btn-box {
    margin-top: 10px;
}

.comment-form__btn {
    padding: 14px 35px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
}

.comment-form__message {
    margin-top: 15px;
    padding: 12px 20px;
    border-radius: 8px;
}

.comment-form__message--success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.comment-form__message--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Comment display styling */
.comment-one {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

.comment-one__single {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #f0f0f0;
}

.comment-one__single:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.comment-one__image {
    flex-shrink: 0;
}

.comment-one__image img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-one__content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.comment-one__content span {
    color: #6c757d;
    font-size: 14px;
    display: block;
    margin-bottom: 10px;
}

.comment-one__content p {
    color: #555;
    line-height: 1.7;
}

/* ============ RESPONSIVE FIXES ============ */
@media (max-width: 991px) {
    .page-header__inner h3 {
        max-width: 100%;
        font-size: 1.8rem;
    }
    
    .page-header__img-1 {
        display: none;
    }
    
    .blog-details__tag-and-share {
        flex-direction: column;
    }
    
    .blog-details__tag {
        width: 100%;
    }

    .blog-page .blog-one__img {
        aspect-ratio: 4 / 3;
    }
}

@media (max-width: 767px) {
    .comment-one__single {
        flex-direction: column;
        gap: 15px;
    }
    
    .blog-details__user-and-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}
