/* Bilingual (EN/FA) support for MrMaper site */

/* Persian web font (Kalameh) — self-hosted */
@import url("/assets/fonts/kalameh/kalameh.css");

/* Apply Persian font + adjust base size when Farsi is active */
html.lang-fa body,
html.lang-fa .navbar,
html.lang-fa .card,
html.lang-fa .pillar-card,
html.lang-fa .timeline-item,
html.lang-fa .post,
html.lang-fa .timeline-body {
  font-family: "Kalameh", "Segoe UI", Tahoma, sans-serif;
  line-height: 2;
  font-size: 1.02rem;
}

/* Timeline headings (bilingual section titles) */
.timeline-section-title {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: var(--primary, #007bff);
}
html.lang-fa .timeline-section-title {
  text-align: right;
}

/* Hide the inactive language. Inline spans use .lang-en / .lang-fa. */
html:not(.lang-fa) .lang-fa {
  display: none !important;
}
html.lang-fa .lang-en {
  display: none !important;
}

/* Block-level bilingual wrappers */
html:not(.lang-fa) .lang-fa-block {
  display: none !important;
}
html.lang-fa .lang-en-block {
  display: none !important;
}

/* RTL adjustments when Persian is active */
html.lang-fa {
  direction: rtl;
}
html.lang-fa body {
  text-align: right;
}

/* Justify ALL Persian text (consistent across the whole site).
   Default RTL justification uses kashida stretching; we avoid inter-word/
   inter-character which create ugly gaps. */
html.lang-fa,
html.lang-fa .lang-fa-block,
html.lang-fa .post,
html.lang-fa .timeline-item,
html.lang-fa .pillar-card,
html.lang-fa .card-text {
  text-align: justify;
}
html.lang-fa p,
html.lang-fa li {
  text-align: justify;
  line-height: 1.9;
}
html.lang-fa .navbar-nav {
  padding-right: 0;
}
html.lang-fa .ml-auto {
  margin-left: 0 !important;
  margin-right: auto !important;
}

/* Language toggle button */
#lang-toggle {
  cursor: pointer;
  font-weight: 600;
  border: 1px solid currentColor;
  border-radius: 6px;
  padding: 0.1rem 0.5rem;
  margin-left: 0.5rem;
  user-select: none;
  font-size: 0.85rem;
  line-height: 1.6;
  display: inline-flex;
  align-items: center;
}
html.lang-fa #lang-toggle {
  margin-left: 0;
  margin-right: 0.5rem;
}

/* Pillars grid */
.pillars {
  margin-top: 2rem;
}
.pillar-card {
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  background: #f5f7fa;
  border: 1px solid rgba(0, 0, 0, 0.06);
  height: 100%;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease;
}
html.lang-fa .pillar-card {
  text-align: right;
}

/* Dark mode support for pillar cards (theme uses [data-theme="dark"]) */
[data-theme="dark"] .pillar-card {
  background: #242526;
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

/* ---- Compact, clean timeline ---- */
.timeline-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.25rem 0 0.5rem 0 !important;
}
.timeline-item {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: #fff;
  padding: 0.85rem 1rem;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}
.timeline-item:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.timeline-item .content {
  padding: 0 !important;
}
.timeline-item h2 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0 0 0.15rem 0;
  line-height: 1.5;
  color: #1a1a1a;
}
.timeline-item .date {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary, #007bff);
  margin: 0 0 0.4rem 0;
}
.timeline-item p {
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 0;
  color: #444;
}
/* Three timeline sections as a responsive grid */
.about-timeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.about-timeline-grid .col {
  margin-top: 0 !important;
}
.timeline-section-title {
  font-size: 1.05rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--primary, #007bff);
  display: inline-block;
}
[data-theme="dark"] .timeline-item {
  background: #242526;
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .timeline-item h2 {
  color: #f1f1f1;
}
[data-theme="dark"] .timeline-item p {
  color: rgba(255, 255, 255, 0.75);
}

/* Project card image fallback (when repo has no screenshot) */
.project-img-fallback {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #007bff22, #17a2b822);
  color: #007bff;
  font-size: 3rem;
}
[data-theme="dark"] .project-img-fallback {
  background: linear-gradient(135deg, #007bff33, #17a2b833);
  color: #4da3ff;
}
