/* ===== وبلاگ همبازی (فهرست، نوشته، نویسنده) ===== */
/* پس‌زمینه‌ی صریح، تا در حالت‌های تاریکِ اجباری مرورگر متن ناپدید نشود */
body { background: #fff; color: #1b1b1b; }
.bp {
  --ink: #1b1b1b;
  --muted: #6a655c;
  --line: #e7e1d6;
  --cream: #f6f1e9;
  --accent: #ff5722;
  --accent-ink: #b4320a;
  width: 100%;
  color: var(--ink);
  padding-bottom: 56px;
  line-height: 1.9;
}
.bp, .bp * { font-family: iranYekan, Tahoma, sans-serif; }
.bp img { width: auto; max-width: 100%; height: auto; }
.bp a { color: inherit; }
.bp a:focus-visible, .bp button:focus-visible, .bp summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.bp .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.bp-wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 16px; }

/* ---- مسیر صفحه (breadcrumb) */
.crumbs {
  display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 16px 0 4px;
  font-size: 0.82rem; color: var(--muted);
}
.crumbs li { list-style: none; }
.crumbs li:not(:last-child)::after { content: "›"; margin-inline-start: 8px; color: #b9b3a8; }
.crumbs a:hover { color: var(--accent-ink); }
.crumbs [aria-current] { color: var(--ink); max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

/* ---- سرصفحه‌ی فهرست */
.blog-hero { text-align: center; padding: 28px 0 14px; }
.blog-hero h1 { font-size: clamp(1.6rem, 4.2vw, 2.4rem); line-height: 1.6; }
.blog-hero p { color: var(--muted); max-width: 640px; margin: 10px auto 0; }

/* ---- شبکه و کارت */
.post-grid { display: grid; gap: 20px; grid-template-columns: 1fr; padding-block: 18px 6px; }
@media (min-width: 640px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }

.post-card {
  position: relative; display: flex; flex-direction: column; background: #fff;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post-card:hover, .post-card:focus-within { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(27, 27, 27, 0.1); }
.post-card__img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover;
  background: var(--cream);
}
.post-card__img--ph { display: grid; place-items: center; }
.post-card__img--ph img { width: 64px; opacity: 0.85; }
.post-card__body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.post-card__meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.78rem; color: var(--muted); }
.post-card__title { font-size: 1.04rem; line-height: 1.85; font-weight: 700; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; }
.post-card__title a:hover { color: var(--accent-ink); }
.post-card__excerpt, .post-card__title {
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card__title { -webkit-line-clamp: 3; line-clamp: 3; }
.post-card__excerpt { font-size: 0.9rem; color: #4a463f; -webkit-line-clamp: 3; line-clamp: 3; }
.post-card__author { margin-top: auto; padding-top: 8px; display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--muted); }

/* ---- آواتار نویسنده */
.avatar {
  flex: none; width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, #ff7a4d, #ff5722); color: #1b1b1b;
  display: inline-grid; place-items: center; font-size: 0.8rem; font-weight: 700; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar--md { width: 36px; height: 36px; font-size: 0.95rem; }

/* ---- صفحه‌بندی */
.pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 28px 0 0; flex-wrap: wrap; }
.pager a, .pager span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
  padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 0.92rem;
}
.pager a:hover { border-color: var(--accent); color: var(--accent-ink); }
.pager .is-current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager .is-disabled { color: #b9b3a8; background: var(--cream); }

/* ---- نوار پیشرفت مطالعه */
.read-progress { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 2000; background: transparent; pointer-events: none; }
.read-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.1s linear; }

/* ---- نوشته */
.article { width: 100%; max-width: 760px; margin-inline: auto; padding-inline: 16px; }
.preview-banner {
  background: #fff3cd; border: 1px solid #f0d98a; color: #6b5200; border-radius: 12px;
  padding: 10px 14px; margin: 14px 0 0; font-size: 0.9rem;
}
.article__head h1 { font-size: clamp(1.5rem, 4.4vw, 2.25rem); line-height: 1.75; margin: 8px 0 12px; font-weight: 700; }
.article__lead { color: #4a463f; font-size: 1.05rem; margin-bottom: 14px; }
.article__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: var(--muted); font-size: 0.88rem; }
.article__meta .by { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.article__meta .by:hover { color: var(--accent-ink); }
.article__meta i { vertical-align: -2px; margin-inline-end: 4px; }

.article__cover { margin: 18px auto 8px; max-width: 540px; }
.article__cover img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 14px; background: var(--cream); }
@media (max-width: 640px) {
  .article { padding-inline: 12px; }
  .article__cover { max-width: none; margin-inline: 0; }
}

/* فهرست مطالب */
.toc { background: var(--cream); border-radius: 14px; padding: 4px 16px; margin: 18px 0; }
.toc summary { cursor: pointer; padding: 12px 0; font-weight: 700; list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "▾"; transition: transform 0.2s; }
.toc[open] summary::after { transform: rotate(180deg); }
.toc ol { padding: 0 0 12px; margin: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; list-style: none; }
.toc li a { display: flex; gap: 8px; padding: 7px 0; font-size: 0.95rem; color: #3a362f; }
.toc li a::before { content: counter(toc, persian) "."; color: var(--accent-ink); min-width: 1.6em; }
.toc li.lvl3 { padding-inline-start: 1.4em; }
.toc li a:hover, .toc li a.is-active { color: var(--accent-ink); }

/* متن */
.article-body { font-size: 1.06rem; line-height: 2.1; color: #262420; overflow-wrap: anywhere; margin-top: 18px; }
.article-body > :first-child { margin-top: 0; }
.article-body p { margin: 0 0 1.15em; }
.article-body h2 {
  font-size: 1.45rem; line-height: 1.75; margin: 2em 0 0.7em; padding-inline-start: 12px;
  border-inline-start: 4px solid var(--accent); scroll-margin-top: 84px; font-weight: 700;
}
.article-body h3 { font-size: 1.2rem; line-height: 1.8; margin: 1.6em 0 0.5em; scroll-margin-top: 84px; font-weight: 700; }
.article-body h4 { font-size: 1.05rem; margin: 1.4em 0 0.4em; font-weight: 700; }
.article-body ul, .article-body ol { margin: 0 0 1.2em; padding-inline-start: 1.7em; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { list-style: inherit; margin-bottom: 0.45em; }
.article-body a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: #7d2206; }
.article-body strong, .article-body b { font-weight: 700; }
.article-body blockquote {
  margin: 1.4em 0; padding: 14px 18px; background: var(--cream);
  border-inline-start: 4px solid var(--accent); border-radius: 10px; color: #3a362f;
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body img { display: block; max-width: 100% !important; height: auto !important; border-radius: 12px; margin: 1.3em auto; }
.article-body figure { margin: 1.5em 0; }
.article-body figcaption { text-align: center; font-size: 0.85rem; color: var(--muted); margin-top: 6px; }
.article-body table { display: block; overflow-x: auto; border-collapse: collapse; width: 100%; margin: 1.3em 0; font-size: 0.95rem; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 9px 12px; text-align: right; min-width: 90px; }
.article-body th { background: var(--cream); font-weight: 700; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.article-body iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 12px; margin: 1em 0; }
.article-body video, .article-body audio { width: 100%; border-radius: 12px; margin: 1em 0; }
.article-body code { background: var(--cream); padding: 2px 6px; border-radius: 6px; direction: ltr; unicode-bidi: embed; }
.article-body mark { background: #ffe9a8; padding: 0 3px; border-radius: 3px; }
.article-body img.img-small { max-width: 62% !important; }
.article-body .embed-video iframe { margin: 0; }
.article-body .align-center { text-align: center; }
.article-body .align-left { text-align: left; }
.article-body .callout { background: #fff5ef; border: 1px solid #ffd7c6; border-radius: 12px; padding: 14px 16px; margin: 1.4em 0; }
.article-body .callout-tip { background: #effaf2; border-color: #bfe7cb; }
.article-body .callout-warn { background: #fff8e1; border-color: #f4dd91; }
.article__media { margin: 18px 0; display: grid; gap: 12px; }
.article__media video, .article__media audio { width: 100%; border-radius: 12px; }

/* اشتراک‌گذاری */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 30px 0 6px; }
.share__label { font-weight: 700; margin-inline-end: 4px; }
.share a, .share button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-size: 0.9rem; color: var(--ink);
}
.share a:hover, .share button:hover { border-color: var(--accent); color: var(--accent-ink); }
.share [hidden] { display: none; }

/* کارت نویسنده */
.author-card {
  display: flex; gap: 20px; align-items: flex-start; margin: 34px 0;
  padding: 22px; border-radius: 22px; border: 1px solid #f3dccf;
  background: radial-gradient(120% 140% at 100% 0%, #fff3ec 0%, #fffaf6 45%, #f6f1e9 100%);
}
.author-card__photo { position: relative; flex: none; width: 96px; height: 96px; }
.author-card__photo::before {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  background: conic-gradient(from 200deg, #ff5722, #ffb89f 35%, #ff5722 65%, #ffd9cb);
}
.author-card__photo > img, .author-card__initials {
  position: relative; display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  border: 4px solid #fff; background: #fff;
}
.author-card__initials { display: grid; place-items: center; font-size: 2rem; font-weight: 700; color: #1b1b1b; background: linear-gradient(135deg, #ffd0bd, #ff8a65); }
.author-card__brandlogo { padding: 10px; background: #ff5722 !important; object-fit: contain !important; }
.author-card__badge {
  position: absolute; bottom: -8px; inset-inline: 50% auto; transform: translateX(50%);
  background: #1b1b1b; color: #fff; font-size: 0.7rem; padding: 2px 10px; border-radius: 999px; white-space: nowrap; line-height: 1.8;
}
.author-card__text { flex: 1; min-width: 0; }
.author-card__kicker { font-size: 0.78rem; color: var(--accent-ink); letter-spacing: 0; }
.author-card__name { font-size: 1.2rem; font-weight: 700; line-height: 1.7; }
.author-card__name a:hover { color: var(--accent-ink); }
.author-card__role { color: var(--muted); font-size: 0.9rem; }
.author-card__bio { margin-top: 8px; font-size: 0.95rem; line-height: 2; color: #3a362f; }
.author-card__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.author-card__links a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
  border-radius: 999px; background: #fff; border: 1px solid #f0d9cc; font-size: 0.85rem;
}
.author-card__links a:hover { border-color: var(--accent); color: var(--accent-ink); }
@media (max-width: 560px) {
  .author-card { flex-direction: column; align-items: center; text-align: center; padding: 22px 16px; }
  .author-card__links { justify-content: center; }
}

/* دعوت به همبازی */
.cta-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  background: #1b1b1b; color: #fff; border-radius: 20px; padding: 22px; margin: 30px 0;
}
.cta-card h2, .cta-card h3 { font-size: 1.15rem; line-height: 1.8; }
.cta-card p { color: #d6d0c6; font-size: 0.92rem; margin-top: 2px; }
.cta-card__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-cta, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 14px; font-weight: 700; font-size: 0.95rem; cursor: pointer; border: 2px solid transparent;
}
.btn-cta { background: var(--accent); color: #1b1b1b; }
.btn-cta:hover { background: #ff7043; }
.btn-ghost { border-color: #ffffff55; color: #fff; }
.btn-ghost:hover { border-color: #fff; }
.bp-section-title { font-size: 1.3rem; margin: 40px 0 6px; font-weight: 700; }

/* ---- صفحه‌ی نویسنده */
.author-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 30px 0 10px; }
.author-hero .author-card__photo { width: 120px; height: 120px; }
.author-hero h1 { margin-top: 18px; font-size: clamp(1.5rem, 4vw, 2rem); }
.author-hero p { max-width: 620px; margin-top: 8px; color: #3a362f; }
.author-hero .author-card__links { justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .post-card, .toc summary::after, .read-progress i { transition: none; }
}
