/* Blog styles — layered on top of styles.css (loaded after it).
   Blog pages do NOT load localization.js/script.js, so the language button
   styles (runtime-injected on the homepage) are replicated statically here. */

/* ---------- Article shell ---------- */
.blog-article {
    max-width: 72ch;
    margin: 0 auto;
    padding: 9rem 1.5rem 4rem;
    color: var(--text-secondary);
    line-height: 1.75;
    font-size: 1.0625rem;
}

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

.blog-article h1 {
    font-size: clamp(1.9rem, 4.5vw, 2.75rem);
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.blog-article h2 {
    font-size: clamp(1.4rem, 3vw, 1.75rem);
    color: var(--text-primary);
    margin: 3rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.25);
    letter-spacing: -0.01em;
}

.blog-article h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 2rem 0 0.75rem;
}

.blog-article p {
    margin-bottom: 1.25rem;
}

.blog-article ul,
.blog-article ol {
    margin: 0 0 1.25rem 1.5rem;
}

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

.blog-article a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(79, 172, 254, 0.35);
    transition: var(--transition-smooth);
}

.blog-article a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--accent-color);
}

.blog-article blockquote {
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    border-left: 3px solid var(--primary-color);
    background: var(--background-card);
    border-radius: 0 12px 12px 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

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

/* ---------- Post meta + byline ---------- */
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

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

.byline {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.byline img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(102, 126, 234, 0.4);
}

.byline .byline-name {
    color: var(--text-primary);
    font-weight: 600;
    display: block;
    line-height: 1.3;
}

.byline .byline-role {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: block;
}

/* ---------- Prompt example blocks ---------- */
.blog-article pre {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.blog-article pre code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--text-secondary);
    background: none;
    padding: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.blog-article code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: var(--background-glass);
    padding: 0.15em 0.4em;
    border-radius: 6px;
    font-size: 0.9em;
    color: var(--text-primary);
}

.prompt-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.5rem;
}

.prompt-label.naive {
    background: rgba(245, 87, 108, 0.15);
    color: #f5576c;
    border: 1px solid rgba(245, 87, 108, 0.35);
}

.prompt-label.engineered {
    background: rgba(56, 239, 125, 0.12);
    color: #38ef7d;
    border: 1px solid rgba(56, 239, 125, 0.3);
}

/* ---------- Pattern selection table ---------- */
.table-scroll {
    overflow-x: auto;
    margin: 0 0 1.5rem;
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 12px;
}

.blog-article table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 560px;
}

.blog-article th {
    text-align: left;
    color: var(--text-primary);
    background: rgba(102, 126, 234, 0.12);
    padding: 0.75rem 1rem;
}

.blog-article td {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: top;
}

.blog-article td:first-child {
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
}

/* ---------- End-of-article CTA ---------- */
.article-cta {
    margin-top: 3.5rem;
    padding: 2rem;
    background: var(--background-card);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: var(--border-radius);
    text-align: center;
    backdrop-filter: blur(10px);
}

.article-cta h2 {
    border-bottom: none;
    margin: 0 0 0.75rem;
    padding-bottom: 0;
}

.article-cta p {
    color: var(--text-secondary);
    max-width: 46ch;
    margin: 0 auto 1.5rem;
}

.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.cta-buttons a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    border-bottom: none;
    transition: var(--transition-smooth);
}

.cta-buttons .cta-primary {
    background: var(--primary-gradient);
    color: #ffffff;
}

.cta-buttons .cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    color: #ffffff;
}

.cta-buttons .cta-secondary {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.4);
    color: var(--text-secondary);
}

.cta-buttons .cta-secondary:hover {
    background: rgba(102, 126, 234, 0.2);
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* ---------- Static language toggle (mirror of runtime-injected styles) ---------- */
.language-switcher {
    margin-left: 1rem;
}

a.language-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    font-family: var(--font-primary);
    text-decoration: none;
}

a.language-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    color: var(--text-primary);
    transform: translateY(-2px);
}

a.language-btn i {
    font-size: 1rem;
}

/* ---------- Blog index tweaks ---------- */
.blog-index-header {
    padding-top: 9rem;
    text-align: center;
}

.blog-view-all {
    text-align: center;
    margin-top: 2.5rem;
}

.blog-view-all a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.blog-view-all a:hover {
    color: var(--text-primary);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .blog-article {
        padding: 7rem 1.25rem 3rem;
        font-size: 1rem;
    }

    .language-switcher {
        margin-left: 0;
        margin-right: 0;
    }

    a.language-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}
