/* ===========================
   Ducat Blog Styles
   Loads after styles.css — uses existing CSS vars
   =========================== */

/* --- Blog Hero --- */
.blog-hero {
    padding: calc(var(--nav-h) + 60px) 0 40px;
    text-align: center;
}

.blog-hero .sec-head h1 {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.blog-hero .sec-head p {
    color: var(--text-secondary);
    font-size: 17px;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Category Filter Pills --- */
.blog-filters {
    padding: 0 0 48px;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    border-radius: 427px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.filter-pill:hover {
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--text-primary);
}

.filter-pill.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

/* --- Featured Card --- */
.blog-featured {
    padding: 0 0 56px;
}

.blog-featured-card {
    display: flex;
    flex-direction: row;
    border-radius: var(--radius-card);
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.blog-featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.blog-featured-card-img {
    width: 55%;
    min-height: 320px;
    overflow: hidden;
    flex-shrink: 0;
}

.blog-featured-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-featured-card-content {
    width: 45%;
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.blog-featured-card-content .blog-card-category {
    width: fit-content;
}

.blog-featured-card-content h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
}

.blog-featured-card-content p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.blog-featured-card-content .blog-card-meta {
    margin-top: 4px;
}

/* --- Blog Grid --- */
.blog-articles {
    padding: 0 0 80px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* --- Blog Card --- */
.blog-card {
    background: var(--bg-card);
    border: 1px solid #28272c;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.blog-card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

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

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

.blog-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.blog-card-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 427px;
    background: rgba(24, 88, 228, 0.12);
    color: var(--accent-blue);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    width: fit-content;
}

.blog-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    margin: 0;
}

.blog-card-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 8px;
}

.blog-card-meta span {
    display: inline-flex;
    align-items: center;
}

.blog-card-meta .meta-sep {
    width: 3px;
    height: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Hidden state for load more */
.blog-card.hidden {
    display: none;
}

/* --- Load More --- */
.blog-load-more {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

.load-more-btn {
    padding: 12px 32px;
    font-size: 14px;
}

/* --- Post Hero --- */
.post-hero {
    padding: calc(var(--nav-h) + 32px) 0 0;
}

.post-hero-img {
    border-radius: var(--radius-card);
    overflow: hidden;
    max-height: 440px;
}

.post-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Post Layout --- */
.post-section {
    padding: 48px 0 80px;
}

.post-container {
    display: flex;
    flex-direction: row;
    gap: 48px;
}

/* --- Post Sidebar --- */
.post-sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--nav-h) + 24px);
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-toc {
    background: var(--bg-card-alt);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 20px;
}

.post-toc h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.post-toc a {
    display: block;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
    line-height: 1.4;
    border-left: 2px solid transparent;
    padding-left: 12px;
    margin-left: -2px;
}

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

.post-toc a.active {
    color: var(--accent-blue);
    border-left-color: var(--accent-blue);
}

/* --- Share Button --- */
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-btn);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.share-btn:hover {
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--text-primary);
}

.share-btn.copied {
    border-color: var(--green);
    color: var(--green);
}

/* --- Post Content --- */
.post-content {
    flex: 1;
    max-width: 720px;
    min-width: 0;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.post-date,
.post-read-time {
    font-size: 14px;
    color: var(--text-muted);
}

.post-title {
    font-size: 40px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 16px;
}

.post-author {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* --- Post Body Typography --- */
.post-body h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 48px;
    margin-bottom: 16px;
    line-height: 1.3;
}

.post-body h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 32px;
    margin-bottom: 12px;
    line-height: 1.35;
}

.post-body p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

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

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

.post-body img {
    width: 100%;
    border-radius: 12px;
    margin: 24px 0;
}

.post-body blockquote {
    border-left: 3px solid var(--accent-blue);
    padding: 16px 24px;
    margin: 24px 0;
    background: rgba(24, 88, 228, 0.04);
    border-radius: 0 8px 8px 0;
}

.post-body blockquote p {
    color: var(--text-primary);
    font-style: italic;
    margin-bottom: 0;
}

.post-body code {
    font-family: var(--font-mono);
    font-size: 14px;
    background: var(--bg-card-alt);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-primary);
}

.post-body pre {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 24px;
    overflow-x: auto;
    margin: 24px 0;
}

.post-body pre code {
    background: none;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
}

.post-body ul,
.post-body ol {
    margin: 16px 0 20px 24px;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.7;
}

.post-body li {
    margin-bottom: 8px;
}

.post-body li::marker {
    color: var(--text-muted);
}

/* --- Related Posts --- */
.related-posts {
    padding: 0 0 80px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 64px;
}

.related-posts .sec-head {
    margin-bottom: 32px;
}

.related-posts .sec-head h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

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

    .blog-featured-card {
        flex-direction: column;
    }

    .blog-featured-card-img {
        width: 100%;
        min-height: 240px;
        max-height: 320px;
    }

    .blog-featured-card-content {
        width: 100%;
        padding: 28px 24px;
    }

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

    .post-sidebar {
        width: 100%;
        position: static;
        flex-direction: row;
        gap: 12px;
    }

    .post-toc {
        flex: 1;
    }

    .share-btn {
        width: auto;
    }

    .post-content {
        max-width: 100%;
    }

    .post-title {
        font-size: 32px;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: calc(var(--nav-h) + 40px) 0 24px;
    }

    .blog-hero .sec-head h1 {
        font-size: 32px;
    }

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

    .blog-featured-card-content h2 {
        font-size: 22px;
    }

    .post-hero-img {
        max-height: 280px;
    }

    .post-title {
        font-size: 26px;
    }

    .post-body h2 {
        font-size: 22px;
        margin-top: 36px;
    }

    .post-body h3 {
        font-size: 18px;
    }

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