/* ════════════════════════════════════════════════
   SMAcode — استایل صفحات وبلاگ، نوشته‌ها و سایدبار
   نسخه ۳.۰
   ════════════════════════════════════════════════ */


/* ══════════════════════════════════════
   ۱. لایه‌بندی اصلی
   ══════════════════════════════════════ */

.site-content {
    padding: var(--sxl) 4%;
    background: var(--bg);
}

.site-content__wrap {
    width: var(--w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 17rem;
    gap: var(--sxl);
    align-items: start;
}

.site-content__wrap--page {
    grid-template-columns: 1fr;
    max-width: 50rem;
}

.site-content__main--full {
    max-width: 50rem;
    margin: 0 auto;
}


/* ══════════════════════════════════════
   ۲. هدر صفحه
   ══════════════════════════════════════ */

.page-header {
    margin-bottom: var(--sxl);
}

.page-header__title {
    font-size: var(--fxl);
    color: var(--dk);
    margin-bottom: var(--sx);
}

.page-header__desc {
    color: var(--txl);
    font-size: var(--fs);
    line-height: 1.8;
}


/* ══════════════════════════════════════
   ۳. گرید نوشته‌ها
   ══════════════════════════════════════ */

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
    gap: var(--sl);
}

.posts-grid--3 {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
}


/* ══════════════════════════════════════
   ۴. کارت نوشته
   ══════════════════════════════════════ */

.post-card {
    background: var(--wh);
    border: 1px solid var(--bd);
    border-radius: .875rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all .4s;
}

.post-card:hover {
    border-color: var(--c1);
    box-shadow: 0 .5rem 2rem rgba(13, 148, 136, .08);
    transform: translateY(-.25rem);
}

.post-card__thumb {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg);
}

.post-card__thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bd);
}

.post-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s;
}

.post-card:hover .post-card__img {
    transform: scale(1.05);
}

.post-card__body {
    padding: var(--sm);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-card__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sx);
    flex-wrap: wrap;
    gap: var(--sx);
}

.post-card__cat {
    background: rgba(13, 148, 136, .1);
    color: var(--c1);
    padding: .1em .5em;
    border-radius: 1rem;
    font-size: var(--fx);
    font-weight: 600;
    text-decoration: none;
}

.post-card__cat:hover {
    background: rgba(13, 148, 136, .2);
}

.post-card__date {
    font-size: var(--fx);
    color: #94A3B8;
}

.post-card__title {
    font-size: var(--fm);
    margin-bottom: var(--sx);
    line-height: 1.6;
}

.post-card__title a {
    color: var(--dk);
    text-decoration: none;
    transition: color .25s;
}

.post-card__title a:hover {
    color: var(--c1);
}

.post-card__excerpt {
    font-size: var(--fx);
    color: var(--txl);
    line-height: 1.8;
    flex: 1;
    margin-bottom: var(--sm);
}

.post-card__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--ss);
    border-top: 1px solid var(--bd);
    gap: var(--sx);
}

.post-card__author {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.post-card__author-img {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
}

.post-card__author-name {
    font-size: var(--fx);
    color: var(--txl);
}

.post-card__more {
    font-size: var(--fx);
    font-weight: 600;
    color: var(--c1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    transition: gap .3s;
}

.post-card:hover .post-card__more {
    gap: .5rem;
}


/* ══════════════════════════════════════
   ۵. نوشته تکی
   ══════════════════════════════════════ */

.post-single__header {
    margin-bottom: var(--sl);
}

.post-single__cats {
    display: flex;
    gap: var(--sx);
    flex-wrap: wrap;
    margin-bottom: var(--ss);
}

.post-single__cat {
    background: rgba(13, 148, 136, .1);
    color: var(--c1);
    padding: .15em .6em;
    border-radius: 1.25rem;
    font-size: var(--fx);
    font-weight: bold;
    text-decoration: none;
}

.post-single__title {
    font-size: var(--f2l);
    line-height: 1.5;
    margin-bottom: var(--sm);
}

.post-single__meta {
    display: flex;
    align-items: center;
    gap: var(--sl);
    flex-wrap: wrap;
    color: var(--txl);
    font-size: var(--fx);
}

.post-single__meta-item {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.post-single__meta-link {
    text-decoration: none;
    color: var(--txl);
    transition: color .25s;
}

.post-single__meta-link:hover {
    color: var(--c1);
}

.post-single__avatar {
    flex-shrink: 0;
}

.post-single__avatar-img {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 2px solid var(--bd);
}

.post-single__author {
    display: block;
    font-weight: 600;
    color: var(--dk);
    font-size: var(--fs);
}

.post-single__date {
    display: block;
    color: #94A3B8;
    font-size: var(--fx);
}

.post-single__thumbnail {
    margin-bottom: var(--sl);
    border-radius: 1rem;
    overflow: hidden;
}

.post-single__img {
    width: 100%;
    height: auto;
    display: block;
}

.post-single__caption {
    text-align: center;
    font-size: var(--fx);
    color: var(--txl);
    padding: var(--ss);
    background: var(--bg);
}


/* ══════════════════════════════════════
   ۶. محتوای نوشته (entry-content)
   ══════════════════════════════════════ */

.entry-content {
    font-size: var(--fb);
    line-height: 2;
    color: var(--tx);
}

.entry-content h2 {
    font-size: var(--fl);
    margin-top: var(--sxl);
    margin-bottom: var(--sm);
    padding-bottom: var(--sx);
    border-bottom: 2px solid var(--bd);
}

.entry-content h3 {
    font-size: var(--fm);
    margin-top: var(--sl);
    margin-bottom: var(--ss);
}

.entry-content p {
    margin-bottom: var(--sm);
}

.entry-content img {
    border-radius: .75rem;
    margin: var(--sm) 0;
}

.entry-content a {
    color: var(--c1);
    text-decoration: underline;
    text-decoration-color: rgba(13, 148, 136, .3);
    text-underline-offset: .2em;
    transition: text-decoration-color .25s;
}

.entry-content a:hover {
    text-decoration-color: var(--c1);
}

.entry-content blockquote {
    border-right: 4px solid var(--c1);
    padding: var(--sm) var(--sl);
    margin: var(--sl) 0;
    background: var(--c1bg);
    border-radius: 0 .5rem .5rem 0;
    font-style: italic;
    color: var(--dk);
}

.entry-content pre {
    background: #1E1E2E;
    color: #CDD6F4;
    padding: var(--sl);
    border-radius: .75rem;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: var(--fx);
    line-height: 1.8;
    margin: var(--sl) 0;
    direction: ltr;
    text-align: left;
}

.entry-content code {
    background: var(--bg);
    padding: .1em .4em;
    border-radius: .25rem;
    font-size: .9em;
    font-family: 'Courier New', Courier, monospace;
    color: var(--c1);
}

.entry-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: var(--sm);
    padding-right: 1.5rem;
}

.entry-content li {
    margin-bottom: var(--sx);
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--sl) 0;
    font-size: var(--fs);
}

.entry-content th,
.entry-content td {
    padding: var(--ss) var(--sm);
    border: 1px solid var(--bd);
    text-align: right;
}

.entry-content th {
    background: var(--bg);
    font-weight: 700;
    color: var(--dk);
}


/* ══════════════════════════════════════
   ۷. تگ‌ها و اشتراک‌گذاری
   ══════════════════════════════════════ */

.post-single__footer {
    margin-top: var(--sxl);
    padding-top: var(--sl);
    border-top: 1px solid var(--bd);
}

.post-single__tags {
    display: flex;
    align-items: center;
    gap: var(--sx);
    flex-wrap: wrap;
}

.post-single__tags svg {
    color: var(--txl);
}

.post-single__tag {
    background: var(--bg);
    color: var(--txl);
    padding: .2em .6em;
    border-radius: .375rem;
    font-size: var(--fx);
    text-decoration: none;
    border: 1px solid var(--bd);
    transition: all .25s;
}

.post-single__tag:hover {
    background: var(--c1bg);
    color: var(--c1);
    border-color: var(--c1);
}

.post-single__share {
    display: flex;
    align-items: center;
    gap: var(--ss);
    margin-top: var(--sl);
    padding: var(--sm);
    background: var(--bg);
    border-radius: .75rem;
}

.post-single__share-label {
    font-size: var(--fx);
    font-weight: 600;
    color: var(--txl);
}

.post-single__share-links {
    display: flex;
    gap: var(--sx);
}

.post-single__share-link {
    width: 2rem;
    height: 2rem;
    border-radius: .5rem;
    background: var(--wh);
    border: 1px solid var(--bd);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--txl);
    transition: all .25s;
}

.post-single__share-link:hover {
    background: var(--c1);
    color: #fff;
    border-color: var(--c1);
}


/* ══════════════════════════════════════
   ۸. مطالب مرتبط و ناوبری
   ══════════════════════════════════════ */

.post-single__related {
    margin-top: var(--sxl);
    padding-top: var(--sxl);
    border-top: 1px solid var(--bd);
}

.post-single__related-title {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: var(--fm);
    margin-bottom: var(--sl);
    color: var(--dk);
}

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sl);
    margin-top: var(--sxl);
    padding-top: var(--sl);
    border-top: 1px solid var(--bd);
}

.post-nav__link {
    display: flex;
    flex-direction: column;
    gap: var(--sx);
    padding: var(--sm);
    background: var(--wh);
    border: 1px solid var(--bd);
    border-radius: .75rem;
    text-decoration: none;
    transition: all .3s;
}

.post-nav__link:hover {
    border-color: var(--c1);
    box-shadow: 0 .25rem 1rem rgba(13, 148, 136, .08);
}

.post-nav__link--next {
    text-align: left;
}

.post-nav__label {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: var(--fx);
    color: var(--c1);
    font-weight: 600;
}

.post-nav__title {
    font-size: var(--fs);
    color: var(--dk);
    font-weight: 600;
    line-height: 1.5;
}


/* ══════════════════════════════════════
   ۹. نتایج خالی
   ══════════════════════════════════════ */

.no-results {
    text-align: center;
    padding: var(--s2l) var(--sl);
}

.no-results__icon {
    color: var(--bd);
    margin-bottom: var(--sm);
}

.no-results__title {
    font-size: var(--fl);
    margin-bottom: var(--ss);
}

.no-results__text {
    color: var(--txl);
    font-size: var(--fs);
    margin-bottom: var(--sl);
}

.no-results__search {
    max-width: 24rem;
    margin: 0 auto var(--sl);
}


/* ══════════════════════════════════════
   ۱۰. صفحه‌بندی
   ══════════════════════════════════════ */

.pagination {
    margin-top: var(--sxl);
    display: flex;
    justify-content: center;
}

.pagination__list {
    display: flex;
    align-items: center;
    gap: .3rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination__item .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    min-width: 2.2rem;
    height: 2.2rem;
    padding: 0 .5rem;
    border-radius: .5rem;
    font-size: var(--fs);
    font-weight: 600;
    color: var(--tx);
    text-decoration: none;
    border: 1px solid var(--bd);
    background: var(--wh);
    transition: all .25s;
}

.pagination__item .page-numbers:hover,
.pagination__item .page-numbers.current {
    background: var(--c1);
    color: #fff;
    border-color: var(--c1);
}

.pagination__item .page-numbers.dots {
    border: none;
    background: none;
    cursor: default;
}


/* ══════════════════════════════════════
   ۱۱. برگه تکی
   ══════════════════════════════════════ */

.page-single__header {
    margin-bottom: var(--sl);
}

.page-single__title {
    font-size: var(--f2l);
}

.page-single__thumbnail {
    margin-bottom: var(--sl);
    border-radius: 1rem;
    overflow: hidden;
}

.page-single__img {
    width: 100%;
    height: auto;
}

.page-links {
    display: flex;
    gap: .3rem;
    margin-top: var(--sl);
}

.page-links span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--c1);
    color: #fff;
    border-radius: .375rem;
    font-weight: 600;
    font-size: var(--fs);
}


/* ══════════════════════════════════════
   ۱۲. هدر آرشیو
   ══════════════════════════════════════ */

.archive-header {
    margin-bottom: var(--sxl);
    padding: var(--sl);
    background: var(--wh);
    border: 1px solid var(--bd);
    border-radius: .875rem;
}

.archive-header__title {
    font-size: var(--fxl);
    margin-bottom: var(--sx);
}

.archive-header__desc {
    color: var(--txl);
    font-size: var(--fs);
    line-height: 1.8;
    margin-bottom: var(--sx);
}

.archive-header__count {
    font-size: var(--fx);
    color: #94A3B8;
    margin: 0;
}

.archive-header__author {
    display: flex;
    align-items: center;
    gap: var(--sm);
}

.archive-header__avatar {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    border: 3px solid var(--bd);
}


/* ══════════════════════════════════════
   ۱۳. جستجو
   ══════════════════════════════════════ */

.search-header {
    margin-bottom: var(--sxl);
    padding: var(--sl);
    background: var(--wh);
    border: 1px solid var(--bd);
    border-radius: .875rem;
    text-align: center;
}

.search-header__icon {
    color: var(--c1);
    margin-bottom: var(--ss);
}

.search-header__title {
    font-size: var(--fl);
    margin-bottom: var(--sx);
}

.search-header__query {
    color: var(--c1);
}

.search-header__count {
    font-size: var(--fx);
    color: #94A3B8;
    margin-bottom: var(--sm);
}

.search-header__form {
    max-width: 28rem;
    margin: 0 auto;
}

.search-header__form .search-form {
    display: flex;
    gap: .4rem;
}

.search-header__form .search-field {
    flex: 1;
    padding: .5rem .75rem;
    border: 1.5px solid var(--bd);
    border-radius: .5rem;
    font-size: var(--fs);
    font-family: inherit;
}

.search-header__form .search-submit {
    padding: .5rem 1rem;
    background: var(--c1);
    color: #fff;
    border: none;
    border-radius: .5rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: var(--sm);
}

.search-item {
    display: flex;
    gap: var(--sm);
    padding: var(--sm);
    background: var(--wh);
    border: 1px solid var(--bd);
    border-radius: .75rem;
    transition: all .3s;
}

.search-item:hover {
    border-color: var(--c1);
    box-shadow: 0 .25rem 1rem rgba(13, 148, 136, .06);
}

.search-item__thumb {
    width: 6rem;
    height: 6rem;
    flex-shrink: 0;
    border-radius: .5rem;
    overflow: hidden;
}

.search-item__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-item__body {
    flex: 1;
    min-width: 0;
}

.search-item__meta {
    display: flex;
    align-items: center;
    gap: var(--ss);
    margin-bottom: var(--sx);
}

.search-item__type {
    background: var(--c1bg);
    color: var(--c1);
    font-size: var(--fx);
    font-weight: 600;
    padding: .1em .5em;
    border-radius: .75rem;
}

.search-item__date {
    font-size: var(--fx);
    color: #94A3B8;
}

.search-item__title {
    font-size: var(--fm);
    margin-bottom: var(--sx);
    line-height: 1.5;
}

.search-item__title a {
    color: var(--dk);
    text-decoration: none;
}

.search-item__title a:hover {
    color: var(--c1);
}

.search-item__excerpt {
    font-size: var(--fx);
    color: var(--txl);
    line-height: 1.7;
    margin-bottom: var(--sx);
}

.search-item__highlight {
    background: rgba(13, 148, 136, .15);
    color: var(--c1);
    padding: .05em .15em;
    border-radius: .2rem;
}

.search-item__link {
    font-size: var(--fx);
    font-weight: 600;
    color: var(--c1);
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.no-results__suggestions {
    text-align: right;
    max-width: 20rem;
    margin: 0 auto var(--sl);
}

.no-results__suggestions h3 {
    font-size: var(--fs);
    margin-bottom: var(--sx);
}

.no-results__suggestions ul {
    font-size: var(--fx);
    color: var(--txl);
    line-height: 2;
}


/* ══════════════════════════════════════
   ۱۴. ۴۰۴
   ══════════════════════════════════════ */

.error-page {
    text-align: center;
    padding: var(--sxl) 0;
}

.error-page__visual {
    max-width: 24rem;
    margin: 0 auto var(--sl);
}

.error-page__svg {
    width: 100%;
    height: auto;
}

.error-page__signal {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: fpDraw 3s ease forwards;
}

.error-page__dot {
    animation: fpDot 2s infinite;
}

.error-page__dot-ring {
    animation: error-ring 2s infinite;
}

@keyframes error-ring {
    0%   { r: 12; opacity: .3; }
    50%  { r: 18; opacity: .1; }
    100% { r: 12; opacity: .3; }
}

.error-page__title {
    font-size: var(--fxl);
    margin-bottom: var(--ss);
}

.error-page__desc {
    color: var(--txl);
    font-size: var(--fs);
    line-height: 1.8;
    margin-bottom: var(--sl);
}

.error-page__search {
    max-width: 24rem;
    margin: 0 auto var(--sl);
}

.error-page__search .search-form {
    display: flex;
    gap: .4rem;
}

.error-page__search .search-field {
    flex: 1;
    padding: .55rem .875rem;
    border: 1.5px solid var(--bd);
    border-radius: .5rem;
    font-size: var(--fs);
    font-family: inherit;
}

.error-page__search .search-submit {
    padding: .55rem 1rem;
    background: var(--c1);
    color: #fff;
    border: none;
    border-radius: .5rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

.error-page__actions {
    display: flex;
    justify-content: center;
    gap: var(--ss);
    flex-wrap: wrap;
    margin-bottom: var(--sxl);
}

.error-page__suggested {
    margin-top: var(--sxl);
    padding-top: var(--sxl);
    border-top: 1px solid var(--bd);
    text-align: right;
}

.error-page__suggested-title {
    font-size: var(--fm);
    margin-bottom: var(--sl);
    text-align: center;
}


/* ══════════════════════════════════════
   ۱۵. آرشیو کدها و وبلاگ
   ══════════════════════════════════════ */

.codes-archive-header {
    margin-bottom: var(--sxl);
}

.codes-archive-header__content {
    text-align: center;
    margin-bottom: var(--sl);
}

.codes-archive-header__title {
    font-size: var(--fxl);
    margin-bottom: var(--sx);
}

.codes-archive-header__desc {
    color: var(--txl);
    font-size: var(--fs);
}

.codes-filter {
    display: flex;
    justify-content: center;
    gap: .35rem;
    flex-wrap: wrap;
}

.codes-filter__item {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .4rem .875rem;
    border-radius: 2rem;
    font-size: var(--fx);
    font-weight: 600;
    color: var(--txl);
    text-decoration: none;
    background: var(--wh);
    border: 1px solid var(--bd);
    transition: all .25s;
}

.codes-filter__item:hover,
.codes-filter__item--active {
    background: var(--c1);
    color: #fff;
    border-color: var(--c1);
}

.codes-filter__count {
    font-size: .65rem;
    opacity: .7;
}

.archive-stats {
    display: flex;
    gap: var(--sl);
    margin-bottom: var(--sl);
    flex-wrap: wrap;
}

.archive-stats__item {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: var(--fx);
    color: var(--txl);
}

.codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
    gap: var(--sl);
}


/* ══════════════════════════════════════
   ۱۶. کارت کد
   ══════════════════════════════════════ */

.code-card {
    background: var(--wh);
    border: 1px solid var(--bd);
    border-radius: .875rem;
    padding: var(--sl);
    display: flex;
    flex-direction: column;
    transition: all .4s;
}

.code-card:hover {
    border-color: var(--c1);
    box-shadow: 0 .5rem 1.5rem rgba(13, 148, 136, .08);
    transform: translateY(-.2rem);
}

.code-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--ss);
}

.code-card__icon {
    width: 2.2rem;
    height: 2.2rem;
    background: var(--c1bg);
    border-radius: .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c1);
}

.code-card__diff {
    font-size: .65rem;
    font-weight: 700;
    padding: .15em .5em;
    border-radius: 1rem;
}

.code-card__diff--beginner     { background: #DCFCE7; color: #16A34A; }
.code-card__diff--intermediate { background: #FEF3C7; color: #D97706; }
.code-card__diff--advanced     { background: #FEE2E2; color: #DC2626; }

.code-card__title {
    font-size: var(--fs);
    margin-bottom: var(--sx);
    font-family: 'Courier New', monospace;
}

.code-card__title a {
    color: var(--dk);
    text-decoration: none;
    transition: color .25s;
}

.code-card__title a:hover {
    color: var(--c1);
}

.code-card__desc {
    font-size: var(--fx);
    color: var(--txl);
    line-height: 1.7;
    flex: 1;
    margin-bottom: var(--sm);
}

.code-card__tags {
    display: flex;
    gap: var(--sx);
    flex-wrap: wrap;
    margin-bottom: var(--sm);
}

.code-card__tags span {
    background: var(--c1bg);
    color: var(--c1);
    padding: .1em .5em;
    border-radius: 1rem;
    font-size: .65rem;
    font-weight: 600;
}

.code-card__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--ss);
    border-top: 1px solid var(--bd);
}

.code-card__link {
    font-size: var(--fx);
    font-weight: 600;
    color: var(--c1);
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    text-decoration: none;
    transition: gap .3s;
}

.code-card:hover .code-card__link {
    gap: .5rem;
}

.code-card__download {
    width: 2rem;
    height: 2rem;
    border-radius: .5rem;
    background: var(--c1bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c1);
    transition: all .25s;
}

.code-card__download:hover {
    background: var(--c1);
    color: #fff;
}


/* ══════════════════════════════════════
   ۱۷. صفحه تک کد
   ══════════════════════════════════════ */

.code-single__header {
    margin-bottom: var(--sl);
}

.code-single__breadcrumb {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: var(--fx);
    color: var(--txl);
    margin-bottom: var(--sm);
    flex-wrap: wrap;
}

.code-single__breadcrumb a {
    color: var(--txl);
    text-decoration: none;
}

.code-single__breadcrumb a:hover {
    color: var(--c1);
}

.code-single__breadcrumb span:last-child {
    color: var(--dk);
    font-weight: 600;
}

.code-single__cats {
    display: flex;
    gap: var(--sx);
    flex-wrap: wrap;
    margin-bottom: var(--ss);
}

.code-single__title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: var(--f2l);
    font-family: 'Courier New', monospace, Tahoma;
    margin-bottom: var(--sm);
}

.code-single__title svg {
    color: var(--c1);
    flex-shrink: 0;
}

.code-single__meta {
    display: flex;
    align-items: center;
    gap: var(--sl);
    flex-wrap: wrap;
    font-size: var(--fx);
    color: var(--txl);
}

.code-single__meta-item {
    display: flex;
    align-items: center;
    gap: .3rem;
}

.code-single__difficulty {
    font-size: .65rem;
    font-weight: 700;
    padding: .15em .5em;
    border-radius: 1rem;
}

.code-single__difficulty--beginner     { background: #DCFCE7; color: #16A34A; }
.code-single__difficulty--intermediate { background: #FEF3C7; color: #D97706; }
.code-single__difficulty--advanced     { background: #FEE2E2; color: #DC2626; }

.code-single__download {
    margin-bottom: var(--sl);
}

.code-single__tags {
    display: flex;
    align-items: center;
    gap: var(--sx);
    flex-wrap: wrap;
    margin-top: var(--sl);
    padding-top: var(--sl);
    border-top: 1px solid var(--bd);
}


/* ══════════════════════════════════════
   ۱۸. سایدبار v3
   ══════════════════════════════════════ */

.sb {
    display: flex;
    flex-direction: column;
    gap: var(--sm);
    position: sticky;
    top: calc(var(--header-h) + var(--sm));
    max-height: calc(100vh - var(--header-h) - var(--sm) * 2);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    padding-left: 2px;
    transition: scrollbar-color .3s;
}

.sb:hover { scrollbar-color: var(--bd) transparent; }
.sb::-webkit-scrollbar { width: 4px; }
.sb::-webkit-scrollbar-track { background: transparent; }
.sb::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; transition: background .3s; }
.sb:hover::-webkit-scrollbar-thumb { background: var(--bd); }

.sb__card {
    background: var(--wh);
    border: 1px solid var(--bd);
    border-radius: 1rem;
    padding: var(--sm);
    transition: border-color .35s, box-shadow .35s;
}

.sb__card:hover {
    border-color: rgba(13, 148, 136, .25);
    box-shadow: 0 4px 20px rgba(13, 148, 136, .06);
}

.sb-anim {
    opacity: 0;
    transform: translateY(1rem);
    animation: sbIn .5s ease forwards;
}

/* ══════════════════════════════════════
   سایدبار — جستجو گرافیکی
   ══════════════════════════════════════ */

.sb__card--search {
    background: linear-gradient(135deg, var(--c1), #0F766E);
    border: none;
    padding: var(--sm);
    position: relative;
    overflow: hidden;
}

.sb__card--search::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, .08);
    border-radius: 50%;
    pointer-events: none;
    animation: sbSearchFloat 10s ease-in-out infinite;
}

.sb__card--search::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -20px;
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, .05);
    border-radius: 50%;
    pointer-events: none;
    animation: sbSearchFloat 14s ease-in-out infinite reverse;
}

@keyframes sbSearchFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(8px, -6px) scale(1.1); }
    50%      { transform: translate(-5px, 4px) scale(.95); }
    75%      { transform: translate(4px, 8px) scale(1.05); }
}

.sb__card--search:hover {
    box-shadow: 0 6px 24px rgba(13, 148, 136, .25);
    border-color: transparent;
}

.sb-search {
    position: relative;
    z-index: 1;
}

.sb-search__form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sb-search__input-wrap {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, .15);
    border: 1.5px solid rgba(255, 255, 255, .2);
    border-radius: .6rem;
    overflow: hidden;
    transition: all .3s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.sb-search__input-wrap:focus-within {
    background: rgba(255, 255, 255, .25);
    border-color: rgba(255, 255, 255, .4);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .1);
}

.sb-search__input-icon {
    color: rgba(255, 255, 255, .6);
    margin-right: .6rem;
    flex-shrink: 0;
    transition: color .25s;
}

.sb-search__input-wrap:focus-within .sb-search__input-icon {
    color: rgba(255, 255, 255, .9);
}

.sb-search__input {
    flex: 1;
    padding: .6rem 0;
    border: none;
    outline: none;
    font-size: var(--fx);
    font-family: inherit;
    color: #ffffff;
    background: transparent;
    min-width: 0;
}

.sb-search__input::placeholder {
    color: rgba(255, 255, 255, .5);
    font-size: var(--fx);
}

.sb-search__btn {
    padding: .6rem .7rem;
    background: rgba(255, 255, 255, .15);
    border: none;
    border-right: 1px solid rgba(255, 255, 255, .1);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .25s;
    flex-shrink: 0;
}

.sb-search__btn:hover {
    background: rgba(255, 255, 255, .25);
}

.sb-search__btn svg {
    transition: transform .25s;
}

.sb-search__btn:hover svg {
    transform: translateX(-2px);
}


/* Dark Mode جستجو سایدبار */
[data-theme="dark"] .sb__card--search {
    background: linear-gradient(135deg, #0D9488, #0F766E);
}

[data-theme="dark"] .sb__card--search::before {
    background: rgba(255, 255, 255, .05);
}

[data-theme="dark"] .sb__card--search::after {
    background: rgba(255, 255, 255, .03);
}

[data-theme="dark"] .sb-search__input-wrap {
    background: rgba(0, 0, 0, .2);
    border-color: rgba(255, 255, 255, .1);
}

[data-theme="dark"] .sb-search__input-wrap:focus-within {
    background: rgba(0, 0, 0, .3);
    border-color: rgba(255, 255, 255, .2);
}

[data-theme="dark"] .sb-search__input {
    color: #E2E8F0;
}

[data-theme="dark"] .sb-search__input::placeholder {
    color: rgba(255, 255, 255, .4);
}

[data-theme="dark"] .sb-search__btn {
    background: rgba(0, 0, 0, .15);
    border-right-color: rgba(255, 255, 255, .08);
}

[data-theme="dark"] .sb-search__btn:hover {
    background: rgba(0, 0, 0, .25);
}

.sb-anim:nth-child(1) { animation-delay: .1s; }
.sb-anim:nth-child(2) { animation-delay: .2s; }
.sb-anim:nth-child(3) { animation-delay: .3s; }
.sb-anim:nth-child(4) { animation-delay: .4s; }
.sb-anim:nth-child(5) { animation-delay: .5s; }

@keyframes sbIn { to { opacity: 1; transform: translateY(0); } }

.sb__head {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: var(--sm);
    padding-bottom: var(--sx);
    border-bottom: 1px solid var(--bd);
}

.sb__head-dot {
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    flex-shrink: 0;
    animation: sbPulse 2.5s ease-in-out infinite;
}

.sb__head-dot--green  { background: #16A34A; box-shadow: 0 0 0 3px rgba(22, 163, 74, .15); }
.sb__head-dot--blue   { background: #3B82F6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .15); }
.sb__head-dot--purple { background: #8B5CF6; box-shadow: 0 0 0 3px rgba(139, 92, 246, .15); }
.sb__head-dot--orange { background: #F97316; box-shadow: 0 0 0 3px rgba(249, 115, 22, .15); }

@keyframes sbPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: .7; }
}

.sb__head-title {
    font-size: var(--fs);
    font-weight: 700;
    color: var(--dk);
    margin: 0;
    line-height: 1.4;
}

.sb__card--stats {
    background: linear-gradient(135deg, var(--c1), #0F766E);
    border: none;
    padding: var(--sm);
}

.sb__card--stats:hover { box-shadow: 0 6px 24px rgba(13, 148, 136, .2); }

.sb-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}

.sb-stats__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    padding: var(--ss);
    background: rgba(255, 255, 255, .12);
    border-radius: .75rem;
    text-decoration: none;
    transition: all .3s;
    backdrop-filter: blur(4px);
}

.sb-stats__box:hover {
    background: rgba(255, 255, 255, .22);
    transform: translateY(-.15rem);
}

.sb-stats__icon { color: rgba(255, 255, 255, .7); }
.sb-stats__num { font-size: var(--fl); font-weight: 900; color: #fff; line-height: 1; }
.sb-stats__lbl { font-size: .6rem; color: rgba(255, 255, 255, .7); font-weight: 600; text-align: center; line-height: 1.3; }

.sb-list { list-style: none; margin: 0; padding: 0; }

.sb-list__item {
    opacity: 0;
    animation: sbSlide .4s ease forwards;
}

@keyframes sbSlide {
    from { opacity: 0; transform: translateX(.5rem); }
    to   { opacity: 1; transform: translateX(0); }
}

.sb-list__link {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .5rem .4rem;
    text-decoration: none;
    border-radius: .5rem;
    transition: background .25s;
}

.sb-list__link:hover { background: var(--bg); }

.sb-list__num {
    flex-shrink: 0;
    width: 1.6rem;
    height: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--txl);
    border-radius: .375rem;
    font-size: .6rem;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    transition: all .25s;
    border: 1px solid var(--bd);
}

.sb-list__link:hover .sb-list__num { background: var(--c1); color: #fff; border-color: var(--c1); }

.sb-list__icon {
    flex-shrink: 0;
    width: 1.6rem;
    height: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c1bg);
    color: var(--c1);
    border-radius: .375rem;
    transition: all .25s;
}

.sb-list__link:hover .sb-list__icon { background: var(--c1); color: #fff; }

.sb-list__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }

.sb-list__title {
    font-size: var(--fx);
    font-weight: 600;
    color: var(--dk);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .25s;
}

.sb-list__title--mono { font-family: 'Courier New', monospace, Tahoma; -webkit-line-clamp: 1; }
.sb-list__link:hover .sb-list__title { color: var(--c1); }

.sb-list__meta { font-size: .6rem; color: var(--txl); display: flex; align-items: center; gap: .25rem; }

.sb-list__level { display: flex; align-items: center; gap: .3rem; font-size: .6rem; font-weight: 600; }
.sb-list__level--green  { color: #16A34A; }
.sb-list__level--yellow { color: #D97706; }
.sb-list__level--red    { color: #DC2626; }

.sb-list__bar { width: 3px; border-radius: 1px; background: var(--bd); }
.sb-list__bar:nth-child(1) { height: 6px; }
.sb-list__bar:nth-child(2) { height: 9px; }
.sb-list__bar:nth-child(3) { height: 12px; }
.sb-list__level--green .sb-list__bar--on  { background: #16A34A; }
.sb-list__level--yellow .sb-list__bar--on { background: #D97706; }
.sb-list__level--red .sb-list__bar--on    { background: #DC2626; }

.sb__more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    margin-top: var(--sx);
    padding: .45rem;
    background: var(--bg);
    border-radius: .5rem;
    font-size: var(--fx);
    font-weight: 600;
    color: var(--c1);
    text-decoration: none;
    transition: all .3s;
}

.sb__more:hover { background: var(--c1); color: #fff; gap: .6rem; }
.sb__more:hover svg { transform: translateX(-2px); }

.sb-topics { margin-bottom: .25rem; }
.sb-topics--sep { margin-top: var(--ss); padding-top: var(--ss); border-top: 1px solid var(--bd); }
.sb-topics__label { display: block; font-size: .55rem; font-weight: 800; color: var(--txl); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .35rem; }

.sb-topics__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .35rem .4rem;
    text-decoration: none;
    border-radius: .4rem;
    transition: all .25s;
}

.sb-topics__row:hover { background: var(--c1bg); padding-right: .6rem; }
.sb-topics__name { font-size: var(--fx); font-weight: 600; color: var(--tx); transition: color .25s; }
.sb-topics__row:hover .sb-topics__name { color: var(--c1); }

.sb-topics__badge {
    min-width: 1.3rem;
    height: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 .3rem;
    background: var(--bg);
    color: var(--txl);
    border-radius: 2rem;
    font-size: .55rem;
    font-weight: 700;
    border: 1px solid var(--bd);
    transition: all .25s;
}

.sb-topics__row:hover .sb-topics__badge { background: var(--c1); color: #fff; border-color: var(--c1); transform: scale(1.1); }

.sb-tags { display: flex; flex-wrap: wrap; gap: .3rem; }

.sb-tags__pill {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    padding: .2rem .55rem;
    background: var(--bg);
    color: var(--txl);
    border: 1px solid var(--bd);
    border-radius: 2rem;
    font-size: .6rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .3s;
    line-height: 1.5;
}

.sb-tags__hash { color: var(--c1); font-weight: 800; opacity: .5; transition: opacity .25s; }

.sb-tags__pill:hover {
    background: var(--c1);
    color: #fff;
    border-color: var(--c1);
    transform: translateY(-.15rem);
    box-shadow: 0 3px 10px rgba(13, 148, 136, .2);
}

.sb-tags__pill:hover .sb-tags__hash { color: rgba(255, 255, 255, .7); opacity: 1; }


/* ══════════════════════════════════════
   ۱۹. سایدبار Dark Mode
   ══════════════════════════════════════ */

[data-theme="dark"] .sb__card { background: var(--wh); border-color: var(--bd); }
[data-theme="dark"] .sb__card:hover { border-color: rgba(13, 148, 136, .3); box-shadow: 0 4px 20px rgba(13, 148, 136, .1); }
[data-theme="dark"] .sb__card--stats { background: linear-gradient(135deg, #0D9488, #0F766E); border: none; }
[data-theme="dark"] .sb__head { border-bottom-color: var(--bd); }
[data-theme="dark"] .sb__head-title { color: var(--dk); }
[data-theme="dark"] .sb-list__link:hover { background: var(--bg); }
[data-theme="dark"] .sb-list__num { background: var(--bg); border-color: var(--bd); color: var(--txl); }
[data-theme="dark"] .sb-list__link:hover .sb-list__num { background: var(--c1); color: #fff; border-color: var(--c1); }
[data-theme="dark"] .sb-list__icon { background: var(--c1bg); }
[data-theme="dark"] .sb-list__link:hover .sb-list__icon { background: var(--c1); color: #fff; }
[data-theme="dark"] .sb-list__title { color: var(--dk); }
[data-theme="dark"] .sb-list__link:hover .sb-list__title { color: var(--c1); }
[data-theme="dark"] .sb-list__meta { color: var(--txl); }
[data-theme="dark"] .sb-list__bar { background: var(--bd); }
[data-theme="dark"] .sb__more { background: var(--bg); }
[data-theme="dark"] .sb__more:hover { background: var(--c1); color: #fff; }
[data-theme="dark"] .sb-topics--sep { border-top-color: var(--bd); }
[data-theme="dark"] .sb-topics__label { color: var(--txl); }
[data-theme="dark"] .sb-topics__name { color: var(--tx); }
[data-theme="dark"] .sb-topics__row:hover { background: var(--c1bg); }
[data-theme="dark"] .sb-topics__row:hover .sb-topics__name { color: var(--c1); }
[data-theme="dark"] .sb-topics__badge { background: var(--bg); border-color: var(--bd); color: var(--txl); }
[data-theme="dark"] .sb-topics__row:hover .sb-topics__badge { background: var(--c1); color: #fff; border-color: var(--c1); }
[data-theme="dark"] .sb-tags__pill { background: var(--bg); border-color: var(--bd); color: var(--txl); }
[data-theme="dark"] .sb-tags__pill:hover { background: var(--c1); color: #fff; border-color: var(--c1); }


/* ══════════════════════════════════════
   ۲۰. ریسپانسیو
   ══════════════════════════════════════ */

@media (max-width: 64rem) {
    .site-content__wrap { grid-template-columns: 1fr; }

    .sb {
        position: static;
        max-height: none;
        overflow-y: visible;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--sm);
    }

    .sb__card--stats { grid-column: 1 / -1; }
    .sb-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 48rem) {
    .sb { grid-template-columns: 1fr; }
    .post-nav { grid-template-columns: 1fr; }
    .post-single__meta { flex-direction: column; align-items: flex-start; gap: var(--ss); }
    .search-item { flex-direction: column; }
    .search-item__thumb { width: 100%; height: 10rem; }
    .code-single__title { font-size: var(--fl); }
}

@media (prefers-reduced-motion: reduce) {
    .sb-anim { opacity: 1 !important; transform: none !important; animation: none !important; }
    .sb-list__item { opacity: 1 !important; animation: none !important; }
    .sb__head-dot { animation: none !important; }
}