/*
Theme Name: 1001 Tech
Theme URI: https://the1001tech.com
Author: 1001 Tech
Author URI: https://the1001tech.com
Description: قالب إخباري تقني احترافي لمنصة 1001 Tech - يدعم الوضع الداكن والفاتح
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tech1001
Tags: news, technology, rtl, arabic, dark-mode
*/

/* =============================================
   VARIABLES - Light Mode (Default)
   ============================================= */
:root {
  --brand1: #1e90ff;
  --brand2: #7c5cfc;
  --brand-grad: linear-gradient(90deg, #1e90ff, #7c5cfc);
  --brand-grad-v: linear-gradient(135deg, #1e90ff, #7c5cfc);

  --bg: #eef2ff;
  --surface: #ffffff;
  --surface2: #e8edfc;
  --border: rgba(26, 110, 216, 0.12);
  --text: #0d0f1a;
  --muted: #5a6080;
  --accent: #1a6ed8;
  --accent2: #6d44e8;
  --tag-bg: rgba(26, 110, 216, 0.09);
  --tag-color: #1a6ed8;
}

/* =============================================
   DARK MODE
   ============================================= */
body.dark-mode {
  --bg: #0d0f14;
  --surface: #13161f;
  --surface2: #1a1e2b;
  --border: rgba(100, 140, 255, 0.12);
  --text: #eef0f8;
  --muted: #8890aa;
  --accent: #4d9fff;
  --accent2: #a78bfa;
  --tag-bg: rgba(77, 159, 255, 0.13);
  --tag-color: #7bb8ff;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: 'Noto Kufi Arabic', 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent2); }

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

ul, ol { list-style: none; }

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Noto Serif Arabic', 'Georgia', serif;
  color: var(--text);
  line-height: 1.4;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1rem; color: var(--text); }

/* =============================================
   LAYOUT
   ============================================= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main.site-main { flex: 1; }

/* =============================================
   UTILITY CLASSES
   ============================================= */
.grad-text {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tag-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: var(--tag-color);
  background: var(--tag-bg);
  padding: 3px 10px;
  border-radius: 20px;
}

.section-title-bar {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Noto Kufi Arabic', sans-serif;
}
.section-title-bar::before {
  content: '';
  display: block;
  width: 3px;
  height: 18px;
  background: var(--brand-grad-v);
  border-radius: 2px;
  flex-shrink: 0;
}

.card {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--accent); }

.btn-grad {
  display: inline-block;
  background: var(--brand-grad);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 9px 20px;
  font-size: 13px;
  font-family: 'Noto Kufi Arabic', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-grad:hover { opacity: 0.9; color: #fff; }

.meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.meta-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.logo img {
    max-height: 40px; /* تحكم في طول اللوغو من هنا */
    width: auto;
    display: block;
}

/* هذا الكود يضمن أن اللوغو المرفوع يأخذ نفس شكل التنسيق */
.custom-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}
/* تنسيق اللوغو في الفوتر */
.footer-logo-wrap img {
    max-height: 40px; /* يمكنك تصغيره أو تكبيره حسب الرغبة */
    width: auto;
    display: inline-block;
    filter: brightness(1); /* لضمان وضوحه في الخلفية الداكنة */
}

/* إزالة أي تنسيقات افتراضية قد تظهر حول الرابط */
.footer-logo-wrap .custom-logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
}
/* تنسيق اللوغو في الهيدر (الفوق) */
.logo .custom-logo-link img {
    max-height: 45px; /* تصغير الحجم قليلاً ليكون متناسق */
    width: auto;
    object-fit: contain;
}

/* تنسيق اللوغو في الفوتر (التحت) */
.footer-logo-wrap .custom-logo-link img {
    max-height: 35px; /* حجم أصغر للفوتر ليظهر بأناقة */
    width: auto;
    object-fit: contain;
    margin-bottom: 10px;
}

/* إصلاح مشكلة اختفاء التصنيفات أو تداخلها */
.footer-nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* ترك مسافة بين الأقسام */
}
/* ضبط اللوغو في كل الموقع */
.custom-logo-link {
    display: inline-flex !important;
    align-items: center !important;
}

.custom-logo {
    width: auto !important;
    height: auto !important;
}

/* حجم اللوغو الفوق (الهيدر) */
.topbar .custom-logo {
    max-height: 35px !important; /* نقص هنا إذا جالك كبير */
}

/* حجم اللوغو التحت (الفوتر) */
.site-footer .custom-logo {
    max-height: 30px !important; /* حجم صغير وأنيق للفوتر */
    margin-bottom: 0 !important;
}

/* تنظيم الفوتر باش مايجيش "بشع" */
.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

/* تصغير الخط تاع التصنيفات في الفوتر */
.footer-nav ul.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px !important; /* خط صغير واحترافي */
    opacity: 0.8;
}
/* إصلاح اللوغو في الفوتر */
.footer-logo-wrap .custom-logo-link {
    display: block !important;
    line-height: 0 !important;
    margin-bottom: 10px !important;
}

.footer-logo-wrap .custom-logo {
    max-height: 40px !important; /* هذا هو السر، حددنا الطول بدقة */
    width: auto !important;
    object-fit: contain !important;
    display: inline-block !important;
}

/* إخفاء النص القديم أو أيقونة اللانهاية إذا بقيت تظهر خلف الصورة */
.footer-logo-icon, .footer-logo-text {
    display: none !important;
}

/* تنظيم قسم الفوتر */
.footer-brand {
    text-align: right !important; /* لضمان المحاذاة لليمين بالعربية */
    padding-bottom: 20px !important;
}

.footer-tagline {
    font-size: 13px !important;
    color: #888 !important;
    margin-top: 5px !important;
}

/* إصلاح قائمة التصنيفات */
.footer-nav .footer-links {
    display: flex !important;
    gap: 20px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 15px 0 !important;
    border-top: 1px solid #222; /* خط فاصل بسيط يعطي أناقة */
    padding-top: 15px !important;
}