/*
* Blog / News system styling. Uses the same colors and spacing
* variables as the rest of the theme (defined in global.css) so it
* stays visually part of Velaphix, while giving the content area its
* own editorial identity.
*/

#blog, #blog-single {
    padding: 0 0 3rem;
}

/* Every title/category link inside a blog card needs to inherit its
   parent's color instead of falling back to the browser's default
   blue link color, since (unlike a single wrapping <a>) these are
   separate nested links for accessibility and independent click
   targets (photo vs category vs title). */
.blog-hero a, .blog-secondary-card a, .blog-list-item a,
.blog-related-card a, .blog-byline a {
    color: inherit;
    text-decoration: none;
    display: block;
}

.blog-masthead {
    margin-bottom: 1.2rem;
}

.blog-masthead .eyebrow {
    font-size: var(--very-small-font-size);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.blog-masthead-title {
    font-size: var(--medium-font-size);
    font-weight: 500;
    margin-bottom: 0.8rem;
}

.blog-tabs {
    display: flex;
    gap: 1.2rem;
    overflow-x: auto;
    white-space: nowrap;
    border-bottom: var(--border);
    padding-bottom: 0.7rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.blog-tabs::-webkit-scrollbar {
    display: none;
}

.blog-tab {
    font-size: var(--small-font-size);
    color: var(--txt-faded);
    padding-bottom: 0.5rem;
    flex-shrink: 0;
}

.blog-tab.active {
    color: var(--title-color);
    font-weight: 500;
    border-bottom: 2px solid var(--primary-color);
}

/* ---------------------------------------------------
   Category badge — plain colored text, no background
--------------------------------------------------- */
.blog-card-cat {
    display: inline-block;
    font-size: var(--very-small-font-size);
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.4rem;
}

/* Variant used over a photo (hero) — plain white text with a subtle
   shadow for legibility against any image, no background chip. */
.blog-card-cat.on-dark {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ---------------------------------------------------
   Hero story
--------------------------------------------------- */
.blog-hero {
    position: relative;
    border-radius: var(--bd-rad-big);
    overflow: hidden;
    margin-bottom: 1rem;
}

.blog-hero-media img {
    width: 100%;
    height: 15rem;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.blog-hero:hover .blog-hero-media img {
    transform: scale(1.03);
}

.blog-hero-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 2.5rem 1.2rem 1.2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.45) 55%, transparent 100%);
}

.blog-hero-caption h2 {
    color: #fff;
    font-size: var(--heading-font-size);
    line-height: 1.3;
    margin: 0.3rem 0;
    font-weight: 500;
}

.blog-hero-meta {
    font-size: var(--very-small-font-size);
    color: rgba(255, 255, 255, 0.8);
}

/* ---------------------------------------------------
   Secondary row (2 medium cards)
--------------------------------------------------- */
.blog-secondary-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.blog-secondary-media {
    display: block;
    border-radius: var(--bd-rad-md);
    overflow: hidden;
    margin-bottom: 0.6rem;
}

.blog-secondary-media img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.blog-secondary-card:hover .blog-secondary-media img {
    transform: scale(1.04);
}

.blog-secondary-card h3 {
    font-size: var(--small-font-size);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* ---------------------------------------------------
   Plain article list — now uses the exact same card
   shape (image on top, fixed 16:10 ratio, text below)
   as the secondary row above it, at every screen size,
   so every non-hero post looks visually consistent —
   no more a different thumbnail treatment on mobile vs
   desktop.
--------------------------------------------------- */
.blog-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.blog-list-item {
    display: flex;
    flex-direction: column;
}

.blog-list-media {
    display: block;
    border-radius: var(--bd-rad-md);
    overflow: hidden;
    margin-bottom: 0.6rem;
}

.blog-list-media img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}

.blog-list-content {
    min-width: 0; /* prevents a long unbroken title from overflowing past the card instead of wrapping/clamping */
}

.blog-list-content h3 {
    font-size: var(--medium-font-size);
    line-height: 1.4;
    margin: 0.2rem 0 0.3rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: break-word;
}

.blog-list-meta {
    font-size: var(--very-small-font-size);
    color: var(--txt-faded);
}

.empty {
    padding: 2rem 0;
    color: var(--txt-faded);
    font-size: var(--small-font-size);
    text-align: center;
}

/* ---------------------------------------------------
   Single article page
--------------------------------------------------- */
.blog-single-title {
    font-size: var(--heading-font-size);
    line-height: 1.3;
    margin: 0.6rem 0 0.8rem;
    overflow-wrap: break-word;
}

.blog-byline {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1.2rem;
}

.blog-byline img {
    border-radius: 50%;
    width: 2.2rem;
    height: 2.2rem;
    object-fit: cover;
}

.blog-byline-name {
    font-size: var(--small-font-size);
    font-weight: 500;
}

.blog-byline-meta {
    font-size: var(--very-small-font-size);
    color: var(--txt-faded);
}

.blog-single-image img {
    width: 100%;
    max-height: 22rem;
    object-fit: cover;
    border-radius: var(--bd-rad-big);
    margin-bottom: 1.5rem;
    display: block;
}

/* Table of contents */
.blog-toc {
    background-color: #fafafa;
    border-radius: var(--bd-rad-md);
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
}

.blog-toc .blog-toc-title {
    font-size: var(--small-font-size);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.blog-toc ol {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.blog-toc a {
    font-size: var(--small-font-size);
    color: var(--primary-color);
    text-decoration: none;
}

.blog-toc .toc-level-3 {
    padding-left: 1rem;
}

/* Article body content — readable prose width and rhythm */
.blog-single-content {
    font-size: var(--normal-font-size);
    line-height: 1.8;
    overflow-wrap: break-word;
}

.blog-single-content h2, .blog-single-content h3 {
    margin: 1.6rem 0 0.8rem;
}

.blog-single-content p {
    margin-bottom: 1.1rem;
}

.blog-single-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--bd-rad-md);
    margin: 1rem 0;
}

.blog-single-content blockquote {
    border-left: 3px solid var(--primary-color);
    padding-left: 1rem;
    font-style: italic;
    color: var(--txt-faded);
    margin: 1.5rem 0;
}

/* Author bio box */
.blog-author-box {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    background-color: #fafafa;
    border-radius: var(--bd-rad-md);
    padding: 1rem 1.2rem;
    margin: 2rem 0;
}

.blog-author-box img {
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    object-fit: cover;
    flex-shrink: 0;
}

.blog-author-name {
    font-size: var(--small-font-size);
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.blog-author-bio {
    font-size: var(--very-small-font-size);
    color: var(--txt-faded);
    line-height: 1.6;
}

/* Related reads */
.blog-related-title {
    font-size: var(--medium-font-size);
    font-weight: 500;
    margin-bottom: 0.8rem;
}

.blog-related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.blog-related-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: var(--bd-rad-md);
    margin-bottom: 0.5rem;
    display: block;
}

.blog-related-card p {
    font-size: var(--small-font-size);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

@media only screen and (min-width: 640px) {

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

@media only screen and (min-width: 770px) {

    .blog-hero-media img {
        height: 24rem;
    }

    .blog-single-content, .blog-single-title, .blog-byline, .blog-toc, .blog-author-box {
        max-width: 42rem;
        margin-left: auto;
        margin-right: auto;
    }

    .blog-single-image img, .blog-related {
        max-width: 48rem;
        margin-left: auto;
        margin-right: auto;
    }
}
