/* PrimeNest - blog public pages (Phase 6 Slice 9) */

.blog-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 2rem 3rem;
}

.blog-page__subheading {
    margin: 0.25rem 0 0;
    color: var(--color-text-muted);
}

@media (max-width: 900px) {
    .blog-page {
        padding: 1rem 1rem 2.5rem;
    }
}

/* ---------- Blog index ---------- */

.blog-index-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

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

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

.blog-index-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #eef1f4;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.blog-index-card:hover {
    border-color: var(--color-blue-primary);
}

.blog-index-card__media {
    display: block;
    aspect-ratio: 5 / 3;
    overflow: hidden;
    background: #eef1f4;
}

.blog-index-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-index-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1rem 1.1rem 1.25rem;
}

.blog-index-card__title {
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.blog-index-card__excerpt {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.blog-index-card__meta {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* ---------- Article page ---------- */

.blog-article {
    max-width: 760px;
    margin: 1.25rem auto 3rem;
    padding: 0 2rem;
}

@media (max-width: 900px) {
    .blog-article {
        padding: 0 1rem;
    }
}

.blog-article__header h1 {
    margin: 0 0 0.5rem;
}

.blog-article__byline {
    margin: 0 0 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.blog-article__cover {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 1.75rem;
    object-fit: cover;
}

.blog-article__body {
    line-height: 1.75;
    color: #2a2a2a;
    /* A long stretch of text with no spaces (a raw URL, a run-on test string)
       can't be broken at a normal word boundary — without this, it forces
       its container, and the whole page, to scroll sideways instead of
       wrapping. Admin-authored content isn't proofread by a machine, so this
       has to hold regardless of what actually gets typed into a post. */
    overflow-wrap: anywhere;
}

.blog-article__body h2,
.blog-article__body h3 {
    margin: 1.75rem 0 0.75rem;
}

.blog-article__body p {
    margin: 0 0 1.1rem;
}

.blog-article__body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.blog-article__body blockquote {
    margin: 1.25rem 0;
    padding: 0.25rem 1.25rem;
    border-left: 3px solid var(--color-blue-primary);
    color: var(--color-text-muted);
}

.blog-article__back {
    margin-top: 2.5rem;
}

.blog-article__back a {
    color: var(--color-blue-primary);
    text-decoration: none;
    font-weight: 600;
}
