/**
 * ZxAcc — Blog redesign (additive, loaded after theme-typewriter.css)
 * ---------------------------------------------------------------------
 * Covers two approved features:
 *   1) Homepage blog section — replaces the old 4-card grid with an
 *      auto-sliding carousel (".bc-*" classes), driven by the rewritten
 *      beiten_render_blog_grid() in functions.php.
 *   2) Single-post page redesign — title/meta, table of contents, a
 *      centered share row, related articles, restyled WP comments, and
 *      a sticky sidebar (recent products + recent articles). All of this
 *      is scoped under ".single-post" so the shared blog listing/search
 *      templates (which reuse .post-title/.post-content/.blog-sidebar)
 *      are completely unaffected.
 *
 * Nothing here removes or restructures earlier selectors — revert by
 * dropping the enqueue calls in functions.php.
 */

/* =====================================================================
   1) HOMEPAGE BLOG CAROUSEL
===================================================================== */
.bc-section { background: var(--bg-secondary); position: relative; overflow: hidden; }
.bc-section::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(circle at 18% 8%, rgba(82,132,176,.10), transparent 45%);
}

.bc-head { max-width: var(--container-max); margin: 0 auto 28px; padding: 0 var(--container-padding); display: flex; align-items: center; justify-content: space-between; gap: 16px; position: relative; z-index: 1; }
.bc-head-left { display: flex; align-items: center; gap: 10px; }
.bc-mark { flex-shrink: 0; }
.bc-title { font-family: 'Estedad','Vazirmatn',sans-serif; font-weight: 900; font-size: 26px; margin: 0; color: var(--primary-dark); }
.bc-view {
    display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
    color: var(--primary); text-decoration: none; flex-shrink: 0;
    border: 1.5px solid rgba(53,94,136,.28); border-radius: 999px; padding: 9px 18px;
    transition: background .25s, border-color .25s;
}
.bc-view:hover { background: rgba(82,132,176,.08); border-color: var(--primary); color: var(--primary); }
.bc-view svg { width: 14px; height: 14px; }

.bc-wrap { max-width: min(1420px, calc(100vw - 28px)); margin: 0 auto; padding: 0 var(--container-padding); overflow: hidden; position: relative; z-index: 1; }
/* .bc-track bleeds into .bc-wrap's own left/right padding (negative margin, exactly
   canceling it) so the sliding row's edges line up with .bc-wrap's real clipped
   boundary — without this, a sliver of the next card peeks through in the padding
   gap between where the cards are sized to fit and where the clip actually cuts off. */
.bc-track { display: flex; gap: 24px; margin-inline: calc(-1 * var(--container-padding)); transition: transform .85s cubic-bezier(.22,.8,.28,1); will-change: transform; }

.bc-card {
    /* Desktop: exactly 4 complete article cards in view, no partial/cut card at the edge. */
    display: flex; flex-direction: column; flex-shrink: 0; width: calc((100% - 72px) / 4);
    border-radius: 20px; overflow: hidden; background: #fff; text-decoration: none;
    border: 1px solid rgba(53,94,136,.10); box-shadow: 0 14px 30px -22px rgba(32,56,82,.28);
    transition: transform .3s ease, box-shadow .3s ease;
}
.bc-card:hover { transform: translateY(-4px); box-shadow: 0 20px 38px -22px rgba(32,56,82,.32); }
.bc-img { display: block; height: 220px; background-size: cover; background-position: center; background-color: var(--bg-secondary); }
.bc-body { display: flex; flex-direction: column; gap: 10px; padding: 17px 18px 19px; min-height: 96px; }
.bc-title-text {
    font-weight: 800; font-size: 15px; line-height: 1.7; color: #17263a; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bc-meta { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; color: #64748b; flex-wrap: wrap; }
.bc-cat { font-weight: 800; }
.bc-dot { color: #FFC53D; }
.bc-comments { display: inline-flex; align-items: center; gap: 3px; }
.bc-comments svg { width: 11px; height: 11px; }

/* Related-articles grid reuses .bc-card but as a static 2-up grid, not the track */
.related-articles__grid .bc-card,
.bc-card--static { width: auto; }

@media (max-width: 1024px) {
    .bc-title { font-size: 22px; }
}

/* [zxacc 2026-09] Homepage article carousel — same motion as the «محبوب‌ترین
   محصولات» slider: newest article first, auto-advances one card at a time
   to the LEFT on every screen size, swipe/drag to move by hand.
   Only the track direction + card widths change; the card markup/look is
   untouched. Cards always fit the row exactly — no half-cut card:
   4 per row > 1100px, 3 > 900px, 2 > 600px, 1 on phones. */
.bc-wrap { touch-action: pan-y; }
.bc-track { direction: ltr; --bc-gap: 24px; gap: var(--bc-gap); }
.bc-track .bc-card { direction: rtl; width: calc((100% - 3 * var(--bc-gap)) / 4); }
.bc-wrap.is-dragging .bc-track { transition: none; }
.bc-wrap.is-dragging .bc-card { pointer-events: none; }
.bc-card img, .bc-card .bc-img { -webkit-user-drag: none; }
@media (max-width: 1100px) {
    .bc-track .bc-card { width: calc((100% - 2 * var(--bc-gap)) / 3); }
}
@media (max-width: 900px) {
    .bc-track { --bc-gap: 16px; transition-duration: .45s; }
    .bc-track .bc-card { width: calc((100% - var(--bc-gap)) / 2); }
}
@media (max-width: 600px) {
    .bc-track .bc-card { width: 100%; }
    .bc-img { height: 190px; }
}
@media (max-width: 480px) {
    .bc-head { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* =====================================================================
   2) SINGLE POST — title, meta row, cover, table of contents
   All scoped under ".single-post" so index.php / search.php (which
   reuse .post-title / .post-content / .blog-sidebar) are untouched.
===================================================================== */
.single-post .post-title {
    font-size: 27px; line-height: 1.65; margin: 0 0 14px; color: var(--primary-dark);
    position: relative; padding-inline-start: 16px;
}
.single-post .post-title::before {
    content: ''; position: absolute; inset-inline-start: 0; top: 3px; bottom: 3px;
    width: 4px; border-radius: 4px; background: #FFC53D;
}

.single-post .post-metabar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 0; background: none; border: none; margin-bottom: 6px; }
.single-post .post-metabar__cat {
    display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 800;
    color: #fff; background: var(--gradient-primary); border-radius: 999px; padding: 5px 14px;
}
.single-post .post-metabar__items { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; opacity: 1; }
.single-post .post-metabar__item { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: #7c8ba0; }
.single-post .post-metabar__item svg { color: var(--secondary); }
.single-post .post-metabar__author { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; color: var(--primary-dark); }
.single-post .post-metabar__sep { color: #FFC53D; font-weight: 900; }

.single-post .post-featured-image { border-radius: 20px; margin-top: 18px; }
.single-post .post-featured-image img { border-radius: 20px; }

/* ---- table of contents (auto-built per-article by beiten_toc_from_content) ---- */
.post-toc { border-radius: 18px; overflow: hidden; border: 1px solid rgba(53,94,136,.12); margin: 26px 40px 6px; background: #fff; box-shadow: 0 14px 30px -24px rgba(32,56,82,.22); }
.post-toc__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; background: var(--gradient-secondary); color: #fff; cursor: pointer; user-select: none; }
.post-toc__title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; }
.post-toc__title svg { width: 17px; height: 17px; color: #FFD873; flex-shrink: 0; }
.post-toc__toggle { width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; transition: transform .3s ease; flex-shrink: 0; }
.post-toc__toggle svg { width: 12px; height: 12px; }
.post-toc.is-collapsed .post-toc__toggle { transform: rotate(180deg); }
.post-toc__list { list-style: none; margin: 0; padding: 8px; display: flex; flex-direction: column; gap: 2px; max-height: 600px; overflow: hidden; transition: max-height .35s ease, opacity .3s ease, padding .35s ease; }
.post-toc.is-collapsed .post-toc__list { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; }
.post-toc__list a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; font-weight: 700; color: #334155; text-decoration: none; transition: background .2s, color .2s; }
.post-toc__list a:hover { background: rgba(82,132,176,.08); color: var(--primary-dark); }
.post-toc__list a svg { width: 12px; height: 12px; color: #FFC53D; flex-shrink: 0; }
.single-post .post-content h2 { scroll-margin-top: 24px; }

/* ---- share row (centered, with a divider above it) ---- */
.post-share-v2-wrap { padding: 0 40px; }
.post-share-v2-divider { border: none; border-top: 1px solid rgba(53,94,136,.12); margin: 8px 0 0; }
.post-share-v2 { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; margin: 30px 0; text-align: center; }
.post-share-v2__label { font-size: 12px; font-weight: 700; color: #64748b; }
.post-share-v2__row { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.post-share-v2__chip {
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 46px; width: 46px; height: 46px; border-radius: 14px;
    position: relative; color: var(--primary);
    background: linear-gradient(135deg, rgba(255,255,255,.92) 0%, rgba(249,245,236,.78) 100%);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(53,94,136,.16);
    box-shadow: 0 6px 16px rgba(53,94,136,.12), inset 0 1px 0 rgba(255,255,255,.7);
    text-decoration: none; transition: transform .2s ease, box-shadow .2s ease;
}
.post-share-v2__chip:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(53,94,136,.2), inset 0 1px 0 rgba(255,255,255,.7); }
.post-share-v2__chip svg { width: 19px; height: 19px; }
/* compact variant used in the sidebar card */
.post-share-v2--compact { flex-direction: row; justify-content: flex-start; text-align: start; margin: 0; gap: 10px; }
.post-share-v2--compact .post-share-v2__label { font-size: 11px; color: #7c8ba0; }
.post-share-v2--compact .post-share-v2__row { gap: 9px; }
.post-share-v2--compact .post-share-v2__chip { flex-basis: 36px; width: 36px; height: 36px; border-radius: 10px; }
.post-share-v2--compact .post-share-v2__chip svg { width: 16px; height: 16px; }

/* ---- related articles (end of post) ---- */
.related-articles { padding: 6px 40px 10px; }
.related-articles__title { font-weight: 800; font-size: 17px; margin: 0 0 16px; color: #1c2e42; }
.related-articles__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 560px) { .related-articles__grid { grid-template-columns: 1fr; } }

/* =====================================================================
   3) STICKY SIDEBAR — recent products + recent articles
===================================================================== */
.single-post .single-post-grid { align-items: start; }
.post-sidebar-v2 { position: sticky; top: 30px; display: flex; flex-direction: column; gap: 22px; }
.post-side-card { background: #fff; border-radius: 20px; padding: 20px; box-shadow: 0 16px 34px -24px rgba(32,56,82,.25); border: 1px solid rgba(53,94,136,.06); }
.post-side-card__head { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; }
.post-side-card__dot { width: 7px; height: 7px; border-radius: 50%; background: #FFC53D; flex-shrink: 0; }
.post-side-card__title { font-weight: 800; font-size: 14px; color: #1c2e42; margin: 0; }

.post-side-item { display: flex; gap: 10px; align-items: flex-start; padding-block: 9px; border-bottom: 1px solid rgba(53,94,136,.07); text-decoration: none; }
.post-side-item:last-of-type { border-bottom: none; }
.post-side-item__thumb { width: 44px; height: 44px; border-radius: 10px; background-size: cover; background-position: center; background-color: var(--bg-secondary); flex-shrink: 0; }
.post-side-item__info { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.post-side-item__name {
    font-size: 12px; font-weight: 700; color: #233246; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-side-item__meta { font-size: 10px; color: #94a3b8; display: flex; gap: 5px; align-items: center; }
.post-side-item__cat { font-weight: 700; }
.post-side-item__sep { color: #FFC53D; }

.post-side-card__cta {
    display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 11px;
    border-radius: 12px; background: var(--gradient-primary); color: #fff; font-weight: 800; font-size: 12px;
    margin-top: 14px; text-decoration: none; border: none; cursor: pointer;
}
.post-side-card__cta svg { width: 14px; height: 14px; }

@media (max-width: 1024px) {
    .post-sidebar-v2 { position: static; }
}

/* =====================================================================
   4) COMMENTS — restyle the default WP comment markup (comments.php is
   untouched; only the existing classes are re-skinned, scoped to the
   single-post page so archive/other comment forms are unaffected).
===================================================================== */
.single-post .comments-area { padding: 6px 40px 10px; }
.single-post .comments-title { font-weight: 800; font-size: 17px; margin: 0 0 18px; color: #1c2e42; }
.single-post .comment-list { list-style: none; margin: 0 0 6px; padding: 0; }
.single-post .comment-list .children { list-style: none; margin: 0; padding-inline-start: 50px; }
.single-post .comment-body { display: flex; gap: 12px; margin-bottom: 16px; }
.single-post .comment-author.vcard { flex-shrink: 0; }
.single-post .comment-author .avatar { width: 40px; height: 40px; border-radius: 50%; display: block; border: 2px solid #fff; box-shadow: 0 4px 10px rgba(32,56,82,.15); }
.single-post .comment-author .fn { display: none; } /* name is rendered again via comment-metadata; avoid duplicate */
.single-post .comment-content-wrap { background: #fff; border-radius: 14px; padding: 12px 14px; flex: 1; border: 1px solid rgba(53,94,136,.08); min-width: 0; }
.single-post .comment-metadata { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; font-size: 10px; color: #94a3b8; }
.single-post .comment-metadata a { color: inherit; text-decoration: none; }
.single-post .comment-author-name { font-size: 12.5px; font-weight: 800; color: #1c2e42; }
.single-post .comment-content p { font-size: 12px; line-height: 1.9; color: #4d6883; margin: 0 0 8px; }
.single-post .comment-reply-link {
    display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; color: var(--primary);
    text-decoration: none; border: 1px solid rgba(53,94,136,.2); border-radius: 999px; padding: 4px 12px;
}
.single-post .comment-reply-link:hover { background: rgba(82,132,176,.08); }
.single-post .bypostauthor > .comment-content-wrap { border-color: rgba(53,94,136,.35); background: linear-gradient(135deg, rgba(82,132,176,.06), rgba(255,255,255,1)); }

.single-post #respond,
.single-post .comment-respond {
    background: #fff; border-radius: 16px; padding: 20px; margin-top: 10px; border: 1px solid rgba(53,94,136,.08);
}
.single-post .comment-reply-title { font-weight: 800; font-size: 15px; margin: 0 0 14px; color: #1c2e42; }
.single-post .comment-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .single-post .comment-form-row { grid-template-columns: 1fr; } }
.single-post .comment-form-group { margin-bottom: 12px; }
.single-post .comment-form-group label { font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 6px; }
.single-post .comment-form-group .form-control {
    width: 100%; border: 1px solid rgba(53,94,136,.15); border-radius: 10px; padding: 10px 12px;
    font-size: 12px; font-family: inherit; color: #233246; box-sizing: border-box; background: #fff;
}
.single-post .comment-form-group .form-control:focus { border-color: var(--primary); outline: none; }
.single-post textarea.form-control { min-height: 90px; resize: vertical; }
.single-post .btn-submit-comment {
    border: none; background: var(--gradient-primary); color: #fff; font-weight: 800; font-size: 12.5px;
    padding: 11px 24px; border-radius: 10px; cursor: pointer;
}

@media (max-width: 1024px) {
    .post-toc { margin-left: 24px; margin-right: 24px; }
    .post-share-v2-wrap, .related-articles, .single-post .comments-area { padding-left: 24px; padding-right: 24px; }
}

/* [zxacc 1.3.1] article carousel keeps its slide when the device has «reduce motion» on
   (pro.css shortens every transition to .01ms, which made the row jump instead of slide) */
.bc-track{transition-duration:.85s!important}
@media (max-width:900px){.bc-track{transition-duration:.45s!important}}
.bc-wrap.is-dragging .bc-track{transition-duration:0s!important}
