/*
Theme Name: Fedniy Simple
Theme URI: https://techfedniy.com/
Author: Ayman M.
Author URI: https://ayamaansi.com/
Description: A simple and responsive WordPress theme designed for Fedniy Tech platform.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fedniy-simple
*/

/* ========================================================= */
/* === 0. General Reset & Variables (Custom Properties) === */
/* ========================================================= */
:root {
  --primary: #0d1128;
  --accent: #FFA200;
  --text-color: #333;
  --light-bg: #f5f5f5;
  --font-family: 'Noto Sans', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  color: var(--text-color);
  line-height: 1.6;
  text-align: right; /* Default RTL alignment */
  background-color: #fff;
}

a {
  text-decoration: none;
  color: var(--accent);
}

.clear-both {
  clear: both;
}

.full-width-container {
    width: 100%;
    margin: 0 auto;
}

.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* ========================================================= */
/* === 1. Top Bar & Header Styles === */
/* ========================================================= */

/* === TOP BAR === */
.topbar{
    background:var(--primary);
    color:#fff;
    padding:6px 0;
    font-size:13px;
}
.topbar-inner{
    display:flex;
    justify-content:space-between;
    align-items:center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    direction: rtl; /* For RTL layout */
}
.topbar-left {
    display: flex;
    align-items: center;
}
.topbar-right {
    display: flex;
    align-items: center;
}
.top-social a{
    color:#fff;
    font-size:16px;
    margin-left:12px;
}
.top-contact{
    color:#fff;
    margin-right:12px;
    text-decoration:none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    /* التعديل: يعكس ترتيب العناصر (الأيقونة والنص) ليضع الأيقونة على اليسار */
    flex-direction: row-reverse; 
}
.top-contact i {
    color: var(--accent);
}
.top-contact:hover {
    color: var(--accent);
}
.top-contact .txt {
    direction: ltr; /* Ensure numbers read correctly */
    unicode-bidi: plaintext;
}
/* === MAIN HEADER === */
.site-header{
  /* تعيين صورة الخلفية المطلوبة (1.png) */
  background:url('assets/img/1.png') center/cover no-repeat;
  padding:0px 0 0; 
  position:relative;
  min-height: 450px; /* لضمان وجود مساحة كافية للـ Hero */
}
.site-header::before{
  content:"";
  position:absolute;
  inset:0;
  background:rgba(0,0,0,0.5); /* طبقة تعتيم فوق الصورة */
  z-index: 1;
}
.site-header-inner{
  position:relative;
  z-index:10; 
  display:flex;
  justify-content:space-between;
  align-items:center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0px 0px; 
  direction: rtl;
}

/* Styles for Logo and Title to be inline */
.site-brand {
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

/* Custom Logo Image */
.site-brand img{
    height: 200px; /* ارتفاع مناسب للشعار ليظهر بجانب النص */
    width:auto;
    transition: transform 0.3s;
}

.site-brand .site-title, .site-brand .site-description {
    color: #fff;
    text-decoration: none;
    line-height: 1.2;
}
.site-brand .site-title {
    font-size: 28px;
    font-weight: 700;
}
.site-brand .site-description {
    font-size: 14px;
    display: none; /* إخفاء الوصف ليظهر الشعار والعنوان في سطر واحد */
}

/* Main Navigation */
.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

.main-navigation a {
    color: #fff;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 16px;
    position: relative;
    z-index: 11;
}

.main-navigation a:hover {
    color: var(--accent);
}

/* Login Button */
.btn-login{
  background:var(--accent);
  color:#fff!important;
  padding:8px 16px;
  border-radius:8px;
  text-decoration:none;
  font-weight:700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.3s;
  position: relative;
  z-index: 11;
}
.btn-login:hover {
    background: #e69100; /* Darker accent on hover */
}

/* === Hero Section Styles === */
.hero-content {
    padding: 40px 0; 
    text-align: center;
    position: relative;
    z-index: 5; 
}

.hero-title {
    font-size: 48px;
    color: #fff;
    font-weight: 700;
    margin-bottom: 15px;
}

.hero-description {
    font-size: 20px;
    color: #fff;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.btn-hero {
    background: var(--accent);
    color: #fff !important;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    display: inline-block;
    transition: background 0.3s;
}

.btn-hero:hover {
    background: #e69100;
}
/* ========================================================= */
/* === 8. Departments Card Linking Styles === */
/* ========================================================= */

.dept-card-link {
    display: block; /* لجعل الرابط يغطي كامل مساحة البطاقة */
    text-decoration: none;
    color: inherit; /* يحافظ على لون النص داخل البطاقة */
    transition: transform 0.3s, box-shadow 0.3s;
}

/* التنسيق عند التمرير على البطاقة */
.dept-card-link:hover {
    transform: translateY(-5px); /* تأثير الرفع عند التمرير */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15); /* ظل واضح */
}

/* التأكد من أن النص والايقونة داخل البطاقة تحتفظ بألوانها */
.dept-card-link:hover .dept-card {
    color: var(--text-color); /* يمكن تغيير هذا اللون إذا أردتِ */
}

/* التأكد من أن البطاقات بنفس الارتفاع ضمن الـ Grid */
.departments-grid {
    display: grid;
    /* ... (تنسيقات الـ Grid الموجودة) ... */
}
.dept-card {
    height: 100%; /* ضمان ارتفاع متساوٍ */
    /* ... (تنسيقات البطاقة الموجودة) ... */
}
/* ========================================================= */
/* === 2. Front Page Sections (About & Departments) === */
/* ========================================================= */

.sec-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
}
.sec-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin: 10px auto 0;
}

/* About Section */
.about-fedniy {
    padding: 60px 0;
    background: var(--light-bg);
    margin-top: -10px; /* للتغطية على أي مسافة علوية غير مرغوبة */
}
.about-fedniy-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    gap: 40px;
    direction: rtl;
}

.about-img {
    flex: 0 0 45%;
    max-width: 45%;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.about-img img {
    width: 100%;
    height: auto;
    display: block;
}

.about-text {
    flex: 1;
    max-width: 55%;
}
.about-text h2 {
    font-size: 30px;
    color: var(--primary);
    margin-bottom: 20px;
}
.about-text p {
    margin-bottom: 15px;
    font-size: 17px;
    color: var(--text-color);
}

/* Departments Section */
.departments-section {
  padding: 50px 0;
  text-align: center;
}

.departments-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
  padding: 0 15px;
}

.dept-card {
  background: #fff;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
  text-align: center;
}
.dept-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.dept-icon {
  font-size: 40px;
  color: var(--accent);
  margin-bottom: 15px;
  display: block;
}

.dept-card h3 {
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 10px;
}

.dept-card p {
  font-size: 14px;
  color: #666;
}

/* ========================================================= */
/* === 3. Library Section (Shortcode Output) === */
/* ========================================================= */

.library-section {
    padding: 50px 0;
    text-align: center;
}

.fedniy-library-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 أعمدة */
    gap: 30px;
    text-align: right;
}

.fedniy-book-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s;
}
.fedniy-book-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.book-thumb {
    height: 200px;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid #eee;
}
.book-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fedniy-book-card h3.book-title {
    font-size: 18px;
    color: var(--primary);
    margin: 15px 15px 5px;
    font-weight: 700;
}

.fedniy-book-card p.book-excerpt {
    font-size: 14px;
    color: #666;
    margin: 0 15px 15px;
}

.book-actions {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px 15px;
    gap: 10px;
}

.book-actions a {
    flex-grow: 1;
    text-align: center;
    padding: 8px 0;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.3s;
}

.book-view {
    background: var(--primary);
    color: #fff !important;
}
.book-view:hover {
    background: #000;
}

.book-download {
    background: var(--accent);
    color: #fff !important;
}
.book-download:hover {
    background: #e69100;
}

.no-file {
    color: #999;
    font-style: italic;
    flex-grow: 1;
    text-align: center;
    padding: 8px 0;
}

/* ========================================================= */
/* === 4. Footer & Contact Banner === */
/* ========================================================= */

/* Contact Banner - Dark Gray Background */
.contact-banner {
    width: 100%;
    padding: 45px 0;
    background: var(--primary); /* رصاصي غامق */
    color: #fff;
    text-align: center;
}

.contact-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.contact-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 22px;
    direction: rtl;
}

/* عناصر التواصل */
.contact-items {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    direction: rtl;
}

.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    flex-direction: row-reverse; /* يحط الايقونة شمال */
    /* إضافة انتقال لوني للعنصر الأب استعداداً للتمرير */
    transition: color 0.3s;
}

/* التعديل رقم 1: نجعل العنصر الأب يضيء عند التمرير (للرقم والبريد) */
.contact-item:hover {
    color: var(--accent);
}

.contact-item i {
    font-size: 22px;
    color: var(--accent); /* اللون الافتراضي للأيقونة هو اللون المميز */
    transition: color 0.3s; /* إضافة انتقال للأيقونة */
}

/* التعديل رقم 2: نجعل الأيقونة تضيء بلون مختلف عند التمرير عليها */
.contact-item:hover i {
    color: #fff; /* يمكن تغيير اللون الذي تضيء به الأيقونة هنا، اخترت الأبيض */
}

.contact-item a {
    color: #fff;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s;
}

/* رابط الإيميل يتغير لونه عند التمرير (سيظل يعمل) */
.contact-item a:hover {
    color: var(--accent);
}

/* مهم لتنسيق الأرقام الدولية مع علامة + */
.contact-item span {
    direction: ltr; /* يخلي الرقم يُقرأ شمال → يمين */
    unicode-bidi: plaintext; /* يمنع قلب العلامات */
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 500;
}

/* Footer Bottom (Copyright) */
.footer-bottom {
    background: #000;
    color: #fff;
    padding: 15px 0;
    text-align: center;
}
.footer-bottom .copyright {
    margin: 0;
    font-size: 14px;
}
/* ========================================================= */
/* === 11. Fedniy Library Section === */
/* ========================================================= */
.fedniy-library-section {
    padding: 60px 0;
    text-align: center;
    background: var(--light-bg); /* لون خلفية فاتح */
}

.fedniy-library-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* عرض 4 كتب في الصف */
    gap: 30px;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
}

.fedniy-book-card {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.fedniy-book-card .book-thumb {
    width: 100%;
    height: 200px; /* ارتفاع ثابت لصور الكتب */
    overflow: hidden;
    margin-bottom: 10px;
    border-radius: 6px;
}

.fedniy-book-card .book-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fedniy-book-card .book-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    flex-grow: 1; /* للسماح بالعناوين الطويلة */
}

.fedniy-book-card .book-excerpt {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
}

.fedniy-book-card .book-actions {
    margin-top: auto; /* يدفع الأزرار للأسفل دائماً */
    display: flex;
    justify-content: space-around;
    gap: 8px;
}

.fedniy-book-card .book-actions a {
    flex-grow: 1;
    padding: 8px 5px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.fedniy-book-card .book-view {
    background: var(--accent);
    color: #fff;
}

.fedniy-book-card .book-download {
    background: #ccc;
    color: var(--text-color);
}

.library-more {
    margin-top: 30px;
}

/* التنسيق المتجاوب للمكتبة */
@media (max-width: 1200px) {
    .fedniy-library-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .fedniy-library-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 500px) {
    .fedniy-library-grid {
        grid-template-columns: 1fr;
    }
}
/* ========================================================= */
/* === 5. Single Post & General Content Styles === */
/* ========================================================= */

.container.single-page-content,
.container.single-post-content,
.container.blog-index-page {
    padding-top: 40px;
    padding-bottom: 40px;
    max-width: 850px; /* تحديد عرض مناسب للمحتوى المقروء */
}

/* Typography for content */
.entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4 {
    color: var(--primary);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.entry-content p {
    margin-bottom: 1em;
    font-size: 17px;
}

.entry-content ul, .entry-content ol {
    margin-bottom: 1em;
    padding-right: 20px;
}

.entry-content a {
    font-weight: 500;
}

/* Blog Index / Archive Styles */
.blog-index-page article {
    border-bottom: 1px solid #eee;
    padding-bottom: 25px;
    margin-bottom: 25px;
}
.blog-index-page article:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.blog-index-page h2 a {
    color: var(--primary);
    font-size: 24px;
    font-weight: 700;
}
.entry-meta {
    font-size: 14px;
    color: #888;
    margin-bottom: 15px;
}
.entry-meta span {
    margin-left: 10px;
}

.read-more-link {
    display: inline-block;
    padding: 5px 15px;
    background: var(--accent);
    color: #fff;
    border-radius: 4px;
    margin-top: 10px;
    transition: opacity 0.3s;
}
.read-more-link:hover {
    opacity: 0.9;
}

/* Pagination (The Posts Navigation) */
.navigation.pagination, .post-navigation {
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid #eee;
    margin-top: 30px;
}
.nav-links a {
    padding: 10px 15px;
    border: 1px solid var(--accent);
    color: var(--accent);
    margin: 0 5px;
    border-radius: 4px;
}
.nav-links a:hover {
    background: var(--accent);
    color: #fff;
}

/* ========================================================= */
/* === 6. Media Queries (Responsiveness) === */
/* ========================================================= */

@media (max-width: 1099px) {
    /* Header: تم إزالة flex-direction: column للحفاظ على الأجزاء في صف واحد */
    .site-header-inner {
        /* flex-direction: column; -- تم حذفها بناءً على طلب المستخدم */
        flex-wrap: wrap; /* للسماح بالعناصر بالنزول عند ضيق المساحة جداً */
        justify-content: center; /* لمحاذاة العناصر في المنتصف */
        padding-bottom: 30px; /* لزيادة المسافة في الأسفل */
    }
    .main-navigation ul {
        justify-content: center;
        margin: 15px 0;
        gap: 20px;
    }
    
    /* About Section */
    .about-fedniy-inner {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }
    .about-img, .about-text {
        max-width: 100%;
        flex: none;
    }

    /* Departments Grid */
    .departments-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Library Grid */
    .fedniy-library-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
}

@media (max-width: 768px) {
    .topbar-inner {
        flex-direction: column;
        gap: 8px;
    }
    .topbar-right, .topbar-left {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Hero Section */
    .hero-content {
        padding: 50px 0;
    }
    .hero-title {
        font-size: 36px;
    }
    .hero-description {
        font-size: 18px;
    }

    /* Departments Grid */
    .departments-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Library Grid */
    .fedniy-library-grid { 
        grid-template-columns: 1fr; 
    }
    
    /* General Content */
    .container.single-page-content,
    .container.single-post-content,
    .container.blog-index-page {
        padding-top: 25px;
        padding-bottom: 25px;
    }
}

@media (max-width: 500px) {
    /* Navigation */
    .main-navigation ul {
        flex-direction: column;
        gap: 10px;
    }
    .main-navigation li {
        width: 100%;
        text-align: center;
    }
    
    /* Departments Grid */
    .departments-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-items {
        flex-direction: column;
        gap: 15px;
    }
}
