/* =============================================================================
 * /blog and /blog/{slug}. Loaded only by .inc/views/blog/*.php.
 * Builds on theme.css (post-card, prose, cta, chips, pagination).
 * ========================================================================== */

.blog-head { position: relative; overflow: hidden; padding: 64px 0 36px; text-align: center; border-bottom: 1px solid var(--border); }
.blog-head > .container { position: relative; z-index: 1; }
.blog-head h1 { margin: .6rem auto .6rem; max-width: 20ch; }
.blog-head__lead { max-width: 60ch; margin: 0 auto 1.6rem; }
.blog-filters { justify-content: center; }
.blog-filters .chip { color: var(--text-2); }
.blog-filters .chip:hover { text-decoration: none; border-color: var(--border-strong); color: var(--text); }
.chip.is-active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--text); }
.chip--tag { font-size: .75rem; }

/* Featured (latest) post */
.blog-featured { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 0; padding: 0; overflow: hidden; color: var(--text); margin-bottom: 1.5rem; border-radius: var(--radius-lg); }
.blog-featured:hover { text-decoration: none; border-color: var(--border-strong); }
.blog-featured__media { min-height: 260px; background: var(--surface-2); }
.blog-featured__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-featured__media--art { display: grid; place-items: center; color: #fff;
    background: radial-gradient(circle at 30% 20%, rgba(139, 92, 246, .75), transparent 55%), radial-gradient(circle at 80% 90%, rgba(34, 211, 238, .55), transparent 55%), radial-gradient(circle at 90% 10%, rgba(244, 114, 182, .45), transparent 50%), var(--surface-3); }
.blog-featured__media--art svg { filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .45)); opacity: .9; }
.blog-featured__body { padding: 2rem; display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.blog-featured__title { font-size: clamp(1.3rem, 2.4vw, 1.75rem); margin: .4rem 0 .2rem; }
.blog-featured__body .btn { margin-top: auto; }

/* Cards */
.blog-grid { margin-top: 0; }
.post-card { transition: transform .2s ease, border-color .2s ease; }
.post-card:hover { transform: translateY(-3px); }
.post-card__cover { width: calc(100% + 2.8rem); max-width: none; margin: -1.4rem -1.4rem .6rem; height: 170px; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; display: block; }
.post-card__foot { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-top: auto; padding-top: .6rem; }
.post-card__foot .muted { display: inline-flex; align-items: center; gap: .3rem; margin-right: auto; }

/* Article */
.blog-article__head { position: relative; overflow: hidden; padding: 56px 0 32px; }
.blog-article__head > .container { position: relative; z-index: 1; }
.blog-crumbs { display: flex; gap: .5rem; color: var(--muted); margin-bottom: 1rem; }
.blog-crumbs a { color: var(--text-2); }
.blog-article__title { font-size: clamp(1.9rem, 4.2vw, 3rem); }
.blog-article__lead { font-size: 1.15rem; color: var(--text-2); margin-bottom: 1.2rem; }
.blog-article__meta { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; align-items: center; font-size: .85rem; color: var(--muted); margin: 0; padding-top: 1rem; border-top: 1px solid var(--border); }
.blog-article__meta span { display: inline-flex; align-items: center; gap: .35rem; }
.blog-article__cover { width: 100%; max-height: 440px; object-fit: cover; border-radius: var(--radius-lg); border: 1px solid var(--border); margin-bottom: 2rem; }
.blog-prose { font-size: 1.06rem; }
.blog-prose > :first-child { margin-top: 0; }
.blog-prose h2 { font-size: 1.45rem; }
.blog-prose table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 1.2rem 0; }
.blog-prose th, .blog-prose td { border-bottom: 1px solid var(--border); padding: .5rem .6rem; text-align: left; }
.blog-tags { margin: 2rem 0 0; }
.blog-tags .chip:hover { text-decoration: none; color: var(--text); }

.blog-check { display: grid; gap: 1.2rem; margin-top: 2.5rem; padding: 1.6rem; background: radial-gradient(circle at 0% 0%, rgba(139, 92, 246, .25), transparent 55%), radial-gradient(circle at 100% 100%, rgba(34, 211, 238, .15), transparent 55%), var(--surface); }
.blog-check .card__title svg { color: var(--accent); }
.blog-check__form { display: flex; gap: .5rem; }
.blog-check__form .field__input { flex: 1; min-width: 0; border-radius: 999px; }

.blog-head-wrap { max-width: 1080px; }
.blog-head-wrap > * { max-width: 720px; }
/* Article layout: content + sticky aside (table of contents, flagged sites) */
.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 3rem; align-items: start; max-width: 1080px; }
.blog-main { min-width: 0; max-width: 720px; }
.blog-aside { order: 2; position: sticky; top: 84px; display: grid; gap: 1.2rem; font-size: .88rem; }
.blog-aside__title { display: flex; align-items: center; gap: .45rem; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: .6rem; }
.blog-toc ol { list-style: none; margin: 0; padding: 0 0 0 .8rem; border-left: 1px solid var(--border); display: grid; gap: .45rem; }
.blog-toc a { color: var(--text-2); display: block; line-height: 1.35; }
.blog-toc a:hover { color: var(--text); text-decoration: none; }
.blog-flagged { padding: 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.blog-flagged ul { list-style: none; margin: 0 0 .8rem; padding: 0; display: grid; gap: .2rem; }
.blog-flagged li a { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .35rem 0; color: var(--text); }
.blog-flagged li a:hover { text-decoration: none; color: var(--accent); }
.blog-flagged li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; min-width: 0; }
.blog-flagged .badge { font-size: .7rem; padding: .1rem .45rem; }
.blog-prose h2 { scroll-margin-top: 84px; }

@media (max-width: 980px) {
    .blog-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
    .blog-aside { order: 0; position: static; }
    .blog-flagged { display: none; }
    .blog-toc { padding: 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
}
@media (max-width: 860px) {
    .blog-featured { grid-template-columns: 1fr; }
    .blog-featured__media { min-height: 180px; }
    .blog-featured__body { padding: 1.4rem; }
}
@media (max-width: 560px) {
    .blog-check__form { flex-direction: column; }
}
