/* Shared styles for the standalone blog post pages (src/blog/*.html) */

.blog-post {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    line-height: 1.7;
}

.blog-header {
    text-align: center;
    margin-bottom: 3rem;
}

.blog-header h1 {
    font-size: 2.25rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

@media (max-width: 600px) {
    .blog-header h1 {
        font-size: 1.75rem;
    }
}

.code-block-wrapper {
    position: relative;
    border-radius: 8px;
}

.copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 0.8rem;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: "Inter", sans-serif;
    z-index: 10;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.copy-button.copied {
    background: #22c55e;
    /* green */
    color: #fff;
    border-color: #22c55e;
}


.code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.65;
}

.code-block code {
    font-family: inherit;
}

.blog-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-wrap: wrap;
    width: 100%;
    text-align: center;
}

.blog-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-meta .meta-sep {
    opacity: 0.5;
}

.blog-content {
    color: #cbd5e1;
    font-size: 1.1rem;
    line-height: 1.75;
    display: block;
    padding: 0;
}

.blog-content h2 {
    color: var(--text-primary);
    margin: 2rem 0 1rem 0;
    font-size: 1.5rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.blog-content h3 {
    color: var(--text-primary);
    margin: 1.5rem 0 0.5rem 0;
    font-size: 1.25rem;
    line-height: 1.4;
}

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

.blog-content ul,
.blog-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.blog-content li {
    margin-bottom: 0.5rem;
}

.blog-content blockquote {
    margin: 1.5rem 0;
    padding: 0.25rem 0 0.25rem 1.25rem;
    border-left: 3px solid var(--primary-color);
    color: var(--text-primary);
}

.blog-content blockquote p {
    margin-bottom: 0;
}

/* ASCII diagrams (code blocks with no language class) must scroll —
   the mobile pre-wrap rule would otherwise scramble the layout */
.blog-content pre>code:not([class]) {
    white-space: pre;
}

.code-block pre {
    color: var(--text-primary);
    margin: 0;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2rem;
    transition: var(--transition-normal);
}

.back-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--accent-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin: 1.5rem 0;
}

.warning p {
    margin: 0;
    color: var(--accent-color);
}

.info {
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin: 1.5rem 0;
}

.info p {
    margin: 0;
    color: var(--primary-color);
}

.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin: 1.5rem 0;
}

.success p {
    margin: 0;
    color: #22c55e;
}

.blog-category {
    display: inline-block;
    background: var(--gradient-secondary);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.blog-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: var(--radius-lg);
    margin: 2rem auto;
    display: block;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.table-scroll {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.blog-content table th,
.blog-content table td {
    text-align: left;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
}

.blog-content table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .blog-post {
        padding: 1rem;
    }

    .blog-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .blog-image {
        max-width: 100%;
        margin: 1rem auto;
    }
}

/* ---------------------------------------------------------
   Internal linking: breadcrumb, in-content links,
   related posts and the author box at the end of a post.
   --------------------------------------------------------- */

.post-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    margin-bottom: 1.75rem;
    color: var(--text-muted);
}

.post-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.post-breadcrumb a:hover {
    color: var(--primary-color);
}

.post-breadcrumb .crumb-sep {
    opacity: 0.5;
}

.post-breadcrumb .crumb-current {
    color: var(--text-muted);
}

/* Inline links inside the article body need to look like links */
.blog-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: rgba(20, 184, 166, 0.45);
}

.blog-content a:hover {
    color: var(--secondary-color);
    text-decoration-color: currentColor;
}

.post-related {
    margin-top: 3.5rem;
    padding-top: 2rem;
    padding-left: 0;
    padding-right: 0;
    max-width: none;
    border-top: 1px solid var(--border-color);
}

.post-related h2 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0 0 1.25rem;
}

.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.related-card {
    display: block;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    text-decoration: none;
    transition: var(--transition-normal);
}

.related-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.related-card-label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-color);
}

.related-card-title {
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--text-primary);
    margin: 0.45rem 0 0.4rem;
}

.related-card-desc {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

.post-author {
    display: flex;
    gap: 1.1rem;
    align-items: flex-start;
    margin-top: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

.post-author img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.post-author-name {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin: 0 0 0.35rem;
}

.post-author-bio {
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin: 0;
}

.post-author-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.83rem;
}

.post-author-links a {
    color: var(--primary-color);
    text-decoration: none;
}

.post-author-links a:hover {
    color: var(--secondary-color);
}

@media (max-width: 600px) {
    .post-author {
        flex-direction: column;
        gap: 0.9rem;
    }
}
