/* ═══════════════════════════════════════════════
   FONT-FACE — آفلاین (بدون نیاز به اینترنت)
═══════════════════════════════════════════════ */

/* ── Vazirmatn — فارسی ── */
@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-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  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;
}

/* ── Inter — انگلیسی ── */
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-300-normal.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ═══════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:        #0d2244;
  --navy-mid:    #163060;
  --navy-light:  #1e4080;
  --accent:      #c8973a;
  --accent-light:#e6b560;
  --text:        #1a1a2e;
  --text-muted:  #5a6276;
  --text-light:  #8895ae;
  --bg:          #ffffff;
  --bg-alt:      #f5f7fb;
  --bg-card:     #ffffff;
  --border:      #dde3ef;
  --border-light:#edf0f7;

  --font-body:  'Inter', system-ui, -apple-system, sans-serif;
  --font-fa:    'Vazirmatn', system-ui, sans-serif;
  --font-serif: 'Inter', system-ui, sans-serif;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(13,34,68,.08), 0 1px 2px rgba(13,34,68,.06);
  --shadow:    0 4px 16px rgba(13,34,68,.10), 0 1px 4px rgba(13,34,68,.06);
  --shadow-lg: 0 12px 40px rgba(13,34,68,.14), 0 4px 12px rgba(13,34,68,.08);

  --container: 1100px;
  --nav-h: 68px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── Skip Navigation Link ── */
.skip-link {
  position: absolute;
  top: -100px;
  inset-inline-start: 1rem;
  background: var(--navy);
  color: #fff;
  padding: .6rem 1.2rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  z-index: 9999;
  transition: top .2s;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

a { color: var(--navy-light); text-decoration: none; }
a:hover { color: var(--accent); }

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

/* ═══════════════════════════════════════════════
   LAYOUT HELPERS
═══════════════════════════════════════════════ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 2rem;
}

.section { padding: 5rem 0; }
.section-alt { background: var(--bg-alt); }

.two-col {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0 4rem;
  align-items: start;
}

/* ═══════════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  z-index: 100;
  transition: box-shadow .25s;
}
.navbar.scrolled { box-shadow: var(--shadow); }

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

.nav-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--navy);
  letter-spacing: -.3px;
}
.nav-brand:hover { color: var(--navy); }

.nav-links {
  display: flex;
  list-style: none;
  gap: .25rem;
}
.nav-links a {
  display: block;
  padding: .45rem .85rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color .2s, background .2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--navy);
  background: var(--bg-alt);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}

/* ═══════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════ */
.hero {
  margin-top: var(--nav-h);
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, #1a3a6e 100%);
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 80% 50%, rgba(200,151,58,.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 10% 80%, rgba(30,64,128,.4) 0%, transparent 60%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 60px;
  background: var(--bg);
  clip-path: ellipse(60% 100% at 50% 100%);
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 3.5rem;
  position: relative;
  z-index: 1;
}

.hero-avatar {
  flex-shrink: 0;
}
.avatar-placeholder {
  width: 130px; height: 130px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.08));
  border: 3px solid rgba(255,255,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.avatar-placeholder svg {
  width: 80px; height: 80px;
}

.hero-label {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: .6rem;
}
.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -.03em;
  color: #ffffff;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.hero-affil {
  font-size: .925rem;
  color: rgba(255,255,255,.72);
  line-height: 1.6;
  margin-bottom: 1.8rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1.1rem;
  border-radius: 100px;
  font-size: .825rem;
  font-weight: 600;
  transition: transform .2s, box-shadow .2s;
}
.badge svg { width: 15px; height: 15px; flex-shrink: 0; }
.badge:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.2); }

.badge-primary {
  background: var(--accent);
  color: #fff;
}
.badge-ghost {
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.2);
}
.badge-ghost:hover { color: #fff; background: rgba(255,255,255,.2); }

/* ═══════════════════════════════════════════════
   SECTION LABELS
═══════════════════════════════════════════════ */
.section-label-col { padding-top: .4rem; }
.section-label {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: .75rem;
  line-height: 1.2;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--navy);
  margin-bottom: 1.5rem;
  line-height: 1.25;
}
.subsection-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin: 2.5rem 0 1.2rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.subsection-title small.teach-period {
  font-size: .8rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════
   BIO
═══════════════════════════════════════════════ */
.bio-text {
  font-size: .95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.75;
}

/* ═══════════════════════════════════════════════
   FACTS GRID
═══════════════════════════════════════════════ */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.fact-card {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.fact-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: .1rem;
}
.fact-value {
  font-size: .9rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .15rem;
}
.fact-label { font-size: .78rem; color: var(--text-muted); }

/* ═══════════════════════════════════════════════
   TIMELINE
═══════════════════════════════════════════════ */
.timeline {
  position: relative;
  padding-left: 1.6rem;
  border-left: 2px solid var(--border);
  margin-top: 1.2rem;
}
.timeline-item {
  position: relative;
  padding-bottom: 1.8rem;
}
.timeline-item:last-child { padding-bottom: 0; }

.tl-dot {
  position: absolute;
  left: -1.7rem;
  top: .35rem;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--border);
  border: 2.5px solid var(--bg);
  box-shadow: 0 0 0 2px var(--border);
}
.tl-dot-accent {
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(200,151,58,.25);
}

.tl-year {
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .06em;
  display: block;
  margin-bottom: .25rem;
}
.tl-degree {
  font-weight: 700;
  font-size: .95rem;
  color: var(--navy);
}
.tl-school {
  font-size: .875rem;
  color: var(--text-muted);
  margin-top: .15rem;
}
.tl-thesis {
  font-size: .825rem;
  color: var(--text-light);
  margin-top: .3rem;
}

/* ═══════════════════════════════════════════════
   AWARDS
═══════════════════════════════════════════════ */
.awards-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.awards-list li {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.award-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: .05rem;
}

/* ═══════════════════════════════════════════════
   RESEARCH CARDS
═══════════════════════════════════════════════ */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.research-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow .25s, transform .25s, border-color .25s;
}
.research-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  border-color: rgba(200,151,58,.3);
}
.rc-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  color: #fff;
}
.rc-icon svg { width: 20px; height: 20px; }
.research-card h4 {
  font-size: .925rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .45rem;
}
.research-card p {
  font-size: .845rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════
   PUBLICATIONS
═══════════════════════════════════════════════ */
.pub-group { margin-bottom: 2.5rem; }
.pub-group-title {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--navy);
  padding: .4rem .8rem;
  background: linear-gradient(90deg, rgba(13,34,68,.07), transparent);
  border-left: 3px solid var(--navy);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1.2rem;
}
.pub-item {
  display: flex;
  gap: 1.2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border-light);
  align-items: flex-start;
}
.pub-item:last-child { border-bottom: none; }

.pub-year {
  flex-shrink: 0;
  font-size: .75rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(200,151,58,.1);
  border: 1px solid rgba(200,151,58,.2);
  border-radius: var(--radius-sm);
  padding: .2rem .5rem;
  height: fit-content;
  margin-top: .15rem;
  white-space: nowrap;
}
.pub-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .25rem;
  line-height: 1.45;
}
.pub-authors {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: .2rem;
}
.pub-venue {
  font-size: .82rem;
  color: var(--text-light);
}

/* ═══════════════════════════════════════════════
   TEACHING TABLE
═══════════════════════════════════════════════ */
.course-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.course-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.course-table thead tr {
  background: var(--navy);
  color: #fff;
}
.course-table th {
  padding: .85rem 1.1rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.course-table td {
  padding: .85rem 1.1rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}
.course-table tr:last-child td { border-bottom: none; }
.course-table tbody tr:hover { background: var(--bg-alt); }
.course-table td:first-child { font-weight: 600; color: var(--text); }

.level-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .55rem;
  border-radius: 100px;
  white-space: nowrap;
}
.level-msc {
  background: rgba(13,34,68,.1);
  color: var(--navy);
}
.level-bsc {
  background: rgba(200,151,58,.12);
  color: #7a5a10;
}

/* ═══════════════════════════════════════════════
   STUDENTS
═══════════════════════════════════════════════ */
.students-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.1rem;
}
.student-card {
  display: flex;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  align-items: flex-start;
  transition: box-shadow .2s, border-color .2s;
}
.student-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: rgba(200,151,58,.3);
}
.student-year {
  font-size: .7rem;
  font-weight: 800;
  color: var(--accent);
  background: rgba(200,151,58,.1);
  border: 1px solid rgba(200,151,58,.2);
  border-radius: var(--radius-sm);
  padding: .3rem .5rem;
  flex-shrink: 0;
  margin-top: .1rem;
  white-space: nowrap;
}
.student-name {
  font-size: .9rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .35rem;
}
.student-thesis {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════
   CONTACT
═══════════════════════════════════════════════ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.contact-block h4 {
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: .6rem;
}
.contact-block p {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.contact-block a {
  color: var(--navy-light);
  word-break: break-all;
}
.contact-block a:hover { color: var(--accent); }

.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.1rem;
  margin-top: 1rem;
}
.ref-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: box-shadow .2s;
}
.ref-card:hover { box-shadow: var(--shadow-sm); }
.ref-name {
  font-weight: 700;
  font-size: .9rem;
  color: var(--navy);
  margin-bottom: .2rem;
}
.ref-title {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .15rem;
}
.ref-inst {
  font-size: .78rem;
  color: var(--text-light);
  margin-bottom: .6rem;
}
.ref-email {
  font-size: .8rem;
  font-weight: 600;
  color: var(--navy-light);
}
.ref-email:hover { color: var(--accent); }

/* ═══════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════ */
.footer {
  background: var(--navy);
  padding: 3rem 0 2.5rem;
  text-align: center;
}
.footer-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: .35rem;
}
.footer-sub {
  font-size: .825rem;
  color: rgba(255,255,255,.55);
  margin-bottom: 1rem;
}
.footer-copy {
  font-size: .78rem;
  color: rgba(255,255,255,.35);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 860px) {
  .two-col {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .section-label-col { display: flex; align-items: center; }

  .hero-inner {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  .hero-badges { justify-content: center; }
}

@media (max-width: 620px) {
  .section { padding: 3.5rem 0; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: #fff;
    flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    gap: .1rem;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }

  .facts-grid { grid-template-columns: 1fr; }
  .research-grid { grid-template-columns: 1fr; }
  .students-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .ref-grid { grid-template-columns: 1fr; }

  .hero { padding: 3rem 0 3.5rem; }
}

/* ═══════════════════════════════════════════════
   SCROLL REVEAL (JS adds .reveal class)
═══════════════════════════════════════════════ */
.fade-up {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .55s ease, transform .55s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: none;
}

/* ═══════════════════════════════════════════════
   LANGUAGE TOGGLE BUTTON
═══════════════════════════════════════════════ */
.lang-btn {
  border: 1.5px solid var(--border);
  background: none;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 700;
  padding: .28rem .72rem;
  border-radius: 100px;
  cursor: pointer;
  letter-spacing: .06em;
  transition: border-color .2s, color .2s, background .2s;
  font-family: var(--font-body);
  line-height: 1.4;
}
.lang-btn:hover {
  border-color: var(--navy);
  color: var(--navy);
  background: var(--bg-alt);
}
[dir="rtl"] .lang-btn {
  font-family: var(--font-fa);
  letter-spacing: 0;
}

/* ═══════════════════════════════════════════════
   RTL — FONT & TYPOGRAPHY
═══════════════════════════════════════════════ */
[dir="rtl"] body {
  font-family: var(--font-fa);
  line-height: 1.85;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
}
[dir="rtl"] .section-title,
[dir="rtl"] .hero-name,
[dir="rtl"] .footer-name {
  font-family: var(--font-fa);
  font-weight: 700;
  letter-spacing: 0;
}
[dir="rtl"] .nav-brand {
  font-family: var(--font-fa);
  letter-spacing: 0;
}
/* فارسی به خوانایی بیشتر نیاز دارد */
[dir="rtl"] .bio-text {
  font-size: 1rem;
  line-height: 2;
  word-spacing: .04em;
}
[dir="rtl"] .hero-name {
  font-size: clamp(2.2rem, 4.5vw, 3rem);
  line-height: 1.3;
}
[dir="rtl"] .hero-label {
  letter-spacing: .08em;
  font-size: .85rem;
}
[dir="rtl"] .hero-affil {
  line-height: 2;
  font-size: .975rem;
}
[dir="rtl"] .tl-degree  { font-size: 1rem; }
[dir="rtl"] .tl-school  { line-height: 1.7; }
[dir="rtl"] .tl-thesis  { line-height: 1.7; font-size: .875rem; }
[dir="rtl"] .awards-list li { font-size: .95rem; line-height: 1.75; }
[dir="rtl"] .student-thesis { font-size: .85rem; line-height: 1.7; }
[dir="rtl"] .subsection-title { font-size: 1.1rem; letter-spacing: 0; }
[dir="rtl"] .pub-group-title  { letter-spacing: 0; font-size: .82rem; }
[dir="rtl"] .fact-label { font-size: .82rem; line-height: 1.5; }
[dir="rtl"] .research-card p { line-height: 1.8; font-size: .9rem; }
[dir="rtl"] .research-card h4 { font-size: .975rem; }
[dir="rtl"] .contact-block p { line-height: 1.9; }
[dir="rtl"] .footer-sub { font-size: .875rem; letter-spacing: 0; }

/* ═══════════════════════════════════════════════
   RTL — TIMELINE
═══════════════════════════════════════════════ */
[dir="rtl"] .timeline {
  padding-left:  0;
  padding-right: 1.6rem;
  border-left:   none;
  border-right:  2px solid var(--border);
}
[dir="rtl"] .tl-dot {
  left:  auto;
  right: -1.75rem;
}

/* ═══════════════════════════════════════════════
   RTL — SECTION LABEL
═══════════════════════════════════════════════ */
[dir="rtl"] .section-label {
  border-left:   none;
  border-right:  3px solid var(--accent);
  padding-left:  0;
  padding-right: .75rem;
}

/* ═══════════════════════════════════════════════
   RTL — PUBLICATION GROUP TITLE
═══════════════════════════════════════════════ */
[dir="rtl"] .pub-group-title {
  border-left:  none;
  border-right: 3px solid var(--navy);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: linear-gradient(270deg, rgba(13,34,68,.07), transparent);
}

/* ═══════════════════════════════════════════════
   RTL — HERO
   در RTL، flex row به‌طور طبیعی راست‌به‌چپ است:
   avatar سمت راست، hero-text سمت چپ (راست‌چین)
═══════════════════════════════════════════════ */
@media (max-width: 860px) {
  [dir="rtl"] .hero-inner { flex-direction: column; text-align: right; }
}
[dir="rtl"] .hero-label,
[dir="rtl"] .hero-name,
[dir="rtl"] .hero-affil { text-align: right; }
[dir="rtl"] .hero-badges { justify-content: flex-start; }

/* ═══════════════════════════════════════════════
   RTL — NAV
   nav-brand در RTL به‌طور طبیعی سمت راست قرار می‌گیرد
═══════════════════════════════════════════════ */
[dir="rtl"] nav {
  display: flex;
  align-items: center;
  gap: .5rem;
}
@media (max-width: 620px) {
  [dir="rtl"] .nav-links {
    flex-direction: column;
  }
}

/* ═══════════════════════════════════════════════
   RTL — FACT CARD
═══════════════════════════════════════════════ */
[dir="rtl"] .fact-card {
  text-align: right;
}

/* ═══════════════════════════════════════════════
   RTL — PUBLICATION ITEM
═══════════════════════════════════════════════ */
[dir="rtl"] .pub-item {
  text-align: right;
}

/* ═══════════════════════════════════════════════
   RTL — STUDENT CARD
═══════════════════════════════════════════════ */
[dir="rtl"] .student-card {
  text-align: right;
}

/* ═══════════════════════════════════════════════
   RTL — AWARDS LIST
═══════════════════════════════════════════════ */
[dir="rtl"] .awards-list li {
  text-align: right;
}

/* ═══════════════════════════════════════════════
   RTL — RESEARCH CARD
═══════════════════════════════════════════════ */
[dir="rtl"] .research-card {
  text-align: right;
}

/* ═══════════════════════════════════════════════
   RTL — TABLE
═══════════════════════════════════════════════ */
[dir="rtl"] .course-table th,
[dir="rtl"] .course-table td {
  text-align: right;
}

/* ═══════════════════════════════════════════════
   RTL — CONTACT & REF
═══════════════════════════════════════════════ */
[dir="rtl"] .contact-block,
[dir="rtl"] .ref-card {
  text-align: right;
}

/* ═══════════════════════════════════════════════
   RTL — راست‌چینی اصلی (کانتینرها)
═══════════════════════════════════════════════ */

/* تمام محتوای داخل section → راست‌چین می‌شود و به فرزندان cascade می‌کند */
[dir="rtl"] .section-content      { text-align: right; }
/* متن Hero */
[dir="rtl"] .hero-text             { text-align: right; }
/* section label column */
[dir="rtl"] .two-col .section-label-col { text-align: right; }
/* سربرگ جدول — override می‌کند text-align: left صریح را */
[dir="rtl"] .course-table th       { text-align: right; letter-spacing: 0; }
/* footer در RTL راست‌چین می‌شود نه وسط */
[dir="rtl"] .footer-inner          { text-align: right; }
/* ستون‌های اطلاعات تماس */
[dir="rtl"] .contact-grid          { direction: rtl; }
/* کارت‌های مرجع */
[dir="rtl"] .ref-grid              { direction: rtl; }

/* ═══════════════════════════════════════════════
   RTL — HERO BADGE DIRECTION
═══════════════════════════════════════════════ */
[dir="rtl"] .badge { flex-direction: row-reverse; }

/* ═══════════════════════════════════════════════
   RTL — COURSE TABLE BADGE
═══════════════════════════════════════════════ */
[dir="rtl"] .course-table td:first-child { font-weight: 600; }

/* ═══════════════════════════════════════════════
   PRINT STYLES
═══════════════════════════════════════════════ */
@media print {
  .navbar, .skip-link, .lang-btn, .nav-toggle, .hero-badges { display: none !important; }
  .hero { margin-top: 0; background: none; padding: 1.5rem 0 1rem; }
  .hero::before, .hero::after { display: none; }
  .hero-name { color: var(--navy) !important; font-size: 1.8rem; }
  .hero-label, .hero-affil { color: var(--text-muted) !important; }
  .section { padding: 1.5rem 0; }
  .section-alt { background: none; }
  .two-col { grid-template-columns: 120px 1fr; gap: 0 2rem; }
  .research-grid { grid-template-columns: repeat(3, 1fr); }
  .students-grid { grid-template-columns: repeat(2, 1fr); }
  .facts-grid { grid-template-columns: repeat(4, 1fr); }
  .footer { background: none; padding: 1rem 0; }
  .footer-name, .footer-sub, .footer-copy { color: var(--text-muted) !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .75rem; color: var(--text-light); }
  a[href^="mailto"]::after, a[href^="tel"]::after { content: none; }
  .rc-icon { display: none; }
  .pub-item { break-inside: avoid; }
  .student-card { break-inside: avoid; }
}
