/* ==========================================================================
   ENHANCED MEDICAL EDUCATIONAL STYLING — v2.0
   hutaifortho.com | Orthopedics · Spine · Surgical Techniques
   Updated: 2026
   ========================================================================== */

/* ─── 1. Design Tokens ──────────────────────────────────────────────────── */
:root {
  /* Brand */
  --clr-primary:        #1a5276;
  --clr-primary-light:  #2471a3;
  --clr-primary-xlight: #d6eaf8;
  --clr-teal:           #0d9488;
  --clr-teal-light:     #ccfbf1;
  --clr-teal-dark:      #0f766e;

  /* Neutral Scale */
  --clr-slate-900: #0f172a;
  --clr-slate-800: #1e293b;
  --clr-slate-700: #334155;
  --clr-slate-600: #475569;
  --clr-slate-400: #94a3b8;
  --clr-slate-200: #e2e8f0;
  --clr-slate-100: #f1f5f9;
  --clr-slate-50:  #f8fafc;
  --clr-white:     #ffffff;

  /* Semantic Callout Colors */
  --clr-warning-bg:   #fffbeb;
  --clr-warning-bdr:  #f59e0b;
  --clr-warning-text: #92400e;
  --clr-danger-bg:    #fff1f2;
  --clr-danger-bdr:   #fb7185;
  --clr-success-bg:   #f0fdf4;
  --clr-success-bdr:  #4ade80;
  --clr-success-text: #166534;
  --clr-info-bg:      #eff6ff;
  --clr-info-bdr:     #60a5fa;

  /* Typography */
  --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --line-height: 1.9;

  /* Elevation */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 14px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:  0 10px 32px rgba(0,0,0,0.10), 0 4px 10px rgba(0,0,0,0.06);
  --shadow-img: 0 8px 30px rgba(26,82,118,0.13), 0 2px 8px rgba(26,82,118,0.07);

  /* Border radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: all 0.25s var(--ease);
}

/* ─── 2. Reading Progress Bar ───────────────────────────────────────────── */
/* Add <div class="reading-progress" id="readingBar"></div> before article  */
/* JS: document.getElementById('readingBar').style.width = percent + '%'    */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-teal));
  z-index: 9999;
  transition: width 0.12s linear;
  width: 0%;
  border-radius: 0 2px 2px 0;
}

/* ─── 3. Base Article Typography ────────────────────────────────────────── */
.article-content {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: var(--line-height);
  color: var(--clr-slate-700);
  font-weight: 400;
}

.article-content p {
  margin-bottom: 1.55rem;
  max-width: 72ch; /* ~optimal 65–75 char/line for readability */
}

/* Paragraph width exceptions — tables/figures should fill available space */
.article-content .table-responsive ~ p,
.article-content figure ~ p,
.article-content .table-responsive + p {
  max-width: 100%;
}

/* Article title */
.article-title {
  font-size: clamp(1.75rem, 4vw, 2.8rem);
  font-weight: 900;
  line-height: 1.2;
  color: var(--clr-primary);
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
}

/* ─── 4. Heading Hierarchy ──────────────────────────────────────────────── */

/* H2 — Major clinical sections */
.article-content h2,
.article-content h2.text-primary {
  font-size: clamp(1.3rem, 2.5vw, 1.75rem) !important;
  font-weight: 800;
  color: var(--clr-primary) !important;
  margin-top: 3.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.65rem;
  position: relative;
  line-height: 1.3;
  border-bottom: 2px solid var(--clr-slate-100) !important;
  letter-spacing: -0.015em;
}

/* Animated accent underline on H2 */
.article-content h2::after,
.article-content h2.text-primary::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 56px;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-teal));
  border-radius: 2px;
  transition: width 0.35s var(--ease);
}

.article-content h2:hover::after,
.article-content h2.text-primary:hover::after {
  width: 110px;
}

/* H3 — Subsection headings */
.article-content h3,
.article-content h3.text-secondary {
  font-size: clamp(1.05rem, 2vw, 1.3rem) !important;
  font-weight: 700;
  color: var(--clr-slate-800) !important;
  margin-top: 2.25rem;
  margin-bottom: 0.9rem;
  padding: 0.45rem 0.9rem;
  border-left: 4px solid var(--clr-teal);
  background: linear-gradient(90deg, rgba(13,148,136,0.06) 0%, transparent 100%);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  line-height: 1.35;
  display: block !important; /* Override old flex rule */
  font-style: normal !important;
  text-align: left !important; /* Prevent caption rule bleeding in */
}

/* H4 — Anatomy sub-labels, classification sub-items */
.article-content h4 {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--clr-slate-600);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 1.75rem;
  margin-bottom: 0.65rem;
}

/* ─── 5. Surgical Pearls & Callout Blockquotes ──────────────────────────── */
.article-content blockquote {
  position: relative;
  background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%) !important;
  border: none !important;
  border-left: 5px solid var(--clr-teal) !important;
  padding: 1.4rem 1.75rem 1.4rem 1.75rem !important;
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  margin: 2.25rem 0 !important;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.7);
}

/* Label chip above pearl content */
.article-content blockquote::before {
  content: '💡  Surgical Pearl';
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--clr-teal-dark);
  background: rgba(13,148,136,0.12);
  padding: 2px 10px;
  border-radius: 50px;
  margin-bottom: 0.7rem;
}

.article-content blockquote p {
  color: #134e4a;
  font-size: 1.03rem;
  margin-bottom: 0 !important;
  max-width: 100%;
  font-weight: 500;
  line-height: 1.75;
}

/* Callout variants — add class="warning|danger|info" to blockquote */
.article-content blockquote.warning {
  background: var(--clr-warning-bg) !important;
  border-left-color: var(--clr-warning-bdr) !important;
}
.article-content blockquote.warning::before {
  content: '⚠️  Clinical Warning';
  color: var(--clr-warning-text);
  background: rgba(245,158,11,0.12);
}
.article-content blockquote.warning p { color: var(--clr-warning-text); }

.article-content blockquote.danger {
  background: var(--clr-danger-bg) !important;
  border-left-color: var(--clr-danger-bdr) !important;
}
.article-content blockquote.danger::before {
  content: '🚨  Complication Alert';
  color: #9f1239;
  background: rgba(251,113,133,0.12);
}
.article-content blockquote.danger p { color: #9f1239; }

.article-content blockquote.info {
  background: var(--clr-info-bg) !important;
  border-left-color: var(--clr-info-bdr) !important;
}
.article-content blockquote.info::before {
  content: 'ℹ️  Clinical Note';
  color: #1d4ed8;
  background: rgba(96,165,250,0.12);
}
.article-content blockquote.info p { color: #1d4ed8; }

/* ─── 6. Professional Medical Tables ───────────────────────────────────── */
/* Wrapper for custom HTML tables */
.article-content .table-responsive {
  margin: 2.5rem 0;
  overflow-x: auto;
}

/* Fix for Markdown generated tables */
.article-content table {
  margin: 2.5rem 0 !important;
  font-size: 0.96rem;
  width: 100%;
  border-collapse: separate; /* Changed to 'separate' to allow rounded corners */
  border-spacing: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--clr-slate-200);
}

.article-content table thead th {
  background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-primary-light) 100%) !important;
  color: var(--clr-white) !important;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 1rem 1.05rem !important;
  border: none !important;
}

.article-content table tbody tr {
  transition: background-color 0.18s var(--ease);
}

.article-content table tbody tr:nth-child(even) {
  background-color: var(--clr-slate-50);
}

.article-content table tbody tr:hover {
  background-color: var(--clr-primary-xlight);
}

.article-content table tbody td {
  padding: 1rem 1.05rem !important;
  border-bottom: 1px solid var(--clr-slate-200) !important; /* <--- FIXED: Added visible borders between rows */
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  vertical-align: middle;
  color: var(--clr-slate-700);
  line-height: 1.6;
}

/* Remove bottom border from the very last row */
.article-content table tbody tr:last-child td {
  border-bottom: none !important;
}

/* First column = key label — make it stand out */
.article-content table tbody td:first-child {
  font-weight: 600;
  color: var(--clr-primary);
}
/* ─── 7. Image Handling ─────────────────────────────────────────────────── */
.article-content img {
  display: block;
  margin: 2.25rem auto !important;
  border-radius: var(--r-md);
  border: 5px solid var(--clr-white) !important;
  box-shadow: var(--shadow-img) !important;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  max-width: 100%;
  height: auto;
  cursor: zoom-in;
}

.article-content img:hover {
  transform: translateY(-3px) scale(1.008);
  box-shadow: 0 18px 45px rgba(26,82,118,0.18), 0 4px 12px rgba(26,82,118,0.1) !important;
}

/* Native figure/figcaption support */
.article-content figure {
  margin: 2.25rem 0;
  text-align: center;
}

.article-content figcaption {
  font-size: 0.83rem;
  color: var(--clr-slate-400);
  font-style: italic;
  margin-top: 0.6rem;
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* Fallback: paragraph immediately after image acts as caption */
/* NOTE: scoped tightly so it doesn't affect h3 globally (original bug) */
.article-content img + p {
  text-align: center !important;
  font-size: 0.83rem !important;
  color: var(--clr-slate-400) !important;
  font-style: italic !important;
  margin-top: -1.2rem !important;
  margin-bottom: 2.25rem !important;
  font-weight: 400 !important;
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

/* ─── 8. Medical Lists ──────────────────────────────────────────────────── */
.article-content ul,
.article-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.75rem;
  display: grid;
  gap: 0.45rem;
}

/* Custom bullet — teal gradient dot */
.article-content ul li {
  list-style: none;
  position: relative;
  padding-left: 1.35rem;
  color: var(--clr-slate-700);
  line-height: 1.7;
}

.article-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-teal), var(--clr-primary));
  flex-shrink: 0;
}

/* Custom number — filled circle badge */
.article-content ol {
  list-style: none;
  counter-reset: ol-counter;
}

.article-content ol li {
  position: relative;
  padding-left: 2.1rem;
  counter-increment: ol-counter;
  line-height: 1.7;
}

.article-content ol li::before {
  content: counter(ol-counter);
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--clr-primary);
  color: var(--clr-white);
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Nested lists */
.article-content ul ul,
.article-content ol ol,
.article-content ul ol,
.article-content ol ul {
  margin-top: 0.35rem;
  margin-bottom: 0;
  padding-left: 1.25rem;
}

.article-content ul ul li::before {
  width: 5px;
  height: 5px;
  background: var(--clr-slate-400);
}

/* ─── 9. MCQ / Exam Answer Blocks ───────────────────────────────────────── */
/* For the 314+ MCQ articles — add these classes in the CMS              */

/* Correct answer highlight */
.article-content .answer-correct {
  background: var(--clr-success-bg);
  border-left: 4px solid var(--clr-success-bdr);
  padding: 0.7rem 1rem;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-weight: 700;
  color: var(--clr-success-text);
  margin: 0.35rem 0;
}

.article-content .answer-correct::before {
  content: '✓ ';
  font-weight: 900;
}

/* Distractor option */
.article-content .answer-option {
  padding: 0.6rem 1rem;
  border: 1px solid var(--clr-slate-200);
  border-radius: var(--r-sm);
  margin: 0.35rem 0;
  transition: var(--transition);
  cursor: pointer;
}

.article-content .answer-option:hover {
  border-color: var(--clr-primary-xlight);
  background: var(--clr-slate-50);
}

/* Explanation box */
.article-content .mcq-explanation {
  background: var(--clr-info-bg);
  border: 1px solid var(--clr-info-bdr);
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  font-size: 0.95rem;
  line-height: 1.7;
}

.article-content .mcq-explanation::before {
  content: '📖  Explanation';
  display: block;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #1d4ed8;
  margin-bottom: 0.5rem;
}

/* ─── 10. Inline Elements ───────────────────────────────────────────────── */
.article-content strong,
.article-content b {
  color: var(--clr-slate-900);
  font-weight: 700;
}

.article-content em,
.article-content i {
  color: var(--clr-slate-600);
}

.article-content a {
  color: var(--clr-primary-light);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: var(--transition);
  font-weight: 500;
}

.article-content a:hover {
  color: var(--clr-primary);
  text-decoration-color: var(--clr-primary);
}

/* ─── 11. Horizontal Rules ──────────────────────────────────────────────── */
.article-content hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--clr-slate-200) 20%, var(--clr-slate-200) 80%, transparent);
  margin: 2.75rem 0;
}

/* ─── 12. Code Blocks ───────────────────────────────────────────────────── */
.article-content code {
  background: var(--clr-slate-100);
  color: var(--clr-primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.87em;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  border: 1px solid var(--clr-slate-200);
}

.article-content pre {
  background: var(--clr-slate-900);
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: var(--r-md);
  overflow-x: auto;
  margin: 2rem 0;
  font-size: 0.9rem;
  box-shadow: var(--shadow-md);
  line-height: 1.6;
}

.article-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  border: none;
}

/* ─── 13. Reference Section ─────────────────────────────────────────────── */
.article-content h2:last-of-type {
  font-size: 1.05rem !important;
  font-weight: 700;
  color: var(--clr-slate-600) !important;
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  padding-bottom: 0.6rem;
  border-top: 1px solid var(--clr-slate-200) !important;
  border-bottom: 1px dashed var(--clr-slate-200) !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.article-content h2:last-of-type::after { display: none; }

.article-content h2:last-of-type ~ ol li,
.article-content h2:last-of-type ~ ul li {
  font-size: 0.9rem;
  color: var(--clr-slate-600);
  line-height: 1.6;
}

/* ─── 14. Badges ────────────────────────────────────────────────────────── */
.badge-update-2026 {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff4e5;
  color: #b45309;
  border: 1px solid #fbbf24;
  font-size: 0.73rem;
  padding: 4px 11px;
  border-radius: 50px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-update-2026::before { content: '✦'; font-size: 0.6rem; }

.badge-specialty {
  display: inline-flex;
  align-items: center;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--clr-primary-xlight);
  color: var(--clr-primary);
  border: 1px solid rgba(26,82,118,0.18);
}

/* ─── 15. Desktop ───────────────────────────────────────────────────────── */
@media (min-width: 992px) {
  .article-content {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    -webkit-hyphens: auto;
  }
}

/* ─── 16. Tablet ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .article-content {
    font-size: 1rem;
    line-height: 1.78;
  }

  .article-content h2,
  .article-content h2.text-primary { margin-top: 2.25rem; }

  .article-content blockquote {
    padding: 1.1rem 1.25rem !important;
  }

  .article-content img { border-width: 3px !important; }

  .article-content table { font-size: 0.85rem; }

  .article-content table thead th,
  .article-content table tbody td {
    padding: 0.65rem 0.75rem !important;
  }
}

/* ─── 17. Mobile ────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .article-content { font-size: 0.97rem; }

  .article-content p { max-width: 100%; }

  .article-content ul,
  .article-content ol { padding-left: 1rem; }

  .article-content h3,
  .article-content h3.text-secondary { padding: 0.35rem 0.75rem; }
}

/* ─── 18. RTL / Arabic (Al Jazeera Font Integration) ───────────────────── */
[dir="rtl"] .article-content {
  text-align: right;
  letter-spacing: 0;
  word-spacing: 0;
  /* Use the exact font-family name defined in your fonts.css */
  font-family: 'AlJazeeraArabic', 'Segoe UI', system-ui, sans-serif;
  line-height: 2.0; /* Arabic script needs slightly more vertical space */
}

/* Ensure all headings inside the article also use Al Jazeera */
[dir="rtl"] .article-title,
[dir="rtl"] .article-content h1,
[dir="rtl"] .article-content h2,
[dir="rtl"] .article-content h3,
[dir="rtl"] .article-content h4,
[dir="rtl"] .article-content .fw-bold {
  font-family: 'AlJazeeraArabic', sans-serif !important;
}

/* Adjust Heading 2 specifically for Arabic aesthetics */
[dir="rtl"] .article-content h2::after,
[dir="rtl"] .article-content h2.text-primary::after {
  left: auto;
  right: 0;
}

/* Adjust Heading 3 background and borders for RTL */
[dir="rtl"] .article-content h3,
[dir="rtl"] .article-content h3.text-secondary {
  border-left: none;
  border-right: 4px solid var(--clr-teal);
  padding-left: 0;
  padding-right: 0.9rem;
  background: linear-gradient(270deg, rgba(13,148,136,0.06) 0%, transparent 100%);
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  text-align: right !important;
}

/* Blockquotes (Surgical Pearls) in Arabic */
[dir="rtl"] .article-content blockquote {
  border-left: none !important;
  border-right: 5px solid var(--clr-teal) !important;
  border-radius: var(--r-lg) 0 0 var(--r-lg);
  font-family: 'AlJazeeraArabic', sans-serif;
}

/* Lists and Bullets */
[dir="rtl"] .article-content ul,
[dir="rtl"] .article-content ol {
  padding-left: 0;
  padding-right: 1.5rem;
}

[dir="rtl"] .article-content ul li {
  padding-left: 0;
  padding-right: 1.35rem;
}

[dir="rtl"] .article-content ul li::before {
  left: auto;
  right: 0;
}

[dir="rtl"] .article-content ol li {
  padding-left: 0;
  padding-right: 2.1rem;
}

[dir="rtl"] .article-content ol li::before {
  left: auto;
  right: 0;
}

/* Tables in Arabic */
[dir="rtl"] .article-content table thead th,
[dir="rtl"] .article-content table tbody td {
  text-align: right !important;
  font-family: 'AlJazeeraArabic', sans-serif;
}

/* Keyword Badges in Arabic */
[dir="rtl"] .badge-keyword {
  font-family: 'AlJazeeraArabic', sans-serif;
  padding-top: 0.5rem !important;
  font-size: 0.8rem;
}

/* ─── 19. Print Styles ──────────────────────────────────────────────────── */
@media print {
  .reading-progress { display: none; }

  .article-content {
    font-size: 11pt;
    line-height: 1.65;
    color: #000;
    text-align: left;
  }

  .article-content h2,
  .article-content h2.text-primary {
    color: #000 !important;
    page-break-after: avoid;
    border-bottom: 1pt solid #ccc !important;
    font-size: 14pt !important;
  }

  .article-content h2::after { display: none; }
  .article-content h3 { page-break-after: avoid; }

  .article-content img {
    max-width: 65% !important;
    box-shadow: none !important;
    border: 1pt solid #bbb !important;
    page-break-inside: avoid;
    margin: 1rem auto !important;
  }

  .article-content blockquote {
    border-left: 3pt solid #666 !important;
    background: #f5f5f5 !important;
    page-break-inside: avoid;
    box-shadow: none;
  }

  .article-content blockquote::before {
    background: none;
  }

  .article-content table {
    page-break-inside: avoid;
    font-size: 9pt;
  }

  .article-content table thead th {
    background: #333 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .article-content a::after {
    content: ' (' attr(href) ')';
    font-size: 8pt;
    color: #555;
  }
}

/* ─── 20. Accessibility ─────────────────────────────────────────────────── */
.article-content *:focus-visible {
  outline: 3px solid var(--clr-teal);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  .article-content *,
  .article-content *::before,
  .article-content *::after,
  .reading-progress {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --clr-primary:   #003166;
    --clr-teal:      #006655;
    --clr-slate-700: #111111;
  }

  .article-content table thead th {
    background: #000 !important;
  }

  .article-content blockquote {
    border-left-width: 7px !important;
    background: #f0fff0 !important;
  }
}
/* Styling for the Bibliography / Reference List */
.article-content ol li, 
.article-content ul li {
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 6px;
    line-height: 1.6;
    margin-bottom: 10px;
}

/* Make the links inside the list fill the whole area and look professional */
.article-content li a.medical-citation-link {
    color: #334155 !important; /* Professional Slate Grey */
    text-decoration: none !important;
    display: block;
    transition: color 0.2s ease;
}

.article-content li:hover {
    background-color: #f1f5f9; /* Light Blue/Grey hover */
}

.article-content li:hover a.medical-citation-link {
    color: #1a5276 !important; /* Brand Blue on hover */
    text-decoration: underline !important;
}

/* PubMed 'View' Badge */
.article-content li a.medical-citation-link::after {
    content: ' [View on PubMed]';
    font-size: 0.75rem;
    font-weight: 700;
    color: #1a5276;
    opacity: 0.6;
}

/* --- KEYWORD BADGES --- */
:root {
  /* Colors - Matching your Medical Slate/Teal theme */
  --keyword-bg: #f1f5f9;          /* var(--clr-slate-100) */
  --keyword-text: #475569;        /* var(--clr-slate-600) */
  --keyword-border: #e2e8f0;      /* var(--clr-slate-200) */
  
  --keyword-hover-bg: #1a5276;    /* var(--clr-primary) */
  --keyword-hover-text: #ffffff;
  --keyword-hover-border: #1a5276;
}

.badge-keyword {
  /* Typography & Layout */
  font-family: 'Roboto', sans-serif; /* Default for English */
  font-weight: 500;
  font-size: 0.85rem;
  line-height: 1.2;
  
  /* Appearance */
  background-color: var(--keyword-bg);
  color: var(--keyword-text);
  border: 1px solid var(--keyword-border) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- ARABIC SPECIFIC (Al Jazeera Font) --- */
[dir="rtl"] .badge-keyword {
  font-family: 'AlJazeeraArabic', sans-serif;
  font-weight: 400; /* AlJazeera is naturally bold, 400 looks cleaner for tags */
  padding-top: 0.6rem !important;   /* Slight adjustment for Arabic vertical alignment */
  padding-bottom: 0.5rem !important;
  letter-spacing: 0;
}

/* Hover & Interaction States */
.badge-keyword:hover,
.badge-keyword:focus {
  background-color: var(--keyword-hover-bg);
  color: var(--keyword-hover-text) !important;
  border-color: var(--keyword-hover-border) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(26, 82, 118, 0.15);
  outline: none;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --keyword-bg: #1e293b;
    --keyword-text: #cbd5e1;
    --keyword-border: #334155;
  }
}

