/* ── Blog Layout ─────────────────────────────────────────────────── */
.blog-wrap {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    box-sizing: border-box;
}

/* ── Blog Index ──────────────────────────────────────────────────── */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 2rem;
}

.blog-card {
    display: block;
    padding: 1.75rem 1.75rem 1.5rem;
    border-radius: 12px;
    background: var(--panel, #18181b);
    border: 1px solid var(--border, rgba(255, 255, 255, .08));
    text-decoration: none;
    color: inherit;
    transition: border-color .18s, box-shadow .18s, transform .18s;
    cursor: pointer;
}

.blog-card:hover {
    border-color: rgba(0, 187, 167, .4);
    box-shadow: 0 0 0 1px rgba(0, 187, 167, .12), 0 4px 24px rgba(0, 0, 0, .3);
    transform: translateY(-1px);
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.775rem;
    color: var(--text-muted, #6b7280);
    margin-bottom: 0.65rem;
    font-weight: 500;
}

.blog-card-meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-muted, #6b7280);
    flex-shrink: 0;
}

.blog-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary, #f3f4f6);
    margin: 0 0 0.55rem 0;
    line-height: 1.4;
    transition: color .15s;
}

.blog-card:hover .blog-card-title {
    color: var(--accent, #00bba7);
}

.blog-card-excerpt {
    font-size: 0.9rem;
    line-height: 1.75;
    color: var(--text-secondary, #9ca3af);
    margin: 0 0 1rem 0;
}

.blog-card-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent, #00bba7);
}

.blog-card-read-more svg {
    width: 14px;
    height: 14px;
    transition: transform .15s;
}

.blog-card:hover .blog-card-read-more svg {
    transform: translateX(3px);
}

/* ── Blog Post ───────────────────────────────────────────────────── */
.blog-post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, .08));
}

.blog-post-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color .15s;
}

.blog-post-back:hover {
    color: var(--accent, #00bba7);
}

.blog-post-back svg {
    width: 14px;
    height: 14px;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.blog-post-meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-muted, #6b7280);
    flex-shrink: 0;
}

.blog-post-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary, #f3f4f6);
    line-height: 1.25;
    margin: 0;
}

/* ── Markdown Content ────────────────────────────────────────────── */
.blog-content {
    font-size: 0.9625rem;
    line-height: 1.85;
    color: var(--text-secondary, #9ca3af);
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4 {
    color: var(--text-primary, #f3f4f6);
    font-weight: 700;
    margin: 2rem 0 0.75rem 0;
    line-height: 1.35;
}

.blog-content h1 {
    font-size: 1.7rem;
}

.blog-content h2 {
    font-size: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, .08));
}

.blog-content h3 {
    font-size: 1.05rem;
}

.blog-content h4 {
    font-size: 0.95rem;
}

/* First heading gets less top margin */
.blog-content>h1:first-child,
.blog-content>h2:first-child {
    margin-top: 0;
}

.blog-content p {
    margin: 0 0 1rem 0;
}

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

.blog-content a {
    color: var(--accent, #00bba7);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color .15s;
}

.blog-content a:hover {
    color: var(--accent-hover, #15d4c2);
}

.blog-content strong {
    color: var(--text-primary, #f3f4f6);
    font-weight: 600;
}

.blog-content em {
    color: inherit;
    font-style: italic;
}

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

.blog-content li {
    margin-bottom: 0.4rem;
    line-height: 1.8;
}

.blog-content li:last-child {
    margin-bottom: 0;
}

.blog-content blockquote {
    margin: 1.25rem 0;
    padding: 0.8rem 1.2rem;
    border-left: 3px solid var(--accent, #00bba7);
    background: rgba(0, 187, 167, .06);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary, #9ca3af);
    font-style: italic;
}

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

.blog-content code {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.82em;
    background: rgba(255, 255, 255, .07);
    color: #e0e0e0;
    padding: 0.15em 0.45em;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, .1);
}

.blog-content pre {
    background: rgba(0, 0, 0, .45);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    padding: 1.1rem 1.25rem;
    overflow-x: auto;
    margin: 1.25rem 0;
    line-height: 1.65;
}

.blog-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.855rem;
    color: #d4d4d4;
}

.blog-content hr {
    border: none;
    border-top: 1px solid var(--border, rgba(255, 255, 255, .08));
    margin: 2rem 0;
}

.blog-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin: 1rem 0;
}

.blog-content th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted, #6b7280);
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.blog-content td {
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary, #9ca3af);
    border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.blog-content tr:last-child td {
    border-bottom: none;
}

/* ── Custom components: @[image] @[video] @[youtube] ────────────────── */
.blog-figure {
    margin: 1.5rem 0;
}

.blog-figure img,
.blog-figure video {
    display: block;
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border, rgba(255, 255, 255, .08));
    background: rgba(0, 0, 0, .25);
}

.blog-figure.blog-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border, rgba(255, 255, 255, .08));
}

.blog-figure.blog-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.blog-content .blog-figure figcaption {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    text-align: center;
}

/* ── Custom components: @[warning] @[note] ──────────────────────────── */
.blog-callout {
    display: flex;
    gap: 0.75rem;
    margin: 1.25rem 0;
    padding: 1rem 1.15rem;
    border-radius: 10px;
    border: 1px solid;
}

.blog-callout::before {
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    line-height: 1.1rem;
    text-align: center;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 800;
    margin-top: 0.1rem;
}

.blog-callout-body> :first-child {
    margin-top: 0;
}

.blog-callout-body> :last-child {
    margin-bottom: 0;
}

.blog-callout-warning {
    background: rgba(245, 158, 11, .08);
    border-color: rgba(245, 158, 11, .3);
    color: #f5c26b;
}

.blog-callout-warning::before {
    content: "!";
    background: rgba(245, 158, 11, .2);
    color: #f5b942;
}

.blog-callout-note {
    background: rgba(0, 187, 167, .08);
    border-color: rgba(0, 187, 167, .3);
    color: #7fe0d4;
}

.blog-callout-note::before {
    content: "i";
    background: rgba(0, 187, 167, .2);
    color: var(--accent, #00bba7);
}

/* ── Empty state ─────────────────────────────────────────────────── */
.blog-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted, #6b7280);
}

.blog-empty svg {
    width: 40px;
    height: 40px;
    margin-bottom: 1rem;
    color: var(--border, rgba(255, 255, 255, .08));
}

.blog-empty p {
    font-size: 0.9rem;
}

/* ── 404 ─────────────────────────────────────────────────────────── */
.blog-not-found {
    padding: 3rem 1rem;
    text-align: center;
}

.blog-not-found h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary, #f3f4f6);
    margin-bottom: 0.6rem;
}

.blog-not-found p {
    color: var(--text-muted, #6b7280);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.blog-not-found a {
    color: var(--accent, #00bba7);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Button component @[button] ──────────────────────────────────── */
.blog-button-wrap {
    display: flex;
    margin: 1.5rem 0;
}

.blog-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    /* WCAG touch target */
    padding: 0.65rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    /* Explicit properties only — avoid transition: all */
    transition:
        background-color 150ms ease,
        border-color 150ms ease,
        color 150ms ease,
        transform 150ms ease;
}

.blog-btn-primary {
    background: var(--accent, #00bba7);
    color: #00110f !important;
    /* override global a { color: inherit } in style.css */
}

.blog-btn-primary:hover {
    background: var(--accent-hover, #15d4c2);
    color: #00110f !important;
    transform: translateY(-1px);
}

.blog-btn-secondary {
    background: transparent;
    border-color: var(--border, rgba(255, 255, 255, 0.08));
    color: var(--text-secondary, #9ca3af) !important;
}

.blog-btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--text-primary, #f3f4f6) !important;
    transform: translateY(-1px);
}

.blog-btn:focus-visible {
    outline: 2px solid var(--accent, #00bba7);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .blog-btn {
        transition: none;
    }

    .blog-btn:hover {
        transform: none;
    }
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .blog-wrap {
        padding: 1.5rem 1rem;
    }

    .blog-post-title {
        font-size: 1.5rem;
    }

    .blog-card {
        padding: 1.25rem;
    }

    /* Button goes full-width on mobile */
    .blog-button-wrap {
        display: block;
    }

    .blog-btn {
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
    }
}