/*
 * Main CSS for Journal24
 */

:root {
    --j24-primary: #c0392b;
    --j24-primary-dark: #96281b;
    --j24-dark: #1a1a2e;
    --j24-gray: #6c757d;
    --j24-light: #f8f9fa;
    --j24-white: #ffffff;
    --j24-border: #e9ecef;
    --j24-shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --j24-shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --j24-radius-sm: 6px;
    --j24-radius-md: 12px;
    --j24-font: 'Cairo', sans-serif;
    --j24-transition: 0.25s ease;
}

/* 
 * Reset
 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--j24-font);
    background-color: var(--j24-light);
    color: var(--j24-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

iframe {
    max-width: 100%;
    border: none;
    display: block;
}

a {
    color: var(--j24-primary);
    text-decoration: none;
    transition: color var(--j24-transition);
}

a:hover {
    color: var(--j24-primary-dark);
}

/* 
 * Layout
 */
.j24-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 
 * Grid Utilities
 */
.j24-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

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

.j24-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Percentage Columns for flex layouts or specific grid tracks */
.j24-col-30 { width: 30%; }
.j24-col-35 { width: 35%; }
.j24-col-65 { width: 65%; }
.j24-col-70 { width: 70%; }

/* 
 * Shared Utilities
 */
.j24-badge {
    display: inline-block;
    background-color: var(--j24-primary);
    color: var(--j24-white);
    padding: 2px 10px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: var(--j24-radius-sm);
    text-transform: uppercase;
}

.j24-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 25%, rgba(0,0,0,0) 55%);
    pointer-events: none;
}

.j24-img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.j24-text-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.j24-text-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Top Row Cards & Featured Cards (البطاقات العلوية الثلاث والبطاقات البارزة)
   ========================================================================== */

.j24-card-top,
.j24-card-featured {
    position: relative;
    overflow: hidden;
    border-radius: var(--j24-radius-md, 12px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.j24-card-top:hover,
.j24-card-featured:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.j24-card-top img,
.j24-card-featured img {
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.j24-card-top:hover img,
.j24-card-featured:hover img {
    transform: scale(1.08) !important;
}

.j24-card-top .j24-overlay,
.j24-card-featured .j24-overlay {
    transition: background 0.3s ease;
}

.j24-card-top:hover .j24-overlay,
.j24-card-featured:hover .j24-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 30%, rgba(0, 0, 0, 0) 60%);
}

/* Top 3 Cards & Featured Cards Titles and Links */
.j24-card-top .j24-badge {
    background-color: var(--j24-top-badge-bg, var(--j24-badge-cat-color, var(--j24-primary))) !important;
    color: var(--j24-top-badge-text, #ffffff) !important;
    position: relative;
    z-index: 3;
    transition: all 0.3s ease;
    text-decoration: none !important;
    display: inline-block;
}

.j24-card-top .j24-badge:hover {
    background-color: var(--j24-top-badge-hover-bg, var(--j24-top-badge-bg, var(--j24-badge-cat-color, var(--j24-primary)))) !important;
    color: var(--j24-top-badge-hover-text, var(--j24-top-badge-text, #ffffff)) !important;
    opacity: 0.92;
    transform: translateY(-2px);
}

.j24-card-top h2 a {
    color: var(--j24-top-title-color, #ffffff) !important;
    text-decoration: none !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    transition: color 0.3s ease, text-shadow 0.3s ease, opacity 0.3s ease;
}

.j24-card-top:hover h2 a,
.j24-card-top h2 a:hover {
    color: var(--j24-top-title-hover, #ffffff) !important;
    text-shadow: 0 2px 12px rgba(255, 255, 255, 0.45);
}

.j24-card-top .j24-card-meta {
    color: var(--j24-top-meta-color, rgba(255, 255, 255, 0.85)) !important;
}

.j24-card-featured h2 a,
.j24-card-featured:hover h2 a,
.j24-card-featured h2 a:hover {
    color: #ffffff !important;
    text-decoration: none !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    transition: text-shadow 0.3s ease, opacity 0.3s ease;
}

.j24-card-featured:hover h2 a {
    text-shadow: 0 2px 12px rgba(255, 255, 255, 0.45);
}


/* ==========================================================================
   Video Play Button (مطابق للصورة: دائرة بيضاء ومثلث مفرغ)
   ========================================================================== */

.j24-play-icon {
    position: absolute;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    pointer-events: none;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: none !important;
    transform: none !important;
}

.j24-play-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2.2;
    stroke-linejoin: round;
    stroke-linecap: round;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

/* منع أي هوفر أو أنيميشن بشكل نهائي وبات */
.j24-play-icon,
*:hover > .j24-play-icon,
*:hover .j24-play-icon {
    transform: none !important;
    animation: none !important;
}

/* المقاس المصغر لبطاقات القوائم الجانبية */
.j24-play-icon-sm {
    width: 32px;
    height: 32px;
    border-width: 1.5px;
}
.j24-play-icon-sm svg {
    width: 15px;
    height: 15px;
    stroke-width: 2;
}

/* ==========================================================================
   Footer Component & Flexible Columns (Astra-Style)
   ========================================================================== */

.site-footer {
    background-color: var(--j24-dark, #0f172a);
    color: #cbd5e1;
    padding-top: 55px;
    font-size: 0.95rem;
}

.j24-footer-grid {
    display: grid;
    gap: 35px;
}

.j24-footer-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.j24-footer-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.j24-footer-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.j24-footer-cols-1 {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

/* Footer Widget Titles */
.footer-widget-title,
.footer-widget .widget-title {
    color: var(--j24-footer-title, #ffffff);
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 0 22px 0;
    position: relative;
    padding-bottom: 12px;
}

.footer-widget-title::after,
.footer-widget .widget-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    width: 38px;
    height: 3px;
    background: var(--j24-primary, #c0392b);
    border-radius: 2px;
}

.j24-footer-cols-1 .footer-widget-title::after {
    inset-inline-start: 50%;
    transform: translateX(-50%);
}

/* Footer Bio & Social */
.j24-footer-bio {
    color: var(--j24-footer-text, #adb5bd);
    line-height: 1.8;
}

.j24-footer-social {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.j24-footer-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--j24-footer-link, #e2e8f0);
    transition: all 0.25s ease;
}

.j24-footer-social-btn:hover {
    background: var(--j24-primary, #c0392b);
    color: #ffffff;
    transform: translateY(-2px);
}

/* Footer Menus (روابط سريعة وأقسام الموقع) */
.j24-footer-menu,
.footer-widget ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: start !important;
}

.j24-footer-menu li,
.footer-widget ul li {
    margin-bottom: 11px;
    list-style: none !important;
    text-align: start !important;
}

.j24-footer-menu a,
.footer-widget ul li a {
    color: var(--j24-footer-link, #94a3b8);
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    position: relative;
    text-align: start !important;
}

/* إلغاء الـ Puce / النقاط والأسهم نهائياً بناءً على طلب المستخدم */
.j24-footer-menu a::before,
.footer-widget ul li a::before {
    display: none !important;
    content: none !important;
}

.j24-footer-menu a:hover,
.footer-widget ul li a:hover {
    color: var(--j24-footer-link-hover, #ffffff);
    transform: none !important;
    text-decoration: underline;
}

/* Category menu with count */
.j24-footer-cat-menu li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    text-align: start;
}

.j24-cat-name {
    text-align: start;
}

.j24-cat-count {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-inline-start: 10px;
    transition: all 0.2s ease;
}

.j24-footer-cat-menu a:hover .j24-cat-count {
    background: var(--j24-primary, #c0392b);
    color: #ffffff;
    text-decoration: none;
}

/* Latest Posts Column */
.j24-footer-latest-posts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.j24-footer-post {
    display: flex;
    gap: 14px;
    align-items: center;
}

.j24-footer-post-img {
    flex-shrink: 0;
    width: 68px;
    height: 60px;
    border-radius: var(--j24-radius-sm, 6px);
    overflow: hidden;
    background: #1e293b;
    display: block;
}

.j24-footer-post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.j24-footer-post:hover .j24-footer-post-img img {
    transform: scale(1.08);
}

.j24-footer-post-info {
    flex-grow: 1;
    min-width: 0;
}

.j24-footer-post-title {
    margin: 0 0 5px 0;
    font-size: 0.92rem;
    line-height: 1.4;
    font-weight: 700;
}

.j24-footer-post-title a {
    color: var(--j24-footer-link, #e2e8f0);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.j24-footer-post-title a:hover,
.j24-footer-latest-posts a:hover,
.j24-footer-post:hover .j24-footer-post-title a {
    color: var(--j24-footer-link-hover, #ffffff) !important;
}

.j24-footer-post-date {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
}

/* Footer Bottom Bar */
.j24-footer-bottom {
    background-color: var(--j24-footer-bottom-bg, rgba(0, 0, 0, 0.25));
    padding: 22px 0;
    margin-top: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 0.88rem;
    color: var(--j24-footer-text, #94a3b8);
}

.j24-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.j24-bottom-links-list {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.j24-bottom-links-list a {
    color: var(--j24-footer-link, #94a3b8);
    text-decoration: none;
    transition: color 0.2s ease;
}

.j24-bottom-links-list a:hover {
    color: var(--j24-footer-link-hover, var(--j24-primary, #c0392b));
}

.j24-developer a {
    color: var(--j24-primary, #c0392b);
    font-weight: 700;
    text-decoration: none;
}

/* Responsive Footer */
@media (max-width: 1024px) {
    .j24-footer-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 640px) {
    .j24-footer-cols-4,
    .j24-footer-cols-3,
    .j24-footer-cols-2 {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .j24-bottom-inner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .j24-bottom-links-list {
        justify-content: center;
    }
}

/* ==========================================================================
   Modern Responsive Pagination (Journal 24)
   ========================================================================== */
.j24-pagination {
    margin-top: 45px;
    padding-top: 25px;
    border-top: 1px solid var(--j24-border, #e2e8f0);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.j24-pagination ul.page-numbers {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.j24-pagination ul.page-numbers li {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
}

.j24-pagination a.page-numbers,
.j24-pagination span.page-numbers {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--j24-dark, #0f172a);
    background: #ffffff;
    border: 1px solid var(--j24-border, #e2e8f0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.j24-pagination a.page-numbers:hover {
    background: var(--j24-primary, #c0392b) !important;
    color: #ffffff !important;
    border-color: var(--j24-primary, #c0392b) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.25);
}

.j24-pagination a.page-numbers:hover .j24-page-arrow {
    stroke: #ffffff;
}

.j24-pagination span.page-numbers.current {
    background: var(--j24-primary, #c0392b) !important;
    color: #ffffff !important;
    border-color: var(--j24-primary, #c0392b) !important;
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(192, 57, 43, 0.3);
}

.j24-pagination span.page-numbers.dots {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: var(--j24-gray, #94a3b8) !important;
    padding: 0 4px !important;
    min-width: auto !important;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.j24-pagination a.page-numbers.prev,
.j24-pagination a.page-numbers.next {
    background: #f8fafc;
    border-color: #cbd5e1;
    font-weight: 700;
    gap: 8px;
    padding: 0 16px;
}

.j24-pagination a.page-numbers.prev:hover,
.j24-pagination a.page-numbers.next:hover {
    background: var(--j24-primary, #c0392b) !important;
    color: #ffffff !important;
    border-color: var(--j24-primary, #c0392b) !important;
}

.j24-pagination .j24-page-arrow {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

/* Hover arrow animation based on text direction */
html[dir="rtl"] .j24-pagination a.page-numbers.prev:hover .j24-page-arrow {
    transform: translateX(3px);
}
html[dir="rtl"] .j24-pagination a.page-numbers.next:hover .j24-page-arrow {
    transform: translateX(-3px);
}
html:not([dir="rtl"]) .j24-pagination a.page-numbers.prev:hover .j24-page-arrow {
    transform: translateX(-3px);
}
html:not([dir="rtl"]) .j24-pagination a.page-numbers.next:hover .j24-page-arrow {
    transform: translateX(3px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .j24-pagination {
        margin-top: 30px;
        padding-top: 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .j24-pagination ul.page-numbers {
        gap: 6px !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
    }

    /* Hide long words 'Précédent'/'Suivant' on mobile, keep sleek arrow icons */
    .j24-pagination .j24-page-text {
        display: none !important;
    }

    .j24-pagination a.page-numbers,
    .j24-pagination span.page-numbers {
        min-width: 38px !important;
        height: 38px !important;
        padding: 0 8px !important;
        font-size: 0.9rem !important;
        border-radius: 8px !important;
    }

    .j24-pagination a.page-numbers.prev,
    .j24-pagination a.page-numbers.next {
        padding: 0 !important;
        min-width: 38px !important;
        height: 38px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .j24-pagination .j24-page-arrow {
        width: 18px !important;
        height: 18px !important;
    }
}




