/* ============================================
   EBOOKR.AI - BLOG STYLES
   Dark theme consistent with landing page design
   ============================================ */

/* ============ VARIABLES ============ */
:root {
    --blog-content-max: 720px;
    --blog-sidebar-width: 240px;
    --blog-gap: 3rem;
    --text-secondary: #FFFC;
    --text-primary: #FFF;
}

/* ============ BLOG LIST PAGE ============ */
.blog-hero {
    padding: 10rem 0 4rem;
    text-align: center;
    position: relative;
}

.blog-hero .hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(180deg, #fff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-hero .hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
    padding-bottom: 4rem;
}

.blog-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.25s ease;
    text-decoration: none;
    color: inherit;
}

.blog-card:hover {
    border-color: var(--border-highlight);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    color: inherit;
}

.blog-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-surface);
}

.blog-card-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(167, 139, 250, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--brand-accent);
}

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

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.blog-card-meta i {
    font-size: 0.75rem;
}

.blog-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.blog-card-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-footer {
    padding: 0 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.blog-card-author {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.blog-card-read-more {
    font-size: 0.8rem;
    color: var(--brand-accent);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: gap 0.2s ease;
}

.blog-card:hover .blog-card-read-more {
    gap: 0.5rem;
}

/* ============ POST DETAIL PAGE ============ */
.blog-post-layout {
    display: grid;
    grid-template-columns: 1fr var(--blog-sidebar-width);
    gap: var(--blog-gap);
    max-width: calc(var(--blog-content-max) + var(--blog-sidebar-width) + var(--blog-gap));
    margin: 0 auto;
    padding: 0 2rem;
    align-items: start;
}

.blog-post-header {
    padding: 10rem 0 2rem;
    text-align: center;
    max-width: 820px;
    margin: 0 auto;
}

.blog-post-header .post-date {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.blog-post-header h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    background: linear-gradient(180deg, #fff 0%, #d4d4d8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-post-header .post-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.blog-post-header .post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    flex-wrap: wrap;
}

.blog-post-header .post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.blog-post-thumbnail {
    width: 100%;
    max-width: 945px;
    margin: 0 auto 3rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.blog-post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============ ARTICLE CONTENT ============ */
.blog-post-content {
    min-width: 0;
}

.blog-post-content .article-body {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #d4d4d8;
}

.blog-post-content .article-body h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.blog-post-content .article-body h2:first-child {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.blog-post-content .article-body h3 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.blog-post-content .article-body h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.blog-post-content .article-body p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.blog-post-content .article-body a {
    color: var(--brand-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(167, 139, 250, 0.4);
    transition: text-decoration-color 0.2s ease;
}

.blog-post-content .article-body a:hover {
    text-decoration-color: var(--brand-accent);
}

.blog-post-content .article-body strong {
    color: var(--text-primary);
    font-weight: 500 !important;
}

.blog-post-content .article-body em {
    color: #e4e4e7;
}

.blog-post-content .article-body blockquote {
    border-left: 3px solid var(--brand-purple);
    background: rgba(124, 58, 237, 0.06);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: #a1a1aa;
    font-style: italic;
}

.blog-post-content .article-body blockquote p:last-child {
    margin-bottom: 0;
}

/* Lists */
.blog-post-content .article-body > ul,
.blog-post-content .article-body > ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.blog-post-content .article-body > li {
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.blog-post-content .article-body ul li::marker {
    color: var(--brand-accent);
}

.blog-post-content .article-body ol li::marker {
    color: var(--brand-accent);
    font-weight: 600;
}

/* Inline code */
.blog-post-content .article-body code {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-size: 0.88em;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    color: #e4e4e7;
}

/* Code blocks - override inline code styles */
.blog-post-content .article-body pre {
    margin: 0;
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.blog-post-content .article-body pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85rem;
    border-radius: 0;
    color: inherit;
}

/* Images */
.blog-post-content .article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    margin: 1.5rem 0;
    display: block;
}

/* Tables */
.blog-post-content .article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.blog-post-content .article-body th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border-medium);
    color: var(--text-primary);
}

.blog-post-content .article-body td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

/* Horizontal rule */
.blog-post-content .article-body hr {
    border: none;
    height: 1px;
    background: var(--border-subtle);
    margin: 2.5rem 0;
}

/* ============ SIDEBAR ============ */
.blog-sidebar {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-bottom: 2rem;
}

.sidebar-toc {
    border-left: 2px solid var(--border-subtle);
    padding-left: 1rem;
}

.sidebar-toc-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.sidebar-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-toc-list li {
    margin-bottom: 0.5rem;
}

.sidebar-toc-list a {
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-decoration: none;
    line-height: 1.4;
    display: block;
    padding: 0.2rem 0;
    border-left: 2px solid transparent;
    margin-left: -1.15rem;
    padding-left: 0.95rem;
    transition: all 0.15s ease-in-out;
}

.sidebar-toc-list a:hover {
    color: var(--text-primary);
}

.sidebar-toc-list a.active {
    color: #ae7fff;
    border-left-color: var(--brand-accent);
    font-weight: 600;
    letter-spacing: 0.025rem;
}

/* ============ AUTHOR BOX ============ */
.author-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-top: 3rem;
}

.author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-purple), var(--brand-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}

.author-avatar-initials {
    background: linear-gradient(135deg, var(--color-purple), var(--color-purple-light));
    font-size: 1.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.author-avatar-img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.author-info p {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin: 0;
    line-height: 1.4;
}

.author-social {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.author-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.author-social a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-highlight);
    color: var(--brand-accent);
    transform: translateY(-1px);
}

/* ============ SOCIAL SHARE ============ */
.social-share {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    margin: 2rem 0;
}

.social-share-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.social-share-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.social-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-share-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-highlight);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* ============ RELATED POSTS ============ */
.related-posts {
    padding: 4rem 0;
}

.related-posts-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* ============ CTA WIDGET ============ */
.blog-cta-widget {
    position: relative;
    min-height: 280px;
    background: url("/static/img/cta_widget_bground.d950dbd88d00.webp");
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: 14px;
    margin: 2rem 0;
    overflow: hidden;
}

.blog-cta-content {
    width: 51%;
    padding: 2.5rem;
    text-align: left;
    position: relative;
    z-index: 1;
}

.blog-cta-widget h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.blog-cta-widget p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.blog-cta-widget .btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    background: var(--color-purple);
    color: #fff;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-cta-widget .btn-cta:hover {
    background: var(--color-purple-light);
    transform: translateY(-1px);
    color: #fff;
}

/* ============ CTA BUTTON WIDGET ============ */
.blog-cta-button-widget {
    margin: 2rem 0;
}

.btn-cta-full {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    background: var(--color-purple);
    color: #fff;
    font-weight: 500;
    font-size: 1.25rem;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

.btn-cta-full:hover {
    background: var(--color-purple-light);
    transform: translateY(-1px);
    color: #fff;
}

.btn-cta-full .btn-text-mobile {
    display: none;
}

.btn-cta-full .btn-text-desktop {
    display: inline;
}

/* ============ EMPTY STATE ============ */
.blog-empty {
    text-align: center;
    padding: 6rem 2rem;
}

.blog-empty i {
    font-size: 3rem;
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
    display: block;
}

.blog-empty h3 {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.blog-empty p {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* ============ PYGMENTS SYNTAX HIGHLIGHTING (Monokai) ============ */
.highlight {
    background: #1a1a2e;
    border: 1px solid #292939;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.65;
    margin-bottom: 1rem;
}

.highlight pre {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    overflow-x: auto;
}

.highlight .hll { background-color: #49483e }
.highlight .c { color: #959077 }
.highlight .err { color: #ED007E; background-color: #1E0010 }
.highlight .esc { color: #F8F8F2 }
.highlight .g { color: #F8F8F2 }
.highlight .k { color: #66D9EF }
.highlight .l { color: #AE81FF }
.highlight .n { color: #F8F8F2 }
.highlight .o { color: #FF4689 }
.highlight .x { color: #F8F8F2 }
.highlight .p { color: #F8F8F2 }
.highlight .ch { color: #959077 }
.highlight .cm { color: #959077 }
.highlight .cp { color: #959077 }
.highlight .cpf { color: #959077 }
.highlight .c1 { color: #959077 }
.highlight .cs { color: #959077 }
.highlight .gd { color: #FF4689 }
.highlight .ge { color: #F8F8F2; font-style: italic }
.highlight .ges { color: #F8F8F2; font-weight: bold; font-style: italic }
.highlight .gr { color: #F8F8F2 }
.highlight .gh { color: #F8F8F2 }
.highlight .gi { color: #A6E22E }
.highlight .go { color: #66D9EF }
.highlight .gp { color: #FF4689; font-weight: bold }
.highlight .gs { color: #F8F8F2; font-weight: bold }
.highlight .gu { color: #959077 }
.highlight .gt { color: #F8F8F2 }
.highlight .kc { color: #66D9EF }
.highlight .kd { color: #66D9EF }
.highlight .kn { color: #FF4689 }
.highlight .kp { color: #66D9EF }
.highlight .kr { color: #66D9EF }
.highlight .kt { color: #66D9EF }
.highlight .ld { color: #E6DB74 }
.highlight .m { color: #AE81FF }
.highlight .s { color: #E6DB74 }
.highlight .na { color: #A6E22E }
.highlight .nb { color: #F8F8F2 }
.highlight .nc { color: #A6E22E }
.highlight .no { color: #66D9EF }
.highlight .nd { color: #A6E22E }
.highlight .ni { color: #F8F8F2 }
.highlight .ne { color: #A6E22E }
.highlight .nf { color: #A6E22E }
.highlight .nl { color: #F8F8F2 }
.highlight .nn { color: #F8F8F2 }
.highlight .nx { color: #A6E22E }
.highlight .py { color: #F8F8F2 }
.highlight .nt { color: #FF4689 }
.highlight .nv { color: #F8F8F2 }
.highlight .ow { color: #FF4689 }
.highlight .pm { color: #F8F8F2 }
.highlight .w { color: #F8F8F2 }
.highlight .mb { color: #AE81FF }
.highlight .mf { color: #AE81FF }
.highlight .mh { color: #AE81FF }
.highlight .mi { color: #AE81FF }
.highlight .mo { color: #AE81FF }
.highlight .sa { color: #E6DB74 }
.highlight .sb { color: #E6DB74 }
.highlight .sc { color: #E6DB74 }
.highlight .dl { color: #E6DB74 }
.highlight .sd { color: #E6DB74 }
.highlight .s2 { color: #E6DB74 }
.highlight .se { color: #AE81FF }
.highlight .sh { color: #E6DB74 }
.highlight .si { color: #E6DB74 }
.highlight .sx { color: #E6DB74 }
.highlight .sr { color: #E6DB74 }
.highlight .s1 { color: #E6DB74 }
.highlight .ss { color: #E6DB74 }
.highlight .bp { color: #F8F8F2 }
.highlight .fm { color: #A6E22E }
.highlight .vc { color: #F8F8F2 }
.highlight .vg { color: #F8F8F2 }
.highlight .vi { color: #F8F8F2 }
.highlight .vm { color: #F8F8F2 }
.highlight .il { color: #AE81FF }

/* ============ RESPONSIVE ============ */
@media (max-width: 992px) {
    .blog-post-layout {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        display: none;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .blog-post-header h1 {
        font-size: 2.25rem;
    }

    .blog-cta-widget {
        url("/static/img/cta_widget_bground.d950dbd88d00.webp");
        background-size: cover;
        background-position: center bottom;
        min-height: 260px;
    }

    .blog-cta-content {
        width: 100%;
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 8rem 0 3rem;
    }

    .blog-hero .hero-title {
        font-size: 2.5rem;
    }

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

    .blog-post-header {
        padding: 8rem 1rem 1.5rem;
    }

    .blog-post-header h1 {
        font-size: 1.85rem;
    }

    .blog-post-header .post-description {
        font-size: 1rem;
    }

    .btn-cta-full .btn-text-desktop {
        display: none;
    }

    .btn-cta-full .btn-text-mobile {
        display: inline;
    }

    .blog-post-content .article-body {
        font-size: 1rem;
    }

    .social-share {
        flex-direction: column;
        align-items: flex-start;
    }

    .author-box {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .blog-hero .hero-title {
        font-size: 2rem;
    }

    .blog-post-header h1 {
        font-size: 1.6rem;
    }

    .blog-post-layout {
        padding: 0 1rem;
    }

    .blog-card-image,
    .blog-card-image-placeholder {
        height: 160px;
    }
}
