/* =========================================================
   article.css — pillar & sub-pillar pages
   Shared by EN / FR / AR (RTL-aware)
   ========================================================= */

:root {
  --bg: #0a0a0c;
  --surface: #14141a;
  --surface-2: #1a1a22;
  --border: #26262f;
  --text: #f1f1f4;
  --muted: #8a8a96;
  --accent: #ff4d2d;
  --accent-2: #ff8a3d;
  --gold: #f5d28b;
  --green: #25d366;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --wrap: 760px;
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.75;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent); color: #fff; }

/* ---------- RTL ---------- */
[dir="rtl"] body { font-family: "IBM Plex Sans Arabic", "Tajawal", system-ui, sans-serif; }
[dir="rtl"] .breadcrumb-sep { transform: scaleX(-1); display: inline-block; }
[dir="rtl"] .callout { border-left: none; border-right: 3px solid var(--accent); }
[dir="rtl"] .steps-list { padding-left: 0; padding-right: 0; }
[dir="rtl"] .steps-list li { padding-left: 0; padding-right: 52px; }
[dir="rtl"] .steps-list li::before { left: auto; right: 0; }
[dir="rtl"] .toc { border-left: none; border-right: 3px solid var(--border); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 24px;
  background: rgba(10,10,12,0.82);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.topbar-brand:hover { text-decoration: none; }
.mark {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-family: var(--display); font-weight: 700; font-size: 0.72rem;
  display: flex; align-items: center; justify-content: center;
}
.topbar-name { font-family: var(--display); font-weight: 600; font-size: 0.95rem; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch { display: flex; gap: 6px; align-items: center; font-size: 0.78rem; }
.lang-switch a {
  color: var(--muted); padding: 4px 8px; border-radius: 6px;
  font-family: var(--display); letter-spacing: 0.04em; text-transform: uppercase;
}
.lang-switch a:hover { color: var(--text); background: rgba(255,255,255,0.05); text-decoration: none; }
.lang-switch a[aria-current="true"] { color: var(--accent); background: rgba(255,77,45,0.1); }
@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
  .topbar-name { display: none; }
}

/* ---------- emergency ribbon ---------- */
.ribbon {
  background: linear-gradient(90deg, rgba(255,77,45,0.16), rgba(255,138,61,0.06));
  border-bottom: 1px solid rgba(255,77,45,0.25);
  padding: 10px 24px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text);
}
.ribbon a { font-weight: 600; }
.ribbon .led {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-inline-end: 8px;
  animation: led 1.8s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes led { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---------- layout ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.article-head { padding: 64px 0 32px; }
.breadcrumbs {
  font-size: 0.82rem; color: var(--muted);
  margin-bottom: 22px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--text); }

h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.08; letter-spacing: -0.035em;
  margin: 0 0 20px;
  background: linear-gradient(180deg, #ffffff, #bdbdc7);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.standfirst {
  font-size: 1.18rem; color: var(--muted); line-height: 1.65;
  margin: 0 0 28px;
}
.meta-line {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  font-size: 0.84rem; color: var(--muted);
  padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.meta-line strong { color: var(--text); font-weight: 600; }

/* ---------- body copy ---------- */
.article-body { padding: 8px 0 60px; }
.article-body h2 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  letter-spacing: -0.025em; line-height: 1.2;
  margin: 56px 0 18px; scroll-margin-top: 80px;
}
.article-body h3 {
  font-family: var(--display); font-weight: 600;
  font-size: 1.22rem; letter-spacing: -0.015em;
  margin: 36px 0 12px; scroll-margin-top: 80px;
}
.article-body p { margin: 0 0 20px; }
.article-body ul, .article-body ol { margin: 0 0 22px; padding-inline-start: 24px; }
.article-body li { margin-bottom: 10px; }
.article-body strong { color: #fff; font-weight: 600; }
.article-body code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em; background: rgba(255,255,255,0.07);
  padding: 2px 6px; border-radius: 5px; color: var(--gold);
}
.article-body pre {
  background: #101016; border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; overflow-x: auto; margin: 0 0 24px;
  font-size: 0.88rem; line-height: 1.6;
  direction: ltr; text-align: left;
}
.article-body pre code { background: none; padding: 0; color: #d8d8e0; }
.article-body hr { border: none; border-top: 1px solid var(--border); margin: 48px 0; }

/* ---------- TOC ---------- */
.toc {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 22px 26px; margin: 0 0 40px;
}
.toc-title {
  font-family: var(--display); font-weight: 600; font-size: 0.8rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 14px;
}
.toc ol { margin: 0; padding-inline-start: 20px; }
.toc li { margin-bottom: 8px; font-size: 0.95rem; }
.toc a { color: var(--text); }
.toc a:hover { color: var(--accent); }

/* ---------- callouts ---------- */
.callout {
  background: rgba(255,77,45,0.06);
  border: 1px solid rgba(255,77,45,0.2);
  border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 20px 24px; margin: 0 0 28px;
}
.callout p:last-child { margin-bottom: 0; }
.callout-title {
  font-family: var(--display); font-weight: 600; font-size: 0.95rem;
  color: var(--accent); margin: 0 0 8px; display: flex; align-items: center; gap: 8px;
}
.callout.warn { background: rgba(245,210,139,0.05); border-color: rgba(245,210,139,0.25); border-left-color: var(--gold); }
.callout.warn .callout-title { color: var(--gold); }
[dir="rtl"] .callout.warn { border-right-color: var(--gold); }

/* ---------- numbered steps ---------- */
.steps-list { list-style: none; padding: 0 !important; margin: 0 0 32px; counter-reset: step; }
.steps-list li {
  counter-increment: step;
  position: relative; padding-left: 52px; margin-bottom: 26px;
}
.steps-list li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-family: var(--display); font-weight: 700; font-size: 0.92rem;
  display: flex; align-items: center; justify-content: center;
}
.steps-list li strong { display: block; margin-bottom: 4px; font-size: 1.05rem; }

/* ---------- symptom / cause table ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 30px; }
table {
  width: 100%; border-collapse: collapse; font-size: 0.94rem;
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
th, td { padding: 13px 16px; text-align: start; border-bottom: 1px solid var(--border); }
th {
  background: var(--surface-2); font-family: var(--display);
  font-weight: 600; font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}
tr:last-child td { border-bottom: none; }
td code { white-space: nowrap; }

/* ---------- CTA block ---------- */
.cta-block {
  background: linear-gradient(135deg, rgba(255,77,45,0.12), rgba(255,138,61,0.04));
  border: 1px solid rgba(255,77,45,0.3);
  border-radius: 18px; padding: 34px 32px; margin: 48px 0;
  text-align: center;
}
.cta-block h2 {
  margin: 0 0 12px !important; font-size: 1.6rem !important;
  font-family: var(--display); font-weight: 700; letter-spacing: -0.02em;
  background: none; color: var(--text);
}
.cta-block p { color: var(--muted); margin: 0 0 22px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px;
  font-weight: 600; font-size: 0.96rem; border: 1px solid transparent;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s, color .2s;
  cursor: pointer; font-family: var(--body);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; box-shadow: 0 10px 28px -12px rgba(255,77,45,0.8);
}
.btn-wa { border-color: var(--green); color: var(--text); }
.btn-wa svg { color: var(--green); flex-shrink: 0; }
.btn-wa:hover { background: var(--green); color: #fff; border-color: var(--green); }
.btn-wa:hover svg { color: #fff; }
.btn-ghost { border-color: rgba(255,255,255,0.18); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); }

/* ---------- FAQ ---------- */
.faq-item {
  border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 10px; background: rgba(255,255,255,0.014);
  transition: border-color .25s, background .25s;
}
.faq-item[open] { border-color: rgba(255,77,45,0.35); background: rgba(255,77,45,0.04); }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 18px 22px;
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 1.5rem; font-weight: 400; line-height: 1;
  color: var(--accent); transition: transform .3s ease; flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item > p { padding: 0 22px 20px; margin: 0; color: var(--muted); font-size: 0.97rem; }

/* ---------- related links ---------- */
.related { margin: 56px 0 0; }
.related h2 { font-size: 1.35rem !important; margin-bottom: 18px !important; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.related-card {
  display: block; padding: 18px 20px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); transition: border-color .25s, transform .25s;
}
.related-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.related-card b { display: block; font-family: var(--display); font-size: 1rem; margin-bottom: 4px; }
.related-card span { font-size: 0.87rem; color: var(--muted); }

/* ---------- form ---------- */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 30px; margin: 40px 0;
}
.form-card h2 { margin-top: 0 !important; }
.field { margin-bottom: 18px; }
.field label {
  display: block; font-family: var(--display); font-weight: 600;
  font-size: 0.85rem; letter-spacing: 0.03em; margin-bottom: 7px; color: var(--text);
}
.field .hint { font-weight: 400; color: var(--muted); font-size: 0.8rem; letter-spacing: 0; }
.field input, .field textarea, .field select {
  width: 100%; padding: 13px 15px; font-size: 0.97rem;
  font-family: var(--body); color: var(--text);
  background: #0e0e13; border: 1px solid var(--border); border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,77,45,0.14);
}
.field input::placeholder, .field textarea::placeholder { color: #56565f; }
.severity-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.severity-row label {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 8px; text-align: center; cursor: pointer;
  border: 1px solid var(--border); border-radius: 10px;
  background: #0e0e13; font-size: 0.85rem; margin: 0;
  transition: border-color .2s, background .2s, color .2s;
}
.severity-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.severity-row label:hover { border-color: rgba(255,77,45,0.5); }
.severity-row input:checked + span { color: #fff; }
.severity-row label:has(input:checked) {
  border-color: var(--accent); background: rgba(255,77,45,0.14);
}
.hp-field { position: absolute !important; left: -9999px !important; opacity: 0 !important; height: 0 !important; }
.form-status { margin-top: 16px; padding: 14px 18px; border-radius: 10px; font-size: 0.93rem; display: none; }
.form-status.show { display: block; }
.form-status.ok { background: rgba(37,211,102,0.1); border: 1px solid rgba(37,211,102,0.4); color: #7ef0aa; }
.form-status.err { background: rgba(255,77,45,0.1); border: 1px solid rgba(255,77,45,0.4); color: #ff9c85; }
.form-alt { text-align: center; margin-top: 18px; font-size: 0.88rem; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 70px;
  padding: 34px 24px 46px;
}
.footer-inner {
  max-width: var(--wrap); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between;
  font-size: 0.84rem; color: var(--muted);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .article-head { padding: 40px 0 24px; }
  .form-card { padding: 22px 18px; }
  .cta-block { padding: 26px 20px; }
  .severity-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
