* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f7fa;
  color: #222;
  line-height: 1.8;
}

/* =========================
   HEADER
========================= */

header {
  background: #111827;
  color: white;
  text-align: center;
  padding: 45px 20px;
}

header h1 {
  margin: 0;
  font-size: 40px;
}

header h1 a {
  color: white !important;
  text-decoration: none !important;
}

header p {
  margin: 10px 0 0;
  font-size: 18px;
}

/* =========================
   NAV
========================= */

nav {
  background: white;
  padding: 15px;
  text-align: center;
  border-bottom: 1px solid #ddd;
}

nav a {
  color: #222;
  text-decoration: none;
  margin: 0 12px;
  font-weight: bold;
}

/* =========================
   MAIN
========================= */

main {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
}

/* المقالات والأقسام العامة */

article,
section {
  background: white;
  padding: 25px;
  margin-bottom: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

article h3 {
  font-size: 28px;
  margin-top: 0;
}

article h4 {
  font-size: 21px;
  margin-top: 25px;
}

/* =========================
   FOOTER
========================= */

footer {
  background: #111827;
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: 50px;
}

/* =========================
   ARTICLE PAGE
========================= */

.article-page {
  max-width: 850px;
  margin: 50px auto;
  padding: 40px;
}

.article-header {
  border-bottom: 1px solid #eee;
  padding-bottom: 25px;
  margin-bottom: 30px;
}

.category {
  display: inline-block;
  background: #eef2ff;
  color: #4338ca;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
}

.article-header h2 {
  font-size: 38px;
  line-height: 1.4;
  margin: 18px 0 10px;
}

.article-date {
  color: #777;
  font-size: 14px;
}

.article-content {
  font-size: 18px;
  padding: 0 18px;
}

.article-content h3 {
  font-size: 25px;
  margin-top: 35px;
}

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

.article-content li {
  margin: 10px 0;
}

.intro {
  font-size: 20px;
  font-weight: bold;
}
.article-content .intro {
  margin-bottom: 15px;
  line-height: 1.8;
}

.tip-box {
  background: #f5f7fa;
  border-right: 4px solid #111827;
  padding: 20px;
  margin: 30px 0;
  border-radius: 8px;
}

.tip-box p {
  margin-bottom: 0;
}

.back-home {
  display: inline-block;
  margin-top: 35px;
  text-decoration: none;
  font-weight: bold;
  color: #111827;
}

/* =========================
   HOME ARTICLE CARDS
========================= */

.home-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  max-width: 850px;
  margin: 30px auto;
}

.home-card > img {
  display: block;
  width: 50% !important;
  max-width: 300px !important;
  height: auto !important;
  object-fit: contain !important;
  margin: 0 auto !important;
}

.home-card-content {
  padding: 25px;
}

.home-card-content h3 {
  font-size: 28px;
  margin: 15px 0 10px;
}

.home-card-content p {
  color: #666;
  font-size: 17px;
}

.read-more {
  display: inline-block;
  margin-top: 15px;
  background: #111827;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
}

.read-more:hover {
  opacity: 0.85;
}

/* =========================
   COMPARISON TABLE
========================= */

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 30px 0;
  font-size: 16px;
}

.comparison-table th,
.comparison-table td {
  border: 1px solid #ddd;
  padding: 14px;
  text-align: center;
}

.comparison-table th {
  font-weight: bold;
}

.comparison-table tr:nth-child(even) {
  background: #f8fafc;
}

/* =========================
   ARTICLE IMAGE
========================= */

.article-image {
  display: block;
  width: 50% !important;
  max-width: 350px !important;
  height: auto !important;
  object-fit: contain !important;
  margin: 30px auto !important;
  border-radius: 12px;
}

/* =========================
   AI IMAGE DETECTOR
========================= */

.ai-detector {
  max-width: 650px;
  margin: 30px auto;
  text-align: center;
}

.upload-box {
  margin-bottom: 20px;
}

/* Drag & Drop */

.drop-zone {
  width: 100%;
  max-width: 600px;
  min-height: 250px;
  margin: 25px auto;
  border: 2px dashed #999;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.drop-zone:hover {
  border-color: #333;
  transform: translateY(-2px);
}

.drop-zone.dragover {
  border-color: #333;
  background: rgba(0, 0, 0, 0.05);
  transform: scale(1.01);
}

/* Upload Icon */

.upload-icon {
  font-size: 45px;
  margin-bottom: 10px;
}

/* Upload Text */

.drop-zone h3 {
  margin: 5px 0;
  font-size: 22px;
}

.drop-zone p {
  margin: 5px 0;
  opacity: 0.7;
}

.drop-zone span {
  font-size: 13px;
  opacity: 0.6;
  margin: 8px 0 15px;
}

/* Browse Button */

#browseButton {
  border: none;
  padding: 11px 22px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 15px;
}

/* Preview */

.image-preview {
  margin: 20px auto;
}

.image-preview img {
  width: 280px;
  height: 280px;
  max-width: 90%;
  object-fit: contain;
  border-radius: 15px;
  display: block;
  margin: auto;
}

/* Analyze / Reset */

#analyzeButton,
.reset-button {
  padding: 12px 25px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  margin: 10px;
}

#analyzeButton:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Result */

.detector-result {
  margin-top: 25px;
  padding: 25px;
  border-radius: 15px;
}

.detector-result.high {
  border: 2px solid #d9534f;
}

.detector-result.medium {
  border: 2px solid #f0ad4e;
}

.detector-result.low {
  border: 2px solid #5cb85c;
}

.ai-percentage {
  font-size: 48px;
  font-weight: bold;
  margin: 15px 0;
}

.progress-container {
  width: 100%;
  height: 14px;
  background: #ddd;
  border-radius: 20px;
  overflow: hidden;
  margin: 20px 0;
}

.progress-bar {
  height: 100%;
  border-radius: 20px;
  transition: width 1s ease;
}

.result-description {
  margin-top: 20px;
  line-height: 1.8;
}

.detector-error {
  margin-top: 20px;
  padding: 15px;
  border-radius: 10px;
}

.detector-note {
  text-align: center;
  font-size: 14px;
  opacity: 0.8;
  margin-top: 20px;
}

/* =========================
   DARK MODE BUTTON
========================= */

#darkModeToggle {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  margin: 0 12px;
  padding: 6px 10px;
  border-radius: 8px;
}

#darkModeToggle:hover {
  background: #f1f1f1;
}

/* =========================
   DARK MODE
========================= */

body.dark-mode {
  background: #111827;
  color: #f3f4f6;
}

body.dark-mode header {
  background: #030712;
}

body.dark-mode nav {
  background: #1f2937;
  border-bottom-color: #374151;
}

body.dark-mode nav a {
  color: #f3f4f6;
}

body.dark-mode #darkModeToggle {
  color: #f3f4f6;
}

body.dark-mode #darkModeToggle:hover {
  background: #374151;
}

body.dark-mode article,
body.dark-mode section {
  background: #1f2937;
  color: #f3f4f6;
}

body.dark-mode .home-card-content p {
  color: #d1d5db;
}

body.dark-mode .article-date {
  color: #9ca3af;
}

body.dark-mode .tip-box {
  background: #111827;
  border-right-color: #9ca3af;
}

body.dark-mode .back-home {
  color: #f3f4f6;
}

body.dark-mode footer {
  background: #030712;
}

body.dark-mode .drop-zone {
  border-color: #6b7280;
}

body.dark-mode .drop-zone:hover {
  border-color: #d1d5db;
}

body.dark-mode .drop-zone.dragover {
  background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .score-circle-inner {
  background: #1f2937;
}

body.dark-mode .score-circle-inner span {
  color: #f3f4f6 !important;
}

body.dark-mode .progress-container {
  background: #374151;
}

/* =========================
   COMPARISON TABLE DARK MODE
========================= */

body.dark-mode table {
  color: #f3f4f6;
}

body.dark-mode table th {
  background: #111827 !important;
  color: #ffffff !important;
}

body.dark-mode table td {
  background: #1f2937 !important;
  color: #f3f4f6 !important;
}

body.dark-mode table tr:nth-child(even) td {
  background: #374151 !important;
  color: #f3f4f6 !important;
}

/* =========================
   RELATED ARTICLES
========================= */

.related-articles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 25px 0 35px;
}

.related-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  transition: 0.25s ease;
}

.related-card:hover {
  transform: translateY(-3px);
  border-color: #2563eb;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.related-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 12px;
  font-size: 24px;
}

.related-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.related-card p {
  margin: 0 0 8px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.7;
}

.related-card span {
  color: #2563eb;
  font-size: 14px;
  font-weight: bold;
}

/* =========================
   CLAUDE VS CHATGPT LINK
========================= */

.comparison-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 18px 20px;
  margin: 20px 0 30px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  transition: 0.25s ease;
}

.comparison-link:hover {
  transform: translateY(-2px);
  border-color: #2563eb;
}

.comparison-link strong {
  font-size: 18px;
}

.comparison-link span {
  color: #2563eb;
  font-size: 14px;
  font-weight: bold;
}

.dark-mode .related-card,
.dark-mode .comparison-link {
  background: #1f2937;
  border-color: #374151;
}

.dark-mode .related-card:hover,
.dark-mode .comparison-link:hover {
  border-color: #60a5fa;
}

.dark-mode .related-icon {
  background: #111827;
}

.dark-mode .related-card p {
  color: #d1d5db;
}

.dark-mode .related-card span,
.dark-mode .comparison-link span {
  color: #60a5fa;
}

/* =========================
   ARTICLES GRID
========================= */

.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 25px;
}

.articles-grid .home-card {
  margin: 0;
}

/* =========================
   SEARCH BAR
========================= */

.site-search {
  max-width: 900px;

  /* إلغاء شكل الـ section العام */
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;

  margin: 22px auto;
  padding: 0 15px;
}

.search-box {
  position: relative;
  max-width: 650px;
  margin: auto;
}

.search-box input {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 18px;

  border: 1px solid #d9dee7;
  border-radius: 28px;

  background: #fff;
  color: #111827;

  font-size: 16px;
  font-family: inherit;

  outline: none;
  transition: 0.2s ease;

  direction: rtl;
}

.search-box input::placeholder {
  color: #9ca3af;
}

.search-box input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.search-icon {
  position: absolute;
  right: 18px;
  top: 50%;

  transform: translateY(-52%);

  font-size: 24px;
  color: #6b7280;

  pointer-events: none;
  z-index: 2;
}

.search-results {
  max-width: 650px;
  margin: 12px auto 0;
}

.search-result {
  display: block;

  padding: 14px 16px;
  margin-bottom: 8px;

  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;

  color: inherit;
  text-decoration: none;

  transition: 0.2s ease;
}

.search-result:hover {
  border-color: #2563eb;
  transform: translateY(-1px);
}

.search-result h3 {
  margin: 0 0 5px;
  font-size: 17px;
}

.search-result p {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
}

.search-empty {
  text-align: center;
  padding: 12px;
  color: #6b7280;
  font-size: 14px;
}

/* Search Dark Mode */

body.dark-mode .search-box input {
  background: #1f2937;
  color: #fff;
  border-color: #374151;
}

body.dark-mode .search-box input::placeholder {
  color: #9ca3af;
}

body.dark-mode .search-icon {
  color: #9ca3af;
}

body.dark-mode .search-result {
  background: #1f2937;
  border-color: #374151;
}

body.dark-mode .search-result p {
  color: #9ca3af;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 600px) {

  header h1 {
    font-size: 32px;
  }

  nav a {
    display: inline-block;
    margin: 5px;
  }

  article,
  section {
    padding: 18px;
  }

  /* Article */

  .article-page {
    margin: 20px auto;
    padding: 22px;
  }

  .article-header h2 {
    font-size: 29px;
  }

  .article-content {
    font-size: 17px;
  }

  /* Home Cards */

  .home-card > img {
    width: 70% !important;
    max-width: 250px !important;
    height: auto !important;
  }

  .home-card-content h3 {
    font-size: 23px;
  }

  /* Article Images */

  .article-image {
    width: 70% !important;
    max-width: 280px !important;
  }

  /* Comparison Table */

  .comparison-table {
    font-size: 14px;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 9px 6px;
  }

  /* Detector */

  .drop-zone {
    min-height: 220px;
    padding: 25px 15px;
  }

  .drop-zone h3 {
    font-size: 19px;
  }

  .image-preview img {
    width: 220px;
    height: 220px;
  }

  /* Related Articles */

  .related-articles {
    grid-template-columns: 1fr;
  }

  .comparison-link {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Articles Grid
     الموبايل يرجع مقال واحد
  */

  .articles-grid {
    display: block;
    margin-top: 25px;
  }

  .articles-grid .home-card {
    margin-bottom: 20px;
  }

  /* Search */

  .site-search {
    margin: 18px auto;
    padding: 0 12px;
  }

  .search-box input {
    height: 48px;
    font-size: 15px;
  }
  }


.home-card img {
  border-radius: 12px;
}


/* تنسيق موحد ومريح لقراءة المقالات */
.article-content {
    font-size: 16px;
    line-height: 1.9;
    max-width: 100%;
}

.article-content p {
    margin-top: 0;
    margin-bottom: 22px;
    line-height: 1.9;
}

.article-content h3 {
    font-size: 22px;
    line-height: 1.5;
    margin-top: 38px;
    margin-bottom: 18px;
}

.article-content h4 {
    font-size: 18px;
    line-height: 1.6;
    margin-top: 25px;
    margin-bottom: 12px;
}

.article-content ul,
.article-content ol {
    padding-right: 25px;
    margin-top: 10px;
    margin-bottom: 24px;
    line-height: 2;
}

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

@media (max-width: 600px) {
    .article-content {
        font-size: 15px;
    }

    .article-content h3 {
        font-size: 20px;
    }

    .article-content h4 {
        font-size: 17px;
    }

    .article-content p {
        margin-bottom: 19px;
    }
}

/* =================================
   تحسين قراءة الصفحة الرئيسية
================================= */

/* النصوص العامة */
#home {
    font-size: 16px;
    line-height: 1.9;
}

/* عناوين الأقسام */
#home > section > h2 {
    font-size: 25px;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* وصف الأقسام */
#home > section > p {
    font-size: 16px;
    line-height: 1.9;
    margin-bottom: 22px;
}

/* بطاقات المقالات */
.home-card {
    overflow: hidden;
    margin-bottom: 28px;
    border-radius: 12px;
}

/* محتوى البطاقة */
.home-card-content {
    padding: 20px;
}

/* تصنيف المقال */
.home-card .category {
    font-size: 13px;
    margin-bottom: 10px;
}

/* تاريخ المقال */
.home-card .article-date {
    font-size: 13px;
    margin-bottom: 10px;
    display: inline-block;
}

/* عنوان المقال */
.home-card h3 {
    font-size: 19px;
    line-height: 1.7;
    margin-top: 8px;
    margin-bottom: 12px;
}

/* وصف المقال */
.home-card p {
    font-size: 15px;
    line-height: 1.9;
    margin-top: 0;
    margin-bottom: 18px;
}

/* رابط قراءة المقال */
.home-card .read-more {
    font-size: 15px;
    display: inline-block;
    margin-top: 5px;
}

/* الصور */
.home-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* البحث */
.site-search {
    margin: 25px auto;
    max-width: 900px;
    padding: 0 20px;
}

.search-box input {
    font-size: 15px;
    line-height: 1.8;
}

/* كاشف الصور */
#detector > p {
    font-size: 15px;
    line-height: 1.9;
    margin-bottom: 20px;
}

.detector-note {
    font-size: 14px;
    line-height: 1.9;
    margin-top: 20px;
}

/* قسم عن الموقع */
#about p {
    font-size: 16px;
    line-height: 2;
    margin-bottom: 20px;
}

/* =================================
   تحسين الموبايل
================================= */

@media (max-width: 600px) {

    #home {
        font-size: 15px;
    }

    #home > section > h2 {
        font-size: 22px;
        margin-bottom: 14px;
    }

    #home > section > p {
        font-size: 15px;
        margin-bottom: 20px;
    }

    .home-card {
        margin-bottom: 22px;
        border-radius: 10px;
    }

    .home-card-content {
        padding: 16px;
    }

    .home-card h3 {
        font-size: 17px;
        line-height: 1.75;
        margin-bottom: 10px;
    }

    .home-card p {
        font-size: 14px;
        line-height: 1.9;
        margin-bottom: 15px;
    }

    .home-card .read-more {
        font-size: 14px;
    }

    .home-card .category,
    .home-card .article-date {
        font-size: 12px;
    }

    #about p {
        font-size: 15px;
        line-height: 1.9;
    }

    .site-search {
        margin: 20px auto;
        padding: 0 15px;
    }
}

/* روابط الفوتر */
.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.footer-links a {
    color: inherit;
    text-decoration: none;
    font-size: 14px;
}

.footer-links a:hover {
    text-decoration: underline;
}

footer p {
    font-size: 14px;
    line-height: 1.8;
    margin: 10px 0;
}

@media (max-width: 600px) {
    .footer-links {
        gap: 14px;
    }

    .footer-links a {
        font-size: 13px;
    }

    footer p {
        font-size: 13px;
    }
}

/* ==========================================
   AI بالعربي - تحسين الصفحة الرئيسية
========================================== */

/* المسافات العامة */
#home {
    line-height: 1.9;
}

/* الأقسام */
#home > section {
    margin-bottom: 30px;
}

/* عناوين الأقسام */
#home > section > h2 {
    font-size: 24px;
    line-height: 1.5;
    margin-bottom: 14px;
}

/* وصف الأقسام */
#home > section > p {
    font-size: 15px;
    line-height: 1.9;
    margin: 0 0 22px;
}

/* بطاقات المقالات */
#latest-articles .home-card {
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 24px;
}

/* الصور */
#latest-articles .home-card img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* محتوى البطاقة */
#latest-articles .home-card-content {
    padding: 18px 20px 20px;
}

/* التصنيف */
#latest-articles .category {
    display: inline-block;
    font-size: 13px;
    margin-bottom: 8px;
}

/* تاريخ المقال */
#latest-articles .article-date {
    display: inline-block;
    font-size: 13px;
    margin-bottom: 8px;
}

/* عنوان المقال */
#latest-articles .home-card h3 {
    font-size: 19px;
    line-height: 1.7;
    margin: 5px 0 12px;
}

/* وصف المقال */
#latest-articles .home-card p {
    font-size: 15px;
    line-height: 1.9;
    margin: 0 0 16px;
}

/* رابط المقال */
#latest-articles .read-more {
    font-size: 14px;
}

/* تحسين قسم البحث */
.site-search {
    max-width: 900px;
    margin: 25px auto;
    padding: 0 20px;
}

/* كاشف الصور */
#detector h2 {
    line-height: 1.6;
}

#detector > p {
    font-size: 15px;
    line-height: 1.9;
}

.detector-note {
    font-size: 14px;
    line-height: 1.9;
}

/* قسم عن الموقع */
#about p {
    font-size: 15px;
    line-height: 2;
    margin-bottom: 18px;
}

/* روابط الفوتر */
.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 15px;
}

.footer-links a {
    font-size: 14px;
    color: inherit;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* ==========================================
   الموبايل
========================================== */

@media (max-width: 600px) {

    #home > section > h2 {
        font-size: 21px;
    }

    #home > section > p {
        font-size: 14px;
    }

    #latest-articles .home-card {
        margin-bottom: 20px;
        border-radius: 10px;
    }

    #latest-articles .home-card-content {
        padding: 15px 16px 17px;
    }

    #latest-articles .home-card h3 {
        font-size: 17px;
        line-height: 1.75;
        margin-bottom: 10px;
    }

    #latest-articles .home-card p {
        font-size: 14px;
        line-height: 1.9;
        margin-bottom: 14px;
    }

    #latest-articles .category,
    #latest-articles .article-date {
        font-size: 12px;
    }

    #latest-articles .read-more {
        font-size: 13px;
    }

    #detector h2 {
        font-size: 20px;
    }

    #detector > p {
        font-size: 14px;
    }

    .site-search {
        padding: 0 15px;
        margin: 20px auto;
    }

    .footer-links {
        gap: 14px;
    }

    .footer-links a {
        font-size: 13px;
    }
}

/* =================================
   تصميم بطاقات المقالات - AI بالعربي
================================= */

.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

.articles-grid .home-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.articles-grid .home-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.09);
}

.articles-grid .home-card > img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #f1f5f9;
}

.articles-grid .home-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px;
}

.articles-grid .category {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 9px;
  padding: 5px 10px;
  border-radius: 20px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
}

.articles-grid .article-date {
  display: block;
  margin-bottom: 8px;
  color: #6b7280;
  font-size: 12px;
}

.articles-grid .home-card h3 {
  margin: 4px 0 10px;
  font-size: 18px;
  line-height: 1.7;
  color: #111827;
}

.articles-grid .home-card p {
  margin: 0 0 18px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.9;
}

.articles-grid .read-more {
  margin-top: auto;
  align-self: flex-start;
  color: #2563eb;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.articles-grid .read-more:hover {
  text-decoration: underline;
}


/* البطاقة المميزة */

.featured-section .articles-grid {
  grid-template-columns: 1fr;
}

.featured-card {
  display: grid !important;
  grid-template-columns: 1.1fr 1fr;
  border: 2px solid #8b5cf6 !important;
}

.featured-card > img {
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.featured-card .home-card-content {
  justify-content: center;
  padding: 24px;
}

.featured-badge {
  align-self: flex-start;
}

/* الوضع الداكن */

body.dark-mode .articles-grid .home-card {
  background: #1f2937;
  border-color: #374151;
}

body.dark-mode .articles-grid .home-card h3 {
  color: #f9fafb;
}

body.dark-mode .articles-grid .home-card p,
body.dark-mode .articles-grid .article-date {
  color: #d1d5db;
}

body.dark-mode .articles-grid .category {
  background: #1e3a5f;
  color: #bfdbfe;
}

/* الموبايل */

@media (max-width: 650px) {
  .articles-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .articles-grid .home-card-content {
    padding: 16px;
  }

  .articles-grid .home-card h3 {
    font-size: 17px;
  }

  .featured-card {
    display: flex !important;
    flex-direction: column;
  }

  .featured-card > img {
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .featured-card .home-card-content {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .articles-grid .home-card {
    transition: none;
  }

  .articles-grid .home-card:hover {
    transform: none;
  }
}


.site-brand {
    margin: 0 0 8px;
}

.site-brand a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-ai {
    font-family: 'Montserrat', sans-serif;
    font-size: 38px;
    font-weight: 900;
    color: #d9ad62;
    letter-spacing: -2px;
}

.brand-ar {
    font-family: 'Reem Kufi', sans-serif;
    font-size: 34px;
    font-weight: 700;
    color: #ffffff;
}

.site-header p {
    margin: 0;
    font-size: 14px;
}

@media (max-width: 600px) {
    .brand-ai {
        font-size: 31px;
    }

    .brand-ar {
        font-size: 28px;
    }
}
body {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
}

h1, h2, h3, h4 {
    font-family: 'Reem Kufi', sans-serif;
    font-weight: 700;
}

.site-brand .brand-ai {
    font-family: 'Montserrat', sans-serif;
}

.site-brand .brand-ar {
    font-family: 'Reem Kufi', sans-serif;
}
.en-text {
    color: #d9ad62;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
}


/* ==========================================
   AI بالعربي - MODERN HEADER & NAVIGATION
   White + Gold + Full Dark Mode
========================================== */

/* HEADER */

header.site-header {
  background: #ffffff !important;
  color: #111827 !important;
  text-align: center;
  padding: 28px 20px 22px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.3s ease, color 0.3s ease;
}

.header-inner {
  max-width: 1100px;
  margin: auto;
}

.site-brand {
  margin: 0 0 8px;
}

.site-brand a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}

.site-brand .brand-ai {
  color: #c99a35 !important;
  font-size: 42px;
}

.site-brand .brand-ar {
  color: #111827 !important;
  font-size: 38px;
}

.site-header p {
  color: #64748b;
  font-size: 15px;
  margin: 5px 0 0;
}

/* NAVIGATION BAR */

nav.site-nav {
  position: relative;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #ffffff !important;
  padding: 10px 15px;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.site-nav .nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  width: 100%;
  max-width: 1150px;
}

.site-nav .nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1f2937 !important;
  text-decoration: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 11px 16px;
  margin: 0;
  border-radius: 10px;
  transition: 0.2s ease;
}

.site-nav .nav-links a:hover {
  background: #fbf5e9;
  color: #a77b25 !important;
}

/* DARK MODE BUTTON */

.site-nav #darkModeToggle {
  color: #ffffff !important;
  background: #c99a35;
  border: 1px solid #c99a35;
  border-radius: 10px;
  padding: 10px 16px;
  margin: 0 5px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.site-nav #darkModeToggle:hover {
  background: #ad8128;
  border-color: #ad8128;
}

/* HAMBURGER BUTTON */

.menu-toggle {
  display: none;
  width: 44px;
  height: 42px;
  padding: 9px;
  border: none;
  border-radius: 10px;
  background: #111827;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 23px;
  height: 2px;
  margin: 5px auto;
  background: #ffffff;
  border-radius: 5px;
  transition: 0.25s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================
   DARK MODE - HEADER & NAV
========================================== */

body.dark-mode header.site-header {
  background: #111827 !important;
  color: #f9fafb !important;
  border-bottom-color: #374151;
}

body.dark-mode .site-brand .brand-ar {
  color: #ffffff !important;
}

body.dark-mode .site-header p {
  color: #cbd5e1;
}

body.dark-mode nav.site-nav {
  background: #1f2937 !important;
  border-bottom-color: #374151;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

body.dark-mode .site-nav .nav-links a {
  color: #f3f4f6 !important;
}

body.dark-mode .site-nav .nav-links a:hover {
  background: #374151;
  color: #e3bd70 !important;
}

body.dark-mode .site-nav #darkModeToggle {
  background: #c99a35;
  color: #111827 !important;
  border-color: #c99a35;
}

body.dark-mode .menu-toggle {
  background: #c99a35;
}

body.dark-mode .menu-toggle span {
  background: #111827;
}

/* ==========================================
   MOBILE NAVIGATION
========================================== */

@media (max-width: 768px) {

  header.site-header {
    padding: 23px 15px 18px;
  }

  .site-brand .brand-ai {
    font-size: 35px;
  }

  .site-brand .brand-ar {
    font-size: 31px;
  }

  .site-header p {
    font-size: 13px;
  }

  nav.site-nav {
    display: flex;
    justify-content: flex-start;
    padding: 9px 15px;
  }

  .menu-toggle {
    display: block;
    flex-shrink: 0;
  }

  .site-nav .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    width: 100%;
    max-width: none;
    padding: 14px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .site-nav .nav-links.active {
    display: flex;
  }

  .site-nav .nav-links a {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 15px;
    border-radius: 9px;
    font-size: 15px;
  }

  .site-nav #darkModeToggle {
    width: 100%;
    margin: 5px 0 0;
    padding: 12px;
  }

  /* Mobile Dark Menu */

  body.dark-mode .site-nav .nav-links {
    background: #1f2937;
    border-bottom-color: #374151;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
  }

  body.dark-mode .site-nav .nav-links a:hover {
    background: #374151;
  }
}

/* Smaller phones */

@media (max-width: 380px) {

  .site-brand .brand-ai {
    font-size: 31px;
  }

  .site-brand .brand-ar {
    font-size: 28px;
  }

  .site-header p {
    font-size: 12px;
  }
}


/* ================================
   AI TOOLS SECTION
================================ */

#ai-tools {
  margin: 35px 0;
  padding: 25px;
  background: #ffffff;
  border-radius: 14px;
  direction: rtl;
}

#ai-tools h2 {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 10px;
}

#ai-tools > p {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  color: #64748b;
  font-size: 15px;
  line-height: 1.8;
  margin: 0 0 22px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.tool-card img {
  display: block;
  width: 100%;
  height: 155px;
  object-fit: cover;
  background: #e2e8f0;
}

.tool-card-content {
  padding: 16px;
}

.tool-card-content h3 {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px;
}

.tool-card-content p {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-size: 14px;
  line-height: 1.8;
  color: #64748b;
  margin: 0 0 14px;
}

.tool-card-content span {
  display: inline-block;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #0284c7;
}

.coming-soon {
  cursor: default;
}

.coming-soon:hover {
  transform: none;
  box-shadow: none;
}

.coming-soon .tool-card-content span {
  color: #94a3b8;
}


/* Mobile: 2 Cards Per Row */

@media (max-width: 600px) {

  #ai-tools {
    padding: 15px;
    margin: 25px 0;
  }

  #ai-tools h2 {
    font-size: 20px;
  }

  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .tool-card img {
    width: 100%;
    height: 115px;
    object-fit: cover;
  }

  .tool-card-content {
    padding: 10px;
  }

  .tool-card-content h3 {
    font-size: 15px;
  }

  .tool-card-content p {
    font-size: 12px;
    line-height: 1.6;
  }

  .tool-card-content span {
    font-size: 12px;
  }

    }


/* AI TOOLS - DARK MODE */

body.dark-mode #ai-tools {
  background: #1f2937;
}

body.dark-mode #ai-tools h2 {
  color: #f9fafb;
}

body.dark-mode #ai-tools > p {
  color: #cbd5e1;
}

body.dark-mode .tool-card {
  background: #111827;
  border-color: #374151;
}

body.dark-mode .tool-card-content h3 {
  color: #f9fafb;
}

body.dark-mode .tool-card-content p {
  color: #cbd5e1;
}

body.dark-mode .tool-card-content span {
  color: #38bdf8;
}

body.dark-mode .coming-soon .tool-card-content span {
  color: #94a3b8;
}

body.dark-mode .tool-card img {
  background: #374151;
}
