/* Theme overrides for أدوات AI بالعربي.
   Default (no data-theme, or data-theme="dark") = the site's current look:
   dark navy (#0b0f1e) with gold (#facc15) accents. Nothing below changes it.
   data-theme="light" = the light variant: same layout, same gold accents,
   light backgrounds with dark navy text. Only the overrides live here, so
   the inline styles in each page stay untouched. */

html[data-theme="light"] body { background: #f1f5f9; color: #0f172a; }

html[data-theme="light"] nav.mainnav { background: #ffffff; border-bottom: 1px solid #e2e8f0; }
html[data-theme="light"] nav.mainnav a { color: #0f172a; }
html[data-theme="light"] nav.mainnav a:hover { color: #b45309; }

html[data-theme="light"] .toolbar input { background: #ffffff; border: 1px solid #cbd5e1; color: #0f172a; }
html[data-theme="light"] .chip { background: #ffffff; border: 1px solid #cbd5e1; color: #0f172a; }
html[data-theme="light"] .chip.active { background: #7c3aed; border-color: #7c3aed; color: #ffffff; }

html[data-theme="light"] .card { background: #ffffff; border: 1px solid #e2e8f0; }
html[data-theme="light"] .card.featured { border: 2px solid #facc15; background: linear-gradient(180deg, #fefce8, #ffffff); }
html[data-theme="light"] .card p, html[data-theme="light"] .card ul { color: #475569; }
html[data-theme="light"] .badge.direct { background: #e2e8f0; color: #334155; }

html[data-theme="light"] .btn.ghost { border: 1px solid #94a3b8; color: #0f172a; }
html[data-theme="light"] .codebox { background: #f8fafc; border: 1px dashed #facc15; }
html[data-theme="light"] .codebox b { color: #a16207; }
html[data-theme="light"] .steps { color: #475569; }
html[data-theme="light"] .section-sub { color: #64748b; }

html[data-theme="light"] article h2 { color: #b45309; }
html[data-theme="light"] article p, html[data-theme="light"] article li { color: #334155; }
html[data-theme="light"] .warn { background: #fffbeb; border: 1px solid #f59e0b; }
html[data-theme="light"] .warn p { color: #92400e; }

html[data-theme="light"] .related { border-top: 1px solid #e2e8f0; }
html[data-theme="light"] .related h2 { color: #b45309; }
html[data-theme="light"] .related a { color: #6d28d9; }

html[data-theme="light"] figure figcaption { color: #64748b; }
html[data-theme="light"] .imgcredit { color: #94a3b8; }
html[data-theme="light"] .imgcredit a { color: #94a3b8; }

html[data-theme="light"] footer { border-top: 1px solid #e2e8f0; color: #64748b; }
html[data-theme="light"] footer a { color: #7c3aed; }

/* Theme toggle button: sits in nav.mainnav. Dark nav (default) = light
   button; light nav (light theme) = dark button. */
.theme-toggle {
  display: inline-block;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .35);
  color: #ffffff;
  border-radius: 999px;
  padding: 6px 14px;
  margin: 0 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: .9rem;
  font-family: inherit;
  white-space: nowrap;
}
html[data-theme="light"] .theme-toggle { border-color: #cbd5e1; color: #0f172a; }

/* Keep the nav tidy on small screens: links + toggle wrap cleanly. */
@media (max-width: 600px) {
  nav.mainnav .wrap { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; }
  nav.mainnav a, .theme-toggle { margin: 2px 8px; }
}
