@font-face {
    font-family: Vazir;
    src: url(../fonts/Vazirmatn-SemiBold.woff2);
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #fff6fb;
    --surface: #fffafd;
    --text: #2b2b2b;
    --accent: #f7a8c4;
    --accent-2: #f7d6e0;
    --border: #000;
    --shadow: 8px 8px 0px #000;
    --radius: 0;
    --transition: .3s ease;
}

[data-theme="dark"] {
    --bg: #121212;
    --surface: #1f1f1f;
    --text: #f8f8f8;
    --accent:#a0254a;
    --accent-2:#a9345d;
    --border: #ffffff;
    --shadow: 8px 8px 0px #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Vazir, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
    overflow-wrap: break-word;
    word-wrap: break-word;
}

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

a {
    text-decoration: none;
    color: inherit;
}

.container {
    width: min(1200px, 90%);
    margin: auto;
    overflow-wrap: break-word;
    word-wrap: break-word;
    min-width: 0;
}

section {
    padding: 5rem 0;
}

h1, h2, h3 {
    font-weight: 900;
    line-height: 1.1;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
}

h2 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    margin-bottom: 2rem;
}

h3 {
    font-size: 1.4rem;
}

/* Neo-card */

.neo-card {
    background: var(--surface);
    border: 4px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: all .25s ease;
}

.neo-card:hover {
    transform: translate(-4px, -4px);
}

.neo-card li {
    list-style: none;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: 4px solid var(--border);
    padding: 1rem 1.5rem;
    font-weight: 800;
    cursor: pointer;
    transition: all .2s ease;
    font-family: inherit;
    font-size: inherit;
}

.btn:hover {
    transform: translate(-3px, -3px);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-secondary {
    background: var(--accent-2);
    color: black;
}

/* Header / Nav */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg);
    border-bottom: 4px solid var(--border);
}

.site-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1;
}

.site-logo img {
    height: 32px;
}

.site-header-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.theme-toggle {
    border: 3px solid var(--border);
    background: var(--surface);
    padding: .75rem;
    cursor: pointer;
    font-size: 1rem;
}

.lang-toggle {
    border: 3px solid var(--border);
    background: var(--accent-2);
    color: var(--text);
    padding: .75rem 1rem;
    cursor: pointer;
    font-weight: 800;
    font-family: inherit;
}

/* Hero / Site Header Content */

.site-header-content {
    padding: 4rem 0;
    text-align: center;
}

.site-header-content h1 {
    margin-bottom: 1rem;
}

.site-header-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.8;
}

/* Post Feed */

.post-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    min-width: 0;
}

/* Post Card */

.post-card {
    background: var(--surface);
    border: 4px solid var(--border);
    box-shadow: var(--shadow);
    transition: all .25s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translate(-4px, -4px);
}

.post-card-image-link {
    display: block;
    overflow: hidden;
    border-bottom: 4px solid var(--border);
}

.post-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.post-card:hover .post-card-image {
    transform: scale(1.05);
}

.post-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-content-link {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-header {
    margin-bottom: .75rem;
}

.post-card-title {
    font-size: 1.3rem;
    font-weight: 900;
    line-height: 1.2;
}

.post-card-tags {
    margin-bottom: .75rem;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.post-card-primary-tag a {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: .25rem .75rem;
    border: 3px solid var(--border);
    font-weight: 700;
    font-size: .8rem;
    text-transform: uppercase;
}

.post-card-excerpt {
    flex: 1;
    opacity: 0.8;
    font-size: .95rem;
    margin-bottom: 1rem;
}

.post-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .85rem;
    opacity: 0.7;
    padding-top: 1rem;
    border-top: 2px solid var(--border);
}

.post-card-reading-time {
    font-weight: 700;
}

/* Article / Single Post */

.article {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    min-width: 0;
}

.article-header {
    margin-bottom: 3rem;
}

.article-tag {
    margin-bottom: 1rem;
}

.article-tag a {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: .25rem .75rem;
    border: 3px solid var(--border);
    font-weight: 700;
    font-size: .8rem;
    text-transform: uppercase;
}

.article-title {
    margin-bottom: 1rem;
}

.article-excerpt {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 1.5rem;
}

.article-image {
    margin-bottom: 2rem;
}

.article-image img {
    width: 100%;
    border: 4px solid var(--border);
}

.article-byline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--surface);
    border: 3px solid var(--border);
}

.article-byline-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-list {
    display: flex;
    list-style: none;
    gap: -.5rem;
}

.author-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 0;
    border: 3px solid var(--border);
}

.article-byline-meta h4 {
    font-size: 1rem;
    font-weight: 800;
}

.byline-meta-content {
    font-size: .85rem;
    opacity: 0.7;
}

/* Article Content */

.gh-content {
    font-size: 1.1rem;
    line-height: 1.8;
    overflow-wrap: break-word;
    word-wrap: break-word;
    min-width: 0;
}

.gh-content h2 {
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.gh-content h3 {
    margin-top: 2rem;
    margin-bottom: .75rem;
}

.gh-content p {
    margin-bottom: 1.5rem;
}

.gh-content img {
    border: 4px solid var(--border);
    margin: 0;
}

.gh-content blockquote {
    border-left: 6px solid var(--accent);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: var(--surface);
    border: 3px solid var(--border);
    font-style: italic;
}

.gh-content pre {
    background: var(--surface);
    border: 4px solid var(--border);
    padding: 1.5rem;
    overflow-x: auto;
    margin: 2rem 0;
    font-size: .9rem;
}

.gh-content code {
    background: var(--surface);
    border: 2px solid var(--border);
    padding: .15rem .4rem;
    font-size: .9em;
}

.gh-content pre code {
    border: none;
    padding: 0;
}

.gh-content ul, .gh-content ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.gh-content li {
    margin-bottom: .5rem;
}

.gh-content a {
    color: var(--accent);
    font-weight: 700;
    border-bottom: 2px solid var(--border);
}

.gh-content a:hover {
    background: var(--accent);
    color: white;
}

/* Pagination */

.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
    padding: 2rem 0;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    padding: 0 1rem;
    font-weight: 800;
    transition: all .2s ease;
}

.pagination a {
    background: var(--surface);
    box-shadow: 4px 4px 0px var(--border);
}

.pagination a:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--border);
}

.pagination .page-number {
    background: var(--accent);
    color: white;
    box-shadow: 4px 4px 0px var(--border);
}

/* Tag / Author Archives */

.archive-header {
    padding: 4rem 0 2rem;
    text-align: center;
    border-bottom: 4px solid var(--border);
    margin-bottom: 3rem;
}

.archive-header h2 {
    margin-bottom: .5rem;
}

.archive-header p {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Author Card */

.author-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--surface);
    border: 4px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
}

.author-card img {
    width: 80px;
    height: 80px;
    border: 4px solid var(--border);
}

.author-card h3 {
    margin-bottom: .25rem;
}

.author-card p {
    opacity: 0.8;
}

/* Footer */

.site-footer {
    border-top: 4px solid var(--border);
    padding: 3rem 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-grid h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-grid ul {
    list-style: none;
}

.footer-grid li {
    margin-top: .75rem;
}

.footer-grid a {
    transition: color var(--transition);
}

.footer-grid a:hover {
    color: var(--accent);
}

.site-footer-social-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.site-footer-social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    background: var(--surface);
    transition: all .2s ease;
}

.site-footer-social-links a:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0px var(--border);
}

.copyright {
    text-align: center;
    font-weight: 700;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}

/* Error Page */

.error-page {
    text-align: center;
    padding: 8rem 0;
}

.error-page h1 {
    font-size: 8rem;
    line-height: 1;
    margin-bottom: 1rem;
}

.error-page p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Animations */

.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: .6s ease;
}

.fade-up.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */

@media (max-width: 992px) {
    .post-feed {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .post-feed {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .article-byline {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .article-byline-content {
        flex-direction: column;
    }

    section {
        padding: 3rem 0;
    }

    .author-card {
        flex-direction: column;
        text-align: center;
    }
}

/* RTL */

html[lang="fa"] body {
    direction: rtl;
    font-family: Vazir, sans-serif;
}

/*html[lang="fa"] .pagination {
    flex-direction: row-reverse;
}*/

/* Ghost content card overrides */

.gh-content .kg-card {
    border: 4px solid var(--border);
    margin: 2rem 0;
}

.gh-content .kg-gallery-card {
    border: none;
    margin: 0;
    padding: 0;
}

.gh-content .kg-gallery-container {
    border: none;
    margin: 0;
    padding: 0;
}

.gh-content .kg-image-card {
    border: none;
    padding: 0;
}

.gh-content .kg-image-card img {
    border: none;
    display: block;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    height: auto;
}

.kg-image-card {
  direction: rtl;
}

/* Comments */

.article-comments {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 4px solid var(--border);
}

/* Footer CTA */

.footer-cta {
    padding: 4rem 0;
    text-align: center;
}

.footer-cta-title {
    margin-bottom: 1.5rem;
}

.footer-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    border: 4px solid var(--border);
    padding: 1rem 2rem;
    background: var(--accent);
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    transition: all .2s ease;
}

.footer-cta-button:hover {
    transform: translate(-3px, -3px);
    box-shadow: 6px 6px 0px var(--border);
    color: white;
}

/* Read More */

.read-more-wrap {
    padding: 3rem 0;
    border-top: 4px solid var(--border);
}

.read-more h3 {
    margin-bottom: 2rem;
    text-align: center;
}

/* Ghost Editor Cards - Required by GScan */

.kg-width-wide {
    max-width: 900px;
    margin-left: -40px;
    margin-right: -40px;
}

.kg-width-full {
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
}

.kg-gallery-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
}

.kg-gallery-row {
    display: flex;
    gap: 2px;
    direction: ltr;
}

.kg-gallery-image {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.kg-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.kg-bookmark-card {
    margin: 2rem 0;
    border: 4px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.kg-bookmark-container {
    display: flex;
    text-decoration: none;
    color: var(--text);
}

.kg-bookmark-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.kg-bookmark-title {
    font-size: 1.2rem;
    font-weight: 900;
    margin-bottom: .5rem;
    line-height: 1.3;
}

.kg-bookmark-description {
    font-size: .9rem;
    opacity: .8;
    margin-bottom: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .85rem;
    margin-top: auto;
}

.kg-bookmark-icon {
    width: 20px;
    height: 20px;
}

.kg-bookmark-author {
    font-weight: 700;
}

.kg-bookmark-publisher {
    opacity: .7;
}

.kg-bookmark-thumbnail {
    width: 220px;
    min-height: 160px;
    flex-shrink: 0;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kg-nft-card {
    border: 4px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin: 2rem 0;
}

.kg-header-card {
    padding: 3rem;
    text-align: center;
    border: 4px solid var(--border);
    box-shadow: var(--shadow);
    margin: 2rem auto;
    max-width: 100%;
}

.kg-header-card h2 {
    margin-bottom: 1rem;
}

.kg-header-card .kg-header-card-description {
    margin-top: .5rem;
}

.kg-header-card .kg-button {
    display: inline-block;
    margin-top: 1rem;
    padding: 1rem 2rem;
    background: var(--accent);
    color: white;
    border: 3px solid var(--border);
    box-shadow: 4px 4px 0px var(--border);
    font-weight: 800;
    text-decoration: none;
    transition: all .2s ease;
}

.kg-header-card .kg-button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--border);
}

/*html[lang="fa"] .kg-header-card {
    box-shadow: -8px 8px 0px var(--border);
}*/

.kg-button-card {
    border: 4px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
}

.kg-file-card {
    border: 4px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.kg-audio-card {
    border: 4px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin: 2rem 0;
}

.kg-video-card {
    border: 4px solid var(--border);
    box-shadow: var(--shadow);
    margin: 2rem 0;
}

