/* ============================================================
   blog.css — Blog listing + article pages
   Brand: dark bg, gold accent, Inter font, 14px radius
   ============================================================ */

/* ---- Reset stacked nav offsets from tokens.css + main.css ---- */
.blog-main, .article-page { padding-top: 0; }
.blog-hero { margin-top: 0; padding: 48px 20px 36px; text-align: center; }
.article-page { padding: 34px 20px 60px; }
.blog-hero .hero-title { font-size: clamp(2.2rem,6vw,3.6rem); font-weight:800; color:var(--text); margin-bottom:14px; letter-spacing:-0.02em; }
.blog-hero .hero-title .accent { color:var(--accent); }
.blog-hero .hero-subtitle { font-size:1.05rem; color:var(--text-muted); max-width:560px; margin:0 auto; line-height:1.6; }

/* ---- Post Cards Grid ---- */
.blog-posts { padding:20px 20px 80px; }
.posts-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(360px,1fr)); gap:24px; }

.post-card {
    background:var(--surface,#0f0f0f); border:1px solid var(--border,#2a2a2a); border-radius:var(--radius,14px);
    overflow:hidden; transition:border-color 0.3s,transform 0.3s,box-shadow 0.3s; display:flex; flex-direction:column;
}
.post-card:hover { border-color:var(--accent); transform:translateY(-4px); box-shadow:0 12px 32px rgba(255,215,0,0.06); }
.post-illustration { width:100%; height:180px; overflow:hidden; background:var(--surface-soft,#161616); }
.post-illustration svg,
.post-illustration img { width:100%; height:100%; display:block; object-fit:cover; transition:transform 0.3s; }
.post-card:hover .post-illustration svg,
.post-card:hover .post-illustration img { transform:scale(1.04); }
.post-body { padding:22px; display:flex; flex-direction:column; gap:10px; flex:1; }
.post-meta { display:flex; justify-content:space-between; align-items:center; font-size:0.78rem; }
.post-category { color:var(--accent); font-family:'IBM Plex Mono',monospace; font-size:0.62rem; text-transform:uppercase; letter-spacing:0.1em; }
.post-date { color:var(--text-muted); font-size:0.72rem; }
.post-body h3 { font-size:1.05rem; font-weight:700; color:var(--text); line-height:1.35; margin:0; }
.post-excerpt { font-size:0.85rem; color:var(--text-muted); line-height:1.55; margin:0; flex:1; }
.post-tags { display:flex; gap:7px; flex-wrap:wrap; }
.post-tags .tag { font-family:'IBM Plex Mono',monospace; font-size:0.6rem; padding:3px 9px; border-radius:14px; color:var(--accent); background:rgba(255,215,0,0.06); border:1px solid rgba(255,215,0,0.12); letter-spacing:0.04em; }
.read-link { display:inline-flex; align-items:center; gap:6px; color:var(--accent); text-decoration:none; font-weight:600; font-size:0.85rem; transition:gap 0.25s; align-self:flex-start; margin-top:4px; }
.read-link:hover { gap:10px; }

/* ---- Article Page ---- */
.article-container { max-width:760px; margin:0 auto; }
.article-header { margin-bottom:32px; padding-bottom:24px; border-bottom:1px solid var(--border); }
.article-header .post-category { display:inline-block; margin-bottom:10px; }
.article-header h1 { font-size:clamp(1.8rem,4vw,2.6rem); font-weight:800; color:var(--text); line-height:1.2; margin-bottom:10px; letter-spacing:-0.02em; }
.article-header .article-meta { display:flex; gap:16px; align-items:center; color:var(--text-muted); font-size:0.82rem; font-family:'IBM Plex Mono',monospace; }
.article-header .article-meta i { color:var(--accent); margin-right:4px; font-size:0.7rem; }
.article-content { color:var(--text-muted); line-height:1.8; font-size:1rem; }
.article-content h2 { color:var(--text); font-size:1.5rem; font-weight:700; margin:36px 0 14px; }
.article-content h3 { color:var(--text); font-size:1.2rem; font-weight:600; margin:28px 0 10px; }
.article-content p { margin-bottom:18px; }
.article-content ul, .article-content ol { margin:12px 0 20px 20px; }
.article-content li { margin-bottom:8px; }
.article-content blockquote { border-left:3px solid var(--accent); margin:24px 0; padding:12px 20px; background:rgba(255,215,0,0.04); color:var(--text); font-style:italic; border-radius:0 8px 8px 0; }
.article-content code { background:var(--surface-soft); color:var(--accent); padding:2px 7px; border-radius:4px; font-family:'IBM Plex Mono',monospace; font-size:0.85em; }
.article-content pre { background:var(--surface-soft); border:1px solid var(--border); border-radius:10px; padding:18px; overflow-x:auto; margin:20px 0; }
.article-content pre code { background:none; padding:0; color:var(--text-muted); }
.article-content strong { color:var(--text); }
.article-illustration { margin:28px 0; background:var(--surface-soft,#161616); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.article-illustration svg { width:100%; display:block; }
.article-illustration figcaption { padding:10px 16px; color:var(--text-muted); font-size:0.78rem; text-align:center; border-top:1px solid var(--border); font-family:'IBM Plex Mono',monospace; }
.article-back { display:inline-flex; align-items:center; gap:8px; color:var(--accent); text-decoration:none; font-weight:600; font-size:0.9rem; margin-top:36px; padding:10px 20px; border:1px solid var(--border); border-radius:var(--radius); transition:all 0.25s; }
.article-back:hover { border-color:var(--accent); background:rgba(255,215,0,0.04); }

/* ---- Category Section Headers ---- */
.category-section { margin-bottom:1.5rem; padding-bottom:0.5rem; border-bottom:1px solid var(--border); }
.category-heading { font-size:1.4rem; font-weight:700; color:var(--text); margin-bottom:4px; letter-spacing:-0.01em; }
.category-subtitle { font-size:0.88rem; color:var(--text-muted); line-height:1.5; margin:0; }

/* ---- Collapsible Categories ---- */
.category-details {
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}
.category-details[open] { padding-bottom: 1.5rem; }
.category-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 8px 4px;
    border-radius: 8px;
    user-select: none;
    transition: background 0.2s;
}
.category-summary::-webkit-details-marker { display: none; }
.category-summary:hover { background: rgba(255, 215, 0, 0.04); }
.category-summary .category-heading {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    margin: 0;
}
.collapse-icon {
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}
.category-details[open] .collapse-icon {
    transform: rotate(180deg);
}
.category-details[open] .posts-grid {
    animation: fadeSlideIn 0.3s ease;
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width:600px) {
    .posts-grid { grid-template-columns:1fr; }
    .post-illustration { height:150px; }
    .article-content { font-size:0.92rem; }
}
