/* ==========================================================================
   RCHEP - Research Center for High Energy Physics
   Sharif University of Technology | Modern Academic Stylesheet
   ========================================================================== */

/* Local Self-Hosted Vazirmatn Font (Zero External Dependency, Instant Load) */
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn[wght].woff2') format('woff2-variations'),
       url('../fonts/Vazirmatn[wght].woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Lucide Vector Icons Integration (https://lucide.dev) */
.lucide {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  vertical-align: -0.18em;
  stroke-width: 2;
  stroke: currentColor;
}

.card-icon .lucide {
  width: 2.2rem;
  height: 2.2rem;
  stroke-width: 1.8;
  color: var(--accent);
}

.event-meta .lucide,
.pub-meta .lucide {
  width: 1rem;
  height: 1rem;
  vertical-align: -0.15em;
  color: var(--accent);
}

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.1);
  --accent: #0ea5e9;
  --accent-glow: rgba(14, 165, 233, 0.25);
  
  --bg-main: #0a0f1d;
  --bg-surface: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(31, 41, 55, 0.9);
  --bg-header: rgba(10, 15, 29, 0.85);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(14, 165, 233, 0.3);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --font-en: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-fa: 'Vazirmatn', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Tahoma, sans-serif;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 25px rgba(37, 99, 235, 0.2);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --container-max: 1200px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.08);
  --accent: #0284c7;
  --accent-glow: rgba(2, 132, 199, 0.15);
  
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #ffffff;
  --bg-header: rgba(248, 250, 252, 0.9);
  
  --border-color: rgba(0, 0, 0, 0.08);
  --border-highlight: rgba(37, 99, 235, 0.25);
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 25px rgba(37, 99, 235, 0.1);
}

.is-hidden {
  display: none !important;
}

/* Mathematical Typography (LaTeX-like) */
.math-tex {
  font-family: 'Cambria Math', 'Latin Modern Math', 'Times New Roman', serif;
  font-style: italic;
  letter-spacing: 0.04em;
  padding: 0 2px;
}

.math-tex sub, .math-tex sup {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
  font-style: normal;
}

.math-tex sub {
  bottom: -0.25em;
}

.math-tex sup {
  top: -0.45em;
}

.math-bar {
  text-decoration: overline;
}

/* Floating Back-to-Top Button */
.back-to-top {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-highlight);
  color: var(--accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 16px var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.25s ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* Virtual Room Live Button */
.live-room-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.88rem;
  font-weight: 700;
  transition: var(--transition);
  text-decoration: none;
}

.live-room-btn:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(6, 182, 212, 0.25));
  border-color: #34d399;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.3);
}

.live-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseAnim 1.6s infinite;
}

/* Download Doc Card */
.download-doc-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 14px;
  transition: var(--transition);
  gap: 16px;
}

.download-doc-card:hover {
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-fa);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.65;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

body[dir="ltr"] {
  font-family: var(--font-en);
  direction: ltr;
  text-align: left;
}

body[dir="ltr"] ul:not(.nav-links),
body[dir="ltr"] ol {
  padding-right: 0 !important;
  padding-left: 1.5rem !important;
}

body[dir="ltr"] .event-meta span,
body[dir="ltr"] .pub-meta span {
  direction: ltr;
}

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

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

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Subtle background particle grid */
.cosmic-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(37, 99, 235, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(14, 165, 233, 0.07) 0%, transparent 45%);
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

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

.brand-logo {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.sharif-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4)) contrast(1.35) saturate(1.45);
}

/* Institutional Top Header Logos */
.institutional-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.institutional-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.inst-logo-sharif {
  height: 94px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.5)) contrast(1.35) saturate(1.45) brightness(1.08);
  transition: var(--transition);
}

.inst-logo-sharif:hover {
  transform: scale(1.05);
}

.inst-plaque-rchep {
  height: 84px;
  width: auto;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-highlight);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
  background: var(--bg-surface);
  transition: var(--transition);
  display: block;
}

.inst-plaque-rchep:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 26px var(--accent-glow);
  border-color: var(--accent);
}

.inst-title-box {
  text-align: center;
  flex: 1;
  padding: 0 20px;
}

.inst-title-box h1 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.inst-title-box span {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 768px) {
  .institutional-header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  .inst-logo-sharif, .inst-plaque-rchep {
    height: 68px;
  }
}

/* Sponsor Styles */
.sponsor-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.sponsor-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-glow);
}

.sponsor-logo-box {
  width: 100%;
  height: 95px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
}

[data-theme="light"] .sponsor-logo-box {
  background: #ffffff;
}

.sponsor-logo-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.sponsor-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 16px;
  border: 3px solid var(--border-highlight);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  background: var(--bg-surface);
}

.sponsor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  white-space: nowrap;
}

.nav-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 5px 7px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

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

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  color: var(--accent);
}

.lang-switch {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.lang-switch:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.mobile-toggle {
  display: none;
}

/* Hero Section */
.hero {
  position: relative;
  padding: 80px 0 60px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 40px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  border: 1px solid var(--border-highlight);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero-badge .pulse {
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 30px;
}

.hero-buttons {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
  color: var(--accent);
}

/* Hero Visual & Image */
.hero-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  gap: 16px;
}

.hero-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 540px;
  border-radius: var(--radius-lg);
  padding: 6px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.4), rgba(99, 102, 241, 0.3), rgba(255, 255, 255, 0.08));
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 35px rgba(14, 165, 233, 0.25);
  transition: var(--transition);
}

.hero-image-wrapper:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 45px rgba(14, 165, 233, 0.35);
}

.hero-image-inner {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius-lg) - 4px);
  aspect-ratio: 16 / 10.5;
  background: var(--bg-surface);
}

.hero-image-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.hero-image-wrapper:hover .hero-image-inner img {
  transform: scale(1.02);
}

.hero-image-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px 12px;
  background: linear-gradient(to top, rgba(10, 15, 29, 0.95) 0%, rgba(10, 15, 29, 0.6) 60%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-image-caption-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-image-badge {
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.85);
  color: white;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
}

/* Weekly Events Calendar Component (under hero image) */
.weekly-calendar-card {
  position: relative;
  width: 100%;
  max-width: 540px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 0 20px rgba(14, 165, 233, 0.12);
  backdrop-filter: blur(12px);
  transition: var(--transition);
}

.weekly-calendar-card:hover {
  border-color: var(--border-highlight);
  box-shadow: 0 14px 30px -5px rgba(0, 0, 0, 0.5), 0 0 25px rgba(14, 165, 233, 0.2);
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.cal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.cal-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseAnim 2s infinite;
}

.cal-badge-info {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-highlight);
}

.cal-days-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-day-cell {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 4px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}

.cal-day-cell:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.cal-day-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.1;
  margin-bottom: 3px;
}

.cal-shamsi-date {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.cal-greg-date {
  font-size: 0.68rem;
  color: var(--text-dim);
  line-height: 1.1;
  margin-top: 2px;
}

.cal-event-indicator {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-top: 4px;
  background: transparent;
}

.cal-day-cell.active-event {
  border-color: rgba(14, 165, 233, 0.5);
  background: rgba(14, 165, 233, 0.08);
}

.cal-day-cell.active-event .cal-shamsi-date {
  color: var(--accent);
}

.cal-day-cell.active-event .cal-event-indicator.active {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.cal-day-cell.active-event .cal-event-indicator.active-purple {
  background: #c084fc;
  box-shadow: 0 0 6px #c084fc;
}

.cal-day-cell.today {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.08);
}

.cal-day-cell.today .cal-shamsi-date {
  color: #10b981;
}

.cal-day-cell.weekend {
  opacity: 0.65;
}

/* Tooltip on Hover */
.cal-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: 250px;
  background: var(--bg-surface);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow);
  pointer-events: none;
  z-index: 1000;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  text-align: right;
  backdrop-filter: blur(16px);
}

body[dir="ltr"] .cal-tooltip {
  text-align: left;
}

.cal-day-cell:hover .cal-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Triangle on tooltip */
.cal-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: var(--border-highlight) transparent transparent transparent;
}

.cal-tip-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.cal-tip-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 4px;
}

.cal-tip-speaker {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 3px;
}

.cal-tip-venue {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.cal-tip-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Subpage Hero Banner */
.subpage-hero {
  position: relative;
  padding: 50px 0 40px;
  border-bottom: 1px solid var(--border-color);
  background: radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.08) 0%, transparent 60%);
  margin-bottom: 40px;
}

.subpage-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 36px;
}

.subpage-hero-img-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 4px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(99, 102, 241, 0.25), rgba(255, 255, 255, 0.05));
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.5), 0 0 25px rgba(14, 165, 233, 0.2);
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
  transition: var(--transition);
}

.subpage-hero-img-wrapper:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 42px -10px rgba(0, 0, 0, 0.6), 0 0 35px rgba(14, 165, 233, 0.3);
}

.subpage-hero-img-inner {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius-lg) - 4px);
  aspect-ratio: 16 / 10.5;
  background: var(--bg-surface);
}

.subpage-hero-img-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.subpage-hero-badge {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
}

[dir="ltr"] .subpage-hero-badge {
  right: auto;
  left: 14px;
}

@media (max-width: 860px) {
  .subpage-hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.atom-container {
  width: 320px;
  height: 320px;
  position: relative;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(56, 189, 248, 0.3);
}

.orbit-1 { width: 140px; height: 140px; animation: spin 16s linear infinite; }
.orbit-2 { width: 220px; height: 220px; transform: rotate(45deg); animation: spinReverse 24s linear infinite; }
.orbit-3 { width: 300px; height: 300px; transform: rotate(-30deg); animation: spin 32s linear infinite; }

.nucleus {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.2rem;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

@keyframes spinReverse {
  100% { transform: rotate(-360deg); }
}

/* Stats Ribbon */
.stats-bar {
  margin: 30px 0 60px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.stat-item h3 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}

.stat-item p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Section Common */
.section {
  padding: 60px 0;
}

.section-header {
  margin-bottom: 40px;
}

.section-tag {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 8px;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 650px;
}

/* Cards & Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  backdrop-filter: blur(8px);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-glow);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 1.4rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.card-body {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  flex-grow: 1;
  margin-bottom: 20px;
}

.card-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card-link:hover {
  gap: 10px;
  color: var(--primary);
}

/* Seminar / Event Card */
.event-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  transition: var(--transition);
  gap: 20px;
}

.event-item:hover {
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
}

.event-date-box {
  min-width: 85px;
  text-align: center;
  padding: 10px;
  background: var(--primary-light);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-highlight);
}

.event-date-box .day {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.event-date-box .month {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.event-info {
  flex-grow: 1;
}

.event-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.event-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Person Profile Card */
.person-card {
  text-align: center;
  padding: 24px;
}

.avatar {
  width: 120px;
  height: 140px;
  border-radius: var(--radius-md);
  margin: 0 auto 16px;
  overflow: hidden;
  background: var(--bg-surface);
  border: 2px solid var(--border-highlight);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease;
}

.person-card:hover .avatar {
  border-color: var(--accent);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.person-card:hover .avatar img {
  transform: scale(1.08);
}

.person-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

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

.person-interests {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  min-height: 38px;
}

.person-links {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* Publication Item */
.pub-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 14px;
  transition: var(--transition);
}

.pub-item:hover {
  border-color: var(--border-highlight);
}

.pub-title {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.pub-authors {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pub-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-blue { background: rgba(37, 99, 235, 0.15); color: #60a5fa; }
.badge-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover, .tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ==========================================================================
   Events Program Quick Nav & Section Tabs (سامانه ناوبری و تب‌های برنامه‌ها)
   ========================================================================== */
.events-quick-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.nav-program-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.nav-program-card:hover {
  border-color: var(--border-highlight);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.nav-program-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.nav-program-header i, .nav-program-header svg {
  color: var(--accent);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-program-header h4 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.nav-program-tabs {
  display: flex;
  gap: 8px;
}

.tab-link {
  flex: 1;
  text-align: center;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.tab-link:hover {
  background: var(--primary);
  color: #ffffff !important;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.tab-link.active-tab {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

[data-theme="dark"] .tab-link.active-tab {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}

/* Target highlight glow when navigated via tab */
:target {
  scroll-margin-top: 90px;
  animation: targetGlow 2.5s ease-out;
}

@keyframes targetGlow {
  0% {
    outline: 3px solid var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
  }
  100% {
    outline: 3px solid transparent;
    box-shadow: none;
  }
}

/* Footer */
.footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 50px 0 24px;
}

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

.footer-col h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-main);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

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

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

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

/* Responsive */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-buttons {
    justify-content: center;
  }
  .atom-container {
    margin: 20px auto 0;
  }
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    right: 0;
    left: 0;
    background: var(--bg-surface);
    flex-direction: column;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
  }
  .nav-links.active {
    display: flex;
  }
  .mobile-toggle {
    display: flex;
  }
  .stats-bar {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .event-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Poster Hover Preview & Click Lightbox Modal (خرامش و زنش پوستر سمینار)
   ========================================================================== */
.poster-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  font-family: inherit;
}

[data-theme="dark"] .poster-btn {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
}

.poster-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

[data-theme="dark"] .poster-btn:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
}

.poster-btn svg {
  width: 14px;
  height: 14px;
}

/* Floating Hover Preview (خرامش) */
.poster-floating-preview {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  background: var(--bg-surface);
  border: 2px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 25px rgba(56, 189, 248, 0.25);
  overflow: hidden;
  width: min(440px, 42vw);
  max-width: 90vw;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.poster-floating-preview.visible {
  opacity: 1;
  transform: scale(1);
}

.poster-floating-preview img {
  width: 100%;
  height: auto;
  max-height: min(600px, 68vh);
  object-fit: contain;
  display: block;
  background: #0f172a;
}

.poster-floating-preview .preview-hint {
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  color: var(--accent);
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}

/* JS-free fallback preview (خرامش بیجاوااسکریپت):
   renders from the button's own --poster variable, so the preview still appears on a
   slow connection where main.js has not executed yet. Disabled once JS is live. */
.poster-btn[style*="--poster"]:hover::after {
  content: '';
  position: fixed;
  bottom: 18px;
  left: 18px;
  width: min(300px, 34vw);
  aspect-ratio: 27 / 35;
  background-color: var(--bg-surface);
  background-image: var(--poster);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
  z-index: 99998;
  pointer-events: none;
}

html.js-posters .poster-btn:hover::after {
  content: none;
}

/* Fullscreen Lightbox Modal (زنش) */
.poster-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.poster-modal.active {
  opacity: 1;
  visibility: visible;
}

.poster-modal-content {
  position: relative;
  max-width: 95vw;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.poster-modal.active .poster-modal-content {
  transform: scale(1);
}

.poster-modal-img-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  border: 1px solid var(--border-highlight);
  overflow: hidden;
  max-height: 84vh;
  max-width: 90vw;
}

.poster-modal-img-container img {
  display: block;
  width: auto;
  height: auto;
  max-width: 88vw;
  max-height: 80vh;
  object-fit: contain;
}

.poster-modal-header {
  width: 100%;
  max-width: 90vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  color: #f3f4f6;
  gap: 16px;
}

.poster-modal-title {
  font-size: 1rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

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

.poster-modal-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  text-decoration: none;
}

.poster-modal-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.poster-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
}

.poster-modal-close:hover {
  background: #ef4444;
  transform: rotate(90deg);
}
