/* ==========================================================================
   Blog Styles — JustCollabs
   Matches legal_base.html design system (Space Grotesk + Outfit, purple/pink)
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --purple: #8B5CF6;
    --purple-light: #A78BFA;
    --pink: #EC4899;
    --blue: #3B82F6;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-600: #4B5563;
    --gray-900: #111827;
    --header-h: 92px;
    --cat-bar-h: 56px;
}

body {
    background: var(--gray-50);
    color: var(--gray-900);
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==========================================================================
   Site Header
   ========================================================================== */

.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 60px;
}

.header-btns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn {
    padding: 0.65rem 1.5rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple), var(--pink));
    color: white;
}

.btn-primary:hover {
    transform: scale(1.05);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-900);
}

.btn-ghost:hover {
    background: var(--gray-100);
}

/* ==========================================================================
   Main
   ========================================================================== */

main {
    margin-top: var(--header-h);
    min-height: calc(100vh - var(--header-h) - 280px);
}

/* ==========================================================================
   Blog Container
   ========================================================================== */

.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
}

/* ── Page header ── */

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

.blog-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.75rem;
    font-weight: 900;
    line-height: 1.1;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.blog-subtitle {
    color: var(--gray-600);
    font-size: 1.05rem;
    margin-top: 0.35rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--purple);
}

/* ==========================================================================
   Sticky Category Bar
   ========================================================================== */

.category-bar {
    position: sticky;
    top: var(--header-h);
    z-index: 100;
    background: rgba(249, 250, 251, 0.92);
    backdrop-filter: blur(8px);
    margin: 0 -2rem;
    padding: 0 2rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 2rem;
}

.category-bar__inner {
    display: flex;
    gap: 0.4rem;
    padding: 0.75rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-bar__inner::-webkit-scrollbar {
    display: none;
}

.category-pill {
    flex-shrink: 0;
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 100px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-600);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-pill:hover {
    border-color: var(--purple);
    color: var(--purple);
}

.category-pill--active {
    background: linear-gradient(135deg, var(--purple), var(--pink));
    color: var(--white);
    border-color: transparent;
}

.category-pill--active:hover {
    color: var(--white);
    border-color: transparent;
    opacity: 0.9;
}

/* ==========================================================================
   Mosaic Grid
   ========================================================================== */

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

/* ==========================================================================
   Post Card
   ========================================================================== */

.post-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

/* Featured card — spans 2 columns */
.post-card--featured {
    grid-column: span 2;
    border-color: transparent;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    color: var(--white);
}

.post-card--featured .post-card__image {
    height: 300px;
}

.post-card--featured .post-card__body {
    padding: 1.5rem 2rem 2rem;
}

.post-card--featured .post-card__category {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
}

.post-card--featured .post-card__title {
    font-size: 1.75rem;
}

.post-card--featured .post-card__title a {
    color: var(--white);
}

.post-card--featured .post-card__title a:hover {
    color: rgba(255, 255, 255, 0.85);
}

.post-card--featured .post-card__excerpt {
    color: rgba(255, 255, 255, 0.85);
    -webkit-line-clamp: 4;
}

.post-card--featured .post-card__date {
    color: rgba(255, 255, 255, 0.7);
}

.post-card--featured .post-card__reading-time {
    color: rgba(255, 255, 255, 0.7);
}

.post-card__image-link {
    display: block;
    overflow: hidden;
}

.post-card__image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.post-card:hover .post-card__image {
    transform: scale(1.03);
}

.post-card__body {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-card__meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
    font-size: 0.8rem;
}

.post-card__category {
    background: linear-gradient(135deg, var(--purple), var(--pink));
    color: white;
    padding: 0.2rem 0.7rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.7rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: opacity 0.2s;
}

.post-card__category:hover {
    opacity: 0.85;
}

.post-card__date {
    color: var(--gray-400);
}

.post-card__title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.5rem;
}

.post-card__title a {
    color: var(--gray-900);
    text-decoration: none;
    transition: color 0.2s;
}

.post-card__title a:hover {
    color: var(--purple);
}

.post-card__excerpt {
    color: var(--gray-600);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.post-card__footer {
    display: flex;
    align-items: center;
    margin-top: auto;
}

.post-card__reading-time {
    color: var(--gray-400);
    font-size: 0.8rem;
}

.post-card__reading-time i {
    margin-right: 0.25rem;
}

/* ==========================================================================
   Skeleton Loading
   ========================================================================== */

.skeleton-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.skeleton-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    overflow: hidden;
}

.skeleton-img {
    width: 100%;
    height: 180px;
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.skeleton-line {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: 0.75rem;
}

.skeleton-line--short {
    width: 40%;
}

.skeleton-line--med {
    width: 65%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   End of Feed / Empty State
   ========================================================================== */

.end-of-feed {
    text-align: center;
    padding: 2.5rem 0 1rem;
    color: var(--gray-400);
    font-size: 0.9rem;
}

.end-of-feed span {
    display: inline-block;
    padding: 0.4rem 1.25rem;
    border: 1px solid var(--gray-200);
    border-radius: 100px;
    background: var(--white);
}

.empty-state {
    text-align: center;
    padding: 6rem 2rem;
    color: var(--gray-400);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.empty-state p {
    font-size: 1.1rem;
}

/* ==========================================================================
   Article Detail
   ========================================================================== */

.article__hero {
    width: 100%;
    max-height: 480px;
    overflow: hidden;
}

.article__hero-image {
    width: 100%;
    height: 100%;
    max-height: 480px;
    object-fit: cover;
    display: block;
}

.article__container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
}

.article__header {
    margin-bottom: 2.5rem;
}

.article__category {
    display: inline-block;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    color: white;
    padding: 0.25rem 0.8rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 1rem;
}

.article__title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.75rem;
    font-weight: 900;
    line-height: 1.15;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.article__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-400);
    font-size: 0.9rem;
}

.article__author {
    font-weight: 600;
    color: var(--gray-600);
}

.article__separator {
    color: var(--gray-300);
}

/* Article Content (rendered Markdown) */
.article__content {
    color: var(--gray-900);
    font-size: 1.1rem;
    line-height: 1.85;
}

.article__content h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--gray-900);
}

.article__content h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.article__content h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--gray-900);
}

.article__content h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.article__content p {
    margin-bottom: 1.25rem;
    color: var(--gray-600);
}

.article__content ul,
.article__content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.75rem;
}

.article__content li {
    margin-bottom: 0.5rem;
    color: var(--gray-600);
}

.article__content a {
    color: var(--purple);
    text-decoration: underline;
    font-weight: 600;
}

.article__content a:hover {
    color: var(--pink);
}

.article__content blockquote {
    border-left: 3px solid var(--purple);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--white);
    border-radius: 0 8px 8px 0;
}

.article__content blockquote p {
    color: var(--gray-600);
    margin-bottom: 0;
}

.article__content code {
    background: var(--gray-100);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.article__content pre {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.25rem;
}

.article__content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.article__content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.article__content hr {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 2rem 0;
}

/* Tags */
.article__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.tag-chip {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.tag-chip:hover {
    border-color: var(--purple);
    color: var(--purple);
}

.article__back {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

/* ==========================================================================
   Footer (matches legal_base.html)
   ========================================================================== */

footer {
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 3rem 2rem 2rem;
    margin-top: 0;
}

.footer-wrap {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-brand h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--gray-900);
}

.footer-brand p {
    color: var(--gray-600);
}

.footer-col h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-900);
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--gray-600);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--purple);
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

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

    .skeleton-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .skeleton-card:last-child {
        display: none;
    }
}

@media (max-width: 768px) {
    .blog-header h1 {
        font-size: 2rem;
    }

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

    .post-card--featured {
        grid-column: 1;
        grid-row: span 1;
    }

    .post-card--featured .post-card__title {
        font-size: 1.35rem;
    }

    .post-card--featured .post-card__image {
        min-height: 200px;
        height: 200px;
    }

    .category-bar {
        margin: 0 -2rem;
        padding: 0 1.5rem;
    }

    .skeleton-row {
        grid-template-columns: 1fr;
    }

    .skeleton-card:nth-child(2),
    .skeleton-card:last-child {
        display: none;
    }

    .article__title {
        font-size: 2rem;
    }

    .article__container {
        padding: 2rem 1.5rem 3rem;
    }

    .article__hero {
        max-height: 300px;
    }

    .article__hero-image {
        max-height: 300px;
    }

    .footer-wrap {
        grid-template-columns: 1fr;
    }

    .header-btns .btn-ghost {
        display: none;
    }
}

@media (max-width: 576px) {
    .blog-container {
        padding: 1.5rem 1rem 3rem;
    }

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

    .category-bar {
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .post-card__body {
        padding: 1rem 1.25rem 1.25rem;
    }

    .article__title {
        font-size: 1.65rem;
    }

    .article__meta {
        font-size: 0.8rem;
    }

    .article__content {
        font-size: 1rem;
    }
}
