/*
 * Single CSS for Journal24 Custom Theme
 */

/* Layout Structure */
.j24-single-layout {
    display: grid;
    grid-template-columns: minmax(0, 68fr) minmax(0, 32fr);
    gap: 30px;
    align-items: start;
}

.j24-single-content,
.j24-single-sidebar {
    min-width: 0;
}

.journal-single-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}

.journal-article-header {
    margin-bottom: 30px;
    text-align: center;
}

.journal-breadcrumbs {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 15px;
}

.journal-breadcrumbs a {
    color: #555;
}

.journal-breadcrumbs .sep {
    margin: 0 5px;
}

.journal-article-cat {
    margin-bottom: 15px;
}

.journal-article-cat a {
    display: inline-block;
    background: var(--journal-primary, #e60000);
    color: #fff;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.journal-article-title {
    font-size: 2.5rem;
    line-height: 1.4;
    margin-bottom: 20px;
}

.journal-article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    color: #777;
}

.journal-meta-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.journal-meta-author img {
    border-radius: 50%;
}

.journal-single-content-wrap {
    display: flex;
    gap: 40px;
}

.journal-single-main {
    flex: 1;
}

.j24-article-featured-image,
.j24-featured-img-wrap,
.j24-article-featured-image img {
    box-shadow: none !important;
}

/* Image Captions (التسمية التوضيحية للصور - بدون شادو وبشكل أنيق متوافق مع العربية والفرنسية) */
.j24-image-caption,
.j24-article-body figcaption,
.j24-article-body .wp-caption-text,
.wp-block-image figcaption,
figure figcaption {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 10px !important;
    padding: 8px 14px !important;
    background-color: var(--j24-light, #f8f9fa) !important;
    border-radius: var(--j24-radius-sm, 6px) !important;
    border: 1px solid var(--j24-border, #e9ecef) !important;
    border-inline-start: 3px solid var(--j24-primary, #c0392b) !important;
    color: var(--j24-gray, #555555) !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
    box-shadow: none !important;
    text-align: start !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* التوافق التام مع العربية RTL (الحد الملون على اليمين) */
body.rtl .j24-image-caption,
body.rtl figcaption,
body.rtl .wp-caption-text,
[dir="rtl"] .j24-image-caption,
[dir="rtl"] figcaption,
[dir="rtl"] .wp-caption-text {
    border-left: 1px solid var(--j24-border, #e9ecef) !important;
    border-right: 3px solid var(--j24-primary, #c0392b) !important;
    text-align: right !important;
}

/* التوافق التام مع الفرنسية LTR (الحد الملون على اليسار) */
body:not(.rtl) .j24-image-caption,
body:not(.rtl) figcaption,
body:not(.rtl) .wp-caption-text,
[dir="ltr"] .j24-image-caption,
[dir="ltr"] figcaption,
[dir="ltr"] .wp-caption-text {
    border-right: 1px solid var(--j24-border, #e9ecef) !important;
    border-left: 3px solid var(--j24-primary, #c0392b) !important;
    text-align: left !important;
}

.j24-image-caption svg,
figcaption svg,
.wp-caption-text svg {
    color: var(--j24-primary, #c0392b) !important;
    flex-shrink: 0 !important;
}

.journal-entry-content {
    font-size: 1.15rem;
    line-height: 1.8;
}

.journal-entry-content h2, .journal-entry-content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.journal-entry-content p {
    margin-bottom: 1.5em;
}

/* Share Buttons */
.journal-article-share {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin: 30px 0;
}

.journal-share-label {
    font-weight: bold;
    margin-left: 10px;
}

.journal-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: #fff;
    transition: transform 0.2s;
}

.journal-share-btn:hover {
    transform: translateY(-2px);
    color: #fff;
}

.journal-share-fb { background: #1877f2; }
.journal-share-tw { background: #000000; }
.journal-share-wa { background: #25d366; }

/* Related Posts */
.journal-related-posts {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.journal-related-title {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.journal-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.journal-related-item-title {
    font-size: 1.1rem;
    margin-top: 10px;
}

.journal-related-img-wrap img, .journal-related-img-wrap .journal-img-placeholder {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

/* ==========================================================================
   Sticky Social Share (Desktop Side & Mobile Floating Bar)
   ========================================================================== */

.j24-article-content-layout {
    display: flex;
    gap: 25px;
    align-items: flex-start;
    position: relative;
    margin-top: 25px;
}

.j24-article-main-column {
    flex: 1;
    min-width: 0;
}

/* Desktop Sticky Share Side Column */
.j24-sticky-share-side {
    position: -webkit-sticky;
    position: sticky;
    top: 190px;
    align-self: flex-start;
    z-index: 50;
    width: 48px;
    flex-shrink: 0;
}

.admin-bar .j24-sticky-share-side {
    top: 222px;
}

.j24-sticky-share-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    background: #ffffff;
    padding: 12px 5px;
    border-radius: 30px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    border: 1px solid #edf0f2;
}

.j24-sticky-share-lbl {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--j24-gray, #777);
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 2px;
}

.j24-share-icon {
    display: inline-flex;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    text-decoration: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.j24-share-icon:hover {
    transform: scale(1.12);
    color: #ffffff !important;
}

.j24-share-fb {
    background: #1877F2;
    box-shadow: 0 3px 10px rgba(24, 119, 242, 0.25);
}
.j24-share-fb:hover {
    background: #0d65d9;
    box-shadow: 0 5px 14px rgba(24, 119, 242, 0.4);
}

.j24-share-tw {
    background: #000000;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}
.j24-share-tw:hover {
    background: #1a1a1a;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.4);
}

.j24-share-wa {
    background: #25D366;
    box-shadow: 0 3px 10px rgba(37, 211, 102, 0.25);
}
.j24-share-wa:hover {
    background: #1ebe5d;
    box-shadow: 0 5px 14px rgba(37, 211, 102, 0.4);
}

.j24-share-copy {
    background: #495057;
    box-shadow: 0 3px 10px rgba(73, 80, 87, 0.25);
}
.j24-share-copy:hover {
    background: #212529;
    box-shadow: 0 5px 14px rgba(33, 37, 41, 0.4);
}

/* Copy Tooltip */
.j24-copy-tooltip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #198754;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 999;
}

[dir="rtl"] .j24-sticky-share-side .j24-copy-tooltip,
body.rtl .j24-sticky-share-side .j24-copy-tooltip {
    left: 100%;
    margin-left: 8px;
}

[dir="ltr"] .j24-sticky-share-side .j24-copy-tooltip,
body:not(.rtl) .j24-sticky-share-side .j24-copy-tooltip {
    right: 100%;
    margin-right: 8px;
}

.j24-copy-tooltip.is-active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Floating Share Bar */
.j24-sticky-share-mobile {
    display: none;
}

@media (max-width: 768px) {
    .j24-single-layout {
        grid-template-columns: 1fr !important;
    }
    .j24-article-content-layout {
        display: block;
    }
    .j24-sticky-share-side {
        display: none !important;
    }
    .j24-sticky-share-mobile {
        display: flex;
        position: fixed;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 9999;
        align-items: center;
        gap: 12px;
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        padding: 7px 18px;
        border-radius: 40px;
        box-shadow: 0 6px 25px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.06);
        border: 1px solid rgba(0, 0, 0, 0.08);
    }
    .j24-m-share-title {
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--j24-dark, #222);
    }
    .j24-m-share-icons {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .j24-m-share-icons .j24-share-icon {
        width: 35px;
        height: 35px;
    }
    .j24-sticky-share-mobile .j24-copy-tooltip {
        bottom: 100%;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        margin-bottom: 8px;
    }
}

/* ==========================================================================
   Single Article Comments & Form
   ========================================================================== */

.j24-comments-area {
    margin-top: 50px;
    padding-top: 35px;
    border-top: 2px solid var(--j24-border, #eee);
}

/* Comments Header (Sticky Bar) */
.j24-comments-header {
    position: -webkit-sticky;
    position: sticky;
    top: 172px;
    z-index: 45;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 18px;
    margin-bottom: 25px;
    border: 1px solid var(--j24-border, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: top 0.2s ease, box-shadow 0.2s ease;
}

.admin-bar .j24-comments-header {
    top: 204px;
}

.j24-comments-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.j24-comments-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(192, 57, 43, 0.08);
    color: var(--j24-primary, #c0392b);
}

.j24-comments-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--j24-dark, #1e293b);
}

.j24-comments-count-wrap {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
}

.j24-comments-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--j24-primary, #c0392b);
    color: #ffffff !important;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.22);
}

/* Comment List */
.j24-comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 35px 0;
}

.j24-comment-list .comment {
    margin-bottom: 20px;
}

.j24-comment-body {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.j24-comment-body:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.j24-comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.j24-comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.j24-comment-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.j24-comment-author-name {
    display: block;
    font-weight: 800;
    font-size: 1rem;
    color: var(--j24-dark, #0f172a);
}

.j24-comment-author-name a {
    color: inherit;
    text-decoration: none;
}

.j24-comment-date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 2px;
}

.j24-comment-reply a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--j24-primary, #c0392b);
    background: rgba(192, 57, 43, 0.08);
    padding: 5px 14px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.j24-comment-reply a:hover {
    background: var(--j24-primary, #c0392b);
    color: #ffffff;
    transform: translateY(-1px);
}

.j24-comment-content {
    font-size: 1rem;
    line-height: 1.7;
    color: #334155;
}

.j24-comment-content p:last-child {
    margin-bottom: 0;
}

.j24-comment-awaiting-moderation {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fef3c7;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.j24-comment-footer {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Left side in RTL */
}

html[dir="ltr"] .j24-comment-footer,
body:not(.rtl) .j24-comment-footer {
    justify-content: flex-start; /* Left side in LTR */
}

.j24-comment-bottom-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.j24-comment-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 4px 11px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.j24-comment-action-btn svg {
    transition: transform 0.2s ease;
}

.j24-comment-add-btn:hover {
    background: var(--j24-primary, #c0392b);
    color: #ffffff;
    border-color: var(--j24-primary, #c0392b);
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.25);
}

.j24-comment-add-btn:hover svg {
    transform: scale(1.1);
}

.j24-comment-top-btn:hover {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

.j24-comment-top-btn:hover svg {
    transform: translateY(-2px);
}

/* Nested Comments (Children) */
.j24-comment-list .children {
    list-style: none;
    margin: 15px 0 0 0;
    padding-inline-start: 25px;
    border-inline-start: 2px solid #e2e8f0;
}

/* Comment Form Styling */
#respond,
#commentform,
.comment-respond,
#comment {
    scroll-margin-top: 210px;
}

.admin-bar #respond,
.admin-bar #commentform,
.admin-bar .comment-respond,
.admin-bar #comment {
    scroll-margin-top: 240px;
}

.comment-respond {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 26px 28px;
    margin-top: 30px;
}

.j24-reply-title {
    margin: 0 0 20px 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--j24-dark, #0f172a);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.j24-reply-title #cancel-comment-reply-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ef4444;
    text-decoration: none;
    border: 1px solid #fca5a5;
    padding: 3px 10px;
    border-radius: 15px;
}

.comment-form p.logged-in-as {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 18px;
}

.j24-comment-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.j24-comment-header-row label {
    margin-bottom: 0 !important;
}

.j24-char-count-wrap {
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
    background: #ffffff;
    padding: 3px 12px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

#j24-char-num {
    font-weight: 800;
    color: var(--j24-primary, #c0392b);
}

.comment-form p.logged-in-as a {
    font-weight: 700;
    color: var(--j24-primary, #c0392b);
    text-decoration: none;
}

.j24-form-fields-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .j24-form-fields-row {
        grid-template-columns: 1fr;
    }
}

.j24-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.j24-form-field label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #334155;
}

.j24-form-field label .required {
    color: #ef4444;
}

.j24-form-field input[type="text"],
.j24-form-field input[type="email"],
.j24-form-field input[type="url"],
.j24-form-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #ffffff;
    color: #1e293b;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.j24-form-field input:focus,
.j24-form-field textarea:focus {
    border-color: var(--j24-primary, #c0392b);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
    outline: none;
}

.j24-form-field textarea {
    resize: vertical;
    min-height: 120px;
}

/* Submit Row */
.j24-submit-row {
    margin-top: 15px;
}

.j24-comment-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--j24-primary, #c0392b);
    color: #ffffff !important;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    padding: 12px 28px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(192, 57, 43, 0.25);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.j24-comment-submit-btn:hover {
    background: #a92317;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(192, 57, 43, 0.38);
}

/* ==========================================================================
   Publishing Terms Box (شروط النشر أسفل زر الإرسال)
   ========================================================================== */

.j24-comment-terms-box {
    margin-top: 22px;
    padding: 15px 18px;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-inline-start: 4px solid var(--j24-primary, #c0392b);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.j24-comment-terms-header {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--j24-dark, #0f172a);
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.j24-comment-terms-header svg {
    color: var(--j24-primary, #c0392b);
    flex-shrink: 0;
}

.j24-comment-terms-body {
    font-size: 0.88rem;
    line-height: 1.7;
    color: #64748b;
    margin: 0;
}

.j24-no-comments {
    color: #94a3b8;
    font-style: italic;
    font-size: 0.95rem;
    padding: 15px 0;
}

/* ==========================================================================
   Responsive Video Embeds & Iframes in Single Article (تضمين الفيديو 16:9)
   ========================================================================== */

/* كتل التضمين في ووردبريس (WordPress Embed Blocks) */
.j24-article-body .wp-block-embed,
.j24-article-body .wp-block-video,
.journal-entry-content .wp-block-embed {
    margin: 25px 0;
}

.j24-article-body .wp-block-embed__wrapper {
    position: relative;
    width: 100%;
}

/* تنسيق مشغل الفيديو وكافة إطارات iframe داخل المقال بنسبة 16:9 متجاوبة */
.j24-article-body iframe,
.j24-article-body video,
.wp-block-embed iframe {
    width: 100% !important;
    max-width: 100% !important;
    height: 460px; /* ارتفاع قياسي للشاشات الكبيرة */
    aspect-ratio: 16 / 9; /* النسبة السينمائية للمتصفحات الحديثة */
    border-radius: var(--j24-radius-md, 8px);
    border: none !important;
    margin: 25px 0;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    display: block;
    background: transparent !important;
}

@media (max-width: 992px) {
    .j24-article-body iframe,
    .j24-article-body video,
    .wp-block-embed iframe {
        height: 380px;
    }
}

@media (max-width: 768px) {
    .j24-article-body iframe,
    .j24-article-body video,
    .wp-block-embed iframe {
        height: 230px;
        margin: 18px 0;
        border-radius: 6px;
    }
}



