/* =========================================
   روزنوشته - استایل اصلی (نسخه سبز زیتونی)
   ========================================= */

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

/* ---- متغیرها (تم روشن - پیش‌فرض) ---- */
:root {
  --bg: #fafaf5;
  --bg-soft: #f0eee2;
  --text: #2a2e1f;
  --text-soft: #4f5340;
  --text-mute: #7d8068;
  --border: #d8d6c4;
  --accent: #6b7c3c;
  --accent-soft: #8a9d4e;
  --accent-light: #e8ebd6;
  --shadow: 0 1px 2px rgba(60,70,30,0.06);
  --sans: 'Vazirmatn', Tahoma, sans-serif;
}

/* ---- تم تاریک ---- */
[data-theme="dark"] {
  --bg: #1a1d12;
  --bg-soft: #252918;
  --text: #f0ede0;
  --text-soft: #c8c5a8;
  --text-mute: #888b6a;
  --border: #353a22;
  --accent: #a8bd5e;
  --accent-soft: #94a851;
  --accent-light: #2a3018;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ---- ریست ---- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.9;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 400;
}

/* ---- محتوای صفحه ---- */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- هدر ---- */
header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---- برند: لوگو جایگزین متن "روزنوشته‌ها" ---- */
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 0.85;
}

.brand-logo {
  width: 52px;
  height: 52px;
  display: block;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.brand:hover .brand-logo {
  transform: scale(1.04);
}

/* پیش‌فرض: لوگوی روشن دیده می‌شه، تیره مخفی */
.brand-logo-dark { display: none; }

/* در تم تاریک: لوگوی تیره دیده می‌شه، روشن مخفی */
[data-theme="dark"] .brand-logo-light { display: none; }
[data-theme="dark"] .brand-logo-dark { display: block; }

.site-tagline {
  display: block;
  font-size: 0.85rem;
  color: var(--text-mute);
  font-weight: 400;
  line-height: 1.4;
}

/* ---- منو ---- */
nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
  padding: 0.3rem 0;
  border-bottom: 1px solid transparent;
}

nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---- دکمه تم ---- */
.theme-toggle {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  padding: 0;
  font-family: var(--sans);
}

.theme-toggle:hover {
  background: var(--accent);
  color: #fff;
  transform: rotate(20deg);
}

/* ============================================
   Hero — معرفی نویسنده در بالای صفحه اصلی
   ============================================ */
.hero {
  display: flex;
  align-items: flex-start;
  gap: 1.6rem;
  padding: 0.5rem 0 2.2rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  animation: fadeUp 0.5s ease-out;
}

.hero-logo {
  flex-shrink: 0;
  margin-top: 0.3rem;
}

.hero-logo-img {
  width: 110px;
  height: 110px;
  display: block;
}

.hero-logo-dark { display: none; }
[data-theme="dark"] .hero-logo-light { display: none; }
[data-theme="dark"] .hero-logo-dark { display: block; }

.hero-body {
  flex: 1;
  min-width: 0;
}

.hero-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
  line-height: 1.4;
  letter-spacing: -0.3px;
}

.hero-role {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.7rem;
  direction: ltr;
  text-align: right;
  unicode-bidi: plaintext;
}

.hero-bio {
  font-size: 1rem;
  color: var(--text-soft);
  line-height: 1.85;
  margin-bottom: 1rem;
  font-weight: 400;
}

/* چیپ‌های سوابق تحصیلی */
.hero-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding: 0;
}

.chip {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  background: var(--bg-soft);
  color: var(--text-soft);
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 400;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.chip:hover {
  background: var(--accent-light);
  border-color: var(--accent-soft);
  color: var(--text);
}

/* لینک‌های Hero */
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}

.hero-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: opacity 0.2s ease;
}

.hero-links a:hover {
  opacity: 0.7;
}

/* ---- لیست روزنوشته‌ها ---- */
.posts-list {
  list-style: none;
}

.post-item {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  transition: padding 0.3s ease;
}

.post-item:last-child {
  border-bottom: none;
}

.post-date {
  display: block;
  font-size: 0.85rem;
  color: var(--text-mute);
  margin-bottom: 0.5rem;
  font-feature-settings: "tnum";
}

.post-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.post-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.post-title a:hover {
  color: var(--accent);
}

.post-excerpt {
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.9;
  margin-bottom: 0.75rem;
  font-weight: 400;
}

.read-more {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.read-more:hover {
  text-decoration: underline;
}

.read-more::after {
  content: " ←";
  display: inline-block;
  transition: transform 0.2s;
}

.read-more:hover::after {
  transform: translateX(-3px);
}

/* ---- صفحه پست تکی ---- */
.post-full {
  padding: 1rem 0 3rem;
}

.post-full .post-date {
  margin-bottom: 1rem;
}

.post-full h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 2rem;
  color: var(--text);
  letter-spacing: -0.5px;
}

.post-content {
  font-size: 1.05rem;
  line-height: 2;
  color: var(--text);
  font-weight: 400;
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--text);
}

.post-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2rem 0 0.8rem;
  color: var(--text);
}

.post-content blockquote {
  border-right: 3px solid var(--accent);
  padding: 0.5rem 1.5rem;
  margin: 1.5rem 0;
  color: var(--text-soft);
  background: var(--accent-light);
  border-radius: 0 4px 4px 0;
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.post-content ul, .post-content ol {
  margin: 1rem 2rem 1.5rem 0;
  padding-right: 1rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5rem 0;
}

/* ---- ناوبری بین پست‌ها ---- */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  gap: 1rem;
}

.post-nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9rem;
}

.post-nav a:hover {
  color: var(--accent);
}

/* ---- صفحه درباره ---- */
.about-content {
  font-size: 1.05rem;
  line-height: 2;
}

.about-content h1 {
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.about-content p {
  margin-bottom: 1.2rem;
  color: var(--text);
}

.contact-box {
  background: var(--accent-light);
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 2rem;
  border: 1px solid var(--border);
}

.contact-box a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  direction: ltr;
  display: inline-block;
}

.contact-box a:hover {
  text-decoration: underline;
}

/* ---- فوتر ---- */
footer {
  margin-top: 5rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-mute);
  font-size: 0.85rem;
}

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

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

/* ---- انیمیشن ورود ---- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-item, .post-full, .about-content {
  animation: fadeUp 0.5s ease-out;
}

.post-item:nth-child(2) { animation-delay: 0.05s; }
.post-item:nth-child(3) { animation-delay: 0.1s; }
.post-item:nth-child(4) { animation-delay: 0.15s; }
.post-item:nth-child(5) { animation-delay: 0.2s; }

/* ---- ریسپانسیو ---- */
@media (max-width: 600px) {
  html { font-size: 15px; }
  
  .container { padding: 0 1.2rem; }
  
  header {
    padding: 1.8rem 0 1.2rem;
    margin-bottom: 1.8rem;
  }
  
  .header-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .site-tagline {
    font-size: 0.78rem;
  }
  
  nav {
    gap: 0.9rem;
  }
  
  nav a {
    font-size: 0.88rem;
  }

  /* Hero ریسپانسیو */
  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 0.5rem 0 1.8rem;
  }

  .hero-logo {
    margin-top: 0;
  }

  .hero-logo-img {
    width: 92px;
    height: 92px;
  }

  .hero-name {
    font-size: 1.35rem;
  }

  .hero-role {
    text-align: center;
  }

  .hero-chips {
    justify-content: center;
  }

  .hero-links {
    justify-content: center;
  }
  
  .post-title { font-size: 1.2rem; }
  .post-full h1 { font-size: 1.6rem; }
}

/* صفحه‌های خیلی کوچک */
@media (max-width: 380px) {
  .brand-logo {
    width: 40px;
    height: 40px;
  }
  .site-tagline {
    display: none; /* تو موبایل‌های خیلی کوچک، فقط لوگو */
  }
}

/* ---- اسکرول‌بار سفارشی ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { 
  background: var(--border); 
  border-radius: 4px; 
}
::-webkit-scrollbar-thumb:hover { background: var(--text-mute); }

/* ---- انتخاب متن ---- */
::selection {
  background: var(--accent);
  color: #fff;
}
