/* ========================================
   Azizullah Badghisi — Legacy Website
   Modern Responsive Stylesheet
   ======================================== */

:root {
  --gold: #b8860b;
  --gold-light: #d4a843;
  --gold-pale: #f5e6c0;
  --cream: #faf6ef;
  --brown: #3e2c1c;
  --brown-light: #5c4033;
  --brown-mid: #7a6b5a;
  --text: #2c2017;
  --text-light: #6b5d4e;
  --border: #d9cdb8;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(62,44,28,0.08);
  --shadow-md: 0 4px 12px rgba(62,44,28,0.1);
  --shadow-lg: 0 8px 30px rgba(62,44,28,0.12);
  --radius: 10px;
  --transition: 0.25s ease;
}

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

.site-notice {
  background: var(--gold);
  color: #3a2800;
  text-align: center;
  padding: 0.55rem 1.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.src-link {
  font-size: 0.68rem;
  font-family: sans-serif;
  color: var(--gold);
  text-decoration: none;
  margin-left: 0.25rem;
  vertical-align: super;
  opacity: 0.85;
}
.src-link:hover { opacity: 1; text-decoration: underline; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

/* RTL support */
body.rtl {
  direction: rtl;
  text-align: right;
  font-family: 'Vazirmatn', 'B Nazanin', 'Tahoma', 'Georgia', serif;
}

/* ---- NAVBAR ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(62, 44, 28, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--gold);
  padding: 0 2rem;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-brand {
  color: var(--gold-light);
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

body.rtl .nav-brand {
  font-size: 1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  list-style: none;
}

.nav-links a {
  color: var(--cream);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(184, 134, 11, 0.2);
  color: var(--gold-light);
}

.nav-links .lang-link {
  background: var(--gold);
  color: var(--brown);
  font-weight: 700;
  margin-left: 0.5rem;
  font-size: 0.82rem;
}

body.rtl .nav-links .lang-link {
  margin-left: 0;
  margin-right: 0.5rem;
}

.nav-links .lang-link:hover {
  background: var(--gold-light);
  color: var(--brown);
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--cream);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- HERO ---- */
.hero {
  background: linear-gradient(160deg, var(--brown) 0%, var(--brown-light) 60%, #6b5340 100%);
  color: var(--cream);
  text-align: center;
  padding: 5rem 2rem 4.5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(184,134,11,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  margin-bottom: 0.6rem;
  position: relative;
}

.hero .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--gold-light);
  font-style: italic;
  margin-bottom: 0.4rem;
  position: relative;
}

.hero .years {
  font-size: 0.95rem;
  color: #c4b8a4;
  letter-spacing: 0.12em;
  position: relative;
}

.hero .scroll-hint {
  display: inline-block;
  margin-top: 2rem;
  color: var(--gold-light);
  font-size: 0.85rem;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity var(--transition);
  position: relative;
}

.hero .scroll-hint:hover { opacity: 1; }

.hero .scroll-arrow {
  display: block;
  margin: 0.3rem auto 0;
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--gold-light);
  border-bottom: 2px solid var(--gold-light);
  transform: rotate(45deg);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(45deg) translateY(6px); }
}

/* ---- LAYOUT ---- */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.section { margin-bottom: 4rem; }

/* ---- TYPOGRAPHY ---- */
h2 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  color: var(--brown);
  margin-bottom: 1.2rem;
  position: relative;
  padding-bottom: 0.6rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
}

body.rtl h2::after {
  left: auto;
  right: 0;
}

h3 {
  font-size: 1.15rem;
  color: var(--brown-light);
  margin-top: 1.8rem;
  margin-bottom: 0.6rem;
}

p { margin-bottom: 1rem; }

ul { margin: 0.5rem 0 1.2rem 1.5rem; }
body.rtl ul { margin: 0.5rem 1.5rem 1.2rem 0; }
ul li { margin-bottom: 0.5rem; }

strong { color: var(--brown); }

.usd {
  color: var(--brown-mid);
  font-size: 0.86em;
  font-style: italic;
}

/* ---- BIO CARD ---- */
.bio-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.8rem 0;
  box-shadow: var(--shadow-sm);
}

.bio-item {
  padding: 1rem 1.3rem;
  border-bottom: 1px solid #f0ebe2;
}

.bio-item:not(:nth-child(3n)) {
  border-right: 1px solid #f0ebe2;
}

body.rtl .bio-item:not(:nth-child(3n)) {
  border-right: none;
  border-left: 1px solid #f0ebe2;
}

.bio-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brown-mid);
  display: block;
  margin-bottom: 0.15rem;
}

.bio-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brown);
}

/* ---- STATS ---- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card .number {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--gold);
  display: block;
  line-height: 1.2;
}

.stat-card .label {
  font-size: 0.8rem;
  color: var(--brown-mid);
  margin-top: 0.3rem;
  display: block;
}

/* ---- HIGHLIGHT BOX ---- */
.highlight {
  background: linear-gradient(135deg, #f7f0de 0%, #f0e8d2 100%);
  border-left: 4px solid var(--gold);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  box-shadow: var(--shadow-sm);
}

body.rtl .highlight {
  border-left: none;
  border-right: 4px solid var(--gold);
  border-radius: var(--radius) 0 0 var(--radius);
}

/* ---- GALLERY ---- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.8rem;
  margin-top: 1.5rem;
}

.gallery-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.gallery-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #e8dfd0 0%, #d9cdb8 50%, #c4b8a4 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--brown-light);
  font-size: 0.85rem;
  gap: 0.6rem;
}

.gallery-placeholder svg {
  width: 40px;
  height: 40px;
  opacity: 0.4;
}

.gallery-caption {
  padding: 1.2rem 1.4rem;
}

.gallery-caption .caption-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--brown);
  display: block;
  margin-bottom: 0.3rem;
}

.gallery-caption .caption-text {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.55;
}

.gallery-note {
  margin-top: 1.5rem;
  padding: 1rem 1.4rem;
  background: rgba(184,134,11,0.06);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--brown-mid);
}

.gallery-note code {
  background: rgba(62,44,28,0.08);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ---- ARCHIVE CARDS ---- */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.archive-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.3rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.archive-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.pdf-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--brown);
  color: var(--gold-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: system-ui, sans-serif;
}

.archive-card .info { min-width: 0; }

.archive-card .title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brown);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-card .detail {
  font-size: 0.78rem;
  color: var(--brown-mid);
}

/* ---- REFLECTION BOX ---- */
.reflection {
  background: linear-gradient(160deg, var(--brown) 0%, var(--brown-light) 100%);
  color: var(--cream);
  padding: 2.8rem 2.5rem;
  border-radius: var(--radius);
  margin-top: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.reflection h2 {
  color: var(--gold-light);
}

.reflection h2::after {
  background: var(--gold);
}

.reflection p {
  color: #ddd5c8;
}

.reflection em {
  color: var(--gold-pale);
}

/* ---- TIMELINE ---- */
.timeline {
  position: relative;
  padding-left: 2.5rem;
  margin: 2rem 0;
}

body.rtl .timeline {
  padding-left: 0;
  padding-right: 2.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

body.rtl .timeline::before {
  left: auto;
  right: 8px;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.5rem;
  top: 0.55rem;
  width: 10px;
  height: 10px;
  background: var(--gold);
  border: 2px solid var(--cream);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--gold-pale);
}

body.rtl .timeline-item::before {
  left: auto;
  right: -2.5rem;
}

.timeline-year {
  font-weight: 700;
  color: var(--gold);
  font-size: 0.9rem;
}

.timeline-text {
  font-size: 0.95rem;
  color: var(--text);
}

/* ---- FOOTER ---- */
footer {
  background: var(--brown);
  color: #c4b8a4;
  text-align: center;
  padding: 2.5rem 2rem;
  font-size: 0.88rem;
}

footer .footer-main {
  color: var(--cream);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

footer .footer-sources {
  font-size: 0.78rem;
  color: #9a8d7e;
  margin-top: 0.8rem;
}

footer a {
  color: var(--gold-light);
  text-decoration: none;
}

footer a:hover { text-decoration: underline; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .bio-card { grid-template-columns: repeat(2, 1fr); }
  .bio-item:not(:nth-child(3n)) { border-right: none; }
  body.rtl .bio-item:not(:nth-child(3n)) { border-left: none; }
  .bio-item:nth-child(odd) { border-right: 1px solid #f0ebe2; }
  body.rtl .bio-item:nth-child(odd) { border-right: none; border-left: 1px solid #f0ebe2; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }

  .hamburger { display: block; }

  .nav-links {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(62, 44, 28, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 1rem;
    gap: 0.2rem;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-bottom: 2px solid var(--gold);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    display: block;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    text-align: center;
  }

  .nav-links .lang-link {
    margin: 0.5rem 0 0 0;
  }

  .hero { padding: 3.5rem 1.5rem 3rem; }
  .container { padding: 2rem 1.2rem 3rem; }
  .reflection { padding: 2rem 1.5rem; }
  .archive-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .bio-card { grid-template-columns: 1fr; }
  .bio-item:nth-child(odd) { border-right: none; }
  body.rtl .bio-item:nth-child(odd) { border-left: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
}
