/* 0xSecurity — RTL Arabic overrides for PaperMod
   Loaded after PaperMod's CSS via the custom CSS hook in layouts/partials. */

html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
  font-family: "Tajawal", "Cairo", "Noto Sans Arabic", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.85;
}

/* Headings in Arabic-friendly weight */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 {
  font-family: "Cairo", "Tajawal", "Noto Sans Arabic", system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.4;
}

/* Code blocks always LTR inside RTL */
html[dir="rtl"] pre,
html[dir="rtl"] code,
html[dir="rtl"] pre code {
  direction: ltr !important;
  text-align: left !important;
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Mono", "DejaVu Sans Mono", ui-monospace, monospace !important;
  unicode-bidi: embed;
}

html[dir="rtl"] pre {
  display: block;
  overflow-x: auto;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  background: #0f172a !important;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

/* Tables: RTL alignment for Arabic columns */
html[dir="rtl"] table {
  direction: rtl;
  text-align: right;
  display: block;
  overflow-x: auto;
  max-width: 100%;
}
html[dir="rtl"] th,
html[dir="rtl"] td {
  text-align: right;
  padding: 0.65rem 1rem;
}

/* Blockquote: right border for RTL */
html[dir="rtl"] blockquote {
  border-right: 4px solid #6366f1;
  border-left: none;
  margin-inline-end: 0;
  margin-inline-start: 0;
  padding: 0.5rem 1rem;
  background: rgba(99, 102, 241, 0.06);
  border-radius: 6px;
  color: inherit;
}

/* Inline links */
html[dir="rtl"] a {
  color: #6366f1;
  text-decoration: none;
  border-bottom: 1px solid rgba(99, 102, 241, 0.35);
  transition: border-color 0.15s ease;
}
html[dir="rtl"] a:hover {
  border-bottom-color: #4f46e5;
}

/* Cover image */
html[dir="rtl"] .post-cover img {
  border-radius: 12px;
}

/* TOC: right-aligned */
html[dir="rtl"] #toc {
  text-align: right;
}

/* Inline Latin / numbers stay LTR */
html[dir="rtl"] code {
  padding: 0.15rem 0.4rem;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 4px;
  font-size: 0.9em;
}

/* Tag list at bottom of post */
html[dir="rtl"] .post-tags {
  text-align: right;
}
html[dir="rtl"] .post-tags a {
  margin-inline-end: 0.5rem;
}

/* Lists */
html[dir="rtl"] ul,
html[dir="rtl"] ol {
  padding-inline-start: 1.5rem;
  margin-block: 1rem;
}
