/* Blog — list, post, sidebar (MyPDF Guru dark theme) */

.blog-page,
.blog-post-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
    width: 100%;
    box-sizing: border-box;
    overflow-x: clip;
}

.blog-hero {
    text-align: center;
    margin-bottom: 2.5rem;
    max-width: 100%;
}

.blog-hero h1 {
    color: var(--text-primary);
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    margin: 0 0 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 800;
    line-height: 1.2;
    flex-wrap: wrap;
}

.blog-hero h1 i {
    color: #f79112;
}

.blog-kicker {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    margin-bottom: 0.6rem;
}

.blog-kicker a {
    color: #f79112;
    text-decoration: none;
}

.blog-kicker a:hover {
    text-decoration: underline;
}

.blog-hero-lead {
    color: var(--text-secondary);
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.65;
    width: calc(95% - 0.2rem);
    max-width: none;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0;
    box-sizing: border-box;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.blog-section-title {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1.1rem;
    line-height: 1.3;
}

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

.blog-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--primary-light);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
    border-color: rgba(247, 145, 18, 0.55);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.blog-card-media {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #1a2332;
}

.blog-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

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

.blog-card-body {
    padding: 1.1rem 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.45rem;
}

.blog-card-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
}

.blog-card-dot {
    margin: 0 0.25rem;
}

.blog-card-title {
    font-size: 1.05rem;
    line-height: 1.35;
    margin: 0;
    font-weight: 700;
}

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

.blog-card-title a:hover {
    color: #f79112;
}

.blog-card-desc {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.blog-card-more {
    margin-top: 0.5rem;
    color: #f79112;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.blog-card-more:hover {
    text-decoration: underline;
}

.blog-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 1rem;
}

/* Pagination */
.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.75rem;
    flex-wrap: wrap;
}

.blog-page-btn {
    color: #fff;
    text-decoration: none;
    border: 1px solid var(--primary-light);
    background: rgba(255, 255, 255, 0.04);
    padding: 0.55rem 0.95rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}

.blog-page-btn:hover:not(.is-disabled) {
    border-color: #f79112;
    color: #f79112;
}

.blog-page-btn.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.blog-page-numbers {
    list-style: none;
    display: flex;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
}

.blog-page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0 0.4rem;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.9rem;
}

.blog-page-num:hover {
    border-color: var(--primary-light);
    color: #fff;
}

.blog-page-num.is-current {
    background: #f79112;
    color: #1a1208;
    border-color: #f79112;
}

/* Post detail */
.blog-post-top {
    margin-bottom: 1.75rem;
}

.blog-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.blog-back:hover {
    color: #f79112;
}

.blog-post-title {
    font-size: clamp(1.6rem, 3.5vw, 2.25rem);
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 0.75rem;
    color: #fff;
    max-width: 820px;
}

.blog-post-meta {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin: 0 0 1.25rem;
}

.blog-post-feature {
    margin: 0 0 1.5rem;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--primary-light);
    background: #1a2332;
}

.blog-post-feature img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    vertical-align: middle;
}

.blog-post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 3rem;
    align-items: start;
    padding-bottom: 2rem;
}

.blog-post-main {
    min-width: 0;
    padding-right: 0.25rem;
}

.blog-prose {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.75;
}

.blog-prose > *:first-child {
    margin-top: 0;
}

.blog-prose h2,
.blog-prose h3 {
    color: #fff;
    margin: 1.75rem 0 0.75rem;
    line-height: 1.3;
}

.blog-prose h2 {
    font-size: 1.45rem;
}

.blog-prose h3 {
    font-size: 1.15rem;
}

.blog-prose p,
.blog-prose ul,
.blog-prose ol {
    margin: 0 0 1rem;
}

.blog-prose ul,
.blog-prose ol {
    padding-left: 1.25rem;
}

.blog-prose li {
    margin-bottom: 0.35rem;
}

.blog-prose a {
    color: #f79112;
}

.blog-prose strong {
    color: #fff;
}

.blog-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--primary-light);
    margin: 0.75rem 0 1.25rem;
}

.blog-prose .blog-tool-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.25rem 0 1rem;
    color: #fff;
    font-weight: 600;
    font-size: 1.05rem;
}

.blog-prose .blog-tool-head img.blog-logo,
.blog-prose img.blog-logo {
    width: 48px;
    height: 48px;
    margin: 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #fff;
    object-fit: contain;
    flex-shrink: 0;
}

.blog-prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 0.95rem;
}

.blog-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0.75rem 0 1.5rem;
    border: 1px solid var(--primary-light);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.blog-table-scroll table {
    min-width: 520px;
    margin: 0;
    border: none;
}

.blog-table-scroll th,
.blog-table-scroll td {
    border-color: rgba(255, 255, 255, 0.08);
}

.blog-table-scroll tr:last-child td {
    border-bottom: none;
}

.blog-prose th,
.blog-prose td {
    border: 1px solid var(--primary-light);
    padding: 0.65rem 0.75rem;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.blog-prose th {
    background: rgba(247, 145, 18, 0.12);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.blog-prose td {
    background: rgba(255, 255, 255, 0.02);
}

.blog-prose blockquote {
    margin: 1.25rem 0;
    padding: 0.85rem 1rem;
    border-left: 3px solid #f79112;
    background: rgba(247, 145, 18, 0.08);
    border-radius: 0 10px 10px 0;
    color: var(--text-secondary);
}

.blog-prose code {
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

.blog-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--primary-light);
}

.blog-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--primary-light);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
}

.blog-tag:hover {
    border-color: #f79112;
    color: #f79112;
}

.blog-tag em {
    font-style: normal;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Sidebar — page scroll only; sticky top set by blog-sidebar.js */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    position: sticky;
    top: 4.75rem; /* JS overrides with measured value */
    align-self: start;
    margin: 0 0 1.5rem;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 0;
    overflow: visible;
}

.blog-side-list a {
    display: grid;
    grid-template-columns: 84px 1fr;
    gap: 0.75rem;
    text-decoration: none;
    align-items: start;
}

.blog-side-list img {
    width: 84px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--primary-light);
    background: #1a2332;
}

.blog-side-list strong {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #fff;
    font-size: 0.88rem;
    line-height: 1.35;
    font-weight: 600;
}

.blog-side-list small {
    display: block;
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.blog-editor-poster {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 1.35rem 1.2rem 1.25rem;
    border-radius: 16px;
    text-decoration: none;
    overflow: hidden;
    min-height: 210px;
    justify-content: flex-end;
    border: 1px solid rgba(247, 145, 18, 0.45);
    background:
        radial-gradient(ellipse 90% 70% at 80% 0%, rgba(247, 145, 18, 0.35), transparent 55%),
        linear-gradient(155deg, #1f2838 0%, #2d3752 45%, #1a2332 100%);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.blog-editor-poster:hover {
    transform: translateY(-3px);
    border-color: #f79112;
    box-shadow: 0 14px 34px rgba(247, 145, 18, 0.22);
}

.blog-editor-poster-glow {
    position: absolute;
    inset: auto -20% -40% auto;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(247, 145, 18, 0.25);
    filter: blur(30px);
    pointer-events: none;
}

.blog-editor-poster-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: 'Lilita One', cursive;
    font-size: 1.15rem;
    color: #fff;
}

.blog-editor-poster-brand i {
    color: #f79112;
}

.blog-editor-poster-headline {
    position: relative;
    z-index: 1;
    font-size: 1.65rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.blog-editor-poster-sub {
    position: relative;
    z-index: 1;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.blog-editor-poster-cta {
    position: relative;
    z-index: 1;
    margin-top: 0.35rem;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #f79112;
    color: #1a1208;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
}

.blog-side-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--primary-light);
    border-radius: 14px;
    padding: 1rem 1.05rem 1.1rem;
}

.blog-side-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.85rem;
}

.blog-side-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.blog-side-list a:hover strong {
    color: #f79112;
}

.blog-side-empty {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.blog-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.blog-tool-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.blog-tool-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-tool-links a i {
    color: #f79112;
    width: 1rem;
    text-align: center;
}

.blog-tool-links a:hover {
    color: #f79112;
}

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

    .blog-post-layout {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .blog-post-main {
        padding-right: 0;
        max-width: 100%;
    }

    .blog-sidebar {
        position: static;
        top: auto;
        max-height: none;
        overflow: visible;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        padding: 0;
        margin-bottom: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        width: 100%;
    }

    .blog-editor-poster {
        grid-column: 1 / -1;
    }

    .blog-prose {
        font-size: 1rem;
    }

    .blog-table-scroll table {
        min-width: 480px;
        font-size: 0.9rem;
    }
}

@media (max-width: 640px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-page,
    .blog-post-page {
        padding: 1.25rem 0.9rem 3rem;
    }

    .blog-hero {
        margin-bottom: 1.75rem;
    }

    .blog-hero h1 {
        font-size: 1.7rem;
        gap: 0.5rem;
    }

    .blog-hero-lead {
        font-size: 1rem;
        width: 100%;
        padding-left: 0;
        padding-right: 0;
        line-height: 1.6;
    }

    .blog-section-title {
        font-size: 1.1rem;
    }

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

    .blog-post-title {
        font-size: clamp(1.35rem, 6vw, 1.85rem);
        word-break: break-word;
    }

    .blog-post-feature {
        border-radius: 12px;
        margin-bottom: 1.1rem;
    }

    .blog-prose h2 {
        font-size: 1.25rem;
    }

    .blog-prose h3 {
        font-size: 1.05rem;
    }

    .blog-prose .blog-tool-head {
        gap: 0.55rem;
        font-size: 0.98rem;
    }

    .blog-prose .blog-tool-head img.blog-logo,
    .blog-prose img.blog-logo {
        width: 40px;
        height: 40px;
    }

    .blog-table-scroll {
        margin: 0.6rem 0 1.25rem;
        border-radius: 10px;
    }

    .blog-table-scroll table {
        min-width: 440px;
        font-size: 0.86rem;
    }

    .blog-prose th,
    .blog-prose td {
        padding: 0.55rem 0.6rem;
    }

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

    .blog-pagination {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .blog-page-numbers {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}
