/* ==========================================================================
   Klyne & Co. — Blog & Newsletter Archive styles
   Used by: blog.html, blog-post.html, newsletter-archive.html
   Builds on the tokens and components in style.css (colors, fonts, .btn, etc.)
   ========================================================================== */

/* ── PAGE HERO (shorter than the home hero) ── */
.blog-hero {
    min-height: 52vh;
    padding-top: 9rem;
    padding-bottom: 4.5rem;
}

.blog-hero .hero-content {
    max-width: 760px;
}

.blog-hero h1 {
    font-size: clamp(2.4rem, 5.5vw, 4.2rem);
}

.blog-hero-sub {
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
    max-width: 560px;
    margin: 0 auto;
}

/* ── FILTER PILLS ── */
.blog-section {
    padding: 4rem 5vw 6rem;
    background: var(--white);
}

.blog-wrap {
    max-width: 1100px;
    margin: 0 auto;
}

.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.blog-pill {
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.55rem 1.3rem;
    border-radius: 100px;
    border: 1px solid rgba(28, 33, 32, 0.15);
    background: var(--white);
    color: var(--dark);
    cursor: pointer;
    transition: all 0.25s ease;
}

.blog-pill:hover {
    border-color: var(--blue);
    color: var(--blue-text-safe);
}

.blog-pill.is-active {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(59, 158, 255, 0.3);
}

/* ── FEATURED POST ── */
.blog-featured {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    border-radius: 14px;
    overflow: hidden;
    background: var(--dark);
    margin-bottom: 3rem;
    text-decoration: none;
    color: var(--white);
    box-shadow: 0 20px 50px rgba(28, 33, 32, 0.12);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.blog-featured:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 60px rgba(28, 33, 32, 0.2);
}

.blog-featured .blog-thumb {
    min-height: 320px;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
}

.blog-featured-body {
    padding: 3rem 2.8rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.blog-featured-body h2 {
    font-family: var(--serif);
    font-size: clamp(1.5rem, 2.6vw, 2.1rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0.9rem 0 1rem;
}

.blog-featured-body p {
    font-weight: 300;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 1.5rem;
}

.blog-featured .blog-meta {
    color: rgba(255, 255, 255, 0.55);
}

/* ── CARD GRID ── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.blog-card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--white);
    overflow: hidden;
    text-decoration: none;
    color: var(--dark);
    transition: all 0.4s ease;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(28, 33, 32, 0.08);
    border-color: rgba(59, 158, 255, 0.2);
}

.blog-card[hidden],
.blog-featured[hidden] {
    display: none;
}

.blog-card-body {
    padding: 1.6rem 1.7rem 1.9rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card h3 {
    font-family: var(--serif);
    font-size: 1.2rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin: 0.8rem 0 0.7rem;
}

.blog-card p {
    font-size: 0.92rem;
    font-weight: 300;
    line-height: 1.7;
    color: var(--gray-text-safe);
    margin-bottom: 1.2rem;
    flex: 1;
}

/* ── THUMBNAIL (gradient + icon placeholder until real images exist) ── */
.blog-thumb {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 25% 20%, rgba(59, 158, 255, 0.35), transparent 55%),
        linear-gradient(135deg, #1C2120 0%, #26302f 100%);
    color: var(--blue-light);
    font-size: 2.4rem;
    position: relative;
    overflow: hidden;
}

.blog-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-thumb.alt-1 {
    background:
        radial-gradient(circle at 75% 25%, rgba(128, 192, 255, 0.3), transparent 55%),
        linear-gradient(135deg, #1C2120 0%, #202a29 100%);
}

.blog-thumb.alt-2 {
    background:
        radial-gradient(circle at 50% 85%, rgba(59, 158, 255, 0.3), transparent 60%),
        linear-gradient(160deg, #1C2120 0%, #242e2d 100%);
}

/* ── TAGS & META ── */
.blog-tag {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--blue-text-safe);
}

.blog-featured .blog-tag,
.dark-surface .blog-tag {
    color: var(--blue-light);
}

.blog-meta {
    font-size: 0.8rem;
    color: var(--gray-text-safe);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
}

.blog-meta span + span::before {
    content: '·';
    margin-right: 0.9rem;
}

/* ── SUBSCRIBE STRIP ── */
.blog-subscribe {
    margin-top: 4.5rem;
    padding: 3rem 2.5rem;
    border-radius: 14px;
    background: var(--dark);
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-subscribe::before {
    content: '';
    position: absolute;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: rgba(59, 158, 255, 0.1);
    filter: blur(80px);
    top: -140px;
    right: -80px;
    pointer-events: none;
}

.blog-subscribe > * {
    position: relative;
}

.blog-subscribe h2 {
    font-family: var(--serif);
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    line-height: 1.2;
    margin-bottom: 0.8rem;
}

.blog-subscribe p {
    font-weight: 300;
    color: rgba(255, 255, 255, 0.75);
    max-width: 480px;
    margin: 0 auto 1.6rem;
    line-height: 1.7;
}

/* ── NEWSLETTER ARCHIVE LIST ── */
.archive-list {
    list-style: none;
    border-top: 1px solid rgba(28, 33, 32, 0.1);
}

.archive-item a {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 1.5rem 2rem;
    align-items: start;
    padding: 2rem 0.5rem;
    border-bottom: 1px solid rgba(28, 33, 32, 0.1);
    text-decoration: none;
    color: var(--dark);
    transition: background 0.3s ease, padding 0.3s ease;
}

.archive-item a:hover {
    background: var(--blue-glow);
    padding-left: 1.2rem;
    padding-right: 1.2rem;
}

.archive-num {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.9rem;
    line-height: 1;
    color: var(--blue-text-safe);
    letter-spacing: -0.02em;
}

.archive-item h3 {
    font-family: var(--serif);
    font-size: 1.25rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.archive-item p {
    font-size: 0.93rem;
    font-weight: 300;
    line-height: 1.7;
    color: var(--gray-text-safe);
}

.archive-date {
    font-size: 0.8rem;
    color: var(--gray-text-safe);
    white-space: nowrap;
    padding-top: 0.3rem;
}

/* ── ARTICLE PAGE ── */
.post-hero {
    min-height: 0;
    padding-top: 9rem;
    padding-bottom: 4rem;
}

.post-hero .hero-content {
    max-width: 820px;
    text-align: left;
}

.post-hero h1 {
    font-size: clamp(2rem, 4.6vw, 3.4rem);
    line-height: 1.18;
    animation: none;
    opacity: 1;
}

.post-hero .hero-badge {
    animation: none;
    opacity: 1;
}

.post-crumbs {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 1.6rem;
}

.post-crumbs a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
}

.post-crumbs a:hover {
    color: var(--blue-light);
}

.post-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin-top: 1.8rem;
}

.post-byline strong {
    color: var(--white);
    font-weight: 600;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--blue);
    color: var(--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.post-layout {
    padding: 4rem 5vw 5rem;
    background: var(--white);
}

.post-body {
    max-width: 720px;
    margin: 0 auto;
}

.post-body > p,
.post-body > ul,
.post-body > ol {
    font-size: 1.06rem;
    line-height: 1.9;
    font-weight: 300;
    color: var(--dark);
    margin-bottom: 1.5rem;
}

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

.post-body li {
    margin-bottom: 0.6rem;
}

.post-body strong {
    font-weight: 600;
}

.post-body a {
    color: var(--blue-text-safe);
    text-underline-offset: 3px;
}

.post-body h2 {
    font-family: var(--serif);
    font-size: clamp(1.45rem, 2.6vw, 1.9rem);
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin: 3rem 0 1.1rem;
    scroll-margin-top: 6rem;
}

.post-body h3 {
    font-family: var(--serif);
    font-size: 1.2rem;
    margin: 2rem 0 0.8rem;
}

.post-body blockquote {
    margin: 2.2rem 0;
    padding: 0.4rem 0 0.4rem 1.6rem;
    border-left: 3px solid var(--blue);
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 500;
    line-height: 1.5;
}

/* Quick answer + key takeaways (written for readers and AI answer engines) */
.post-answer {
    background: var(--blue-glow);
    border: 1px solid rgba(59, 158, 255, 0.25);
    border-radius: 12px;
    padding: 1.6rem 1.8rem;
    margin-bottom: 2.2rem;
}

.post-answer .section-label {
    margin-bottom: 0.6rem;
}

.post-answer p {
    font-size: 1.05rem;
    line-height: 1.75;
    font-weight: 400;
    margin: 0;
}

.post-toc {
    border: 1px solid var(--border);
    background: var(--off-white);
    border-radius: 12px;
    padding: 1.5rem 1.8rem;
    margin-bottom: 2.5rem;
}

.post-toc .section-label {
    margin-bottom: 0.8rem;
}

.post-toc ol {
    padding-left: 1.2rem;
    font-size: 0.95rem;
    line-height: 1.9;
}

.post-toc a {
    color: var(--dark);
    text-decoration: none;
}

.post-toc a:hover {
    color: var(--blue-text-safe);
}

.post-callout {
    background: var(--dark);
    color: var(--white);
    border-radius: 12px;
    padding: 1.8rem 2rem;
    margin: 2.5rem 0;
}

.post-callout h3 {
    margin: 0 0 0.6rem;
    color: var(--blue-light);
    font-size: 1.05rem;
}

.post-callout p {
    font-weight: 300;
    line-height: 1.75;
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
}

/* FAQ */
.post-faq details {
    border-bottom: 1px solid rgba(28, 33, 32, 0.1);
    padding: 1.1rem 0;
}

.post-faq summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1.02rem;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.post-faq summary::-webkit-details-marker {
    display: none;
}

.post-faq summary::after {
    content: '+';
    color: var(--blue-text-safe);
    font-size: 1.3rem;
    line-height: 1;
}

.post-faq details[open] summary::after {
    content: '–';
}

.post-faq details p {
    margin: 0.9rem 0 0;
    font-size: 1rem;
    line-height: 1.8;
    font-weight: 300;
}

/* Author box */
.post-author {
    display: flex;
    gap: 1.3rem;
    align-items: flex-start;
    margin-top: 3.5rem;
    padding: 1.8rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--off-white);
}

.post-author .post-avatar {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    font-size: 1rem;
}

.post-author h4 {
    font-family: var(--serif);
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}

.post-author div span {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-text-safe);
    margin-bottom: 0.6rem;
}

.post-author p {
    font-size: 0.93rem;
    font-weight: 300;
    line-height: 1.7;
}

.post-related {
    padding: 5rem 5vw 6rem;
    background: var(--off-white);
    border-top: 1px solid var(--border);
}

.post-related .blog-grid {
    max-width: 1100px;
    margin: 2.5rem auto 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-featured {
        grid-template-columns: 1fr;
    }

    .blog-featured .blog-thumb {
        min-height: 220px;
    }
}

@media (max-width: 640px) {
    .blog-hero {
        padding-top: 7.5rem;
    }

    .blog-section {
        padding: 3rem 6vw 4rem;
    }

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

    .blog-featured-body {
        padding: 2rem 1.6rem;
    }

    .blog-subscribe {
        padding: 2.4rem 1.5rem;
    }

    .archive-item a {
        grid-template-columns: 1fr;
        gap: 0.6rem;
        padding: 1.6rem 0.2rem;
    }

    .archive-date {
        order: -1;
        padding-top: 0;
    }

    .post-hero {
        padding-top: 7.5rem;
    }

    .post-author {
        flex-direction: column;
    }
}
