/* VahidBlogTheme: typography-led, responsive, bilingual and framework-free. */
:root {
    color-scheme: light;
    --bg: #fafaf8;
    --surface: #ffffff;
    --text: #20252b;
    --muted: #68727e;
    --line: #e7e8e6;
    --accent: #0f766e;
    --accent-wash: #e6f6f1;
    --code-bg: #f1f3f4;
    --code-text: #283543;
    --shadow: 0 6px 32px rgba(20, 25, 30, 0.035);
    --sans: "Inter", "Vazirmatn", system-ui, -apple-system, sans-serif;
    --persian: "Vazirmatn", "Inter", system-ui, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #111519;
    --surface: #171d23;
    --text: #e9edf0;
    --muted: #a5adb6;
    --line: #303940;
    --accent: #69d5bb;
    --accent-wash: #133a35;
    --code-bg: #1e272e;
    --code-text: #e2e8ec;
    --shadow: none;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: .18em;
}

    a:hover {
        text-decoration-thickness: 2px;
    }

    a:focus-visible, button:focus-visible {
        outline: 3px solid var(--accent);
        outline-offset: 3px;
    }

img, svg {
    max-width: 100%;
}

img {
    height: auto;
}

button {
    font: inherit;
}

::selection {
    background: var(--accent-wash);
    color: var(--text);
}

.skip-link {
    position: fixed;
    z-index: 99;
    top: -100px;
    inset-inline-start: 1rem;
    background: var(--text);
    color: var(--bg);
    padding: .6rem 1rem;
    border-radius: 8px;
}

    .skip-link:focus {
        top: 1rem;
    }

/* Top navigation */
.site-header {
    border-bottom: 1px solid var(--line);
    background: var(--bg);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    max-width: 1100px;
    min-height: 86px;
    margin-inline: auto;
    padding-inline: clamp(20px, 4vw, 36px);
}


/* Personal publication branding */

.site-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    line-height: 1.3;
}

    .site-brand .brand-name {
        font-family: "Inter", sans-serif;
        font-size: 19px;
        font-weight: 700;
        letter-spacing: -0.035em;
        color: var(--text-primary, #f1f5f9);
    }

    .site-brand .brand-description {
        font-family: "Inter", sans-serif;
        font-size: 11px;
        font-weight: 400;
        letter-spacing: 0.01em;
        color: var(--muted, #94a3b8);
    }

    .site-brand:hover .brand-name {
        color: var(--accent, #5eead4);
    }

@media (max-width: 600px) {
    .site-brand .brand-name {
        font-size: 17px;
    }

    .site-brand .brand-description {
        font-size: 10px;
    }
}


.accent {
    color: var(--accent);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.primary-nav {
    min-width: 0;
}

.menu-list, .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px 24px;
}

.nav-item {
    position: relative;
}

.primary-nav a, .primary-nav .nav-link {
    display: inline-block;
    padding: 8px 0;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

    .primary-nav a:hover, .primary-nav a[aria-current="page"] {
        color: var(--accent);
    }

.sub-menu {
    position: absolute;
    z-index: 20;
    top: 100%;
    inset-inline-start: 0;
    min-width: 185px;
    padding: 9px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: none;
}

.has-children:hover > .sub-menu, .has-children:focus-within > .sub-menu {
    display: block;
}

.sub-menu .nav-item > a {
    width: 100%;
    padding-block: 9px;
}

.theme-toggle, .nav-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}

.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

    .theme-toggle:hover {
        color: var(--accent);
        border-color: var(--accent);
    }

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    flex-direction: column;
    gap: 4px;
    border-radius: 10px;
}

    .nav-toggle span {
        display: block;
        background: currentColor;
        height: 2px;
        width: 17px;
        border-radius: 3px;
    }

/* Page geometry */
.site-main {
    width: min(100% - 40px, 760px);
    margin: 0 auto;
    min-height: 58vh;
}

.blog-intro {
    width: min(100% - 40px, 760px);
    margin: 0 auto;
    padding: clamp(64px, 10vw, 115px) 0 48px;
}

.eyebrow {
    display: block;
    margin: 0 0 19px;
    font-size: 11px;
    line-height: 1.5;
    letter-spacing: .17em;
    font-weight: 700;
    color: var(--accent);
}

.blog-intro h1 {
    margin: 0;
    font-size: clamp(43px, 6vw, 65px);
    line-height: 1.13;
    font-weight: 750;
    letter-spacing: -.055em;
}

.blog-intro p {
    max-width: 620px;
    margin: 23px 0 0;
    font-size: clamp(17px, 2.2vw, 20px);
    line-height: 1.75;
    color: var(--muted);
}

.post-list {
    padding: 0 0 80px;
}

.post-row {
    padding: 30px 0 32px;
    border-top: 1px solid var(--line);
}

.post-row-meta, .article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.meta-dot {
    color: var(--accent);
}

.post-row > a {
    text-decoration: none;
}

.post-row-title {
    color: var(--text);
    font-size: clamp(21px, 3.1vw, 27px);
    font-weight: 700;
    letter-spacing: -.036em;
    line-height: 1.38;
    margin: 11px 0 8px;
    transition: color .15s ease;
}

.post-row > a:hover .post-row-title {
    color: var(--accent);
}

.post-row-description {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.75;
}

.blog-pagination {
    padding: 28px 0 5px;
}

    .blog-pagination a {
        display: inline-block;
        margin-inline-end: 15px;
        text-decoration: none;
        font-size: 14px;
        font-weight: 600;
    }

    .blog-pagination .pagination, .blog-pagination ul {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        padding: 0;
        margin: 0;
        list-style: none;
    }

/* Article page: no large masthead image. */
.article-page {
    padding: clamp(55px, 8vw, 94px) 0 80px;
}

.article-header {
    padding-bottom: 31px;
    margin-bottom: 38px;
    border-bottom: 1px solid var(--line);
}

.article-title {
    margin: 0 0 18px;
    font-size: clamp(37px, 5vw, 57px);
    line-height: 1.2;
    font-weight: 750;
    letter-spacing: -.053em;
    overflow-wrap: break-word;
}

.article-subtitle {
    margin: 0 0 22px;
    font-size: 20px;
    line-height: 1.6;
    color: var(--muted);
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 25px;
    border-top: 1px solid var(--line);
    margin-top: 55px;
    padding-top: 25px;
}

.back-link {
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

    .back-link:hover {
        text-decoration: underline;
    }

.article-taxonomies {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

    .article-taxonomies a, .article-taxonomies .badge {
        display: inline-block;
        border: 1px solid var(--line);
        border-radius: 100px;
        padding: 3px 12px;
        color: var(--muted);
        font-size: 12px;
        text-decoration: none;
        background: var(--surface);
    }

        .article-taxonomies a:hover {
            color: var(--accent);
            border-color: var(--accent);
        }

/* Body, markdown and typography */
.prose {
    font-size: 17.5px;
    line-height: 1.9;
    overflow-wrap: break-word;
}

    .prose p {
        margin: 0 0 1.45em;
    }

    .prose h2, .prose h3, .prose h4 {
        letter-spacing: -.035em;
        line-height: 1.35;
        color: var(--text);
        scroll-margin-top: 25px;
    }

    .prose h2 {
        font-size: 29px;
        margin: 2.15em 0 .75em;
    }

    .prose h3 {
        font-size: 23px;
        margin: 1.8em 0 .65em;
    }

    .prose h4 {
        font-size: 19px;
        margin: 1.6em 0 .6em;
    }

    .prose ul, .prose ol {
        padding-inline-start: 1.6em;
        margin: 0 0 1.65em;
    }

    .prose li {
        margin-bottom: .5em;
        padding-inline-start: .1em;
    }

        .prose li > p {
            margin-bottom: .5em;
        }

    .prose img {
        display: block;
        max-width: 100%;
        margin: 2rem auto;
        border-radius: 9px;
    }

    .prose blockquote {
        margin: 2rem 0;
        padding: .3rem 0 .3rem 1.2rem;
        border-inline-start: 3px solid var(--accent);
        color: var(--muted);
        font-style: italic;
    }

        .prose blockquote p:last-child {
            margin-bottom: 0;
        }

    .prose hr {
        border: 0;
        border-top: 1px solid var(--line);
        margin: 3rem 0;
    }

    .prose table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        border-collapse: collapse;
        font-size: 14px;
        line-height: 1.6;
        margin: 1.8rem 0;
    }

    .prose th, .prose td {
        padding: 11px 14px;
        border-bottom: 1px solid var(--line);
        text-align: start;
    }

    .prose th {
        font-weight: 700;
        background: var(--surface);
    }

    .prose a {
        text-decoration: underline;
    }

    .prose code, .prose kbd, .prose samp {
        font-family: var(--mono);
        font-size: .83em;
        letter-spacing: -.015em;
        font-variant-ligatures: none;
    }

    .prose :not(pre) > code {
        border: 1px solid var(--line);
        background: var(--code-bg);
        color: var(--code-text);
        padding: .16em .38em;
        border-radius: 5px;
        white-space: break-spaces;
    }

    .prose pre {
        position: relative;
        direction: ltr;
        text-align: left;
        unicode-bidi: isolate;
        margin: 1.8rem 0 2rem;
        padding: 22px 21px;
        border-radius: 11px;
        background: var(--code-bg);
        color: var(--code-text);
        border: 1px solid var(--line);
        overflow-x: auto;
        tab-size: 4;
        line-height: 1.65;
        font-size: 13.5px;
    }

        .prose pre code {
            display: block;
            width: max-content;
            min-width: 100%;
            padding: 0 35px 0 0;
            color: inherit;
            background: none;
            border: 0;
            white-space: pre;
            font-size: inherit;
        }

.code-copy {
    position: absolute;
    top: 9px;
    right: 9px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 4px 9px;
    border-radius: 5px;
    cursor: pointer;
    font-family: var(--sans);
    font-size: 11px;
}

    .code-copy:hover {
        color: var(--accent);
    }

/* Language / RTL: article direction chosen from title if needed. */
:lang(fa) {
    font-family: var(--persian);
    letter-spacing: 0;
}

[dir="rtl"] .article-title, [dir="rtl"] .post-row-title, [dir="rtl"] .prose h2, [dir="rtl"] .prose h3, [dir="rtl"] .prose h4, [dir="rtl"] .blog-intro h1 {
    letter-spacing: normal;
}

[dir="rtl"] .prose {
    line-height: 2.1;
}

    [dir="rtl"] .prose blockquote {
        padding-inline-start: 1.2rem;
        padding-inline-end: 0;
    }

[dir="rtl"] .back-link {
    direction: ltr;
    unicode-bidi: isolate;
}

.article-page[lang="fa"] .article-title {
    font-size: clamp(35px, 5vw, 52px);
    line-height: 1.55;
}

.post-row[lang="fa"] .post-row-title {
    line-height: 1.65;
}

/* Generic headings, forms, and alerts for other Orchard content types. */
.site-main > h1 {
    margin-top: 2.5rem;
}

.site-main input, .site-main textarea, .site-main select {
    max-width: 100%;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    padding: 9px 12px;
    border-radius: 7px;
}

.site-main button, .site-main .btn {
    cursor: pointer;
}

.site-main .alert {
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 1rem;
    border-radius: 10px;
    margin-block: 1rem;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--line);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    width: min(100% - 40px, 1100px);
    margin: 0 auto;
    padding: 29px 0 37px;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 720px) {
    .site-header-inner {
        min-height: 70px;
        flex-wrap: wrap;
        gap: 0;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 9px 0 19px;
    }

        .site-nav.is-open {
            display: flex;
        }

    .menu-list {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 1px;
    }

    .primary-nav a {
        font-size: 15px;
        padding: 8px 0;
    }

    .sub-menu {
        display: block;
        position: static;
        box-shadow: none;
        border: 0;
        padding: 0 0 0 17px;
        background: transparent;
    }

    .article-header {
        margin-bottom: 28px;
    }

    .prose {
        font-size: 16.5px;
    }

        .prose h2 {
            font-size: 25px;
        }

        .prose pre {
            margin-inline: -3px;
            font-size: 12px;
        }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}

.site-footer {
    border-top: 1px solid var(--border, #30363d);
    padding: 28px 0;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-copyright,
.footer-tagline {
    font-size: 13px;
    color: var(--muted, #9ca3af);
}


.footer-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

    .footer-social a {
        width: 38px;
        height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        color: var(--muted, #9ca3af);
        background: transparent;
        border: 1px solid transparent;
        text-decoration: none;
        transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    }

        .footer-social a i {
            font-size: 19px;
            line-height: 1;
        }

        .footer-social a:hover {
            color: var(--accent, #5eead4);
            background: rgba(94, 234, 212, 0.08);
            border-color: rgba(94, 234, 212, 0.2);
            transform: translateY(-2px);
        }

        .footer-social a:focus-visible {
            outline: 2px solid var(--accent, #5eead4);
            outline-offset: 3px;
        }


@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
}

/* Commenting */

.article-comments {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(128, 128, 128, .25);
}

    .article-comments h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

.comment-form {
    display: grid;
    gap: 1.25rem;
}

.comment-field {
    display: grid;
    gap: .5rem;
}

    .comment-field label {
        font-size: .9rem;
        font-weight: 500;
    }

    .comment-field input,
    .comment-field textarea {
        width: 100%;
        box-sizing: border-box;
        padding: .85rem 1rem;
        border: 1px solid rgba(128, 128, 128, .35);
        border-radius: 6px;
        background: transparent;
        color: inherit;
        font: inherit;
    }

    .comment-field textarea {
        resize: vertical;
    }

.comment-submit {
    justify-self: start;
    padding: .75rem 1.25rem;
    border: 0;
    border-radius: 6px;
    background: #2563eb;
    color: white;
    font: inherit;
    cursor: pointer;
}

    .comment-submit:hover {
        background: #1d4ed8;
    }

.comment-notice {
    font-size: .85rem;
    opacity: .65;
    margin: 0;
}
