/* ==========================================================================
   بلاگ، تک‌نوشته و برگه‌های عمومی
   ========================================================================== */

/* ---------- سربرگ فهرست ---------- */
.blog-wrap { padding-top: 1.25rem; padding-bottom: 3.5rem; }
.blog-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin: 0.5rem 0 1.25rem; }
.blog-title { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 800; }
.blog-desc { margin: 0.4rem 0 0; max-width: 56ch; font-size: 0.9rem; color: var(--muted); line-height: 1.9; }

.blog-search { position: relative; width: min(100%, 320px); }
.blog-search i { position: absolute; top: 50%; inset-inline-start: 0.9rem; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.blog-search input[type="search"] { width: 100%; min-height: 46px; padding: 0.6rem 1rem; padding-inline-start: 2.6rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-size: 0.88rem; color: var(--ink); }
.blog-search input[type="search"]:focus { outline: 2px solid var(--ink); outline-offset: 1px; }

.blog-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.blog-chips a { padding: 0.45rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 0.82rem; color: var(--ink-2); text-decoration: none; transition: background 0.25s var(--ease), color 0.25s var(--ease); }
.blog-chips a:hover { background: var(--bg-soft); }
.blog-chips a.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- کارت نوشته ---------- */
.post-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; font-size: 0.74rem; color: var(--muted); }
.post-card-meta time { font-size: inherit; }
.post-cat { display: inline-block; padding: 0.15rem 0.65rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.74rem; font-weight: 700; text-decoration: none; }
.post-cat:hover { background: var(--accent); color: #fff; }
.post-read { display: inline-flex; align-items: center; gap: 0.25rem; }
.post-read i { font-size: 0.9rem; }

.post-card .journal-body { display: flex; flex-direction: column; flex: 1; }
.post-card .journal-body p { -webkit-line-clamp: 3; }
.post-card .promo-cta { margin-top: auto; }

@media (min-width: 992px) {
  .post-card--featured { flex-direction: row; }
  .post-card--featured .journal-media { flex: 0 0 55%; aspect-ratio: auto; min-height: 340px; }
  .post-card--featured .journal-body { justify-content: center; padding: 2rem 2.25rem; }
  .post-card--featured .journal-body h3 { font-size: 1.5rem; line-height: 1.6; }
  .post-card--featured .journal-body p { -webkit-line-clamp: 4; font-size: 0.92rem; }
}

.blog-empty { display: grid; justify-items: center; gap: 0.5rem; padding: 4rem 1rem; text-align: center; }
.blog-empty i { font-size: 3rem; color: var(--muted); }
.blog-empty h2 { margin: 0; font-size: 1.2rem; font-weight: 800; }
.blog-empty p { margin: 0 0 0.75rem; color: var(--muted); font-size: 0.9rem; }

/* ---------- تک‌نوشته ---------- */
.post-wrap { padding-top: 1.25rem; padding-bottom: 2rem; }
.post-article { max-width: 780px; margin: 0 auto; }
.post-header { margin-bottom: 1.5rem; text-align: center; }
.post-title { margin: 0.75rem 0 0.75rem; font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; line-height: 1.7; }
.post-lead { margin: 0 auto 1rem; max-width: 60ch; font-size: 1rem; line-height: 2; color: var(--ink-2); }
.post-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.5rem 1.25rem; font-size: 0.8rem; color: var(--muted); }
.post-meta > * { display: inline-flex; align-items: center; gap: 0.35rem; color: inherit; text-decoration: none; }
.post-meta a:hover { color: var(--ink); }
.post-meta-author img { width: 32px; height: 32px; border-radius: 50%; }

.post-cover { max-width: 1040px; margin: 0 auto 2rem; border-radius: var(--r-lg); overflow: hidden; background: var(--bg-soft); }
.post-cover img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: cover; }
.post-wrap .post-article { position: relative; }
.post-wrap .post-cover { max-width: 100%; }

.post-content { font-size: 1.02rem; line-height: 2.2; color: var(--ink-2); }
.post-content > * + * { margin-top: 1.1rem; }
.post-content h2, .post-content h3, .post-content h4 { margin-top: 2.2rem; color: var(--ink); font-weight: 800; line-height: 1.7; }
.post-content h2 { font-size: 1.45rem; }
.post-content h3 { font-size: 1.2rem; }
.post-content h4 { font-size: 1.05rem; }
.post-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { color: var(--ink); }
.post-content img, .post-content video, .post-content iframe { max-width: 100%; height: auto; border-radius: var(--r-md); }
.post-content figure { margin: 1.75rem 0; }
.post-content figcaption, .post-content .wp-caption-text { margin-top: 0.5rem; font-size: 0.8rem; text-align: center; color: var(--muted); }
.post-content ul, .post-content ol { padding-inline-start: 1.5rem; }
.post-content li + li { margin-top: 0.35rem; }
.post-content blockquote { margin: 1.75rem 0; padding: 1.1rem 1.4rem; border-inline-start: 4px solid var(--accent); border-radius: var(--r-sm); background: var(--bg-soft); color: var(--ink); font-size: 1.05rem; }
.post-content blockquote p { margin: 0; }
.post-content hr { border: 0; height: 1px; background: var(--line); margin: 2rem 0; }
.post-content table { width: 100%; border-collapse: collapse; font-size: 0.9rem; display: block; overflow-x: auto; }
.post-content th, .post-content td { padding: 0.65rem 0.9rem; border: 1px solid var(--line); text-align: right; }
.post-content th { background: var(--bg-soft); font-weight: 700; }
.post-content pre { padding: 1rem; border-radius: var(--r-sm); background: var(--dark); color: #fff; direction: ltr; overflow-x: auto; font-size: 0.85rem; }
.post-content code { font-size: 0.88em; }
.alignleft { float: left; margin: 0.25rem 1.25rem 1rem 0; }
.alignright { float: right; margin: 0.25rem 0 1rem 1.25rem; }
.aligncenter { display: block; margin-inline: auto; }
.post-content::after, .entry-content::after { content: ""; display: block; clear: both; }

.post-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.post-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.post-tags a { padding: 0.3rem 0.8rem; border-radius: 999px; background: var(--bg-soft); font-size: 0.78rem; color: var(--ink-2); text-decoration: none; }
.post-tags a:hover { background: var(--ink); color: #fff; }
.post-share { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--muted); }
.post-share a, .post-share button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; transition: background 0.25s var(--ease), color 0.25s var(--ease); }
.post-share a:hover, .post-share button:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

.author-box { display: flex; gap: 1rem; align-items: flex-start; margin-top: 1.75rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-soft); }
.author-box img { width: 64px; height: 64px; border-radius: 50%; flex: none; }
.author-box strong { display: block; margin-bottom: 0.25rem; }
.author-box p { margin: 0; font-size: 0.86rem; line-height: 1.9; color: var(--muted); }

.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; max-width: 780px; margin: 2rem auto 0; }
.post-nav-item { display: grid; gap: 0.3rem; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; color: var(--ink); text-decoration: none; transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease); }
.post-nav-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.post-nav-item small { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--muted); font-size: 0.75rem; }
.post-nav-item span { font-weight: 700; font-size: 0.9rem; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-nav-item.is-next { text-align: left; }
.post-nav-item.is-next small { justify-content: flex-end; }
@media (max-width: 575.98px) { .post-nav { grid-template-columns: 1fr; } .post-nav-item.is-next { text-align: right; } .post-nav-item.is-next small { justify-content: flex-start; } }

.post-related { padding-top: 1rem; }

/* ---------- نظرات ---------- */
.comments-area { max-width: 780px; margin: 2.5rem auto 0; }
.comments-title, .comment-reply-title { margin: 0 0 1.25rem; font-size: 1.2rem; font-weight: 800; }
.comment-list, .comment-list ol { margin: 0; padding: 0; list-style: none; }
.comment-list .children { margin-top: 1rem; padding-inline-start: 1.5rem; border-inline-start: 2px solid var(--line); }
.comment-list > li, .comment-list .children > li { margin-bottom: 1rem; }
.comment-body { padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-bottom: 0.5rem; font-size: 0.78rem; color: var(--muted); }
.comment-author { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--ink); }
.comment-author img { width: 44px; height: 44px; border-radius: 50%; }
.comment-author .says { display: none; }
.comment-metadata a { color: var(--muted); text-decoration: none; }
.comment-content p { margin: 0 0 0.5rem; font-size: 0.92rem; line-height: 2; }
.reply a { font-size: 0.78rem; font-weight: 700; color: var(--accent); text-decoration: none; }
.comment-awaiting-moderation { font-size: 0.8rem; color: var(--accent); }
.comments-closed { padding: 1rem; border-radius: var(--r-sm); background: var(--bg-soft); color: var(--muted); font-size: 0.88rem; text-align: center; }

.comment-respond { margin-top: 2rem; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-soft); }
.comment-form { display: grid; gap: 1rem; }
@media (min-width: 640px) { .comment-form { grid-template-columns: 1fr 1fr; } .comment-form .comment-form-comment, .comment-form .comment-form-cookies-consent, .comment-form .form-submit { grid-column: 1 / -1; } }
.comment-form p { margin: 0; }
.comment-form label { display: block; margin-bottom: 0.35rem; font-size: 0.85rem; font-weight: 600; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font: inherit; font-size: 0.9rem; color: var(--ink); }
.comment-form input:focus, .comment-form textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.comment-form-cookies-consent { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--muted); }
.comment-form-cookies-consent label { margin: 0; font-weight: 400; }
.comment-form .btn-ink { cursor: pointer; }
#cancel-comment-reply-link { margin-inline-start: 0.75rem; font-size: 0.78rem; font-weight: 400; color: var(--accent); }

/* ---------- برگه‌های عمومی (حساب کاربری، سبد، پرداخت و ...) ---------- */
.page-wrap--entry { padding-top: 1.25rem; padding-bottom: 3.5rem; }
.page-article { margin: 0; }
.page-header { margin-bottom: 1.5rem; }
.page-article .page-title { margin: 0; font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 800; }
.page-wrap--entry:not(.page-wrap--shop) .entry-content h2, .page-wrap--entry:not(.page-wrap--shop) .entry-content h3 { margin-top: 1.75rem; font-weight: 800; color: var(--ink); }
.page-wrap--entry:not(.page-wrap--shop) .entry-content a { color: var(--accent); }
.page-links { display: flex; gap: 0.5rem; margin-top: 1rem; font-size: 0.85rem; }

/* ---------- صفحه‌بندی داخل بلاگ ---------- */
.blog-wrap .pagination-bar { margin-top: 2rem; }
.comments-area .navigation.pagination { margin-top: 1rem; }
.comments-area .nav-links { display: flex; gap: 0.5rem; }
