/*
Theme Name: Swalefhom Theme
Theme URI: https://swalefhom.com
Author: amolood
Author URI: https://swalefhom.com
Description: قالب مخصص لمنصة سواليفهم لتوثيق التراث، مبني باستخدام Tailwind CSS وبدون إضافات خارجية.
Version: 1.0
Text Domain: swalefhom
Tags: custom-background, custom-logo, custom-menu, featured-images, rtl-language-support
*/

/* =========================================
   1. إعدادات الخطوط العامة (Global Fonts)
   ========================================= */
:root {
    --font-primary: 'IBM Plex Sans Arabic', sans-serif;
    --color-primary: #FAC39B;
    --color-secondary: #6E1946;
    --color-dark: #0F2837;
    --color-text: #e5e7eb;
}

body {
    font-family: var(--font-primary);
}

/* =========================================
   2. إصلاحات ووردبريس الأساسية (WP Core)
   هذه الكلاسات يضيفها ووردبريس للصور والمحاذاة تلقائياً
   ========================================= */
.alignnone {
    margin: 5px 20px 20px 0;
}

.aligncenter,
div.aligncenter {
    display: block;
    margin: 5px auto 5px auto;
    clear: both;
}

.alignright {
    float: right;
    margin: 5px 0 20px 20px;
}

.alignleft {
    float: left;
    margin: 5px 20px 20px 0;
}

a img.alignright {
    float: right;
    margin: 5px 0 20px 20px;
}

a img.alignnone {
    margin: 5px 20px 20px 0;
}

a img.alignleft {
    float: left;
    margin: 5px 20px 20px 0;
}

a img.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-caption {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 96%; /* Image does not overflow the content area */
    padding: 5px 3px 10px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.wp-caption.alignnone {
    margin: 5px 20px 20px 0;
}

.wp-caption.alignleft {
    margin: 5px 20px 20px 0;
}

.wp-caption.alignright {
    margin: 5px 0 20px 20px;
}

.wp-caption img {
    border: 0 none;
    height: auto;
    margin: 0;
    max-width: 98.5%;
    padding: 0;
    width: auto;
    border-radius: 4px;
}

.wp-caption p.wp-caption-text {
    font-size: 14px;
    line-height: 17px;
    margin: 0;
    padding: 0 4px 5px;
    color: var(--color-primary);
    margin-top: 5px;
}

/* إخفاء النصوص المخصصة لقارئات الشاشة */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* =========================================
   3. تنسيق محتوى المقالات (Entry Content)
   هذا الجزء مهم جداً لأن المحرر لا يضيف كلاسات Tailwind
   ========================================= */
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    color: #fff;
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 1em;
    line-height: 1.3;
}

.prose h1 { font-size: 2.25rem; }
.prose h2 { font-size: 1.875rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 0.5rem; }
.prose h3 { font-size: 1.5rem; color: var(--color-primary); }
.prose h4 { font-size: 1.25rem; }

.prose p {
    margin-bottom: 1.5em;
    line-height: 1.8;
    color: #d1d5db; /* Gray-300 */
    font-size: 1.1rem;
}

.prose ul, .prose ol {
    margin-bottom: 1.5em;
    padding-right: 1.5em; /* RTL styling */
    color: #d1d5db;
}

.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }

.prose li {
    margin-bottom: 0.5em;
}

.prose a {
    color: var(--color-primary);
    text-decoration: underline;
    transition: color 0.2s;
}

.prose a:hover {
    color: #FF9619;
}

.prose blockquote {
    border-right: 4px solid var(--color-primary);
    padding-right: 1em;
    margin: 2em 0;
    font-style: italic;
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 0.5rem;
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 2em 0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* =========================================
   4. تنسيق ترقيم الصفحات (Pagination)
   ========================================= */
.pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination .page-numbers.current {
    background: var(--color-primary);
    color: var(--color-dark);
    font-weight: bold;
}

.pagination .page-numbers:hover:not(.current) {
    background: rgba(255, 255, 255, 0.2);
}

/* =========================================
   5. إصلاح شريط أدمن ووردبريس (Admin Bar Fix)
   لأن النافبار لديك Fixed، سيغطيه شريط الأدمن
   ========================================= */
body.admin-bar #main-nav {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar #main-nav {
        top: 46px;
    }
}