/* Blog layout — extends sample.css */

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

.blog-wrap {
    position: relative;
    z-index: 1;
    max-width: 820px;
    margin: 0 auto;
    padding: 28px 24px 60px;
}

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

.blog-header .back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
}

.post-article.panel {
    padding: 28px 32px;
}

.post-article h1 {
    font-size: 1.65rem;
    text-align: right;
    margin-bottom: 18px;
    line-height: 1.35;
}

.post-article h2,
.post-article h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--cyan);
    margin: 28px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--stroke);
}

.post-article p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 12px 0;
    line-height: 1.75;
}

.post-article p strong {
    color: var(--text-primary);
}

.post-article ul {
    margin: 12px 24px 16px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.75;
}

.post-article li {
    margin: 6px 0;
}

.post-article li::marker {
    color: var(--cyan);
}

.post-note {
    background: var(--cyan-glow);
    border: 1px solid rgba(34, 211, 238, 0.25);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 14px 0;
}

.post-article code {
    background: rgba(15, 23, 42, 0.6);
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid var(--stroke);
    font-size: 0.85em;
    color: var(--cyan);
}

.code-block {
    position: relative;
    margin: 16px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--stroke);
    background: rgba(7, 10, 18, 0.85);
}

.code-block pre {
    margin: 0;
    padding: 18px 20px;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
    font-family: "SF Mono", "Fira Code", ui-monospace, monospace;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-primary);
    background: transparent;
}

.code-block .code-copy {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--stroke);
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    font-family: inherit;
    transition: all 0.15s ease;
}

.code-block .code-copy:hover {
    color: var(--cyan);
    border-color: rgba(34, 211, 238, 0.35);
    background: var(--cyan-glow);
}

.code-block .code-copy.copied {
    color: var(--green);
    border-color: rgba(16, 185, 129, 0.3);
    background: var(--green-glow);
}

.post-figure {
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--stroke);
    background: var(--bg-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-figure:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.post-figure img {
    display: block;
    width: 100%;
    height: auto;
}

.post-media-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin: 20px 0;
}

.post-media-row .post-thumb {
    flex-shrink: 0;
    width: 120px;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow-sm);
}

.post-footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--stroke);
    text-align: center;
}

.post-footer .btn.primary {
    text-decoration: none;
}

/* Index */
.index-hero {
    text-align: center;
    margin-bottom: 32px;
}

.index-hero p {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 480px;
    margin: 10px auto 0;
}

.post-grid {
    display: grid;
    gap: 16px;
}

.post-card {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 20px 22px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.post-card:hover {
    transform: translateY(-2px);
    border-color: rgba(34, 211, 238, 0.35);
}

.post-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    background: none;
    -webkit-text-fill-color: unset;
}

.post-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
}

.post-card .read-more {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cyan);
}

.post-card .pill {
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .blog-wrap { padding: 16px 16px 48px; }
    .post-article.panel { padding: 20px 18px; }
    .post-media-row { flex-direction: column; align-items: center; text-align: center; }
    .post-media-row .post-thumb { width: 100px; }
    .post-figure.hero-hide-mobile { display: none; }
}
