/* Blog details — article content & page chrome */
.blog-details-page {
    direction: rtl;
    text-align: right;
}

.single-post-article {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(3, 15, 39, 0.08);
    overflow: hidden;
    margin-bottom: 2rem;
}

.single-post-hero {
    margin: 0;
    overflow: hidden;
    background: #f3f6ff;
}

.single-post-hero img {
    display: block;
    width: 100%;
    max-height: 480px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.single-post-header {
    padding: 1.75rem 2rem 0;
}

.single-post-title {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 800;
    line-height: 1.45;
    color: #030f27;
    margin: 0 0 1rem;
}

.single-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #eef1f6;
    margin-bottom: 0.25rem;
}

.single-post-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.single-post-meta .meta-item i {
    color: #fdbe33;
    font-size: 0.95rem;
}

/* Rich article body */
.blog-detail-text {
    padding: 1.5rem 2rem 2.25rem;
    font-size: 1.0625rem;
    line-height: 1.95;
    color: #374151;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.blog-detail-text > *:first-child {
    margin-top: 0;
}

.blog-detail-text > *:last-child {
    margin-bottom: 0;
}

.blog-detail-text p {
    margin: 0 0 1.25rem;
}

.blog-detail-text h2,
.blog-detail-text h3,
.blog-detail-text h4,
.blog-detail-text h5,
.blog-detail-text h6 {
    color: #030f27;
    font-weight: 700;
    line-height: 1.4;
    margin: 2rem 0 1rem;
}

.blog-detail-text h2 {
    font-size: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #fdbe33;
}

.blog-detail-text h3 {
    font-size: 1.3rem;
}

.blog-detail-text h4 {
    font-size: 1.15rem;
}

.blog-detail-text a {
    color: #030f27;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.blog-detail-text a:hover {
    color: #c9941a;
}

.blog-detail-text strong,
.blog-detail-text b {
    color: #030f27;
    font-weight: 700;
}

.blog-detail-text ul,
.blog-detail-text ol {
    margin: 0 0 1.25rem;
    padding-right: 1.5rem;
    padding-left: 0;
}

.blog-detail-text li {
    margin-bottom: 0.5rem;
}

.blog-detail-text li::marker {
    color: #fdbe33;
}

.blog-detail-text blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-right: 4px solid #fdbe33;
    border-left: none;
    background: linear-gradient(90deg, #f8fafc 0%, #fff 100%);
    border-radius: 0 8px 8px 0;
    color: #1f2937;
    font-style: italic;
}

.blog-detail-text blockquote p:last-child {
    margin-bottom: 0;
}

.blog-detail-text img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(3, 15, 39, 0.1);
}

.blog-detail-text figure {
    margin: 1.5rem 0;
    text-align: center;
}

.blog-detail-text figcaption {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.blog-detail-text table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    font-size: 0.95rem;
    overflow-x: auto;
    display: block;
}

.blog-detail-text th,
.blog-detail-text td {
    border: 1px solid #e5e7eb;
    padding: 0.65rem 0.85rem;
    text-align: right;
}

.blog-detail-text th {
    background: #030f27;
    color: #fff;
    font-weight: 600;
}

.blog-detail-text tr:nth-child(even) td {
    background: #f9fafb;
}

.blog-detail-text hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d1d5db, transparent);
    margin: 2rem 0;
}

.blog-detail-text pre,
.blog-detail-text code {
    font-family: Consolas, Monaco, 'Courier New', monospace;
    direction: ltr;
    text-align: left;
}

.blog-detail-text code {
    background: #f3f4f6;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: #b45309;
}

.blog-detail-text pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.25rem 0;
}

.blog-detail-text pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.blog-detail-text iframe,
.blog-detail-text video {
    max-width: 100%;
    border-radius: 8px;
    margin: 1.25rem 0;
}

/* Tags */
.blog-details-page .single-tags {
    margin: 0 0 2rem;
}

.blog-details-page .single-tags a {
    border-radius: 999px;
    transition: all 0.2s ease;
}

/* Author box RTL */
.blog-details-page .single-bio {
    border-radius: 12px;
}

.blog-details-page .single-bio-text {
    padding-right: 1.5rem;
    padding-left: 0;
}

/* Comments & form */
.blog-details-page .single-comment h2,
.blog-details-page .comment-form h2,
.blog-details-page .single-related h2 {
    text-align: right;
}

.blog-details-page .comment-form label {
    font-weight: 600;
    color: #030f27;
    margin-bottom: 0.35rem;
}

.blog-details-page .comment-form .form-control {
    border-radius: 8px;
    border-color: #e5e7eb;
    text-align: right;
}

.blog-details-page .comment-form .form-control:focus {
    border-color: #fdbe33;
    box-shadow: 0 0 0 0.2rem rgba(253, 190, 51, 0.2);
}

.blog-details-page .comment-text p {
    text-align: right;
}

.blog-details-page .reply-btn {
    font-size: 0.875rem;
}

/* Sidebar RTL */
.blog-details-page .sidebar .widget-title,
.blog-details-page .sidebar .post-text,
.blog-details-page .sidebar .text-widget p,
.blog-details-page .sidebar .category-list {
    text-align: right;
}

.blog-details-page .sidebar .category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-details-page .sidebar .category-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.blog-details-page .post-item .post-text {
    padding-right: 15px;
    padding-left: 0;
}

.blog-details-page .post-meta p a {
    color: #030f27 !important;
    font-size: inherit !important;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
}

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

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.alert p {
    margin: 0;
}

#reply-to {
    display: none;
    margin-bottom: 20px;
    padding: 10px 15px;
    background: #edf2ff;
    border-radius: 8px;
    color: #4a6bff;
}

#replying-to-name {
    font-weight: 600;
}

#cancel-reply {
    margin-right: 10px;
    color: #4a6bff;
    text-decoration: none;
    font-weight: 500;
}

#cancel-reply:hover {
    text-decoration: underline;
}

@media (max-width: 767.98px) {
    .single-post-header,
    .blog-detail-text {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .blog-detail-text {
        font-size: 1rem;
        line-height: 1.85;
    }

    .single-post-meta {
        gap: 0.5rem 1rem;
    }
}
