/* ==========================================================================
   AMUORA — چیدمان بلاگ با سایدبار سمت راست + استایل محتوای ویرایشگر
   ========================================================================== */

.blog-shell.bl-wide {
    width: min(1200px, 94%);
    max-width: none;
    margin-left: auto;
    margin-right: auto;
}

.bl-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 34px;
    margin-top: 10px;
}

.bl-main { min-width: 0; align-self: start; }
.bl-sidebar { min-width: 0; display: flex; flex-direction: column; gap: 18px; }

/* فهرست مقاله‌ها داخل ستون اصلی: دو ستون، کارت اول تمام‌عرض */
.bl-main .bi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.bl-main .bi-card.is-lead { grid-column: 1 / -1; }

/* ================= ویجت‌ها ================= */
.bl-widget {
    padding: 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(25, 113, 92, 0.12);
    box-shadow: 0 12px 30px rgba(22, 53, 44, 0.06);
}

.bl-widget-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 19px;
    font-weight: 400;
    color: #16352c;
}
.bl-widget-title::after {
    content: '';
    flex: 1;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(226, 109, 77, 0.55), transparent);
}

/* جست‌وجو */
.bl-search { display: flex; gap: 8px; }
.bl-search input {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1.5px solid rgba(25, 113, 92, 0.18);
    background: #fbfdfc;
    font-family: inherit;
    font-size: 13.5px;
    color: #16352c;
    outline: none;
}
.bl-search input:focus { border-color: #19715c; }
.bl-search button {
    flex: 0 0 auto;
    width: 46px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    background: linear-gradient(135deg, #e26d4d, #19715c);
    color: #fff;
}

/* کارت دعوت */
.bl-cta {
    position: relative;
    overflow: hidden;
    color: #fff;
    border: 0;
    background: linear-gradient(145deg, #19715c 0%, #0f4f40 100%);
}
.bl-cta::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: rgba(226, 109, 77, 0.35);
}
.bl-cta > * { position: relative; }
.bl-cta-emoji { font-size: 28px; line-height: 1; }
.bl-cta h3 { margin: 10px 0 6px; font-family: 'DM Serif Display', Georgia, serif; font-size: 21px; font-weight: 400; }
.bl-cta p { margin: 0 0 14px; font-size: 13px; line-height: 1.75; opacity: 0.9; }
.bl-cta-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 999px;
    background: #fff;
    color: #0f4f40;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}
.bl-cta-link { display: block; margin-top: 10px; font-size: 12px; color: rgba(255, 255, 255, 0.85); }

/* فهرست پست‌ها */
.bl-posts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bl-post { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.bl-post:hover .bl-post-text b { color: #c2410c; }

.bl-post-rank {
    flex: 0 0 26px;
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 21px;
    color: #e26d4d;
}

.bl-post-thumb {
    flex: 0 0 62px;
    width: 62px;
    height: 62px;
    overflow: hidden;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 24px;
    background: linear-gradient(135deg, #e26d4d, #19715c);
}
.bl-post-thumb img { width: 100%; height: 100%; object-fit: cover; }

.bl-post-text { min-width: 0; }
.bl-post-text b {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.45;
    color: #16352c;
    transition: color 0.2s ease;
}
.bl-post-text span { display: block; margin-top: 3px; font-size: 11.5px; color: #7c8b84; }

/* دسته‌ها */
.bl-cats-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bl-cats-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 600;
    color: #35514a;
    text-decoration: none;
    transition: background 0.18s ease;
}
.bl-cats-list a:hover { background: rgba(25, 113, 92, 0.07); }
.bl-cats-list a.is-active { background: rgba(226, 109, 77, 0.12); color: #c2410c; }
.bl-cats-list em {
    font-style: normal;
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 999px;
    text-align: center;
    font-size: 11.5px;
    font-weight: 800;
    color: #19715c;
    background: rgba(25, 113, 92, 0.1);
}

/* برچسب‌ها */
.bl-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.bl-tags a {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: #35514a;
    background: rgba(25, 113, 92, 0.07);
    transition: background 0.18s ease, color 0.18s ease;
}
.bl-tags a.is-big { font-size: 13.5px; font-weight: 800; color: #19715c; }
.bl-tags a:hover { background: #e26d4d; color: #fff; }

.bl-rss {
    display: block;
    padding: 12px 16px;
    border-radius: 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    color: #c2410c;
    background: rgba(226, 109, 77, 0.1);
}

/* فهرست مطالب */
.bl-toc {
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 110px);
    overflow: auto;
}
.bl-toc ol { list-style: none; margin: 0; padding: 0; }
.bl-toc a,
.bl-toc-inline a {
    display: block;
    padding: 6px 10px;
    border-left: 2px solid rgba(25, 113, 92, 0.15);
    font-size: 13px;
    line-height: 1.5;
    color: #4d6459;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.bl-toc li.is-sub a,
.bl-toc-inline li.is-sub a { padding-left: 22px; font-size: 12.5px; }
.bl-toc a:hover { color: #c2410c; }
.bl-toc a.is-active {
    color: #c2410c;
    font-weight: 700;
    border-left-color: #e26d4d;
    background: rgba(226, 109, 77, 0.07);
}

/* فهرست مطالب داخل مقاله — فقط موبایل */
.bl-toc-inline {
    display: none;
    margin: 0 0 22px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(25, 113, 92, 0.15);
}
.bl-toc-inline summary { cursor: pointer; font-weight: 800; color: #16352c; font-size: 14px; }
.bl-toc-inline ol { list-style: none; margin: 10px 0 0; padding: 0; }

/* نوار پیشرفت مطالعه */
.bl-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10001;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, #e26d4d, #19715c);
    transition: width 0.1s linear;
}

/* ================= محتوای مقاله ================= */
.bp-body h2,
.bp-body h3,
.bp-body h4 { scroll-margin-top: 96px; }

.bp-body [dir="rtl"] {
    direction: rtl;
    text-align: right;
    font-family: Tahoma, 'Poppins', sans-serif;
    line-height: 2.05;
}

.bp-body figure { margin: 24px auto; }
.bp-body figure img { display: block; width: 100%; height: auto; border-radius: 14px; }
.bp-body figcaption { margin-top: 8px; text-align: center; font-size: 12.5px; color: #7c8b84; }

.bp-body .bx-img-center { margin-left: auto; margin-right: auto; }
.bp-body .bx-img-left { float: left; max-width: 50%; margin: 6px 24px 14px 0; }
.bp-body .bx-img-right { float: right; max-width: 50%; margin: 6px 0 14px 24px; }
.bp-body .bx-img-full { width: 100% !important; }
.bp-body::after { content: ''; display: block; clear: both; }

.bp-body .bx-callout {
    position: relative;
    margin: 24px 0;
    padding: 16px 18px 16px 54px;
    border-radius: 16px;
    border: 1px solid;
}
.bp-body .bx-callout::before { position: absolute; left: 18px; top: 15px; font-size: 19px; line-height: 1; }
.bp-body .bx-callout p { margin: 4px 0; }
.bp-body .bx-callout-info { background: #eef6ff; border-color: #cfe2fb; }
.bp-body .bx-callout-info::before { content: 'ℹ️'; }
.bp-body .bx-callout-tip { background: #ecfdf5; border-color: #bbf0d6; }
.bp-body .bx-callout-tip::before { content: '💡'; }
.bp-body .bx-callout-warning { background: #fff7ed; border-color: #fed7aa; }
.bp-body .bx-callout-warning::before { content: '⚠️'; }
.bp-body .bx-callout-note { background: #f5f3ff; border-color: #ddd6fe; }
.bp-body .bx-callout-note::before { content: '📝'; }

.bp-body .bx-btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, #e26d4d, #19715c);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: 0 12px 24px -10px rgba(226, 109, 77, 0.6);
}

.bp-body .bx-table-wrap {
    margin: 24px 0;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(25, 113, 92, 0.16);
}
.bp-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bp-body th,
.bp-body td { padding: 11px 14px; text-align: start; border-bottom: 1px solid rgba(25, 113, 92, 0.1); vertical-align: top; }
.bp-body th { background: #f1f7f4; color: #16352c; font-weight: 700; }
.bp-body tr:nth-child(even) td { background: #fbfdfc; }

.bp-body .bx-video {
    position: relative;
    margin: 26px 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 16px;
    background: #000;
}
.bp-body .bx-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.bp-body mark { padding: 0 3px; border-radius: 3px; background: #fff1a8; }
.bp-body pre {
    padding: 16px 18px;
    border-radius: 14px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.7;
    background: #16352c;
    color: #e8f3ee;
}
.bp-body :not(pre) > code {
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.9em;
    color: #c2410c;
    background: #eef3ef;
}
.bp-body hr {
    margin: 34px 0;
    height: 1px;
    border: 0;
    background: linear-gradient(90deg, transparent, rgba(25, 113, 92, 0.35), transparent);
}

/* ================= موبایل و تبلت ================= */
@media (max-width: 980px) {
    .bl-layout { grid-template-columns: 1fr; }
    .bl-sidebar .bl-toc { display: none; }
    .bl-toc-inline { display: block; }
}

@media (max-width: 640px) {
    .bl-main .bi-grid { grid-template-columns: 1fr; }
    .bp-body .bx-img-left,
    .bp-body .bx-img-right { float: none; max-width: 100%; width: 100% !important; margin: 20px 0; }
}