@charset "UTF-8";

/* ============================================================================
   articles.css — المكتبة التربوية وصفحة المقال
   ============================================================================

   قاعدتان تحكمان هذا الملف:

   1) لا محدّد شامل يضبط font-family. محدّد مثل ‎.art *‎ يزن 0-1-0 وهو
      وزن ‎.fa-solid‎ نفسه، فإن حُمّل بعده أطاح بأيقونات FontAwesome
      وأخفاها. الخطوط تُضبط على العناصر مباشرة.

   2) كل المحدّدات مقيّدة بـ‎.lib‎ أو ‎.art‎ فلا تتسرّب إلى بقية القوالب.

   قسم ‎.article-body-content‎ هو الأهم: هو ما ينسّق مخرجات محرّر لوحة
   التحكم. الكاتب يكتب عناوين وقوائم واقتباسات وصورًا بلا معرفة بالـCSS،
   وهذه القواعد تعطيها شكلًا مرتّبًا على الموقع.
   ========================================================================= */


/* ============================ المكتبة ============================ */

.lib-banner {
    padding: 80px 20px 60px;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #0369a1, #0f172a);
}

.lib-banner-inner {
    max-width: 780px;
    margin: 0 auto;
}

.lib-badge {
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 16px;
    font-size: .82rem;
    font-weight: 600;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 30px;
}

.lib-banner h1 {
    margin: 0 0 12px;
    font-size: 2.3rem;
    font-weight: 900;
    line-height: 1.4;
}

.lib-banner p {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.9;
    color: #e0f2fe;
}

.lib-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 45px 20px 70px;
}

/* ------------------------------------------------------------ البحث */
.lib-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 560px;
    margin: 0 auto 26px;
}

.lib-search i {
    position: absolute;
    right: 16px;
    color: #94a3b8;
    pointer-events: none;
}

.lib-search input {
    flex: 1;
    padding: 12px 44px 12px 16px;
    font-size: .95rem;
    color: #1f2937;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 40px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.lib-search input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .15);
}

.lib-search button {
    padding: 12px 24px;
    font-size: .92rem;
    font-weight: 700;
    color: #fff;
    background: #0284c7;
    border: 0;
    border-radius: 40px;
    cursor: pointer;
}

.lib-search button:hover { background: #0369a1; }

/* ------------------------------------------------------ التصنيفات */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
}

.category-pills a {
    padding: 7px 18px;
    font-size: .88rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    text-decoration: none;
    transition: all .15s;
}

.category-pills a:hover {
    background: #e0f2fe;
    color: #0369a1;
    text-decoration: none;
}

.category-pills a.is-active {
    background: #0284c7;
    border-color: #0284c7;
    color: #fff;
}

.category-pills a span {
    display: inline-block;
    margin-right: 5px;
    padding: 0 6px;
    font-size: .75rem;
    background: rgba(0, 0, 0, .08);
    border-radius: 10px;
}

.category-pills a.is-active span { background: rgba(255, 255, 255, .25); }

.lib-result {
    margin-bottom: 22px;
    font-size: .92rem;
    color: #64748b;
    text-align: center;
}

.lib-result a {
    margin-right: 8px;
    color: #0284c7;
}

/* ---------------------------------------------------- شبكة المقالات */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 24px;
}

.article-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .1);
}

.article-card-img {
    display: block;
    height: 195px;
    background: #f1f5f9;
    overflow: hidden;
}

.article-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s;
}

.article-card:hover .article-card-img img { transform: scale(1.06); }

.article-card-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 2.2rem;
    color: #cbd5e1;
}

.article-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 10px;
    font-size: .78rem;
    color: #94a3b8;
}

.article-card-body h3 {
    margin: 0 0 10px;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.7;
}

.article-card-body h3 a {
    color: #0f172a;
    text-decoration: none;
}

.article-card-body h3 a:hover { color: #0284c7; }

.article-card-body p {
    flex: 1;
    margin: 0 0 14px;
    font-size: .89rem;
    line-height: 1.9;
    color: #64748b;
}

.article-card-link {
    font-size: .88rem;
    font-weight: 700;
    color: #0284c7;
    text-decoration: none;
}

.article-card-link:hover { text-decoration: underline; }

/* ---------------------------------------------------------- الترقيم */
.lib-pager {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 40px;
}

.page-link {
    min-width: 40px;
    padding: 9px 14px;
    font-size: .9rem;
    font-weight: 600;
    text-align: center;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
}

.page-link:hover {
    background: #f1f5f9;
    text-decoration: none;
}

.page-link.is-active {
    background: #0284c7;
    border-color: #0284c7;
    color: #fff;
}

.lib-empty {
    padding: 70px 20px;
    text-align: center;
    color: #64748b;
}

.lib-empty > i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.lib-empty h3 {
    margin: 0 0 8px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #334155;
}

.lib-empty p {
    max-width: 440px;
    margin: 0 auto;
    line-height: 1.9;
}


/* ========================== صفحة المقال ========================== */

.article-layout-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 45px 20px 70px;
    align-items: start;
}

.article-main-card {
    min-width: 0;
    padding: 34px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
}

.article-header-tag {
    display: inline-block;
    margin-bottom: 14px;
    padding: 5px 14px;
    font-size: .8rem;
    font-weight: 700;
    color: #0369a1;
    background: #e0f2fe;
    border-radius: 30px;
}

.article-title {
    margin: 0 0 16px;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.5;
    color: #0f172a;
}

.article-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding-bottom: 20px;
    margin-bottom: 24px;
    font-size: .84rem;
    color: #94a3b8;
    border-bottom: 1px solid #f1f5f9;
}

.article-hero {
    margin: 0 0 26px;
    border-radius: 14px;
    overflow: hidden;
}

.article-hero img {
    width: 100%;
    height: auto;
    display: block;
}


/* ------------------------------------------------- متن المقال
   هذه القواعد تنسّق ما يخرجه محرّر لوحة التحكم. الكاتب لا يحتاج
   لكتابة أي CSS — يكفي أن يستعمل أدوات المحرّر (عنوان، قائمة،
   اقتباس، جدول) فتظهر منسّقة هنا.
   ------------------------------------------------------------ */
.article-body-content {
    font-size: 1.05rem;
    line-height: 2.1;
    color: #334155;
}

.article-body-content h2 {
    margin: 34px 0 14px;
    padding-right: 14px;
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    border-right: 5px solid #0ea5e9;
}

.article-body-content h3 {
    margin: 26px 0 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

.article-body-content h4 {
    margin: 22px 0 10px;
    font-size: 1.08rem;
    font-weight: 700;
    color: #334155;
}

.article-body-content p { margin: 0 0 18px; }

.article-body-content a {
    color: #0284c7;
    text-decoration: underline;
}

.article-body-content strong { color: #0f172a; }

.article-body-content ul,
.article-body-content ol {
    margin: 0 0 20px;
    padding-right: 26px;
    padding-left: 0;
}

.article-body-content li { margin-bottom: 8px; }

.article-body-content blockquote {
    margin: 24px 0;
    padding: 18px 22px;
    background: #f0f9ff;
    border-right: 5px solid #0ea5e9;
    border-radius: 0 10px 10px 0;
    font-size: 1.05rem;
    color: #0c4a6e;
}

.article-body-content blockquote p:last-child { margin-bottom: 0; }

.article-body-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 12px;
    display: block;
}

.article-body-content figure {
    margin: 24px 0;
}

.article-body-content figcaption {
    margin-top: 8px;
    font-size: .85rem;
    color: #94a3b8;
    text-align: center;
}

.article-body-content table {
    width: 100%;
    margin: 22px 0;
    border-collapse: collapse;
    font-size: .95rem;
}

.article-body-content th,
.article-body-content td {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    text-align: right;
}

.article-body-content th {
    background: #f8fafc;
    font-weight: 700;
    color: #0f172a;
}

.article-body-content hr {
    margin: 30px 0;
    border: 0;
    border-top: 1px solid #e2e8f0;
}

.article-body-content pre {
    margin: 20px 0;
    padding: 16px;
    overflow-x: auto;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    direction: ltr;
    text-align: left;
}

.article-body-content code {
    padding: 2px 6px;
    font-size: .92em;
    background: #f1f5f9;
    border-radius: 4px;
    direction: ltr;
    display: inline-block;
}

.article-body-content pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}


/* ---------------------------------------------------------- المشاركة */
.share-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
    padding: 18px 22px;
    background: #f8fafc;
    border-radius: 12px;
}

.share-title {
    font-size: .92rem;
    font-weight: 700;
    color: #334155;
}

.share-btns {
    display: flex;
    gap: 8px;
}

.share-btns a,
.share-btns button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    font-size: .95rem;
    color: #fff;
    border: 0;
    border-radius: 50%;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s, opacity .15s;
}

.share-btns a:hover,
.share-btns button:hover {
    transform: translateY(-3px);
    text-decoration: none;
}

.share-btns .is-fb   { background: #1877f2; }
.share-btns .is-tw   { background: #0f172a; }
.share-btns .is-wa   { background: #25d366; }
.share-btns .is-tg   { background: #2aabee; }
.share-btns .is-copy { background: #64748b; }


/* ------------------------------------------------------ بطاقة الكاتب */
.author-bio-card {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-top: 26px;
    padding: 22px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 14px;
}

.author-bio-photo {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
}

.author-bio-photo.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0284c7;
    color: #fff;
    font-size: 1.5rem;
}

.author-bio-info { min-width: 0; }

.author-details h4 {
    margin: 0 0 3px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0c4a6e;
}

.author-meta {
    display: block;
    margin-bottom: 8px;
    font-size: .83rem;
    color: #0369a1;
}

.author-bio-info p {
    margin: 0;
    font-size: .9rem;
    line-height: 1.9;
    color: #475569;
}


/* --------------------------------------------------------- التعليقات */
.comments-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f1f5f9;
}

.comments-title {
    margin: 0 0 22px;
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f172a;
}

.comments-title span { color: #94a3b8; font-weight: 600; }

.comments-list { margin-bottom: 30px; }

.comment-item {
    display: flex;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid #f1f5f9;
}

.comment-item:last-child { border-bottom: 0; }

.comment-avatar {
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #0ea5e9, #0f172a);
    border-radius: 50%;
}

.comment-body { flex: 1; min-width: 0; }

.comment-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 5px;
}

.comment-user {
    font-size: .95rem;
    font-weight: 700;
    color: #0f172a;
}

.comment-date {
    font-size: .78rem;
    color: #94a3b8;
}

.comment-text {
    margin: 0;
    font-size: .93rem;
    line-height: 1.95;
    color: #475569;
    white-space: pre-line;
}

.comments-empty {
    padding: 24px;
    text-align: center;
    font-size: .93rem;
    color: #94a3b8;
    background: #f8fafc;
    border-radius: 10px;
}


/* ------------------------------------------------------ نموذج التعليق */
.comment-form {
    margin-top: 26px;
    padding: 24px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.comment-form h4 {
    margin: 0 0 16px;
    font-size: 1.08rem;
    font-weight: 800;
    color: #0f172a;
}

.comment-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.comment-form label {
    display: block;
    margin-bottom: 5px;
    font-size: .85rem;
    font-weight: 600;
    color: #475569;
}

.comment-form label span { color: #ef4444; }

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 11px 14px;
    font-size: .93rem;
    color: #1f2937;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .15);
}

.comment-form input[readonly] {
    background: #f1f5f9;
    color: #64748b;
}

.comment-form textarea {
    margin-bottom: 12px;
    resize: vertical;
    line-height: 1.8;
}

.comment-note {
    margin: 0 0 16px;
    font-size: .82rem;
    line-height: 1.8;
    color: #64748b;
}

.comment-form button {
    padding: 12px 28px;
    font-size: .95rem;
    font-weight: 700;
    color: #fff;
    background: #0284c7;
    border: 0;
    border-radius: 40px;
    cursor: pointer;
    transition: background .15s;
}

.comment-form button:hover:not(:disabled) { background: #0369a1; }
.comment-form button:disabled { opacity: .6; cursor: not-allowed; }

.art-alert {
    margin-bottom: 14px;
    padding: 12px 16px;
    font-size: .9rem;
    line-height: 1.7;
    border-radius: 9px;
}

.art-alert.is-ok {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}

.art-alert.is-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}


/* ------------------------------------------------------------ الجانب */
.sidebar {
    position: sticky;
    top: 20px;
}

.post-stats,
.related-box {
    margin-bottom: 18px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.post-stats h4,
.related-box h4 {
    margin: 0 0 14px;
    padding-bottom: 12px;
    font-size: .98rem;
    font-weight: 800;
    color: #0f172a;
    border-bottom: 1px solid #f1f5f9;
}

.post-stats ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.post-stats li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: .87rem;
    color: #64748b;
}

.post-stats li strong { color: #0f172a; }

.related-item {
    display: flex;
    gap: 11px;
    padding: 11px 0;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
}

.related-item:last-child { border-bottom: 0; }
.related-item:hover { text-decoration: none; }

.related-item img {
    flex: 0 0 64px;
    width: 64px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
}

.related-item h5 {
    margin: 0 0 4px;
    font-size: .87rem;
    font-weight: 700;
    line-height: 1.6;
    color: #334155;
}

.related-item:hover h5 { color: #0284c7; }

.related-item span {
    font-size: .76rem;
    color: #94a3b8;
}


/* ------------------------------------------------------ الشاشات الصغيرة */
@media (max-width: 900px) {
    .article-layout-container { grid-template-columns: 1fr; }
    .sidebar { position: static; }
}

@media (max-width: 600px) {
    .lib-banner h1 { font-size: 1.6rem; }
    .article-main-card { padding: 22px 18px; }
    .article-title { font-size: 1.45rem; }
    .comment-form-grid { grid-template-columns: 1fr; }
    .lib-search { flex-direction: column; }
    .lib-search button { width: 100%; }
    .author-bio-card { flex-direction: column; }
}
