/* css/blog.css — Leading Edge blog (pages rendered by netlify/functions/blog.mjs) */

.nav-links a.active {
    color: #5a4a3a;
    font-weight: 600;
}

/* Blog list */
.blog-hero {
    background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
    padding: 140px 2rem 64px;
    text-align: center;
}

.blog-hero h1 {
    color: #2c2c2c;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-wrap: balance;
}

.blog-hero-subtitle {
    color: #666;
    font-size: 1.3rem;
    font-weight: 500;
    line-height: 1.5;
    margin: 0 auto;
    max-width: 640px;
    text-wrap: balance;
}

.blog-hero-subtitle a {
    color: #25344f;
}

.blog-hero--message {
    min-height: calc(100vh - 140px);
    padding-top: 180px;
}

.blog-list-section {
    background: #fff;
    min-height: 50vh;
    padding: 64px 2rem 96px;
}

.blog-list {
    display: grid;
    gap: 2rem;
    margin: 0 auto;
    max-width: 960px;
}

.blog-card {
    align-items: center;
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 15px;
    display: grid;
    gap: 2rem;
    grid-template-columns: 360px 1fr;
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.blog-card:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.blog-card:focus-within {
    outline: 3px solid #b33f45;
    outline-offset: 3px;
}

.blog-card--no-image {
    grid-template-columns: 1fr;
}

.blog-card-image img {
    aspect-ratio: 3 / 2;
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.blog-card-body {
    padding: 1.75rem 2rem 1.75rem 0;
}

.blog-card--no-image .blog-card-body {
    padding: 2rem;
}

.blog-card-date {
    color: #6f6f6f;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.blog-card-title {
    color: #2c2c2c;
    font-size: 1.6rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
}

/* The title link covers the whole card. */
.blog-card-title a::after {
    content: '';
    inset: 0;
    position: absolute;
}

.blog-card-title a:focus-visible {
    outline: none;
}

.blog-card:hover .blog-card-title a {
    color: #25344f;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.blog-card-summary {
    color: #555;
}

.blog-empty {
    color: #666;
    font-size: 1.1rem;
    text-align: center;
}

/* Post */
.post {
    background: #fff;
    padding: 128px 2rem 96px;
}

.post-header,
.post-body,
.post-comments,
.post-footer {
    margin: 0 auto;
    max-width: 700px;
}

.post-blog-link {
    color: #b33f45;
    font-weight: 700;
    text-decoration: none;
}

.post-blog-link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.post-title {
    color: #2c2c2c;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 0.5rem 0 1rem;
    text-wrap: balance;
}

.post-meta {
    color: #666;
}

.post-hero {
    margin: 2.5rem auto 3rem;
    max-width: 1100px;
}

.post-hero img {
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    display: block;
    height: auto;
    width: 100%;
}

.post-credit {
    color: #6f6f6f;
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

.post-credit a {
    color: inherit;
    text-underline-offset: 2px;
}

.post-credit a:hover {
    color: #25344f;
}

.post-body {
    color: #333;
    font-size: 1.15rem;
    line-height: 1.8;
}

.post-body > * + * {
    margin-top: 1.4em;
}

.post-body h2 {
    color: #2c2c2c;
    font-size: 1.75rem;
    line-height: 1.3;
    margin-top: 2.2em;
}

.post-body h3 {
    color: #2c2c2c;
    font-size: 1.35rem;
    line-height: 1.35;
    margin-top: 1.8em;
}

.post-body a {
    color: #25344f;
    text-underline-offset: 3px;
}

.post-body a:hover {
    color: #b33f45;
}

.post-body blockquote {
    border-left: 4px solid #b33f45;
    color: #444;
    font-style: italic;
    padding-left: 1.25rem;
}

.post-body ul,
.post-body ol {
    padding-left: 1.5rem;
}

.post-body li + li {
    margin-top: 0.5em;
}

.post-figure img {
    border-radius: 10px;
    display: block;
    height: auto;
    width: 100%;
}

.post-figure figcaption {
    color: #6f6f6f;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.post-footer {
    align-items: center;
    border-top: 1px solid #e3e3e3;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 3.5rem;
    padding-top: 2rem;
}

.post-all-link {
    color: #25344f;
    font-weight: 600;
    text-underline-offset: 3px;
}

.post-comments {
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e3e3e3;
}
.reader-comment { padding: 1.5rem 0; border-bottom: 1px solid #e3e3e3; }
.reader-comment h3 { margin: 0; font-size: 1.1rem; }
.reader-comment time { color: #666; font-size: 0.875rem; }
.reader-comment p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 0.75rem; }
.comment-form { margin-top: 2rem; }
.comment-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.comment-form legend { font-size: 1.4rem; font-weight: 600; padding: 0; }
.comment-form label { display: block; margin: 1rem 0 0.4rem; font-weight: 600; }
.comment-form input, .comment-form textarea {
    display: block; width: 100%; box-sizing: border-box; border: 1px solid #888;
    border-radius: 4px; padding: 0.75rem; font: inherit; color: #222; background: #fff;
}
.comment-form textarea { resize: vertical; }
.comment-form :focus-visible { outline: 2px solid #25344f; outline-offset: 3px; }
.comment-form button { margin-top: 1rem; cursor: pointer; font: inherit; }
.comment-form button:disabled { opacity: 0.6; cursor: wait; }
.comment-form .comment-honeypot { display: none; }
.comment-form [role="status"] { margin-top: 1rem; }

@media (max-width: 768px) {
    .blog-hero {
        padding: 110px 1rem 48px;
    }

    .blog-hero h1 {
        font-size: 2.4rem;
    }

    .blog-hero-subtitle {
        font-size: 1.1rem;
    }

    .blog-hero--message {
        padding-top: 140px;
    }

    .blog-list-section {
        padding: 40px 1rem 64px;
    }

    .blog-card {
        gap: 0;
        grid-template-columns: 1fr;
    }

    .blog-card-body,
    .blog-card--no-image .blog-card-body {
        padding: 1.25rem 1.25rem 1.5rem;
    }

    .blog-card-title {
        font-size: 1.35rem;
    }

    .post {
        padding: 104px 1rem 64px;
    }

    .post-title {
        font-size: 2.1rem;
    }

    /* Photo runs edge to edge on phones. */
    .post-hero {
        margin: 1.75rem -1rem 2rem;
    }

    .post-hero img {
        border-radius: 0;
        box-shadow: none;
    }

    .post-credit {
        padding: 0 1rem;
    }

    .post-body {
        font-size: 1.075rem;
        line-height: 1.75;
    }
}

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

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