/* ==========================================================================
   100 TOKOH DUNIA - PREMIUM EDITORIAL MULTILINGUAL STYLESHEET
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Merriweather", Georgia, "Times New Roman", serif;
  --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Theme: Light */
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-secondary: #f1f5f9;
  --bg-tertiary: #e2e8f0;
  --border-color: #e2e8f0;
  --border-color-focus: #3b82f6;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-gold: #d97706;
  --accent-gold-bg: #fef3c7;
  --accent-emerald: #059669;
  --accent-purple: #7c3aed;

  --tag-science-bg: #eff6ff;
  --tag-science-text: #1d4ed8;
  --tag-leaders-bg: #fef2f2;
  --tag-leaders-text: #b91c1c;
  --tag-philosophy-bg: #f5f3ff;
  --tag-philosophy-text: #6d28d9;
  --tag-arts-bg: #ecfdf5;
  --tag-arts-text: #047857;
  --tag-culture-bg: #fffbeb;
  --tag-culture-text: #b45309;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --header-height: 70px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-primary: #0b0f19;
  --bg-surface: #131b2e;
  --bg-surface-elevated: #1a233a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --border-color: #1e293b;
  --border-color-focus: #60a5fa;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --accent-primary: #3b82f6;
  --accent-primary-hover: #60a5fa;
  --accent-gold: #fbbf24;
  --accent-gold-bg: rgba(251, 191, 36, 0.15);

  --tag-science-bg: rgba(59, 130, 246, 0.15);
  --tag-science-text: #93c5fd;
  --tag-leaders-bg: rgba(239, 68, 68, 0.15);
  --tag-leaders-text: #fca5a5;
  --tag-philosophy-bg: rgba(139, 92, 246, 0.15);
  --tag-philosophy-text: #c4b5fd;
  --tag-arts-bg: rgba(16, 185, 129, 0.15);
  --tag-arts-text: #6ee7b7;
  --tag-culture-bg: rgba(245, 158, 11, 0.15);
  --tag-culture-text: #fcd34d;
}

/* RTL Layout for Arabic */
html[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .dropdown-menu {
  left: auto;
  right: 0;
}

html[dir="rtl"] .search-icon {
  left: auto;
  right: 18px;
}

html[dir="rtl"] .search-input {
  padding-left: 20px;
  padding-right: 48px;
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, select {
  font-family: inherit;
  font-size: inherit;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   NAVIGATION & HEADER
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

[data-theme="dark"] .site-header {
  background-color: rgba(19, 27, 46, 0.85);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-badge {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 900;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Language Selector Dropdown */
.lang-selector-container {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.lang-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--border-color-focus);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  min-width: 200px;
  padding: 8px 0;
  display: none;
  z-index: 110;
  max-height: 380px;
  overflow-y: auto;
}

.lang-menu.show {
  display: block;
  animation: fadeInDown 0.2s ease-out;
}

.lang-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.9rem;
  text-align: left;
  transition: var(--transition);
}

html[dir="rtl"] .lang-item {
  text-align: right;
}

.lang-item:hover {
  background: var(--bg-secondary);
  color: var(--accent-primary);
}

.lang-item.active {
  background: var(--bg-secondary);
  color: var(--accent-primary);
  font-weight: 700;
}

/* Theme Toggle Button */
.theme-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.theme-btn:hover {
  background: var(--bg-secondary);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  padding: 48px 0 32px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border-color);
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-gold-bg);
  color: var(--accent-gold);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 16px;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 780px;
  margin: 0 auto 36px;
  font-weight: 400;
}

/* Search Bar */
.search-wrapper {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 16px 24px 16px 52px;
  font-size: 1.05rem;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--border-color-focus);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   FILTER & CONTROL BAR
   ========================================================================== */
.controls-section {
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.category-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 14px;
  scrollbar-width: thin;
}

.category-pills::-webkit-scrollbar {
  height: 4px;
}

.category-pills::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.pill-btn {
  white-space: nowrap;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.pill-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.pill-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.custom-select {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.custom-select:focus {
  border-color: var(--border-color-focus);
}

.view-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.view-btn {
  border: none;
  background: none;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.view-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   ADSENSE UNITS & VALUABLE INVENTORY AD CONTAINERS (Anti-CLS)
   ========================================================================== */
.ad-slot-container {
  width: 100%;
  margin: 32px auto;
  text-align: center;
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  position: relative;
  overflow: hidden;
}

.ad-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.ad-slot-leaderboard {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot-infeed {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Placeholder for ad simulation or dev preview */
.ad-mock-placeholder {
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin: 0 auto;
  background: repeating-linear-gradient(
    45deg,
    var(--bg-secondary),
    var(--bg-secondary) 10px,
    var(--bg-tertiary) 10px,
    var(--bg-tertiary) 20px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   FIGURES GRID & CARDS
   ========================================================================== */
.figures-container {
  padding: 40px 0 60px;
  flex: 1;
}

.figures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.figures-grid.list-view {
  grid-template-columns: 1fr;
  gap: 16px;
}

/* Figure Card */
.figure-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.figure-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--border-color-focus);
}

.card-image-wrap {
  position: relative;
  width: 100%;
  height: 260px;
  background: var(--bg-secondary);
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.4s ease;
}

.figure-card:hover .card-img {
  transform: scale(1.05);
}

.card-badge-category {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}

html[dir="rtl"] .card-badge-category {
  left: auto;
  right: 14px;
}

.cat-science { background: var(--tag-science-bg); color: var(--tag-science-text); }
.cat-leaders { background: var(--tag-leaders-bg); color: var(--tag-leaders-text); }
.cat-philosophy { background: var(--tag-philosophy-bg); color: var(--tag-philosophy-text); }
.cat-arts { background: var(--tag-arts-bg); color: var(--tag-arts-text); }
.cat-culture { background: var(--tag-culture-bg); color: var(--tag-culture-text); }

.card-badge-era {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

html[dir="rtl"] .card-badge-era {
  right: auto;
  left: 14px;
}

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.card-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 12px;
}

.card-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 18px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.8rem;
}

.meta-tag {
  background: var(--bg-secondary);
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.read-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.read-btn:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

/* List View Overrides */
.figures-grid.list-view .figure-card {
  flex-direction: row;
  height: 180px;
}

.figures-grid.list-view .card-image-wrap {
  width: 220px;
  height: 100%;
  flex-shrink: 0;
}

.figures-grid.list-view .card-desc {
  -webkit-line-clamp: 2;
}

@media (max-width: 640px) {
  .figures-grid.list-view .figure-card {
    flex-direction: column;
    height: auto;
  }
  .figures-grid.list-view .card-image-wrap {
    width: 100%;
    height: 220px;
  }
}

/* ==========================================================================
   DETAIL MODAL & ARTICLE VIEWER
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.25s ease-out;
}

.modal-dialog {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  position: relative;
  display: flex;
  flex-direction: column;
  animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

html[dir="rtl"] .modal-close-btn {
  right: auto;
  left: 16px;
}

.modal-close-btn:hover {
  background: var(--bg-secondary);
}

.modal-hero {
  position: relative;
  height: 320px;
  background: var(--bg-secondary);
  overflow: hidden;
}

.modal-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.modal-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  color: #ffffff;
}

.modal-figure-name {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.modal-figure-title {
  font-size: 1.1rem;
  color: #93c5fd;
  font-weight: 600;
}

.modal-content {
  padding: 32px;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: var(--transition);
}

.btn-action:hover {
  background: var(--bg-secondary);
}

.btn-audio {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.btn-audio:hover {
  background: var(--accent-primary-hover);
}

.btn-audio.playing {
  background: #dc2626;
  border-color: #dc2626;
  animation: pulse 1.5s infinite;
}

/* Quote Box */
.quote-box {
  background: var(--accent-gold-bg);
  border-left: 4px solid var(--accent-gold);
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  margin-bottom: 32px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-primary);
}

html[dir="rtl"] .quote-box {
  border-left: none;
  border-right: 4px solid var(--accent-gold);
}

/* Specs Table */
.specs-table-wrap {
  margin-bottom: 36px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border-color);
}

.section-headline {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.spec-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Biography Narrative */
.biography-section {
  margin-bottom: 32px;
}

.bio-block {
  margin-bottom: 24px;
}

.bio-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.bio-text {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

/* ==========================================================================
   COOKIE CONSENT MODAL & FOOTER
   ========================================================================== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
  padding: 20px 0;
  z-index: 150;
  display: none;
}

.cookie-banner.show {
  display: block;
  animation: slideUp 0.3s ease-out;
}

.cookie-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.cookie-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 800px;
  line-height: 1.5;
}

.cookie-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 48px 0 32px;
  margin-top: auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}

@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

.footer-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.footer-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 480px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Toast Notifications */
.toast-msg {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--text-primary);
  color: var(--text-inverse);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  z-index: 300;
  display: none;
  animation: fadeIn 0.2s ease-out;
}

html[dir="rtl"] .toast-msg {
  right: auto;
  left: 30px;
}

.toast-msg.show {
  display: block;
}

/* Keyframes */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}


/* ==========================================================================
   STANDALONE ARTICLE & CONTENT PAGES (ARTICLE, ABOUT, PRIVACY, TERMS)
   ========================================================================== */

.page-wrapper {
  padding: 40px 0 60px;
  flex: 1;
}

/* Breadcrumbs */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent-primary);
}

.breadcrumb-separator {
  color: var(--border-color);
  font-size: 0.8rem;
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 600;
}

/* Article Hero & Layout */
.article-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 36px;
  align-items: start;
}

@media (max-width: 960px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* Article Sidebar (Sticky Profile Infobox) */
.article-sidebar {
  position: sticky;
  top: 90px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.sidebar-avatar-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
  aspect-ratio: 4 / 4.5;
  background: var(--bg-secondary);
}

.sidebar-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sidebar-figure-name {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.25;
}

.sidebar-native-name {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-style: italic;
}

.sidebar-figure-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 20px;
  line-height: 1.4;
}

.sidebar-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.sidebar-specs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 18px;
  margin-bottom: 20px;
}

/* Article Main Content */
.article-main {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .article-main {
    padding: 24px 18px;
  }
}

.article-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-color);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.toolbar-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--border-color-focus);
}

.toolbar-btn.primary {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.toolbar-btn.primary:hover {
  background: var(--accent-primary-hover);
}

.toolbar-btn.playing {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.article-quote {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(124, 58, 237, 0.05));
  border-left: 4px solid var(--accent-primary);
  padding: 24px 28px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 28px 0;
  position: relative;
}

html[dir="rtl"] .article-quote {
  border-left: none;
  border-right: 4px solid var(--accent-primary);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.article-quote p {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.article-quote cite {
  font-size: 0.88rem;
  font-style: normal;
  font-weight: 700;
  color: var(--accent-primary);
  display: block;
}

/* Section Headlines in Article */
.article-section {
  margin-bottom: 36px;
}

.article-section-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-section-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 20px;
  background: var(--accent-primary);
  border-radius: 2px;
}

.article-p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

/* Next / Previous Figure Navigation */
.figure-nav-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

@media (max-width: 600px) {
  .figure-nav-row {
    grid-template-columns: 1fr;
  }
}

.figure-nav-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  text-decoration: none;
  transition: var(--transition);
}

.figure-nav-card:hover {
  background: var(--bg-secondary);
  border-color: var(--border-color-focus);
  transform: translateY(-2px);
}

.figure-nav-card.next {
  justify-content: flex-end;
  text-align: right;
}

html[dir="rtl"] .figure-nav-card.next {
  justify-content: flex-start;
  text-align: left;
}

.nav-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.nav-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}

/* Related Figures Section */
.related-section {
  margin-top: 50px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.related-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-color-focus);
}

.related-card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--bg-secondary);
}

.related-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.related-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.related-card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Content Pages (About, Privacy, Terms) */
.content-page-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px 56px;
  box-shadow: var(--shadow-sm);
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .content-page-card {
    padding: 28px 20px;
  }
}

.content-page-title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.content-page-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
}

.prose h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 36px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.prose h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 24px 0 12px;
}

.prose p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.prose ul, .prose ol {
  margin: 0 0 20px 24px;
  color: var(--text-secondary);
  line-height: 1.75;
}

html[dir="rtl"] .prose ul, html[dir="rtl"] .prose ol {
  margin: 0 24px 20px 0;
}

.prose li {
  margin-bottom: 8px;
}

.prose strong {
  color: var(--text-primary);
}

.compliance-callout {
  background: var(--tag-science-bg);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 24px 0;
}

.compliance-callout h4 {
  color: var(--accent-primary);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.compliance-callout p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.manage-cookies-action-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
