/* ======================================================== */
/* BLOG-SPECIFIC OVERRIDES — scoped to .blog-page           */
/* Layers on top of /resources/css/new/main.css             */
/* ======================================================== */

.blog-page {
    padding: 100px 32px 64px;
    max-width: 1200px;
    margin: 0 auto;
    font-family: var(--font-primary);
    color: var(--text-secondary);
    background: var(--bg-primary);
}

.blog-page a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.blog-page a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Re-land heading sizes inside the blog so they don't inherit
   the massive landing-page h2 scale from main.css            */
.blog-page h1,
.blog-page h2,
.blog-page h3,
.blog-page h4,
.blog-page h5,
.blog-page h6 {
    font-family: var(--font-primary);
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.blog-container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0;
    min-width: 0;
}

.blog-listing-container {
    max-width: 840px;
}

/* ======================================================== */
/* MASTHEAD — publication identity lockup                   */
/* ======================================================== */

.blog-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.blog-header a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    gap: 0.35rem;
}

.blog-header a:hover {
    text-decoration: none;
}

.blog-header a:hover .blog-masthead-title {
    color: var(--accent);
}

.blog-masthead-label {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
}

.blog-masthead-title {
    font-family: var(--font-primary);
    font-size: clamp(26px, 4vw, 34px);
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.1;
    transition: color 0.2s ease;
}

.blog-masthead-tagline {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-top: 0.15rem;
}

.blog-masthead-intro {
    max-width: 620px;
    margin: 1rem auto 0;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.65;
}

/* ======================================================== */
/* POST FEED — uniform vertical cards */
/* ======================================================== */

.post-feed {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-feed .entry {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.post-feed .entry:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.entry-card-link {
    display: block;
}

.entry-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

/* ======================================================== */
/* BLOG POST STYLING */
/* ======================================================== */

.entry h2 {
    font-weight: 600;
    font-size: clamp(22px, 2.8vw, 26px);
    margin-bottom: 0;
    line-height: 1.25;
}

.entry h2 a {
    color: var(--text-primary);
    text-decoration: none;
}

.entry h2 a:hover {
    color: var(--accent);
}

.entry-header {
    margin-bottom: 1.5rem;
}

.entry-deck {
    margin: 0.85rem 0 1.2rem;
    max-width: 62ch;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: clamp(18px, 2.2vw, 22px);
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
}

.blog-preview-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(59, 151, 211, 0.28);
    border-radius: var(--radius);
    background: rgba(59, 151, 211, 0.08);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.blog-preview-notice strong {
    color: var(--text-primary);
}

.entry-meta {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-bottom: 1em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.entry-meta-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.entry-meta-author {
    color: var(--text-secondary);
    font-weight: 500;
    display: inline-block;
    margin: 0 1px;
}

.entry-meta-separator {
    margin: 0 4px;
    color: var(--text-muted);
    opacity: 0.7;
}

.reading-time {
    color: var(--accent);
    font-weight: 500;
}

/* ======================================================== */
/* FEATURED IMAGE STYLING */
/* ======================================================== */
.featured-image, .featured-image-banner {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-inset);
}

.featured-image {
    aspect-ratio: 16 / 9;
    height: auto;
    margin: 0;
}

.featured-image-banner {
    height: auto;
    aspect-ratio: 16 / 9;
    margin-bottom: 1.5em;
    border-radius: var(--radius);
}

.featured-image img,
.featured-image-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.entry a:hover .featured-image img,
.entry-card-link:hover .featured-image img {
    transform: scale(1.03);
}

/* ======================================================== */
/* READING ZONE — structural wrapper (keeps dark palette)   */
/* ======================================================== */

.reading-zone {
    margin-top: 1.5rem;
    min-width: 0;
}

/* ======================================================== */
/* ARTICLE BODY — editorial serif + generous spacing        */
/* ======================================================== */

.entry-excerpt, .entry-content {
    font-family: var(--font-primary);
    font-size: 14px;
    line-height: 1.7;
}

/* Single post: magazine-quality reading */
article.entry .entry-content {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 19px;
    line-height: 1.78;
    color: var(--text-secondary);
}

/* Inline emoji images (pasted from Slack/Google) */
article.entry .entry-content img[data-stringify-type="emoji"],
article.entry .entry-content img[data-emoji] {
    display: inline;
    height: 1.1em;
    width: 1.1em;
    vertical-align: -0.15em;
    margin: 0 0.05em;
    object-fit: contain;
}

/* Lead paragraph: visual on-ramp */
article.entry .entry-content > p:first-of-type:not(.article-deck),
article.entry .entry-content > .article-deck + p,
article.entry .entry-content > .article-editor-paragraph:first-of-type:not(.article-deck) {
    font-size: 1.15em;
    line-height: 1.68;
    color: var(--text-primary);
}

/* Drop cap */
article.entry .entry-content > p:first-of-type:not(.article-deck)::first-letter,
article.entry .entry-content > .article-deck + p::first-letter,
article.entry .entry-content > .article-editor-paragraph:first-of-type:not(.article-deck)::first-letter {
    float: left;
    font-size: 3em;
    line-height: 0.88;
    font-weight: 700;
    color: var(--accent);
    margin: 0.02em 0.14em 0 0;
    padding-top: 0;
}

/* ======================================================== */
/* ARTICLE BODY — rich typography for reading               */
/* ======================================================== */

.entry-content p {
    margin: 0 0 1.28em;
    color: var(--text-secondary);
}

.entry-content h2 {
    font-family: var(--font-primary);
    font-size: 1.5em;
    margin: 2.15em 0 0.55em;
    padding-bottom: 0.28em;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.entry-content h3 {
    font-family: var(--font-primary);
    font-size: 1.25em;
    margin: 1.8em 0 0.5em;
    color: var(--text-primary);
}

.entry-content h4 {
    font-family: var(--font-primary);
    font-size: 1.1em;
    margin: 1.5em 0 0.5em;
    color: var(--text-primary);
}

.entry-content blockquote,
.entry-content .article-editor-blockquote {
    margin: 2em 0;
    padding: 1em 1.5em;
    border-left: 3px solid var(--accent);
    background: var(--bg-surface);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-primary);
    font-style: italic;
}

.entry-content blockquote p:last-child {
    margin-bottom: 0;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1.5em 0;
    display: block;
}

.entry-content figure {
    margin: 2em 0;
}

.entry-content figcaption {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5em;
}

.entry-content ul,
.entry-content ol {
    margin: 1.35em 0 1.8em;
    padding: 1em 1.2em 1em 1.65em;
    list-style-position: outside;
    border-left: 3px solid rgba(59, 151, 211, 0.55);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

.entry-content ul {
    list-style-type: disc;
}

.entry-content ol {
    padding-left: 2.25em;
    list-style-type: decimal;
}

.entry-content li {
    margin: 0 0 0.75em;
    padding-left: 0.2em;
    line-height: 1.7;
}

.entry-content li:last-child {
    margin-bottom: 0;
}

.entry-content li::marker {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.82em;
    font-weight: 700;
}

.entry-content ul ul,
.entry-content ul ol,
.entry-content ol ul,
.entry-content ol ol {
    margin: 0.75em 0 0.9em;
    padding-top: 0.55em;
    padding-bottom: 0.55em;
    border-left-color: rgba(59, 151, 211, 0.28);
    background: transparent;
}

.entry-content .article-deck {
    margin: 0 0 1.6em;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1.2em;
    line-height: 1.55;
}

.entry-content blockquote.article-pull-quote {
    margin: 2.4em 0;
    padding: 1.15em 1.4em;
    border-left: 4px solid var(--accent);
    background: rgba(59, 151, 211, 0.08);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1.15em;
    font-style: normal;
    line-height: 1.6;
}

.entry-content .article-archetype,
.entry-content .article-further-reading {
    margin: 1.75em 0;
    padding: 1.1em 1.25em;
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: rgba(255, 255, 255, 0.025);
}

.entry-content .article-archetype h2,
.entry-content .article-archetype h3,
.entry-content .article-further-reading h2,
.entry-content .article-further-reading h3 {
    margin-top: 0;
    margin-bottom: 0.65em;
    padding-bottom: 0;
    border-bottom: 0;
}

.entry-content .article-archetype p,
.entry-content .article-further-reading p {
    margin: 0.65em 0;
    line-height: 1.62;
}

.entry-content .article-archetype p:last-child,
.entry-content .article-further-reading p:last-child,
.entry-content .article-further-reading ul:last-child,
.entry-content .article-further-reading ol:last-child {
    margin-bottom: 0;
}

.entry-content hr,
.entry-content .article-editor-horizontal-rule {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5em 0;
}

.entry-content .article-editor-horizontal-rule__container {
    margin: 2.5em 0;
}

.entry-content .article-editor-horizontal-rule__delete-button-container {
    display: none;
}

.entry-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.entry-content em {
    font-style: italic;
}

.entry-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(59, 151, 211, 0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s ease;
}

.entry-content a:hover {
    text-decoration-color: var(--accent);
}

.entry-content .is-empty {
    display: none;
}

.entry-production-cta {
    margin: 2rem 0;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    background: var(--bg-surface);
}

.entry-production-cta p {
    margin: 0 0 1rem;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 15px;
    line-height: 1.6;
}

.entry-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
    font-size: 14px;
    line-height: 1.7;
}

.entry-excerpt p {
    margin-bottom: 0;
}

.read-more {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 0.35em;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
    margin-top: auto;
    padding-top: 0.75rem;
    transition: color 0.2s ease;
}

.read-more:hover {
    color: var(--accent-hover);
    text-decoration: none;
}

.read-more::after {
    content: '→';
    font-size: 16px;
    transition: transform 0.2s ease;
}

.read-more:hover::after {
    transform: translateX(3px);
}

.entry.wip {
    opacity: 0.75;
    border-left: 3px solid var(--cta);
}

/* ======================================================== */
/* SOCIAL SHARE */
/* ======================================================== */

.entry-social {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.entry-social--inline {
    margin-top: 0;
}

.social-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 26px;
    padding: 0 8px;
    border-radius: var(--radius-sm, 4px);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.social-link:hover {
    background: var(--accent-subtle, rgba(59, 151, 211, 0.08));
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

button.social-link {
    cursor: pointer;
    appearance: none;
}

button.social-link.is-copied {
    background: rgba(37, 185, 154, 0.08);
    border-color: rgba(37, 185, 154, 0.25);
    color: #25b99a;
}

.social-link svg {
    width: 13px;
    height: 13px;
}

/* Single post social — slightly larger pills */
.entry-header .entry-social--inline {
    gap: 8px;
}

.entry-header .entry-social--inline .social-link {
    min-width: 36px;
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
}

/* ======================================================== */
/* PREV / NEXT NAVIGATION */
/* ======================================================== */

.entry-adjacent {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2.5rem;
}

.adjacent-prev,
.adjacent-next {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: border-color 0.2s ease;
}

.adjacent-prev:hover,
.adjacent-next:hover {
    border-color: var(--accent);
    text-decoration: none;
}

.adjacent-next {
    text-align: right;
    align-items: flex-end;
}

.adjacent-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.adjacent-title {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.3;
}

.entry-back {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
}

.entry-back a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.75rem 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.entry-back a:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    text-decoration: none;
}

/* ======================================================== */
/* EMPTY / 404 STATES */
/* ======================================================== */

.blog-empty {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-illustration {
    font-size: 48px;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.blog-empty h2 {
    font-size: 24px;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.blog-empty p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.suggested-posts {
    margin-top: 3rem;
    text-align: left;
}

.suggested-posts h3 {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-align: center;
}

/* ======================================================== */
/* BACK TO TOP */
/* ======================================================== */

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.2s ease;
    z-index: 100;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

/* ======================================================== */
/* SYNTAX HIGHLIGHTING OVERRIDES (hljs)                     */
/* ======================================================== */

.blog-page pre {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.blog-page code {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.blog-page :not(pre) > code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
}

/* ======================================================== */
/* READING PROGRESS BAR                                     */
/* ======================================================== */

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 1000;
    pointer-events: none;
}

.reading-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent);
    transform: scaleX(var(--progress, 0));
    transform-origin: left;
    transition: transform 0.1s linear;
}

/* ======================================================== */
/* END-OF-ARTICLE MARKER                                    */
/* ======================================================== */

.entry-end-mark {
    text-align: center;
    margin: 3rem 0 2rem;
    font-size: 12px;
    letter-spacing: 0.6em;
    color: var(--text-muted);
    opacity: 0.5;
}

/* ======================================================== */
/* AUTHOR BYLINE                                            */
/* ======================================================== */

.author-byline {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 2.5rem;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.author-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* ======================================================== */
/* FEATURED IMAGE as <figure>                               */
/* ======================================================== */

.featured-image-banner figure {
    margin: 0;
}

.featured-image-banner figcaption {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5em;
}

/* ======================================================== */
/* RESPONSIVE DESIGN */
/* ======================================================== */

@media (max-width: 768px) {
    .blog-page {
        padding: 90px 20px 40px;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .blog-container,
    article.entry,
    .entry-header,
    .reading-zone,
    .entry-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .entry-header,
    .entry-content,
    .entry-content p,
    .entry-content h2,
    .entry-content h3,
    .entry-content li {
        overflow-wrap: break-word;
    }

    .blog-header {
        margin-bottom: 2rem;
        padding-bottom: 1.25rem;
    }

    .blog-masthead-label {
        font-size: 11px;
    }

    .blog-masthead-tagline {
        font-size: 10px;
    }

    .entry h2 {
        font-size: 20px;
    }

    .entry-excerpt, .entry-content {
        font-size: 13px;
    }

    article.entry .entry-content {
        font-size: 17px;
        line-height: 1.75;
    }

    article.entry .entry-content > p:first-of-type:not(.article-deck),
    article.entry .entry-content > .article-deck + p,
    article.entry .entry-content > .article-editor-paragraph:first-of-type:not(.article-deck) {
        line-height: 1.68;
    }

    .entry-deck {
        font-size: 17px;
        line-height: 1.55;
    }

    article.entry .entry-content > p:first-of-type:not(.article-deck)::first-letter,
    article.entry .entry-content > .article-deck + p::first-letter,
    article.entry .entry-content > .article-editor-paragraph:first-of-type:not(.article-deck)::first-letter {
        float: none;
        font-size: inherit;
        line-height: inherit;
        font-weight: inherit;
        color: inherit;
        margin: 0;
        padding-top: 0;
    }

    .entry-content p {
        margin-bottom: 1.15em;
    }

    .entry-content h2 {
        margin-top: 1.9em;
        margin-bottom: 0.55em;
    }

    .entry-content ul,
    .entry-content ol {
        margin: 1.2em 0 1.55em;
        padding: 0.85em 0.95em 0.85em 1.35em;
    }

    .entry-content ol {
        padding-left: 2em;
    }

    .entry-content li {
        line-height: 1.62;
    }

    .entry-content blockquote.article-pull-quote,
    .entry-content .article-archetype,
    .entry-content .article-further-reading {
        margin: 1.35em 0;
        padding: 1em;
    }

    .entry-content .article-archetype p,
    .entry-content .article-further-reading p {
        margin: 0.6em 0;
        line-height: 1.58;
    }

    .author-byline {
        padding: 1rem 1.25rem;
    }

    .author-avatar {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .entry-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .entry-adjacent {
        grid-template-columns: 1fr;
    }

    .adjacent-next {
        text-align: left;
        align-items: flex-start;
    }
}
