/* =============================================================
   صفحه جزئیات مقاله
   هیروی تیره هم رنگ هدر، تصویر شناور روی مرز هیرو و متن، ستون متن با عرض
   مناسب خواندن و ستون کناری چسبان (فهرست مطالب، خدمت مرتبط، دسته ها)
   ============================================================= */

.ad-hero,
.ad-body {
    --ad-ink: #14202e;
    --ad-ink-2: #3d4b5c;
    --ad-ink-3: #6b7a8c;
    --ad-line: #e9edf3;
    --ad-soft: #f6f7fb;
    --ad-brand: #e91e8c;
    --ad-brand-deep: #c2156f;
    --ad-violet: #7c5cff;
    --ad-grad: linear-gradient(135deg, #ff4db2 0%, #e91e8c 45%, #a534c9 100%);
    --ad-grad-soft: linear-gradient(135deg, rgba(255,77,178,.10) 0%, rgba(124,92,255,.08) 100%);
    --ad-medium: 'Vazir Medium FD-WOL', 'Vazir FD-WOL', sans-serif;
    --ad-light: 'Vazir Light FD-WOL', 'Vazir FD-WOL', sans-serif;
    --ad-radius: 22px;
}

.ad-hero svg,
.ad-body svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

/* ---------- نوار پیشرفت مطالعه ---------- */
.ad-progress {
    position: fixed;
    top: 0; right: 0; left: 0;
    height: 3px;
    z-index: 1200;
    pointer-events: none;
}
.ad-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #a534c9, #e91e8c, #ff4db2);
    transform: scaleX(0);
    transform-origin: right center;
    box-shadow: 0 0 12px rgba(233,30,140,.55);
}

/* ---------- هیرو ---------- */
.ad-hero {
    position: relative;
    overflow: hidden;
    padding: calc(var(--header-h, 72px) + clamp(28px, 5vw, 56px)) 0 clamp(96px, 12vw, 150px);
    background:
        radial-gradient(1200px 400px at 50% 120%, rgba(233,30,140,.10), transparent 60%),
        linear-gradient(170deg, #0b1420 0%, #101d2c 60%, #0d1824 100%);
    text-align: center;
    isolation: isolate;
}
.ad-hero.no-cover { padding-bottom: clamp(40px, 6vw, 64px); }
.ad-hero::after {
    /* بافت نقطه ای ظریف */
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
    z-index: -1;
}
.ad-hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .55;
    z-index: -1;
    pointer-events: none;
}
.ad-hero-orb--1 { width: 360px; height: 360px; background: #e91e8c; top: -120px; right: -80px; opacity: .28; }
.ad-hero-orb--2 { width: 300px; height: 300px; background: #7c5cff; bottom: -80px; left: -60px; opacity: .24; }

.ad-hero-inner {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ad-preview-bar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(245,158,11,.14);
    border: 1px solid rgba(245,158,11,.4);
    color: #fcd34d;
    font-size: 13px;
    line-height: 1.8;
    text-align: right;
}

.ad-crumbs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 10px;
    font-size: 13px;
    color: rgba(255,255,255,.4);
    margin-bottom: 22px;
}
.ad-crumbs a {
    color: rgba(255,255,255,.62) !important;
    transition: color .2s;
}
.ad-crumbs a:hover { color: #ff4db2 !important; }

.ad-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px 5px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255,77,178,.35);
    background: rgba(233,30,140,.1);
    color: #ff8fcc !important;
    font-size: 12.5px;
    font-family: var(--ad-medium);
    letter-spacing: .2px;
    margin-bottom: 18px;
    transition: background .25s, border-color .25s;
}
.ad-chip i {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #ff4db2;
    box-shadow: 0 0 0 4px rgba(255,77,178,.18);
}
.ad-chip:hover { background: rgba(233,30,140,.18); border-color: rgba(255,77,178,.6); }

.ad-title {
    font-family: 'Vazir FD-WOL', sans-serif;
    font-weight: 700;
    font-size: clamp(23px, 3.6vw, 38px);
    line-height: 1.6;
    letter-spacing: -.3px;
    color: #fff;
    margin: 0 0 16px;
    text-wrap: balance;
}

.ad-lead {
    font-family: var(--ad-light);
    font-size: clamp(14.5px, 1.6vw, 17px) !important;
    line-height: 2 !important;
    color: rgba(226,232,240,.78);
    max-width: 680px;
    margin: 0 auto 26px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ad-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 22px;
    color: rgba(226,232,240,.7);
    font-size: 13.5px;
}
.ad-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.ad-meta-item svg { width: 16px; height: 16px; color: #ff6fbf; }
.ad-meta-item--soft { color: rgba(226,232,240,.45); font-size: 12.5px; }

.ad-author {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-align: right;
}
.ad-author-text { display: flex; flex-direction: column; line-height: 1.5; }
.ad-author-text small { font-size: 11px; color: rgba(226,232,240,.45); }
.ad-author-text b,
.ad-author-text a { font-family: var(--ad-medium); font-weight: normal; color: #fff !important; font-size: 13.5px; }
.ad-author-text a:hover { color: #ff8fcc !important; }

.ad-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: var(--ad-grad, linear-gradient(135deg, #ff4db2, #a534c9));
    color: #fff;
    font-family: var(--ad-medium);
    font-size: 16px;
    box-shadow: 0 0 0 3px rgba(255,255,255,.08);
    flex: 0 0 auto;
}
.ad-avatar--lg { width: 58px; height: 58px; font-size: 22px; box-shadow: 0 8px 22px rgba(233,30,140,.28); }

/* ---------- بدنه ---------- */
.ad-body {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
    padding-bottom: clamp(48px, 7vw, 96px);
    color: var(--ad-ink-2);
}

.ad-cover {
    max-width: 1040px;
    margin: clamp(-120px, -9vw, -64px) auto 0;
    position: relative;
    z-index: 2;
    border-radius: clamp(16px, 2.2vw, 28px);
    overflow: hidden;
    box-shadow: 0 30px 70px -20px rgba(11,20,32,.45), 0 0 0 1px rgba(255,255,255,.06);
    background: #16273a;
}
.ad-cover img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.ad-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: clamp(32px, 4vw, 64px);
    max-width: 1120px;
    margin: clamp(36px, 5vw, 64px) auto 0;
    align-items: start;
}
.ad-article { min-width: 0; max-width: 740px; }

/* ---------- محتوای مقاله ---------- */
.ad-content {
    counter-reset: adsec;
    font-size: 16.5px;
    color: var(--ad-ink-2);
    overflow-wrap: break-word;
}
.ad-content > *:first-child { margin-top: 0 !important; }

.ad-content p {
    font-size: inherit !important;
    line-height: 2.15 !important;
    color: var(--ad-ink-2);
    margin: 0 0 1.4em;
    text-align: right;
}
.ad-content > p:first-child {
    font-size: 17.5px !important;
    color: var(--ad-ink);
}

.ad-content h2 {
    counter-increment: adsec;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-family: var(--ad-medium);
    font-weight: normal;
    font-size: clamp(19px, 2.1vw, 22.5px);
    line-height: 1.75;
    color: var(--ad-ink);
    margin: 2.4em 0 .9em;
    padding: 0;
    background: none;
    border: 0;
    scroll-margin-top: calc(var(--header-h, 72px) + 24px);
}
.ad-content h2::before {
    content: counter(adsec, persian);
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 34px; height: 34px;
    margin-top: 3px;
    border-radius: 11px;
    background: var(--ad-grad-soft);
    border: 1px solid rgba(233,30,140,.16);
    color: var(--ad-brand);
    font-size: 15px;
    line-height: 1;
}

.ad-content h3 {
    position: relative;
    font-family: var(--ad-medium);
    font-weight: normal;
    font-size: clamp(16.5px, 1.8vw, 18.5px);
    line-height: 1.8;
    color: var(--ad-ink);
    margin: 1.9em 0 .6em;
    padding-right: 18px;
    scroll-margin-top: calc(var(--header-h, 72px) + 24px);
}
.ad-content h3::before {
    content: '';
    position: absolute;
    right: 0; top: .78em;
    width: 8px; height: 8px;
    border-radius: 3px;
    background: var(--ad-grad);
    transform: rotate(45deg);
}
.ad-content h4 {
    font-family: var(--ad-medium);
    font-weight: normal;
    font-size: 16px;
    color: var(--ad-ink);
    margin: 1.6em 0 .5em;
}

.ad-content a {
    color: var(--ad-brand-deep) !important;
    font-weight: normal;
    text-decoration: underline !important;
    text-decoration-color: rgba(233,30,140,.3) !important;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 6px;
    transition: text-decoration-color .2s, color .2s;
}
.ad-content a:hover {
    color: var(--ad-brand) !important;
    text-decoration-color: var(--ad-brand) !important;
}

.ad-content strong,
.ad-content b {
    font-family: 'Vazir FD-WOL', sans-serif;
    font-weight: 700;
    color: var(--ad-ink);
}
.ad-content mark {
    background: linear-gradient(transparent 58%, rgba(255,77,178,.2) 58%);
    color: inherit;
    padding: 0 2px;
}

/* فهرست ها */
.ad-content ul,
.ad-content ol {
    margin: 0 0 1.6em;
    padding: 0;
    list-style: none;
}
.ad-content ul > li,
.ad-content ol > li {
    position: relative;
    padding-right: 28px;
    margin-bottom: .7em;
    line-height: 2.05;
    color: var(--ad-ink-2);
}
.ad-content ul > li::before {
    content: '';
    position: absolute;
    right: 6px; top: .85em;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--ad-grad);
    box-shadow: 0 0 0 4px rgba(233,30,140,.09);
}
.ad-content ol { counter-reset: adol; }
.ad-content ol > li { counter-increment: adol; padding-right: 36px; }
.ad-content ol > li::before {
    content: counter(adol, persian);
    position: absolute;
    right: 0; top: .3em;
    width: 25px; height: 25px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    border: 1px solid rgba(233,30,140,.28);
    color: var(--ad-brand);
    font-size: 12.5px;
    line-height: 1;
}

/* نقل قول */
.ad-content blockquote {
    position: relative;
    margin: 2em 0;
    padding: 22px 26px 22px 22px;
    border-radius: 18px;
    background: var(--ad-grad-soft);
    border-right: 3px solid var(--ad-brand);
    color: var(--ad-ink);
    font-family: var(--ad-light);
    font-size: 17.5px;
}
.ad-content blockquote::after {
    content: '\201D';
    position: absolute;
    left: 18px; top: -6px;
    font-size: 84px;
    line-height: 1;
    font-family: Georgia, serif;
    color: rgba(233,30,140,.16);
}
.ad-content blockquote p { color: inherit; margin-bottom: 0; }

/* تصویر داخل متن */
.ad-content img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
}
.ad-content figure { margin: 2em 0; }
.ad-content figcaption {
    margin-top: 10px;
    font-size: 13px;
    color: var(--ad-ink-3);
    text-align: center;
}

.ad-content hr {
    border: 0;
    height: 1px;
    margin: 2.6em auto;
    width: 60%;
    background: linear-gradient(90deg, transparent, rgba(233,30,140,.35), transparent);
    opacity: 1;
}

/* جدول */
.ad-content .article-table {
    margin: 1.8em 0;
    border: 1px solid var(--ad-line);
    border-radius: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    box-shadow: 0 6px 20px -12px rgba(11,20,32,.18);
}
.ad-content table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 14.5px;
    line-height: 1.9;
}
.ad-content th {
    background: var(--ad-soft);
    color: var(--ad-ink);
    font-family: var(--ad-medium);
    font-weight: normal;
    text-align: right;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ad-line);
    white-space: nowrap;
}
.ad-content td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--ad-line);
    color: var(--ad-ink-2);
    vertical-align: top;
}
.ad-content tr:last-child td { border-bottom: 0; }
.ad-content tbody tr:hover td { background: #fcfcfe; }

/* جعبه های نکته، هشدار و یادداشت */
.ad-content .box-tip,
.ad-content .box-warn,
.ad-content .box-note {
    position: relative;
    margin: 1.9em 0;
    padding: 18px 22px 18px 20px;
    border-radius: 18px;
    border: 1px solid;
}
.ad-content .box-tip  { background: #f0fbf6; border-color: #cdeedd; }
.ad-content .box-warn { background: #fff8ec; border-color: #f7e0b5; }
.ad-content .box-note { background: #f6f3ff; border-color: #e1d9ff; }
.ad-content .box-tip p,
.ad-content .box-warn p,
.ad-content .box-note p { margin-bottom: .6em; font-size: 15.5px !important; }
.ad-content .box-tip > :last-child,
.ad-content .box-warn > :last-child,
.ad-content .box-note > :last-child { margin-bottom: 0; }
.ad-content .box-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--ad-medium);
    font-size: 15px !important;
    margin-bottom: 4px !important;
}
.ad-content .box-title::before {
    content: '';
    width: 22px; height: 22px;
    border-radius: 7px;
    flex: 0 0 auto;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 14px;
}
.ad-content .box-tip  .box-title { color: #0f7a4f; }
.ad-content .box-warn .box-title { color: #a35c00; }
.ad-content .box-note .box-title { color: #5b3fd6; }
.ad-content .box-tip  .box-title::before { background-color: #d5f3e4; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f7a4f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-3.5 10.9c.6.4 1 1.1 1 1.9V16h5v-.2c0-.8.4-1.5 1-1.9A6 6 0 0 0 12 3Z'/%3E%3C/svg%3E"); }
.ad-content .box-warn .box-title::before { background-color: #fdebc8; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a35c00' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 8v5M12 17h.01'/%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3C/svg%3E"); }
.ad-content .box-note .box-title::before { background-color: #e7e0ff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b3fd6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l2.5 5.5L20 9.3l-4 4 1 5.7-5-2.8L7 19l1-5.7-4-4 5.5-.8Z'/%3E%3C/svg%3E"); }

/* خلاصه در یک نگاه */
.ad-content .key-points {
    margin: 0 0 2.2em;
    padding: 22px 24px;
    border-radius: 20px;
    background: linear-gradient(160deg, #fff 0%, #fbf7fd 100%);
    border: 1px solid #f1e3f0;
    box-shadow: 0 10px 30px -18px rgba(233,30,140,.35);
}
.ad-content .key-points .box-title { color: var(--ad-brand-deep); }
.ad-content .key-points .box-title::before {
    background-color: #fde3f1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c2156f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 11l3 3 8-8'/%3E%3Cpath d='M20 12v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h9'/%3E%3C/svg%3E");
}
.ad-content .key-points ul { margin: 10px 0 0; }
.ad-content .key-points ul > li { margin-bottom: .35em; font-size: 15.5px; }
.ad-content .key-points ul > li::before {
    width: 16px; height: 16px;
    right: 0; top: .6em;
    border-radius: 50%;
    box-shadow: none;
    background: #fde3f1 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c2156f' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 10px no-repeat;
}

/* دعوت به اقدام داخل متن */
.ad-content .cta-box {
    position: relative;
    overflow: hidden;
    margin: 2.4em 0;
    padding: clamp(22px, 3vw, 30px);
    border-radius: 22px;
    background:
        radial-gradient(400px 200px at 0% 0%, rgba(233,30,140,.35), transparent 70%),
        radial-gradient(300px 200px at 100% 100%, rgba(124,92,255,.3), transparent 70%),
        linear-gradient(160deg, #16273a 0%, #0e1b28 100%);
    color: rgba(226,232,240,.85);
}
.ad-content .cta-box .box-title,
.ad-content .cta-box p { color: rgba(226,232,240,.85); }
.ad-content .cta-box .box-title {
    color: #fff;
    font-size: 17.5px !important;
}
.ad-content .cta-box .box-title::before { display: none; }
.ad-content .cta-box p { font-size: 15px !important; margin-bottom: 16px; }
.ad-content .cta-box a,
.ad-content a.cta-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 999px;
    background: var(--ad-grad);
    color: #fff !important;
    text-decoration: none !important;
    font-family: var(--ad-medium);
    font-size: 14.5px;
    box-shadow: 0 10px 26px -8px rgba(233,30,140,.65);
    transition: transform .25s, box-shadow .25s;
}
.ad-content .cta-box a:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -8px rgba(233,30,140,.8); }
.ad-content .cta-box a::after { content: '\2190'; font-family: sans-serif; }

/* پرسش های متداول */
.ad-content .faq { margin: 1.2em 0 2em; display: grid; gap: 12px; }
.ad-content .faq-item {
    padding: 16px 20px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--ad-line);
    transition: border-color .25s, box-shadow .25s;
}
.ad-content .faq-item:hover { border-color: rgba(233,30,140,.25); box-shadow: 0 10px 24px -16px rgba(233,30,140,.4); }
.ad-content .faq-item h3 {
    margin: 0 0 6px;
    padding-right: 0;
    font-size: 16px;
    color: var(--ad-ink);
}
.ad-content .faq-item h3::before { display: none; }
.ad-content .faq-item p { margin: 0; font-size: 15px !important; line-height: 2 !important; }

/* ---------- برچسب ها، اشتراک و نویسنده ---------- */
.ad-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-top: 44px;
    padding-top: 26px;
    border-top: 1px dashed var(--ad-line);
}
.ad-tags-label { font-family: var(--ad-medium); color: var(--ad-ink); font-size: 14px; }
.ad-tags-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-tags-list a {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--ad-soft);
    border: 1px solid var(--ad-line);
    color: var(--ad-ink-2) !important;
    font-size: 13px;
    transition: all .2s;
}
.ad-tags-list a::before { content: '#'; margin-left: 3px; color: var(--ad-brand); }
.ad-tags-list a:hover { background: #fff; border-color: rgba(233,30,140,.35); color: var(--ad-brand) !important; }

.ad-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 22px;
    padding: 16px 20px;
    border-radius: 18px;
    background: var(--ad-soft);
}
.ad-share > span { font-size: 14px; color: var(--ad-ink-2); }
.ad-share-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-share-btns a,
.ad-share-btns button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--ad-line);
    color: var(--ad-ink-2) !important;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
}
.ad-share-btns a:hover,
.ad-share-btns button:hover { color: var(--ad-brand) !important; border-color: rgba(233,30,140,.35); transform: translateY(-2px); }
.ad-share-btns .ad-copy.is-done { color: #0f7a4f !important; border-color: #9fdcbf; }

.ad-author-box {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    margin-top: 22px;
    padding: 22px 24px;
    border-radius: var(--ad-radius);
    border: 1px solid var(--ad-line);
    background: #fff;
}
.ad-author-box small { display: block; font-size: 12px; color: var(--ad-ink-3); }
.ad-author-box strong { display: block; font-family: var(--ad-medium); font-weight: normal; font-size: 17px; color: var(--ad-ink); margin-bottom: 4px; }
.ad-author-box p { font-size: 14px !important; line-height: 2 !important; color: var(--ad-ink-3); margin: 0; }
.ad-author-link { display: inline-block; margin-top: 8px; font-size: 13.5px; color: var(--ad-brand) !important; }
.ad-author-link:hover { text-decoration: underline !important; }

/* ---------- ستون کناری ---------- */
.ad-sticky {
    position: sticky;
    top: calc(var(--header-h, 72px) + 20px);
    display: grid;
    gap: 18px;
}
.ad-card {
    padding: 20px;
    border-radius: var(--ad-radius);
    background: #fff;
    border: 1px solid var(--ad-line);
    box-shadow: 0 10px 30px -22px rgba(11,20,32,.35);
}
.ad-card-title {
    font-family: var(--ad-medium);
    font-size: 14.5px !important;
    color: var(--ad-ink);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ad-card-title::before {
    content: '';
    width: 16px; height: 3px;
    border-radius: 3px;
    background: var(--ad-grad);
}

.ad-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: calc(100vh - var(--header-h, 72px) - 360px);
    min-height: 120px;
    overflow-y: auto;
    border-right: 1px solid var(--ad-line);
    scrollbar-width: thin;
}
.ad-toc li { margin: 0; }
.ad-toc a {
    position: relative;
    display: block;
    padding: 6px 14px 6px 0;
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--ad-ink-3) !important;
    transition: color .2s;
}
.ad-toc a::before {
    content: '';
    position: absolute;
    right: -1px; top: 8px; bottom: 8px;
    width: 2px;
    border-radius: 2px;
    background: transparent;
    transition: background .2s;
}
.ad-toc a:hover { color: var(--ad-ink) !important; }
.ad-toc a.is-active { color: var(--ad-brand) !important; }
.ad-toc a.is-active::before { background: var(--ad-grad); }

.ad-cta {
    position: relative;
    overflow: hidden;
    border: 0;
    color: rgba(226,232,240,.8);
    background:
        radial-gradient(260px 160px at 100% 0%, rgba(233,30,140,.4), transparent 70%),
        radial-gradient(220px 160px at 0% 100%, rgba(124,92,255,.35), transparent 70%),
        linear-gradient(160deg, #16273a 0%, #0e1b28 100%);
}
.ad-cta-kicker { font-size: 12px !important; color: #ff8fcc; margin: 0 0 4px; letter-spacing: .3px; }
.ad-cta-title { font-family: var(--ad-medium); font-size: 17px !important; color: #fff; margin: 0 0 8px; }
.ad-cta-text { font-size: 13.5px !important; line-height: 2 !important; color: rgba(226,232,240,.72); margin: 0 0 16px; }
.ad-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 16px;
    border-radius: 14px;
    background: var(--ad-grad);
    color: #fff !important;
    font-family: var(--ad-medium);
    font-size: 14px;
    box-shadow: 0 10px 24px -10px rgba(233,30,140,.8);
    transition: transform .25s, box-shadow .25s;
}
.ad-cta-btn svg { width: 16px; height: 16px; transition: transform .25s; }
.ad-cta-btn:hover { transform: translateY(-2px); }
.ad-cta-btn:hover svg { transform: translateX(-3px); }

.ad-cats ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ad-cats a {
    display: inline-block;
    padding: 5px 13px;
    border-radius: 999px;
    border: 1px solid var(--ad-line);
    background: var(--ad-soft);
    color: var(--ad-ink-2) !important;
    font-size: 13px;
    transition: all .2s;
}
.ad-cats a:hover,
.ad-cats a.is-active { background: rgba(233,30,140,.08); border-color: rgba(233,30,140,.3); color: var(--ad-brand) !important; }

/* فهرست مطالب موبایل */
.ad-toc-mobile {
    display: none;
    margin-bottom: 28px;
    border-radius: 18px;
    border: 1px solid var(--ad-line);
    background: var(--ad-soft);
}
.ad-toc-mobile summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
    font-family: var(--ad-medium);
    font-size: 15px;
    color: var(--ad-ink);
}
.ad-toc-mobile summary::-webkit-details-marker { display: none; }
.ad-toc-mobile summary > span { display: inline-flex; align-items: center; gap: 8px; }
.ad-toc-mobile summary svg { color: var(--ad-brand); }
.ad-toc-mobile summary small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Vazir FD-WOL', sans-serif;
    font-size: 12px;
    color: var(--ad-ink-3);
}
.ad-toc-mobile summary small::after {
    content: '';
    width: 7px; height: 7px;
    border-left: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(-45deg) translateY(-2px);
    transition: transform .25s;
}
.ad-toc-mobile[open] summary small::after { transform: rotate(135deg) translate(-2px, 0); }
.ad-toc-mobile ol {
    list-style: none;
    margin: 0;
    padding: 4px 18px 14px;
    counter-reset: tocm;
    border-top: 1px solid var(--ad-line);
}
.ad-toc-mobile li { counter-increment: tocm; }
.ad-toc-mobile a {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    line-height: 1.8;
    color: var(--ad-ink-2) !important;
    border-bottom: 1px solid rgba(233,236,243,.7);
}
.ad-toc-mobile li:last-child a { border-bottom: 0; }
.ad-toc-mobile a::before {
    content: counter(tocm, persian);
    color: var(--ad-brand);
    font-size: 12.5px;
    min-width: 14px;
}

/* ---------- مطالب مرتبط ---------- */
.ad-related {
    max-width: 1120px;
    margin: clamp(56px, 8vw, 96px) auto 0;
}
.ad-related-head { text-align: center; margin-bottom: 28px; }
.ad-related-kicker { font-size: 13px !important; color: var(--ad-brand); margin: 0 0 2px; }
.ad-related-title {
    font-family: var(--ad-medium);
    font-weight: normal;
    font-size: clamp(20px, 2.4vw, 26px);
    color: var(--ad-ink);
    margin: 0;
}
.ad-related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
.ad-rel {
    display: flex;
    flex-direction: column;
    border-radius: var(--ad-radius);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--ad-line);
    transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s;
}
.ad-rel:hover { transform: translateY(-5px); box-shadow: 0 22px 44px -22px rgba(11,20,32,.35); }
.ad-rel-media { display: block; overflow: hidden; aspect-ratio: 16 / 9; background: #eef1f6; }
.ad-rel-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s cubic-bezier(.22,1,.36,1); }
.ad-rel:hover .ad-rel-media img { transform: scale(1.05); }
.ad-rel-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 20px; }
.ad-rel-date { font-size: 12px; color: var(--ad-ink-3); }
.ad-rel-title {
    font-family: var(--ad-medium);
    font-size: 15.5px;
    line-height: 1.9;
    color: var(--ad-ink);
    transition: color .2s;
}
.ad-rel:hover .ad-rel-title { color: var(--ad-brand); }

/* ---------- واکنش گرا ---------- */
@media (max-width: 1199px) {
    .ad-layout { grid-template-columns: minmax(0, 1fr) 270px; }
}

@media (max-width: 991px) {
    .ad-layout { grid-template-columns: minmax(0, 1fr); }
    .ad-article { max-width: 720px; margin: 0 auto; width: 100%; }
    .ad-aside { max-width: 720px; margin: 0 auto; width: 100%; }
    .ad-sticky { position: static; }
    .ad-toc { display: none; }
    .ad-toc-mobile { display: block; }
    .ad-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .ad-hero-orb--1 { width: 240px; height: 240px; }
    .ad-hero-orb--2 { width: 200px; height: 200px; }
    .ad-crumbs { font-size: 12px; margin-bottom: 16px; }
    .ad-title { line-height: 1.7; }
    .ad-meta { gap: 10px 16px; font-size: 12.5px; }
    .ad-meta .ad-author { flex-basis: 100%; justify-content: center; margin-bottom: 2px; }

    .ad-content { font-size: 15.75px; }
    .ad-content > p:first-child { font-size: 16.5px !important; }
    .ad-content p { line-height: 2.05 !important; }
    .ad-content h2 { gap: 11px; margin-top: 2.1em; }
    .ad-content h2::before { width: 30px; height: 30px; font-size: 13.5px; border-radius: 10px; margin-top: 2px; }
    .ad-content blockquote { padding: 18px 20px; font-size: 16px; }
    .ad-content .box-tip,
    .ad-content .box-warn,
    .ad-content .box-note,
    .ad-content .key-points { padding: 16px 18px; }

    .ad-share { flex-direction: column; align-items: stretch; text-align: center; }
    .ad-share-btns { justify-content: center; }
    .ad-author-box { flex-direction: column; align-items: center; text-align: center; padding: 22px 18px; }

    /* کارت های مرتبط در موبایل افقی و جمع و جورند */
    .ad-related-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .ad-rel { flex-direction: row; align-items: stretch; border-radius: 18px; }
    .ad-rel-media { flex: 0 0 118px; aspect-ratio: auto; min-height: 92px; }
    .ad-rel-body { padding: 12px 14px; justify-content: center; }
    .ad-rel-title { font-size: 14px; line-height: 1.85; }
}

@media (prefers-reduced-motion: reduce) {
    .ad-rel, .ad-rel-media img, .ad-cta-btn, .ad-share-btns a { transition: none; }
}
