/*=============================================
  EXCELLENT HEALTH WIKI - Professional Theme
  No pure black (#000) or pure white (#fff)
  Fonts: Inter + Plus Jakarta Sans (Google)
=============================================*/

@import url('https://fonts.googleapis.com/css2?family=Inter:opsz@14..32&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/*--- CSS Variables ---*/
:root {
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  /* Primary - Teal */
  --primary-50: #ecfdf5;
  --primary-100: #d1fae5;
  --primary-200: #a7f3d0;
  --primary-300: #6ee7b7;
  --primary-400: #34d399;
  --primary-500: #0d9488;
  --primary-600: #0f766e;
  --primary-700: #115e59;
  --primary-800: #134e4a;
  --primary-900: #0f3d3a;

  /* Accent - Amber */
  --accent-50: #fffbeb;
  --accent-100: #fef3c7;
  --accent-200: #fde68a;
  --accent-300: #fcd34d;
  --accent-400: #fbbf24;
  --accent-500: #f59e0b;
  --accent-600: #d97706;
  --accent-700: #b45309;

  /* Neutral / Slate */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Category Colors */
  --cat-anatomy: #0d9488;
  --cat-nutrition: #059669;
  --cat-fitness: #ea580c;
  --cat-mental: #7c3aed;
  --cat-diseases: #dc2626;
  --cat-firstaid: #d97706;
  --cat-sleep: #4f46e5;
  --cat-womens: #e11d48;
  --cat-mens: #2563eb;
  --cat-child: #db2777;
  --cat-elderly: #475569;
  --cat-alternative: #0891b2;
  --cat-medications: #0891b2;

  /* Surfaces */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-header: rgba(15, 23, 42, 0.97);
  --bg-footer: #0f172a;
  --bg-sidebar: #ffffff;
  --bg-code: #1e293b;
  --bg-modal: rgba(15, 23, 42, 0.6);
  --bg-search: #ffffff;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #f8fafc;
  --text-link: #0d9488;
  --text-link-hover: #0f766e;

  --border: #e2e8f0;
  --border-focus: #0d9488;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.1), 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px rgba(15, 23, 42, 0.07), 0 2px 4px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 15px rgba(15, 23, 42, 0.1), 0 4px 6px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 20px 25px rgba(15, 23, 42, 0.1), 0 8px 10px rgba(15, 23, 42, 0.05);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --max-width: 1280px;
  --header-height: 64px;
  --sidebar-width: 280px;
  --content-max-width: 860px;
}

/*--- Dark Theme ---*/
[data-theme="dark"] {
  --bg-body: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-header: rgba(2, 6, 23, 0.98);
  --bg-footer: #020617;
  --bg-sidebar: #1e293b;
  --bg-code: #0f172a;
  --bg-modal: rgba(2, 6, 23, 0.8);
  --bg-search: #1e293b;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-link: #34d399;
  --text-link-hover: #6ee7b7;

  --border: #334155;
  --border-focus: #34d399;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5);
}

/*--- Base ---*/
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--text-link); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--text-link-hover); }
img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
::selection { background: var(--primary-500); color: white; }

/*--- Typography ---*/
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 700; line-height: 1.3; color: var(--text-primary); }
code, pre { font-family: var(--font-mono); font-size: 0.9em; }
pre {
  padding: 1.25rem;
  background: var(--bg-code);
  color: var(--primary-200);
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: 1.6;
  margin: 1.25rem 0;
}
code:not(pre code) {
  padding: 2px 6px;
  background: var(--primary-50);
  color: var(--primary-700);
  border-radius: 4px;
  font-size: 0.85em;
}
[data-theme="dark"] code:not(pre code) {
  background: rgba(13, 148, 136, 0.15);
  color: var(--primary-300);
}

/*--- Skip Link ---*/
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--primary-500);
  color: white;
  padding: 0.75rem 1rem;
  z-index: 1000;
  font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/*--- Header ---*/
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-inverse) !important;
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.logo-icon {
  font-size: 1.4rem;
  line-height: 1;
}
.logo-highlight {
  color: var(--primary-400);
}
.header-nav { flex: 1; min-width: 0; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle-icon {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-inverse);
  position: relative;
  border-radius: 2px;
}
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: var(--text-inverse);
  left: 0;
  border-radius: 2px;
  transition: transform 0.25s;
}
.nav-toggle-icon::before { top: -7px; }
.nav-toggle-icon::after { top: 7px; }

.nav-list {
  display: flex;
  list-style: none;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav-list::-webkit-scrollbar { display: none; }
.nav-link {
  display: block;
  padding: 0.4rem 0.6rem;
  color: var(--slate-300) !important;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: white !important;
}

.header-tools {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.tool-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--slate-300);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.tool-btn:hover {
  background: rgba(255,255,255,0.12);
  color: white;
}
.sun-icon { display: block; }
.moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }

/*--- Breadcrumbs ---*/
.breadcrumbs {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
}
.breadcrumb-list {
  display: flex;
  list-style: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.breadcrumb-item + .breadcrumb-item::before {
  content: '/';
  color: var(--text-muted);
  font-size: 0.8rem;
}
.breadcrumb-item a {
  color: var(--text-secondary);
  transition: color 0.2s;
}
.breadcrumb-item a:hover { color: var(--text-link); }
.breadcrumb-item:last-child a {
  color: var(--text-primary);
  font-weight: 600;
}

/*--- Layout ---*/
.layout-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  gap: 2rem;
  flex: 1;
  width: 100%;
}
.main-content { flex: 1; min-width: 0; }
.sidebar-toc {
  width: var(--sidebar-width);
  flex-shrink: 0;
}

/*--- Hero Section ---*/
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0d9488 100%);
  padding: 5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(13, 148, 136, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(245, 158, 11, 0.1) 0%, transparent 50%);
}
.hero-content { position: relative; max-width: 720px; margin: 0 auto; }
.hero-title {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-inverse);
  margin-bottom: 1rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.hero-title .hero-highlight {
  background: linear-gradient(135deg, #34d399, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-description {
  font-size: 1.1rem;
  color: var(--slate-300);
  margin-bottom: 2rem;
  line-height: 1.7;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.hero-search {
  display: flex;
  max-width: 520px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.hero-search-input {
  flex: 1;
  padding: 1rem 1.25rem;
  border: none;
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--bg-search);
  color: var(--text-primary);
  outline: none;
}
.hero-search-input::placeholder { color: var(--text-muted); }
.hero-search-btn {
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
  color: #1a1a2e;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.hero-search-btn:hover { opacity: 0.9; }

/*--- Homepage Categories ---*/
.categories-section {
  padding: 4rem 1.5rem;
}
.container { max-width: var(--max-width); margin: 0 auto; }
.section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2.5rem;
  text-align: center;
  letter-spacing: -0.02em;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.category-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.category-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: white;
  font-size: 1.3rem;
}
.category-card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.category-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.6;
  flex: 1;
}
.category-card-count {
  font-size: 0.8rem;
  color: var(--text-link);
  font-weight: 600;
}

/* Category Colors */
.category-anatomy .category-card-icon,
.category-anatomy::before { background: var(--cat-anatomy); }
.category-nutrition .category-card-icon,
.category-nutrition::before { background: var(--cat-nutrition); }
.category-fitness .category-card-icon,
.category-fitness::before { background: var(--cat-fitness); }
.category-mental .category-card-icon,
.category-mental::before { background: var(--cat-mental); }
.category-diseases .category-card-icon,
.category-diseases::before { background: var(--cat-diseases); }
.category-firstaid .category-card-icon,
.category-firstaid::before { background: var(--cat-firstaid); }
.category-sleep .category-card-icon,
.category-sleep::before { background: var(--cat-sleep); }
.category-womens .category-card-icon,
.category-womens::before { background: var(--cat-womens); }
.category-mens .category-card-icon,
.category-mens::before { background: var(--cat-mens); }
.category-child .category-card-icon,
.category-child::before { background: var(--cat-child); }
.category-elderly .category-card-icon,
.category-elderly::before { background: var(--cat-elderly); }
.category-alternative .category-card-icon,
.category-alternative::before { background: var(--cat-alternative); }
.category-medications .category-card-icon,
.category-medications::before { background: var(--cat-medications); }

/* Category badge on cards */
.meta-category a {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white !important;
  letter-spacing: 0.02em;
}
.category-anatomy .meta-category a { background: var(--cat-anatomy); }
.category-nutrition .meta-category a { background: var(--cat-nutrition); }
.category-fitness .meta-category a { background: var(--cat-fitness); }
.category-mental .meta-category a { background: var(--cat-mental); }
.category-diseases .meta-category a { background: var(--cat-diseases); }
.category-firstaid .meta-category a { background: var(--cat-firstaid); }
.category-sleep .meta-category a { background: var(--cat-sleep); }
.category-womens .meta-category a { background: var(--cat-womens); }
.category-mens .meta-category a { background: var(--cat-mens); }
.category-child .meta-category a { background: var(--cat-child); }
.category-elderly .meta-category a { background: var(--cat-elderly); }
.category-alternative .meta-category a { background: var(--cat-alternative); }
.category-medications .meta-category a { background: var(--cat-medications); }

/*--- Section List ---*/
.section-list {
  max-width: var(--content-max-width);
}
.section-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}
.section-header h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.section-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
.section-content { margin-bottom: 2rem; }
.section-content p { margin-bottom: 1rem; }

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.section-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.section-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}
.section-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.card-link {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  color: var(--text-primary) !important;
  height: 100%;
}
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: white;
}
.card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  line-height: 1.4;
}
.card-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.6;
  flex: 1;
}
.card-count {
  font-size: 0.8rem;
  color: var(--text-link);
  font-weight: 600;
}

/* Card category colors */
.section-card.category-anatomy::before { background: var(--cat-anatomy); }
.section-card.category-nutrition::before { background: var(--cat-nutrition); }
.section-card.category-fitness::before { background: var(--cat-fitness); }
.section-card.category-mental::before { background: var(--cat-mental); }
.section-card.category-diseases::before { background: var(--cat-diseases); }
.section-card.category-firstaid::before { background: var(--cat-firstaid); }
.section-card.category-sleep::before { background: var(--cat-sleep); }
.section-card.category-womens::before { background: var(--cat-womens); }
.section-card.category-mens::before { background: var(--cat-mens); }
.section-card.category-child::before { background: var(--cat-child); }
.section-card.category-elderly::before { background: var(--cat-elderly); }
.section-card.category-alternative::before { background: var(--cat-alternative); }
.section-card.category-medications::before { background: var(--cat-medications); }

.section-card .card-icon { background: var(--cat-anatomy); }
.section-card.category-nutrition .card-icon { background: var(--cat-nutrition); }
.section-card.category-fitness .card-icon { background: var(--cat-fitness); }
.section-card.category-mental .card-icon { background: var(--cat-mental); }
.section-card.category-diseases .card-icon { background: var(--cat-diseases); }
.section-card.category-firstaid .card-icon { background: var(--cat-firstaid); }
.section-card.category-sleep .card-icon { background: var(--cat-sleep); }
.section-card.category-womens .card-icon { background: var(--cat-womens); }
.section-card.category-mens .card-icon { background: var(--cat-mens); }
.section-card.category-child .card-icon { background: var(--cat-child); }
.section-card.category-elderly .card-icon { background: var(--cat-elderly); }
.section-card.category-alternative .card-icon { background: var(--cat-alternative); }
.section-card.category-medications .card-icon { background: var(--cat-medications); }

/*--- Article Page ---*/
.content-article {
  max-width: var(--content-max-width);
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
}
.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}
.article-header h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.article-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.medical-disclaimer-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--accent-50);
  border: 1px solid var(--accent-200);
  border-radius: var(--radius-md);
  color: var(--accent-700);
  font-size: 0.85rem;
  margin-top: 1rem;
  line-height: 1.5;
}
[data-theme="dark"] .medical-disclaimer-banner {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.15);
  color: var(--accent-300);
}

/* Article Content */
.article-content h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}
.article-content h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.article-content h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.article-content p {
  margin-bottom: 1.25rem;
  line-height: 1.8;
}
.article-content ul,
.article-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}
.article-content li { margin-bottom: 0.35rem; line-height: 1.7; }
.article-content strong { color: var(--text-primary); font-weight: 600; }

/* Tables */
.article-content .table-wrapper {
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.article-content th {
  font-weight: 700;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.article-content td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.article-content tbody tr:last-child td { border-bottom: none; }
.article-content tbody tr:hover { background: var(--bg-card-hover); }
.article-content tbody tr:nth-child(even) { background: var(--bg-body); }
[data-theme="dark"] .article-content tbody tr:nth-child(even) { background: rgba(15, 23, 42, 0.3); }

/* Article Images */
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: block;
  margin: 0 auto;
}
.article-figure {
  margin: 2rem auto;
  text-align: center;
  max-width: 100%;
  border-top: 3px solid var(--primary-400);
  padding-top: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1rem 1rem 0.75rem;
}
.article-figure img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  filter: sepia(0.25) brightness(0.95) contrast(1.05);
  transition: filter 0.3s ease;
}
.article-figure img:hover { filter: none; }
.article-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.4;
}

/* Section Heading Accents */
.article-content h2 {
  position: relative;
  padding-left: 0.75rem;
  margin-top: 2.5rem;
}
.article-content h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 4px;
  border-radius: 2px;
  background: var(--primary-500);
}
.article-content h3 {
  color: var(--primary-700);
  font-weight: 700;
}

/* Table Header Colors */
.article-content thead {
  background: var(--primary-100);
}
[data-theme="dark"] .article-content thead {
  background: var(--primary-900);
}
.article-content th {
  color: var(--primary-800);
  font-weight: 700;
}
[data-theme="dark"] .article-content th {
  color: var(--primary-200);
}

/* Colored Callout Boxes */
.article-content .callout {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border-left: 4px solid;
  position: relative;
}
.article-content .callout-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.article-content .callout p {
  margin: 0.35rem 0;
  font-size: 0.92rem;
  line-height: 1.6;
}
.article-content .callout p:first-of-type {
  margin-top: 0;
}
.article-content .callout p:last-child {
  margin-bottom: 0;
}

.callout-info {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e3a5f;
}
[data-theme="dark"] .callout-info {
  background: rgba(59, 130, 246, 0.08);
  color: #93c5fd;
}
.callout-info .callout-title { color: #2563eb; }
[data-theme="dark"] .callout-info .callout-title { color: #60a5fa; }

.callout-clinical {
  background: #fef2f2;
  border-color: #ef4444;
  color: #5c1a1a;
}
[data-theme="dark"] .callout-clinical {
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
}
.callout-clinical .callout-title { color: #dc2626; }
[data-theme="dark"] .callout-clinical .callout-title { color: #f87171; }

.callout-key {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #1a3d2a;
}
[data-theme="dark"] .callout-key {
  background: rgba(34, 197, 94, 0.08);
  color: #86efac;
}
.callout-key .callout-title { color: #16a34a; }
[data-theme="dark"] .callout-key .callout-title { color: #4ade80; }

.callout-warning {
  background: #fff7ed;
  border-color: #f97316;
  color: #4a2511;
}
[data-theme="dark"] .callout-warning {
  background: rgba(249, 115, 22, 0.08);
  color: #fdba74;
}
.callout-warning .callout-title { color: #ea580c; }
[data-theme="dark"] .callout-warning .callout-title { color: #fb923c; }

/* Blockquote */
.article-content blockquote {
  border-left: 4px solid var(--primary-500);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--primary-50);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}
[data-theme="dark"] .article-content blockquote {
  background: rgba(13, 148, 136, 0.08);
}
.article-content hr {
  margin: 2rem 0;
  border: none;
  border-top: 2px solid var(--border);
}

/* Article Sources & Related */
.article-footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 2px solid var(--border); }
.article-footer h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}
.article-sources { margin-bottom: 1.5rem; }
.article-sources ul { list-style: none; padding: 0; }
.article-sources li { margin-bottom: 0.35rem; font-size: 0.9rem; }
.article-sources a { color: var(--text-link); }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.related-card {
  display: block;
  padding: 0.75rem 1rem;
  background: var(--bg-body);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  color: var(--text-primary) !important;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}
.related-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-link);
  color: var(--text-link) !important;
}

/*--- Table of Contents ---*/
.toc {
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
  max-height: calc(100vh - var(--header-height) - 3rem);
  overflow-y: auto;
  padding: 1.25rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.toc-title {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.toc nav ul { list-style: none; padding: 0; }
.toc nav li { margin-bottom: 2px; }
.toc nav a {
  display: block;
  padding: 0.3rem 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-radius: 4px;
  transition: all 0.2s;
  border-left: 2px solid transparent;
}
.toc nav a:hover,
.toc nav a.active {
  color: var(--text-link);
  background: var(--primary-50);
  border-left-color: var(--primary-500);
}
[data-theme="dark"] .toc nav a:hover,
[data-theme="dark"] .toc nav a.active {
  background: rgba(13, 148, 136, 0.1);
}
.toc nav ul ul { padding-left: 0.75rem; }
.toc nav ul ul ul { padding-left: 0.75rem; }

/*--- Search Modal ---*/
.search-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.search-modal.active { display: block; }
.search-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg-modal);
  backdrop-filter: blur(4px);
}
.search-container {
  position: relative;
  max-width: 640px;
  margin: 80px auto 0;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.search-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.search-header-icon { color: var(--text-muted); flex-shrink: 0; }
.search-input {
  flex: 1;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-primary);
  outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.search-close:hover { color: var(--text-primary); }
.search-results { max-height: 50vh; overflow-y: auto; }
.search-hint {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem;
  font-size: 0.9rem;
}
.search-result-item {
  display: block;
  padding: 1rem 1.25rem;
  color: var(--text-primary) !important;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-card-hover); }
.search-result-title { font-weight: 600; margin-bottom: 2px; }
.search-result-desc { font-size: 0.82rem; color: var(--text-muted); }
.search-result-category {
  display: inline-block;
  font-size: 0.7rem;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
}

/*--- Footer ---*/
.site-footer {
  background: var(--bg-footer);
  color: var(--slate-300);
  margin-top: 4rem;
}
.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
}
.footer-heading {
  font-family: var(--font-heading);
  color: var(--text-inverse);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}
.footer-text {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--slate-400);
}
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-link {
  color: var(--slate-400) !important;
  font-size: 0.88rem;
  transition: color 0.2s;
}
.footer-link:hover { color: var(--text-inverse) !important; }
.footer-disclaimer {
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: var(--slate-400);
  margin-bottom: 1.5rem;
  text-align: center;
  line-height: 1.5;
}
.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.82rem;
  color: var(--slate-500);
}

/*--- Responsive ---*/
@media (max-width: 1024px) {
  .sidebar-toc { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .categories-grid { grid-template-columns: 1fr; }
  .section-grid { grid-template-columns: 1fr; }
  .hero { padding: 3rem 1.25rem; }
  .categories-section { padding: 2.5rem 1.25rem; }

  .nav-list {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-header);
    flex-direction: column;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    max-height: 60vh;
    overflow-y: auto;
  }
  .nav-list.active { display: flex; }
  .nav-toggle { display: block; }

  .footer-grid { grid-template-columns: 1fr; }
  .content-article { padding: 1.5rem; border-radius: var(--radius-lg); }
  .article-header h1 { font-size: 1.6rem; }
  .layout-wrapper {
    flex-direction: column;
    padding: 1rem;
  }
  .section-header h1 { font-size: 1.6rem; }
  .related-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.6rem; }
  .site-logo { font-size: 1.1rem; }
  .header-container { padding: 0 1rem; gap: 0.75rem; }
  .hero-search { flex-direction: column; border-radius: var(--radius-md); }
  .hero-search-btn { padding: 0.85rem; }
  .related-grid { grid-template-columns: 1fr; }
}

/*--- Print ---*/
@media print {
  .site-header, .site-footer, .sidebar, .breadcrumbs,
  .search-modal, .nav-toggle, .header-tools { display: none; }
  .layout-wrapper { display: block; padding: 0; }
  .content-article { box-shadow: none; border: none; padding: 0; }
  body { background: white; color: black; font-size: 11pt; }
  a { color: black !important; }
  .article-content a[href]::after { content: " (" attr(href) ")"; }
}
