/* ===== تنسيقات صفحة المقالة الفردية ===== */

/* القسم الرئيسي للمقالة */
.post-single-section { 
    padding: 120px 0; 
    background: var(--cream); 
    min-height: 100vh; 
}

/* حاوية المقالة */
.post-single-content { 
    max-width: 900px; 
    margin: 0 auto; 
    background: var(--white); 
    border-radius: 30px; 
    overflow: hidden; 
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1); 
    border: 3px solid var(--gold-light);
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* رأس المقالة */
.post-single-header { 
    padding: 50px 60px 40px; 
    background: var(--gradient-olive); 
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.post-single-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.post-single-header .breadcrumb { 
    justify-content: flex-start; 
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

/* عنوان المقالة */
.post-single-title { 
    font-size: 3rem; 
    font-weight: 900; 
    margin-bottom: 25px; 
    line-height: 1.3; 
    font-family: 'Amiri', serif;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* معلومات المقالة */
.post-single-meta { 
    display: flex; 
    gap: 30px; 
    flex-wrap: wrap; 
    font-size: 1rem; 
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    z-index: 2;
}

.post-single-meta span { 
    display: flex; 
    align-items: center; 
    gap: 8px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.post-single-meta span:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.post-single-meta i { 
    color: var(--gold-primary);
    font-size: 1.1rem;
}

/* صورة المقالة */
.post-single-image { 
    width: 100%; 
    height: 500px; 
    overflow: hidden;
    position: relative;
}

.post-single-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.3) 0%, transparent 50%);
}

.post-single-image img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-single-content:hover .post-single-image img {
    transform: scale(1.05);
}

/* محتوى المقالة */
.post-single-body { 
    padding: 60px; 
    font-size: 1.15rem; 
    line-height: 2; 
    color: var(--text-dark);
    position: relative;
}

/* حرف البداية المزخرف */
.post-single-body > p:first-of-type::first-letter {
    float: right;
    font-size: 4.5rem;
    line-height: 0.9;
    margin: 10px 0 5px 15px;
    color: var(--gold-primary);
    font-weight: 900;
    font-family: 'Amiri', serif;
}

/* العناوين داخل المحتوى */
.post-single-body h1,
.post-single-body h2, 
.post-single-body h3,
.post-single-body h4,
.post-single-body h5,
.post-single-body h6 { 
    color: var(--olive-dark); 
    margin-top: 45px;
    margin-bottom: 25px; 
    font-weight: bold; 
    font-family: 'Amiri', serif;
    position: relative;
    padding-bottom: 15px;
}

.post-single-body h2 {
    font-size: 2.2rem;
    border-right: 5px solid var(--gold-primary);
    padding-right: 20px;
}

.post-single-body h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 80px;
    height: 3px;
    background: var(--gradient-gold);
}

.post-single-body h3 {
    font-size: 1.8rem;
    color: var(--olive-light);
}

.post-single-body h4 {
    font-size: 1.4rem;
    color: var(--text-dark);
}

.post-single-body h5 {
    font-size: 1.2rem;
}

.post-single-body h6 {
    font-size: 1.1rem;
}

/* الفقرات */
.post-single-body p { 
    margin-bottom: 25px;
    text-align: justify;
    line-height: 2.2;
}

/* القوائم */
.post-single-body ul,
.post-single-body ol { 
    margin: 30px 0;
    padding-right: 40px;
}

.post-single-body ul {
    list-style-type: none;
}

.post-single-body ul li::before {
    content: '◆';
    color: var(--gold-primary);
    font-weight: bold;
    display: inline-block;
    width: 1.5em;
    margin-right: -1.5em;
    font-size: 1.2em;
}

.post-single-body ol {
    list-style-type: none;
    counter-reset: item;
}

.post-single-body ol li {
    counter-increment: item;
}

.post-single-body ol li::before {
    content: counter(item);
    background: var(--gradient-gold);
    color: var(--olive-dark);
    font-weight: bold;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
    font-size: 0.9em;
}

.post-single-body li {
    margin-bottom: 15px;
    line-height: 2;
    transition: all 0.3s ease;
    padding: 10px 0;
}

.post-single-body li:hover {
    transform: translateX(-5px);
}

/* الاقتباسات */
.post-single-body blockquote { 
    border-right: 5px solid var(--gold-primary); 
    background: linear-gradient(135deg, #f9f9f9 0%, #fff 100%);
    padding: 30px 35px; 
    margin: 35px 0; 
    font-style: italic;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    position: relative;
    font-size: 1.1rem;
}

.post-single-body blockquote::before {
    content: '"';
    position: absolute;
    top: -20px;
    right: 20px;
    font-size: 5rem;
    color: var(--gold-light);
    font-family: Georgia, serif;
    line-height: 1;
}

.post-single-body blockquote p {
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

/* النصوص المميزة */
.post-single-body strong,
.post-single-body b {
    color: var(--olive-dark);
    font-weight: 800;
    background: linear-gradient(transparent 60%, rgba(212, 175, 55, 0.2) 60%);
}

.post-single-body em,
.post-single-body i {
    color: var(--text-gray);
    font-style: italic;
}

.post-single-body mark {
    background: rgba(212, 175, 55, 0.3);
    padding: 3px 6px;
    border-radius: 4px;
}

/* الروابط */
.post-single-body a {
    color: var(--gold-primary);
    text-decoration: none;
    border-bottom: 2px solid var(--gold-light);
    transition: all 0.3s ease;
    font-weight: 600;
}

.post-single-body a:hover {
    color: var(--gold-dark);
    border-bottom-color: var(--gold-primary);
    transform: translateY(-1px);
}

/* الصور داخل المحتوى */
.post-single-body img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    margin: 35px 0;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    transition: all 0.4s ease;
}

.post-single-body img:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

/* الجداول */
.post-single-body table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 35px 0;
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.post-single-body table th {
    background: var(--gradient-olive);
    color: var(--white);
    padding: 18px 20px;
    text-align: right;
    font-weight: 700;
    font-size: 1.05rem;
}

.post-single-body table td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--gold-light);
    transition: all 0.3s ease;
}

.post-single-body table tr:hover td {
    background: var(--cream);
}

.post-single-body table tr:last-child td {
    border-bottom: none;
}

/* الأكواد */
.post-single-body code {
    background: var(--cream);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Courier New', 'Consolas', monospace;
    color: var(--olive-dark);
    font-size: 0.92em;
    border: 1px solid var(--gold-light);
}

.post-single-body pre {
    background: var(--cream);
    padding: 25px;
    border-radius: 15px;
    overflow-x: auto;
    margin: 35px 0;
    border: 2px solid var(--gold-light);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    position: relative;
}

.post-single-body pre::before {
    content: 'CODE';
    position: absolute;
    top: 10px;
    left: 15px;
    background: var(--gold-primary);
    color: var(--white);
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.post-single-body pre code {
    background: none;
    padding: 0;
    border: none;
    display: block;
    line-height: 1.6;
    direction: ltr;
    text-align: left;
}

/* الفواصل الأفقية */
.post-single-body hr {
    border: none;
    height: 3px;
    background: var(--gradient-gold);
    margin: 50px 0;
    border-radius: 3px;
}

/* صناديق التنبيه */
.post-single-body .alert,
.post-single-body .note,
.post-single-body .warning {
    padding: 20px 25px;
    border-radius: 12px;
    margin: 30px 0;
    border-right: 5px solid;
}

.post-single-body .alert {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.post-single-body .note {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.post-single-body .warning {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* تذييل المقالة */
.post-single-footer { 
    padding: 40px 60px; 
    border-top: 2px solid var(--gold-light); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 20px;
    background: var(--cream);
}

/* رسالة المقالة غير موجودة */
.post-not-found { 
    text-align: center; 
    padding: 100px 20px; 
    background: var(--white); 
    border-radius: 30px; 
    max-width: 600px; 
    margin: 0 auto; 
    border: 3px solid var(--gold-light);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.post-not-found i { 
    font-size: 100px; 
    color: var(--gold-light); 
    margin-bottom: 30px;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.post-not-found h2 { 
    font-size: 2.5rem; 
    color: var(--olive-dark); 
    margin-bottom: 20px; 
    font-weight: 900;
    font-family: 'Amiri', serif;
}

.post-not-found p { 
    font-size: 1.2rem; 
    color: var(--text-gray); 
    margin-bottom: 40px;
    line-height: 1.8;
}

/* شريط تقدم القراءة */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 5px;
    background: var(--gradient-gold);
    z-index: 9999;
    transition: width 0.2s ease;
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.5);
}

/* زر المشاركة العائم */
.share-float {
    position: fixed;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 999;
}

.share-float a {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--white);
    border: 2px solid var(--gold-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--olive-dark);
    font-size: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.share-float a:hover {
    background: var(--gold-primary);
    color: var(--white);
    transform: scale(1.1);
    border-color: var(--gold-primary);
}

/* تحسينات للطباعة */
@media print {
    .post-single-header,
    .post-single-footer,
    .share-float,
    .reading-progress {
        display: none;
    }
    
    .post-single-body {
        padding: 20px;
        font-size: 12pt;
    }
    
    .post-single-body a {
        color: #000;
        text-decoration: underline;
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 992px) {
    .post-single-section {
        padding: 100px 0;
    }
    
    .share-float {
        left: 15px;
    }
    
    .share-float a {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .post-single-header { 
        padding: 40px 30px; 
    }
    
    .post-single-title { 
        font-size: 2rem; 
    }
    
    .post-single-meta {
        gap: 15px;
        font-size: 0.9rem;
    }
    
    .post-single-image { 
        height: 300px; 
    }
    
    .post-single-body { 
        padding: 40px 25px; 
        font-size: 1.05rem; 
    }
    
    .post-single-body > p:first-of-type::first-letter {
        font-size: 3rem;
    }
    
    .post-single-body h2 {
        font-size: 1.6rem;
    }
    
    .post-single-body h3 {
        font-size: 1.4rem;
    }
    
    .post-single-body h4 {
        font-size: 1.2rem;
    }
    
    .post-single-body ul,
    .post-single-body ol {
        padding-right: 25px;
    }
    
    .post-single-body blockquote {
        padding: 20px 25px;
        font-size: 1rem;
    }
    
    .post-single-body blockquote::before {
        font-size: 3rem;
        top: -10px;
    }
    
    .post-single-body pre {
        padding: 20px;
        font-size: 0.85rem;
    }
    
    .post-single-footer { 
        padding: 30px; 
        flex-direction: column; 
    }
    
    .post-single-footer .btn-luxury, 
    .post-single-footer .btn-luxury-outline { 
        width: 100%; 
        justify-content: center; 
    }
    
    .share-float {
        display: none;
    }
}

@media (max-width: 480px) {
    .post-single-section {
        padding: 80px 0;
    }
    
    .post-single-content {
        border-radius: 20px;
    }
    
    .post-single-title {
        font-size: 1.6rem;
    }
    
    .post-single-body {
        padding: 30px 20px;
        font-size: 1rem;
    }
    
    .post-single-body h2 {
        font-size: 1.4rem;
    }
    
    .post-single-footer {
        padding: 20px;
    }
    
    .post-not-found {
        padding: 60px 20px;
    }
    
    .post-not-found i {
        font-size: 70px;
    }
    
    .post-not-found h2 {
        font-size: 1.8rem;
    }
}