/* CSS Document */

/*
==================================================
        Unified Stylesheet for Sepehr Blog
==================================================
این فایل استایل‌های صفحات اصلی و داخلی بلاگ را
به صورت یکپارچه شامل می‌شود.
*/

/* =============== متغیرها و استایل‌های پایه =============== */
:root {
  /* Colors */
  --brand-main: #263b8f;
  --brand-accent: #0EA5E9;
  --accent-red: #e53935;
  --accent-turquoise: #00c3c8;
  --text-main: #111827;
  --text-muted: #6b7280;
  --bg-page: #F4F5FB;
  --bg-card: #ffffff;
  --bg-soft: #f5f7fb;
  --border-soft: #e5e7eb;

  /* Sizing & Shadow */
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Vazirmatn", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.7;
}

a {
  color: var(--accent-red);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}


/* =============== HEADER (Unified) =============== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.97);
  color: #e5e7eb;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.7);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 1.5rem;
  font-size: 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.topbar-left,
.topbar-right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.topbar-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #cbd5f5;
  text-decoration: none;
}
.topbar-item:hover {
  color: #ffffff;
  text-decoration: none;
}

.topbar-divider {
  color: #9ca3af;
}

.navbar {
  padding: 0.6rem 0 0.7rem;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  flex-shrink: 0;
}

.brand img {
  height: 40px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: 0.88rem;
}

.nav-links a {
  position: relative;
  color: #e5e7eb;
  padding-bottom: 0.15rem;
  text-decoration: none;
}

.nav-links a::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-accent), var(--accent-red));
  transition: width 0.18s ease-out;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a.active {
  color: #ffffff;
}

/* Dropdown (Unified) */
.nav-dropdown {
  position: relative;
}

.nav-drop-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: none;
  border: none;
  color: #e5e7eb;
  font: inherit;
  cursor: pointer;
}

.nav-drop-toggle i {
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.nav-drop-toggle:hover i {
    transform: translateY(2px);
}

.nav-drop-menu {
  position: absolute;
  top: 130%;
  inset-inline-end: 0;
  min-width: 220px;
  border-radius: var(--radius-md);
  background-color: #020617;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.95);
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.18s ease-out;
  z-index: 40;
}

.nav-drop-menu a {
  display: block;
  padding: 8px 16px;
  font-size: 0.82rem;
  color: #e5e7eb;
}

.nav-drop-menu a:hover {
  background-color: rgba(148, 163, 184, 0.18);
}

.nav-drop-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Mobile Menu Toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(148, 163, 184, 0.7);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.6rem;
  color: #e5e7eb;
  font-size: 0.8rem;
  cursor: pointer;
}


/* =============== BREADCRUMB (Unified) =============== */
.breadcrumb-section {
  background-color: var(--bg-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 0.7rem 0 0.8rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.breadcrumb a {
  color: var(--brand-main);
}
.breadcrumb span {
  font-size: 0.7rem;
}

/* =============== MAIN LAYOUT (Unified) =============== */
.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(0, 1.1fr);
  gap: 1.8rem;
  padding-block: 32px 40px;
}

/* =============== HERO - BLOG INDEX PAGE =============== */
.blog-index-page .hero {
  padding: 40px 1.5rem 32px;
  background: radial-gradient(circle at 10% 0%, #1d4ed8 0, #020617 40%, #020617 100%);
  color: #e5e7f0;
}
.blog-index-page .hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.4fr);
  gap: 32px;
  max-width: 1140px;
  margin: 0 auto;
}
/* ... other specific hero styles from blog.css ... */
.blog-index-page .hero-copy h1 { font-size: clamp(1.9rem, 2.4vw, 2.4rem); margin-bottom: 0.6rem; }
.blog-index-page .hero-copy p { font-size: 0.95rem; line-height: 1.9; color: #e5e7eb; max-width: 36rem; }
.blog-index-page .hero-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; font-size: 0.82rem; }
.blog-index-page .hero-meta span { padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(148, 163, 184, 0.4); }
.blog-index-page .hero-panel { background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.9)); border-radius: 20px; padding: 16px 18px 14px; box-shadow: 0 24px 50px rgba(15, 23, 42, 0.7); display: flex; flex-direction: column; gap: 10px; }
.blog-index-page .hero-badge { display: inline-flex; align-self: flex-start; font-size: 0.78rem; padding: 4px 10px; border-radius: 999px; background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.6); color: #e0f2fe; }
.blog-index-page .hero-note { margin: 0; font-size: 0.85rem; line-height: 1.8; color: #e5e7eb; }
.blog-index-page .hero-search { display: flex; gap: 8px; margin-top: 4px; }
.blog-index-page .hero-search input { flex: 1; border-radius: 999px; border: 1px solid rgba(148, 163, 184, 0.7); background: rgba(15, 23, 42, 0.9); color: #e5e7eb; padding: 8px 14px; font-size: 0.86rem; }
.blog-index-page .hero-search button { border-radius: 999px; border: none; padding: 8px 16px; font-size: 0.86rem; font-weight: 600; background: linear-gradient(135deg, var(--accent-turquoise), var(--accent-red)); color: #0b1120; cursor: pointer; }


/* =============== HERO - SINGLE ARTICLE PAGE =============== */
.blog-single-page .hero {
  padding: 2.5rem 0 2rem;
  background:
    radial-gradient(circle at 0 0, rgba(14, 165, 233, 0.25), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(38, 59, 143, 0.45), transparent 50%),
    #E5F2FF;
}
.blog-single-page .hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.4fr);
  gap: 1.8rem;
  align-items: stretch;
}
/* ... other specific hero styles from pu-article.css ... */
.blog-single-page .hero-panel { background: #020617; border-radius: var(--radius-lg); padding: 1.3rem 1.4rem 1.4rem; color: #e5e7eb; box-shadow: var(--shadow-soft); position: relative; overflow: hidden; }
.blog-single-page .hero-panel::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.35), transparent 55%), radial-gradient(circle at 100% 100%, rgba(37, 99, 235, 0.6), transparent 60%); opacity: 0.9; mix-blend-mode: screen; pointer-events: none; }
.blog-single-page .hero-panel-inner { position: relative; z-index: 1; }
.blog-single-page .hero-panel-tag { display: inline-flex; align-items: center; padding: 0.22rem 0.8rem; border-radius: var(--radius-pill); border: 1px solid rgba(148, 163, 184, 0.8); font-size: 0.75rem; margin-bottom: 0.75rem; background-color: rgba(15, 23, 42, 0.9); }
.blog-single-page .hero-panel h2 { margin: 0 0 0.6rem; font-size: 1.02rem; }
.blog-single-page .hero-panel p { margin: 0 0 0.65rem; font-size: 0.86rem; line-height: 1.9; }
.blog-single-page .hero-list { list-style: none; margin: 0 0 0.8rem; padding: 0; font-size: 0.84rem; }
.blog-single-page .hero-list li { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.25rem; }
.blog-single-page .hero-list li::before { content: "●"; font-size: 0.55rem; color: var(--brand-accent); }
.blog-single-page .hero-highlight { margin-top: 0.4rem; padding-top: 0.6rem; border-top: 1px dashed rgba(148, 163, 184, 0.7); font-size: 0.8rem; }
.blog-single-page .hero-copy h1 { margin: 0 0 0.7rem; font-size: clamp(2rem, 3vw, 2.5rem); color: var(--brand-main); letter-spacing: -0.03em; }
.blog-single-page .hero-copy p { margin: 0 0 0.9rem; font-size: 0.98rem; color: var(--text-muted); max-width: 34rem; }
.blog-single-page .hero-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: 0.78rem; }
.blog-single-page .hero-chip { padding: 0.25rem 0.85rem; border-radius: var(--radius-pill); background-color: #e5e7eb; color: #374151; }


/* =============== CONTENT - BLOG INDEX PAGE =============== */
.blog-index-page .content { display: flex; flex-direction: column; gap: 26px; }
.blog-index-page .post-card { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 2.2fr); gap: 20px; background-color: var(--bg-card); border-radius: var(--radius-md); border: 1px solid var(--border-soft); padding: 16px 18px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06); transition: transform 0.18s ease-out, box-shadow 0.18s ease-out; }
.blog-index-page .post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.blog-index-page .post-featured { grid-template-columns: minmax(0, 1.3fr) minmax(0, 2.4fr); }
.blog-index-page .post-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--radius-md) - 4px); }
.blog-index-page .post-body { display: flex; flex-direction: column; gap: 8px; }
.blog-index-page .post-label { font-size: 0.75rem; color: var(--accent-red); font-weight: 600; }
.blog-index-page .post-title { font-size: 1.02rem; margin: 0; color: var(--brand-main); }
.blog-index-page .post-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.76rem; color: var(--text-muted); }
.blog-index-page .post-meta i { color: var(--accent-red); margin-left: 4px; }
.blog-index-page .post-excerpt { margin: 0; font-size: 0.9rem; line-height: 1.9; color: #374151; }
.blog-index-page .read-more { align-self: flex-start; margin-top: auto; font-size: 0.86rem; font-weight: 600; color: var(--accent-red); }
.blog-index-page .post-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }


/* =============== CONTENT - SINGLE ARTICLE PAGE =============== */
.blog-single-page article header { margin-bottom: 1.5rem; }
.blog-single-page .article-meta { display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.55rem; }
.blog-single-page .article-meta span i { margin-left: 0.3rem; color: var(--brand-main); }
.blog-single-page .article-intro { margin: 0; font-size: 0.98rem; color: var(--text-main); }
.blog-single-page .article-toc { margin-top: 1.2rem; padding: 0.85rem 1rem; border-radius: var(--radius-md); background-color: var(--bg-card); box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08); border: 1px solid var(--border-soft); font-size: 0.82rem; }
.blog-single-page .article-toc-title { font-weight: 700; margin-bottom: 0.55rem; color: var(--text-muted); }
.blog-single-page .article-toc-list { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; list-style: none; margin: 0; padding: 0; }
.blog-single-page .article-section { margin-top: 1.6rem; }
.blog-single-page .section-card { background-color: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); padding: 1.3rem 1.5rem 1.4rem; }
.blog-single-page .section-title { margin: 0 0 0.6rem; font-size: 1.15rem; color: var(--brand-main); }
.blog-single-page .section-lead { margin: 0 0 0.9rem; font-size: 0.94rem; }
.blog-single-page .section-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.1fr); gap: 1.2rem; align-items: flex-start; }
.blog-single-page .section-card--top-media .section-grid { grid-template-columns: minmax(0, 1fr); }
.blog-single-page .section-media--square { max-width: 220px; height: 220px; margin: 0 auto 1rem; border-radius: 18px; overflow: hidden; box-shadow: 0 14px 35px rgba(148, 163, 184, 0.6); }
.blog-single-page .section-media--square img { width: 100%; height: 100%; object-fit: cover; }
.blog-single-page .section-text p { margin: 0 0 0.75rem; font-size: 0.94rem; line-height: 1.9; }
.blog-single-page .section-text h3 { margin: 0.8rem 0 0.4rem; font-size: 0.98rem; }
.blog-single-page .section-list { margin: 0 0 0.8rem; padding-inline-start: 1.1rem; font-size: 0.9rem; }
.blog-single-page .highlight-box { margin-top: 0.8rem; padding: 0.8rem 1rem; border-radius: var(--radius-md); background: linear-gradient(135deg, #EFF6FF, #F9FAFB); border: 1px solid #DBEAFE; font-size: 0.86rem; color: #1F2937; }
.blog-single-page .highlight-box strong { color: var(--brand-main); }
.blog-single-page .table-wrap { margin-top: 0.6rem; width: 100%; overflow-x: auto; }
.blog-single-page .comparison-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; min-width: 640px; }
/* ...and so on for all specific article styles... */


/* =============== SIDEBAR (Unified) =============== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.widget {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  padding: 14px 16px 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.widget-title {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--brand-main);
  border-right: 3px solid var(--accent-red);
  padding-right: 8px;
}

/* Sidebar > Tag row */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { border-radius: var(--radius-pill); padding: 3px 10px; border: 1px solid var(--border-soft); background-color: #f9fafb; font-size: 0.78rem; color: var(--text-muted); cursor: pointer; }
.tag.active, .tag:hover { border-color: var(--brand-accent); color: var(--brand-main); background: rgba(34, 211, 238, 0.08); }

/* Sidebar > Category List */
.category-list { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
.category-list li + li { margin-top: 4px; }
.category-list a { color: var(--text-main); text-decoration: none; display: inline-flex; align-items: center; }
.category-list a::before { content: "▸"; font-size: 0.75rem; margin-left: 6px; color: var(--accent-red); }

/* Sidebar > Sticky CTA */
.sticky-cta { position: sticky; top: 100px; }
.sticky-cta p { font-size: 0.9rem; }
.sticky-cta .cta-button { display: inline-flex; margin-top: 8px; padding: 7px 16px; border-radius: var(--radius-pill); background: linear-gradient(135deg, var(--brand-accent), var(--accent-red)); border: none; color: #0f172a; font-size: 0.84rem; font-weight: 600; text-decoration: none; }


/* =============== FOOTER (Unified) =============== */
.site-footer {
  background-color: #020617;
  border-top: 1px solid #1f2937;
  color: #9ca3af;
  font-size: 0.82rem;
  padding: 1.3rem 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-brand {
  margin: 0 0 4px;
  color: #e5e7eb;
  font-weight: 600;
}

.footer-text {
  margin: 0;
  max-width: 45ch;
}


/* =============== ANIMATIONS =============== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}


/* =============== RESPONSIVE =============== */
@media (max-width: 992px) {
  .nav-toggle {
    display: inline-flex;
  }
  .nav-links {
    position: fixed;
    inset-inline-start: 0;
    top: 62px; /* Adjust based on your header height */
    width: 100%;
    background-color: #020617;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1.5rem 1.2rem;
    gap: 0.8rem;
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease-out;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .main-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar { order: -1; } /* Sidebar moves to top on mobile for single articles */
  .blog-index-page .sidebar { order: 1; } /* Sidebar stays below on index */

  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .blog-single-page .hero-panel { order: -1; }
  .sticky-cta { position: static; }
}

@media (max-width: 768px) {
  .topbar {
    display: none;
  }
  .container {
    padding-inline: 1.1rem;
  }
  .post-card,
  .post-featured {
    grid-template-columns: minmax(0, 1fr);
  }
}
