/* =========================================================
   BLOG R — استایل‌های به‌روزشده پلتفرم
   این فایل بعد از style.css بارگذاری می‌شود و ظاهر هدر، فوتر،
   کارت‌ها و کامپوننت‌های مشترک را یکدست می‌کند.
   ========================================================= */

:root {
    --header-height: 76px;
    --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #ec4899 100%);
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 18px 45px rgba(99, 102, 241, 0.18);
}

html {
    scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
    background:
        radial-gradient(circle at 15% 0%, rgba(99, 102, 241, 0.05), transparent 45%),
        radial-gradient(circle at 85% 10%, rgba(236, 72, 153, 0.04), transparent 40%),
        var(--bg-primary);
}

img {
    max-width: 100%;
    height: auto;
}

.skip-link {
    position: fixed;
    top: -60px;
    right: 16px;
    z-index: 3000;
    padding: 10px 18px;
    border-radius: 0 0 12px 12px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0;
}

/* ---------- هدر ---------- */
.main-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.25s ease, background 0.25s ease;
}
[data-theme="dark"] .main-header {
    background: rgba(15, 23, 42, 0.9);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}
.main-header.is-scrolled {
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--brand-gradient);
    color: #fff;
    font-weight: 800;
    font-size: 20px;
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.3);
}
.logo-text-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logo-tagline {
    font-size: 10.5px;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14.5px;
    transition: all 0.22s ease;
}
.nav-link i {
    font-size: 15px;
    opacity: 0.75;
}
.nav-link:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
}
.nav-link.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
    font-weight: 700;
}
.nav-link.danger {
    color: var(--danger);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.theme-toggle-btn,
.search-toggle-btn,
.hamburger-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.07);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.25s ease;
}
.theme-toggle-btn:hover,
.search-toggle-btn:hover,
.hamburger-btn:hover {
    background: var(--primary);
    color: #fff;
}
.hamburger-btn {
    display: none;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1.5px solid rgba(99, 102, 241, 0.28);
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 13.5px;
    transition: all 0.22s ease;
}
.login-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.action-icon {
    position: relative;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.07);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 16px;
    transition: all 0.22s ease;
}
.action-icon:hover {
    background: var(--primary);
    color: #fff;
}
.action-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    border: 2px solid var(--bg-primary);
}
.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 12px 5px 5px;
    background: rgba(99, 102, 241, 0.07);
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.22s ease;
}
.user-profile-btn:hover {
    background: rgba(99, 102, 241, 0.14);
}
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}
.user-name {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- منوی موبایل ---------- */
.mobile-menu {
    position: fixed;
    top: var(--header-height);
    right: -110%;
    width: 88%;
    max-width: 340px;
    height: calc(100dvh - var(--header-height));
    padding: 20px;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    box-shadow: -20px 0 50px rgba(15, 23, 42, 0.15);
    overflow-y: auto;
    z-index: 999;
    transition: right 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mobile-menu.active {
    right: 0;
}
.mobile-menu .nav-link {
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 15px;
}
.mobile-menu-divider {
    height: 1px;
    margin: 16px 0;
    background: var(--border-color);
}
.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    margin-bottom: 14px;
    border-radius: 16px;
    background: rgba(99, 102, 241, 0.07);
}
.mobile-user-info img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}
.mobile-user-details h4 {
    font-size: 15px;
}
.mobile-user-details p {
    font-size: 12px;
    color: var(--text-secondary);
}
.menu-overlay {
    position: fixed;
    inset: var(--header-height) 0 0 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}
.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ---------- مودال جستجو ---------- */
.search-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 110px 20px 20px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    z-index: 1200;
}
.search-modal.active {
    display: flex;
}
.search-modal-content {
    width: 100%;
    max-width: 620px;
    padding: 24px;
    border-radius: 22px;
    background: var(--bg-primary);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.3);
    animation: modalDown 0.25s ease;
}
@keyframes modalDown {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}
.search-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.search-modal-header h3 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.search-modal-header h3 i {
    color: var(--primary);
}
.search-close-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
}
.search-close-btn:hover {
    background: var(--danger);
    color: #fff;
}
.search-modal .search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-secondary);
}
.search-modal .search-box input {
    flex: 1;
    min-width: 0;
    padding: 12px 18px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
}
.search-modal .search-box button {
    padding: 11px 24px;
    border: none;
    border-radius: 999px;
    background: var(--brand-gradient);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
.search-hint {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.main-content {
    margin-top: var(--header-height);
    padding: 34px 0 60px;
}

/* ---------- فوتر ---------- */
.glass-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 56px 0 24px;
    margin-top: auto;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.footer-brand .logo-mark {
    width: 36px;
    height: 36px;
    font-size: 18px;
}
.footer-brand strong {
    font-size: 21px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.footer-content {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
    gap: 36px;
    padding-bottom: 36px;
}
.footer-section h3 {
    font-size: 16px;
    margin-bottom: 18px;
    position: relative;
    padding-bottom: 10px;
}
.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 3px;
    border-radius: 3px;
    background: var(--brand-gradient);
}
.footer-description {
    color: var(--text-secondary);
    font-size: 13.5px;
    line-height: 1.9;
    margin-bottom: 18px;
}
.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-links a,
.footer-links li {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}
.footer-links a:hover {
    color: var(--primary);
}
.footer-links i {
    font-size: 11px;
    opacity: 0.7;
}
.social-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.social-link {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.22s ease;
}
.social-link:hover {
    background: var(--brand-gradient);
    color: #fff;
    transform: translateY(-3px);
}
.footer-bottom {
    padding-top: 22px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--text-secondary);
}
.footer-bottom a {
    color: var(--text-secondary);
    text-decoration: none;
}
.footer-bottom a:hover {
    color: var(--primary);
}

/* ---------- کارت‌های مشترک ---------- */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    backdrop-filter: blur(12px);
}
.section-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- امتیاز و لایک ---------- */
.rating-section {
    padding: 22px;
    margin: 28px 0;
    text-align: center;
}
.rating-title {
    font-size: 16px;
    margin-bottom: 12px;
}
.stars {
    display: flex;
    justify-content: center;
    gap: 6px;
    direction: ltr;
}
.star {
    font-size: 34px;
    line-height: 1;
    color: rgba(148, 163, 184, 0.45);
    cursor: pointer;
    transition: transform 0.15s ease, color 0.15s ease;
}
.star:hover {
    transform: scale(1.12);
}
.star.active {
    color: #fbbf24;
}
.rating-info {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.post-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 26px 0;
    padding: 18px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.glass-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13.5px;
    cursor: pointer;
    transition: all 0.22s ease;
}
.glass-button:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}
.like-post-btn.liked,
.comment-action.liked {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.08);
}

/* ---------- کامنت‌ها ---------- */
.comment-card {
    padding: 18px;
    margin-bottom: 14px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-primary);
}
.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.comment-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.comment-author {
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.comment-time {
    font-size: 11.5px;
    color: var(--text-secondary);
}
.comment-body {
    font-size: 14px;
    line-height: 1.95;
    color: var(--text-primary);
}
.comment-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.comment-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.comment-action:hover {
    color: var(--primary);
    border-color: var(--primary);
}
.comment-replies {
    margin-top: 14px;
    padding-right: 18px;
    border-right: 2px solid rgba(99, 102, 241, 0.18);
}
.comment-replies .comment-card {
    background: var(--bg-secondary);
}
.comment-form {
    padding: 20px;
    margin-bottom: 24px;
}
.comment-form form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.comment-form textarea,
.reply-comment-form textarea {
    width: 100%;
    min-height: 110px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.8;
    resize: vertical;
    outline: none;
}
.comment-form textarea:focus,
.reply-comment-form textarea:focus {
    border-color: var(--primary);
}
.comment-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.comment-fields input {
    padding: 11px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13.5px;
    outline: none;
}
.comment-fields input:focus {
    border-color: var(--primary);
}
.comment-note {
    font-size: 12px;
    color: var(--text-secondary);
}
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-size: 14px;
}
.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.alert-error,
.alert-danger {
    background: rgba(239, 68, 68, 0.09);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ---------- کارت مقاله ---------- */
.post-card-modern,
.post-card-horizontal {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: none;
}
.post-card-modern:hover,
.post-card-horizontal:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}
.post-card-horizontal:hover {
    transform: translateX(-4px);
}
.post-thumbnail-modern img,
.post-thumbnail-small img,
.post-thumbnail-large img {
    transition: transform 0.5s ease;
}
.post-card-modern:hover .post-thumbnail-modern img,
.post-card-horizontal:hover .post-thumbnail-small img {
    transform: scale(1.04);
}

/* ---------- مهارت/آمار عمومی ---------- */
.stat-card,
.sidebar-widget {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}

/* ---------- نشان پلتفرم در سایدبار ---------- */
.about-platform-mark {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    display: block;
    object-fit: contain;
    border-radius: 22px;
}

/* ---------- تایپوگرافی محتوای مقاله ---------- */
.post-body {
    font-size: 16.5px;
    line-height: 2.1;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}
.post-body > * + * {
    margin-top: 1.15em;
}
.post-body h2,
.post-body h3,
.post-body h4 {
    margin-top: 1.8em;
    line-height: 1.5;
    scroll-margin-top: calc(var(--header-height) + 20px);
}
.post-body h2 {
    font-size: 25px;
    padding-right: 14px;
    border-right: 4px solid var(--primary);
}
.post-body h3 {
    font-size: 21px;
}
.post-body h4 {
    font-size: 18px;
}
.post-body p {
    margin-bottom: 1.1em;
}
.post-body a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.post-body ul,
.post-body ol {
    padding-right: 1.5em;
    margin-bottom: 1.1em;
}
.post-body li {
    margin-bottom: 0.4em;
}
.post-body img {
    border-radius: 14px;
    margin: 1.4em auto;
    display: block;
}
.post-body blockquote,
.post-body .editor-quote {
    margin: 1.6em 0;
    padding: 16px 20px;
    border-right: 4px solid var(--secondary);
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.07);
    color: var(--text-secondary);
    font-style: normal;
}
.post-body pre {
    direction: ltr;
    text-align: left;
    padding: 18px;
    border-radius: 14px;
    background: #0f172a;
    color: #e2e8f0;
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.7;
}
.post-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}
.post-body code {
    direction: ltr;
    display: inline-block;
    padding: 2px 7px;
    border-radius: 7px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-dark);
    font-family: Consolas, Monaco, monospace;
    font-size: 0.9em;
}
[data-theme="dark"] .post-body code {
    color: #c7d2fe;
}
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    font-size: 14px;
}
.post-body th,
.post-body td {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    text-align: right;
}
.post-body th {
    background: var(--bg-secondary);
    font-weight: 700;
}
.post-body video,
.post-body iframe {
    max-width: 100%;
    border-radius: 14px;
}

/* ---------- دکمه بازگشت به بالا ---------- */
.scroll-to-top {
    position: fixed;
    bottom: 26px;
    left: 26px;
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 14px;
    background: var(--brand-gradient);
    color: #fff;
    font-size: 17px;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(99, 102, 241, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: all 0.3s ease;
    z-index: 90;
}
.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-to-top:hover {
    transform: translateY(-3px);
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 1080px) {
    .header-nav .nav-link span {
        display: none;
    }
    .header-nav .nav-link {
        padding: 10px 12px;
    }
}
@media (max-width: 900px) {
    .header-nav {
        display: none;
    }
    .hamburger-btn {
        display: inline-flex;
    }
    .logo-tagline {
        display: none;
    }
    .header-container {
        padding: 0 16px;
    }
    .user-name {
        display: none;
    }
    .login-btn span {
        display: none;
    }
    .login-btn {
        padding: 9px 12px;
    }
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 26px;
    }
}
@media (min-width: 901px) {
    .mobile-menu,
    .menu-overlay {
        display: none !important;
    }
}
@media (max-width: 600px) {
    .header-actions {
        gap: 5px;
    }
    .theme-toggle-btn,
    .search-toggle-btn,
    .hamburger-btn,
    .action-icon {
        width: 37px;
        height: 37px;
        border-radius: 10px;
    }
    .logo-text {
        font-size: 19px;
    }
    .logo-mark {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    .main-content {
        padding-top: 22px;
    }
    .footer-content {
        grid-template-columns: 1fr;
    }
    .footer-bottom {
        justify-content: center;
        text-align: center;
    }
    .comment-fields {
        grid-template-columns: 1fr;
    }
    .stars .star {
        font-size: 30px;
    }
}

/* فیلد تله‌ی اسپم — از دید کاربر پنهان است */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ==========================================================
   ناوبری مقالات + باکس نویسنده + فهرست مطالب
   ========================================================== */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 34px 0;
}
.post-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    text-decoration: none;
    color: var(--text-primary);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
    min-width: 0;
}
.post-nav-link:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 12px 28px rgba(99, 102, 241, .14);
}
.post-nav-link > i {
    color: var(--primary);
    font-size: 15px;
    flex: 0 0 auto;
}
.post-nav-link > div { min-width: 0; }
.post-nav-link span {
    display: block;
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.post-nav-link strong {
    display: block;
    font-size: 13.5px;
    line-height: 1.8;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.post-nav-link.next { text-align: left; flex-direction: row-reverse; }

.author-box {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px;
    margin: 30px 0;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}
.author-box-avatar {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
}
.author-box-content { min-width: 0; }
.author-box-content h2 { font-size: 17px; margin: 0 0 6px; }
.author-box-content p { margin: 0 0 10px; font-size: 13px; line-height: 1.9; color: var(--text-secondary); }
.author-box-link { color: var(--primary); font-size: 12.5px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.author-box-link:hover { text-decoration: underline; }

/* فهرست مطالب مقاله */
.post-toc {
    position: relative;
    padding: 18px 20px;
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, .25);
    background: linear-gradient(135deg, rgba(99, 102, 241, .07), transparent 70%);
}
.toc-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    margin: 0 0 12px;
}
.toc-title i { color: var(--primary); }
.post-toc ol { margin: 0; padding-right: 20px; display: flex; flex-direction: column; gap: 8px; }
.post-toc li { font-size: 13.5px; line-height: 1.9; }
.post-toc a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color .15s ease, padding .15s ease;
    display: inline-block;
}
.post-toc a:hover { color: var(--primary); padding-right: 4px; }
.post-toc .toc-level-3 { padding-right: 16px; list-style-type: circle; }
.post-toc .toc-level-3 a { font-size: 12.8px; }

@media (max-width: 640px) {
    .post-navigation { grid-template-columns: 1fr; }
    .post-nav-link.next { flex-direction: row; text-align: right; }
    .author-box { flex-direction: column; text-align: center; align-items: center; }
    .post-toc { padding: 14px 16px; }
}

/* اسکرول نرم برای لینک‌های فهرست */
html { scroll-behavior: smooth; }
.post-body h2, .post-body h3 { scroll-margin-top: calc(var(--header-height) + 18px); }

/* ---------- اصلاح مودال جستجو در موبایل ---------- */
.search-modal .search-box { overflow: hidden; }
.search-modal .search-box input { min-width: 0; }
.search-modal .search-box button {
    flex: 0 0 auto;
    white-space: nowrap;
    font-family: inherit;
}
@media (max-width: 520px) {
    .search-modal { padding: 76px 12px 16px; }
    .search-modal-content { padding: 16px; border-radius: 18px; }
    .search-modal-header h3 { font-size: 15.5px; }
    .search-modal .search-box { padding: 4px; gap: 4px; }
    .search-modal .search-box input { padding: 10px 12px; font-size: 13.5px; }
    .search-modal .search-box button { padding: 10px 14px; font-size: 12.5px; }
}

/* ---------- جلوگیری از اسکرول افقی در صفحات فرمی ---------- */
.contact-page, .auth-page, .authors-page, .post-page, .search-page {
    max-width: 100%;
    overflow-x: clip;
}

/* مودال جستجو: دکمه نباید تمام‌عرض شود */
.search-modal .search-box { flex-wrap: nowrap; }
.search-modal .search-box button {
    width: auto !important;
    min-width: 0;
    flex: 0 0 auto;
}

.search-modal .search-box {
    flex-direction: row !important;
    align-items: center;
}

/* ---------- لوگوی پلتفرم ---------- */
.header-logo-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 12px;
    flex-shrink: 0;
}
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}
.footer-brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 10px;
}
@media (max-width: 480px) {
    .header-logo-img { width: 38px; height: 38px; }
}
