/* ───────── Blog list + post ───────── */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.blog-card {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: transform 0.25s var(--ease), border-color 0.25s;
    color: #fff;
    text-decoration: none;
}

.blog-card:hover {
    transform: translateY(-3px);
    border-color: rgba(180, 124, 253, 0.3);
    color: #fff;
}

.blog-card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #3B1D6E 0%, #0A0118 100%);
    overflow: hidden;
}

.blog-card-thumb-inner {
    position: absolute;
    inset: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(180, 124, 253, 0.45), rgba(255, 127, 194, 0.25));
    opacity: 0.7;
}

.blog-card-body {
    padding: 24px 26px 26px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.blog-tag {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    background: rgba(180, 124, 253, 0.10);
    border: 1px solid rgba(180, 124, 253, 0.25);
    color: var(--accent-purple);
}

.blog-date {
    color: var(--text-muted);
    font-size: 13px;
}

.blog-card h2 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.2rem;
    line-height: 1.3;
    letter-spacing: -0.015em;
    margin: 0;
    color: #fff;
}

.blog-excerpt {
    color: var(--text-secondary);
    font-size: 14.5px;
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

.blog-read {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 14px;
    color: var(--accent-purple);
    margin-top: 4px;
}

.blog-read svg {
    transition: transform 0.2s;
}

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

@media (max-width: 980px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

/* ───────── Blog post (article) ───────── */

.blog-post-hero {
    text-align: left;
    padding-bottom: 24px;
}

.blog-post-hero .blog-post-meta {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.blog-post-hero h1.page-title {
    margin: 0 0 16px;
    text-align: left;
    max-width: 28ch;
}

.blog-post-hero .page-lead {
    text-align: left;
    margin: 0;
    max-width: 60ch;
}

.blog-post-section {
    padding-top: 32px;
}

.blog-post-content.prose {
    /* About 70 characters a line at this size. */
    max-width: 36rem;
    margin: 0 auto;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.75;
}

.prose h2 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: #fff;
    font-size: 1.6rem;
    margin: 48px 0 16px;
    letter-spacing: -0.02em;
}

.prose h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: #fff;
    font-size: 1.25rem;
    margin: 32px 0 12px;
}

.prose p {
    margin: 0 0 18px;
    color: var(--text-secondary);
}

.prose a {
    color: var(--accent-purple);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.prose a:hover {
    color: var(--accent-pink);
}

.prose strong {
    color: #fff;
    font-weight: 500;
}

.prose ul,
.prose ol {
    padding-left: 1.4em;
    margin: 0 0 18px;
}

.prose ul li {
    list-style: disc;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.prose ol li {
    list-style: decimal;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.prose blockquote {
    border-left: 3px solid var(--accent-purple);
    padding: 4px 0 4px 20px;
    margin: 24px 0;
    color: #e8e4f0;
    font-style: italic;
}

.prose code {
    font-family: var(--font-mono);
    font-size: 0.92em;
    background: rgba(180, 124, 253, 0.10);
    border: 1px solid rgba(180, 124, 253, 0.25);
    color: #d3c2f5;
    padding: 1px 6px;
    border-radius: 6px;
}

.prose pre {
    background: rgba(15, 5, 32, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: var(--r);
    padding: 16px 18px;
    overflow-x: auto;
    margin: 24px 0;
}

.prose pre code {
    background: none;
    border: 0;
    padding: 0;
}

/* Images in a post body: <figure><img width height><figcaption></figure>.
   width and height on the <img> reserve the space so nothing jumps. */
.prose figure {
    margin: 28px 0;
}

.prose img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--r);
    border: 1px solid var(--glass-border);
}

/* Portrait or small photos: a full-width one runs taller than the screen,
   and a small original would be blown up past its own size. */
.prose figure.figure-narrow {
    max-width: 420px;
}

.prose figure.figure-narrow img {
    width: 100%;
}

.prose figcaption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Tables scroll in their own box if they ever outgrow the column; on a phone
   they stack instead (see the max-width: 600px block below). */
.prose .table-wrap {
    overflow-x: auto;
    margin: 0 0 24px;
}

.prose table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.prose th,
.prose td {
    text-align: left;
    vertical-align: top;
    padding: 10px 12px;
    border-bottom: 1px solid var(--glass-border);
}

.prose th {
    color: var(--text-primary);
    font-weight: 600;
}

/* On a phone each row becomes a block: the first cell as its heading, then
   the rest, each led by its column name when the cell carries data-label. */
@media (max-width: 600px) {
    .prose table {
        min-width: 0;
    }

    .prose table,
    .prose tbody,
    .prose tr,
    .prose td {
        display: block;
    }

    .prose thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .prose tr {
        padding: 14px 0;
        border-bottom: 1px solid var(--glass-border);
    }

    .prose td {
        padding: 2px 0;
        border-bottom: 0;
    }

    .prose td:first-child {
        margin-bottom: 4px;
        color: var(--text-primary);
    }

    .prose td[data-label]::before {
        content: attr(data-label) ": ";
        color: var(--text-primary);
        font-weight: 600;
    }
}

/* The admin preview of a post that may still be hidden. */
.blog-preview-banner {
    display: inline-block;
    margin: 0 0 24px;
    padding: 10px 16px;
    background: var(--accent-tint);
    border: 1px solid var(--accent-line);
    border-radius: var(--r);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.blog-preview-banner a {
    color: var(--text-primary);
    text-decoration: underline;
}

.blog-post-footer {
    max-width: 36rem;
    margin: 56px auto 0;
    padding-top: 32px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-start;
}

.blog-author {
    color: var(--text-muted);
    font-size: 13px;
}

.blog-author a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-decoration-color: rgba(180, 124, 253, 0.4);
    text-underline-offset: 3px;
}

.blog-author a:hover {
    color: var(--accent-purple);
}

.blog-author::before {
    content: "·";
    margin-right: 12px;
    color: var(--border-color);
}

/* ───────── Related posts ───────── */

.blog-related {
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.blog-related h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.blog-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.blog-related-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.02);
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.blog-related-card:hover,
.blog-related-card:focus-visible {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.blog-related-title {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

.blog-related-excerpt {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-secondary);
}

@media (prefers-reduced-motion: reduce) {
    .blog-related-card {
        transition: none;
    }
    .blog-related-card:hover,
    .blog-related-card:focus-visible {
        transform: none;
    }
}
