/* ------------------------------------------------------------------ *
 * Blog index + article pages
 * ------------------------------------------------------------------ */
body.blog-body {
    background: #f8f8f8;
    line-height: 1.5;
}

/* Blog listing */
.blog-hero {
    margin-top: var(--header-h);
    padding: 70px 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #fff;
    text-align: center;
}
.blog-hero h1 {
    font-size: 44px;
    font-weight: 300;
    letter-spacing: 6px;
    margin-bottom: 16px;
}
.blog-hero p {
    font-size: 14px;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.7);
}

.filter-section {
    padding: 30px 0;
    background: #fff;
    border-bottom: 1px solid #eee;
}
.filter-select {
    padding: 12px 40px 12px 18px;
    border: 1px solid #ddd;
    font-size: 14px;
    letter-spacing: 0.5px;
    min-width: 200px;
    background: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    font-family: inherit;
}
.filter-select:focus { outline: none; border-color: #000; }

.blog-grid { padding: 50px 0; }

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}
.blog-card {
    background: #fff;
    padding: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: box-shadow 0.4s ease, transform 0.4s ease;
    position: relative;
    overflow: hidden;
}
.blog-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: linear-gradient(180deg, #000 0%, #666 100%);
    transform: scaleY(0);
    transition: transform 0.4s ease;
}
.blog-card:hover,
.card-link:focus-visible .blog-card {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}
.blog-card:hover::before,
.card-link:focus-visible .blog-card::before { transform: scaleY(1); }

.card-category {
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 12px;
}
.card-title {
    font-size: 19px;
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 14px;
    color: #000;
}
.card-excerpt {
    font-size: 14px;
    color: #555;
    line-height: 1.65;
    margin-bottom: 20px;
    flex-grow: 1;
}
.card-meta {
    font-size: 12px;
    color: #999;
    letter-spacing: 0.5px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}
.card-meta span { display: inline-flex; align-items: center; gap: 6px; }

.article-card { margin-bottom: 30px; display: flex; }
.article-card.hidden { display: none; }

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
    letter-spacing: 0.5px;
    display: none;
}

/* Article hero */
.article-hero {
    margin-top: var(--header-h);
    padding: 70px 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #fff;
}
.article-hero .container { max-width: 800px; }
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 1px;
    margin-bottom: 22px;
    transition: color 0.3s;
}
.back-link:hover,
.back-link:focus-visible { color: rgba(255,255,255,0.9); }

.article-title {
    font-size: 38px;
    font-weight: 300;
    letter-spacing: 0.5px;
    line-height: 1.3;
    margin-bottom: 26px;
}
.article-meta {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.5px;
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
}
.article-meta span { display: inline-flex; align-items: center; gap: 8px; }

/* Article body */
.article-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px;
    line-height: 1.8;
    color: #333;
}
.article-content h1 { font-size: 30px; font-weight: 300; margin: 50px 0 22px; }
.article-content h2 { font-size: 26px; font-weight: 300; margin: 45px 0 18px; }
.article-content h3 { font-size: 21px; font-weight: 400; margin: 35px 0 14px; }
.article-content p  { font-size: 17px; margin-bottom: 22px; color: #444; }
.article-content strong { color: #000; }
.article-content code {
    background: #f4f4f4;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 14px;
    color: #c7254e;
    font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
}
.article-content pre {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 25px;
    margin: 30px 0;
    overflow-x: auto;
    position: relative;
}
.article-content pre code {
    background: none;
    color: #f8f8f2;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
}
.code-block-wrapper { position: relative; }
.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #ddd;
    padding: 6px 12px;
    font-size: 11px;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
    text-transform: uppercase;
    font-family: inherit;
}
.copy-btn:hover,
.copy-btn:focus-visible { background: rgba(255,255,255,0.2); color: #fff; }
.copy-btn.copied { background: #4CAF50; border-color: #4CAF50; color: #fff; }

.article-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 15px;
}
.article-table th,
.article-table td { padding: 12px 15px; border: 1px solid #ddd; }
.article-table th {
    background: #f5f5f5;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}
.article-table tr:nth-child(even) { background: #fafafa; }

.article-content blockquote {
    margin: 30px 0;
    padding: 20px 25px;
    border-left: 4px solid #000;
    background: #f8f8f8;
    font-style: italic;
    color: #555;
}
.article-content blockquote strong { color: #000; font-style: normal; }

.article-content ul,
.article-content ol { margin: 22px 0; padding-left: 25px; }
.article-content li { margin-bottom: 8px; font-size: 17px; color: #444; }

.article-content hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 40px 0;
}

.article-tags {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}
.article-tags span {
    display: inline-block;
    padding: 6px 14px;
    background: #f5f5f5;
    margin: 5px 8px 5px 0;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: #555;
}

.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    padding: 14px 28px;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: background-color 0.3s;
}
.back-to-blog:hover,
.back-to-blog:focus-visible { background: #333; color: #fff; }

@media (max-width: 768px) {
    .blog-hero { margin-top: var(--header-h); padding: 50px 0; }
    .blog-hero h1 { font-size: 30px; letter-spacing: 3px; }
    .blog-card { padding: 24px; }

    .article-hero { margin-top: var(--header-h); padding: 50px 0; }
    .article-title { font-size: 26px; }
    .article-content { padding: 40px 16px; }
    .article-content h2 { font-size: 22px; }
    .article-content h3 { font-size: 19px; }
}
