/* ================================================
   My Pocket Coach — Blog Styles
   ================================================ */

/* === NAV ACTIVE STATE === */
.nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    width: 100%;
}

/* === READING PROGRESS BAR === */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    z-index: 1100;
    transition: width 0.1s linear;
}

/* === BLOG HERO === */
.blog-hero {
    position: relative;
    padding: 180px 0 80px;
    text-align: center;
    overflow: hidden;
}

.blog-hero .hero-background {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.blog-hero .gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
}

.blog-hero .orb-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -200px;
    left: -100px;
    opacity: 0.15;
}

.blog-hero .orb-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    bottom: -150px;
    right: -100px;
    opacity: 0.15;
}

.blog-hero-content {
    position: relative;
    z-index: 1;
}

.blog-hero-title {
    font-family: var(--font-display);
    font-size: clamp(48px, 8vw, 80px);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    line-height: 1.1;
}

.blog-hero-subtitle {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
}

/* === CATEGORY FILTER BAR === */
.blog-filters {
    padding: 0 0 40px;
    position: relative;
    z-index: 1;
}

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

.filter-tag {
    padding: 8px 20px;
    border-radius: 100px;
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-tag.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--text-primary);
    border-color: transparent;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

/* === BLOG POST GRID === */
.blog-grid-section {
    padding: 0 0 var(--section-padding);
}

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

/* === POST CARD === */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    animation: fadeInUp 0.6s ease forwards;
}

.post-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow:
        0 8px 40px rgba(0, 240, 255, 0.1),
        0 0 0 1px rgba(0, 240, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.post-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.post-card-image {
    width: 100%;
    height: 200px;
    background: var(--bg-tertiary);
    overflow: hidden;
    position: relative;
}

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

.post-card:hover .post-card-image img {
    transform: scale(1.05);
}

.post-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-card));
    color: var(--text-muted);
    transition: color 0.4s ease;
}

.post-card:hover .post-card-image-placeholder {
    color: var(--primary);
}

.post-card-body {
    padding: 24px;
}

/* === CATEGORY TAGS === */
.post-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.cat-ai-coaching {
    background: rgba(0, 240, 255, 0.12);
    color: var(--primary);
    border: 1px solid rgba(0, 240, 255, 0.25);
}

.cat-nutrition-science {
    background: rgba(76, 175, 80, 0.12);
    color: #66bb6a;
    border: 1px solid rgba(76, 175, 80, 0.25);
}

.cat-training {
    background: rgba(124, 77, 255, 0.12);
    color: var(--secondary);
    border: 1px solid rgba(124, 77, 255, 0.25);
}

.cat-wearables {
    background: rgba(255, 152, 0, 0.12);
    color: #ffb74d;
    border: 1px solid rgba(255, 152, 0, 0.25);
}

.cat-competition-prep {
    background: rgba(255, 0, 110, 0.12);
    color: var(--accent);
    border: 1px solid rgba(255, 0, 110, 0.25);
}

.cat-trends {
    background: rgba(233, 30, 99, 0.12);
    color: #f48fb1;
    border: 1px solid rgba(233, 30, 99, 0.25);
}

.post-card-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 12px;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.post-card:hover .post-card-title {
    color: var(--primary);
}

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

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.meta-separator {
    color: var(--text-muted);
}

/* === BACK TO BLOG LINK === */
.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    margin-bottom: 24px;
}

.back-to-blog:hover {
    color: var(--primary);
}

.back-to-blog svg {
    transition: transform 0.3s ease;
}

.back-to-blog:hover svg {
    transform: translateX(-3px);
}

/* === BREADCRUMB NAV === */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    padding-top: 120px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb-separator {
    color: var(--text-muted);
    font-size: 12px;
}

.breadcrumb-current {
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

/* === ARTICLE PAGE LAYOUT === */
.article-layout {
    display: grid;
    grid-template-columns: 1fr minmax(0, 720px) 1fr;
    gap: 40px;
    padding-bottom: var(--section-padding);
}

.article-sidebar-left {
    position: relative;
}

.article-main {
    min-width: 0;
}

.article-sidebar-right {
    position: relative;
}

/* === POST HEADER === */
.post-header {
    margin-bottom: 48px;
}

.post-header .post-category {
    margin-bottom: 16px;
}

.post-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.post-meta-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-secondary);
}

.post-meta-bar time {
    color: var(--text-muted);
}

.post-meta-bar .read-time {
    color: var(--text-muted);
}

.post-author-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--bg-primary);
}

/* === TABLE OF CONTENTS (Desktop Sidebar) === */
.toc {
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.toc-title {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid var(--border-color);
}

.toc-list li {
    padding-left: 16px;
    position: relative;
}

.toc-list a {
    display: block;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
    line-height: 1.5;
}

.toc-list a:hover,
.toc-list a.active {
    color: var(--primary);
}

.toc-list a.active::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 20px;
    background: var(--primary);
}

/* === ARTICLE BODY TYPOGRAPHY === */
.article-body {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.article-body h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 48px;
    margin-bottom: 20px;
    line-height: 1.3;
    scroll-margin-top: 100px;
}

.article-body h3 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 36px;
    margin-bottom: 16px;
    line-height: 1.35;
    scroll-margin-top: 100px;
}

.article-body h4 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 28px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.article-body p {
    margin-bottom: 20px;
}

.article-body a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(0, 240, 255, 0.3);
    transition: text-decoration-color 0.3s ease;
}

.article-body a:hover {
    text-decoration-color: var(--primary);
}

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

.article-body em {
    font-style: italic;
    color: var(--text-secondary);
}

/* Lists */
.article-body ul,
.article-body ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.article-body ul {
    list-style: none;
    padding-left: 0;
}

.article-body ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
}

.article-body ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 11px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

.article-body ol li {
    margin-bottom: 10px;
    padding-left: 4px;
}

.article-body ol li::marker {
    color: var(--primary);
    font-weight: 600;
}

/* Blockquote */
.article-body blockquote {
    border-left: 3px solid var(--primary);
    margin: 32px 0;
    padding: 20px 24px;
    background: rgba(0, 240, 255, 0.04);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--text-secondary);
}

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

/* Code blocks */
.article-body code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9em;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--primary-light);
}

.article-body pre {
    margin: 28px 0;
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.article-body pre code {
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Images in article */
.article-body img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 28px 0;
    border: 1px solid var(--border-color);
}

.article-body figure {
    margin: 32px 0;
}

.article-body figcaption {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 12px;
    font-style: italic;
}

/* Horizontal rule */
.article-body hr {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 48px 0;
}

/* Tables */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0;
    font-size: 15px;
}

.article-body th,
.article-body td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.article-body th {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.article-body tr:hover td {
    background: rgba(0, 240, 255, 0.03);
}

/* === SHARE BUTTONS === */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.share-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
    transform: translateY(-2px);
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

.share-btn.copied {
    border-color: #4caf50;
    color: #4caf50;
}

/* === AUTHOR BIO === */
.author-bio {
    margin-top: 64px;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.author-bio-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--bg-primary);
    flex-shrink: 0;
}

.author-bio-text {
    flex: 1;
    min-width: 0;
}

.author-bio-name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.author-bio-role {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 12px;
}

.author-bio-description {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-secondary);
}

/* === WAITLIST CTA SECTION (Post Bottom) === */
.post-cta {
    margin-top: 64px;
    padding: 48px 40px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.06), rgba(124, 77, 255, 0.06));
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.post-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(0, 240, 255, 0.05), transparent 60%);
    pointer-events: none;
}

.post-cta-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    position: relative;
}

.post-cta-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.post-cta .cta-button {
    position: relative;
}

/* === RELATED POSTS === */
.related-posts {
    margin-top: 80px;
    padding-top: 48px;
    border-top: 1px solid var(--border-color);
}

.related-posts-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 32px;
}

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

.related-post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.related-post-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 240, 255, 0.25);
    box-shadow: 0 6px 30px rgba(0, 240, 255, 0.08);
}

.related-post-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    padding: 20px;
}

.related-post-card .post-category {
    margin-bottom: 10px;
}

.related-post-card h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.related-post-card:hover h3 {
    color: var(--primary);
}

.related-post-card .post-card-meta {
    font-size: 12px;
}

/* === ANIMATION KEYFRAMES === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    .article-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .article-sidebar-left {
        display: none;
    }

    .article-sidebar-right {
        display: none;
    }

    /* Show inline TOC on tablet */
    .toc-inline {
        display: block;
        margin-bottom: 40px;
        padding: 24px;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 12px;
    }

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

/* Hide inline TOC on desktop (shown in sidebar) */
.toc-inline {
    display: none;
}

/* === RESPONSIVE: MOBILE (max-width: 768px) === */
@media (max-width: 768px) {
    .blog-hero {
        padding: 140px 0 60px;
    }

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

    .filter-bar {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }

    .filter-bar::-webkit-scrollbar {
        display: none;
    }

    .filter-tag {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .post-card-image {
        height: 180px;
    }

    .post-card-body {
        padding: 20px;
    }

    .post-card-title {
        font-size: 18px;
    }

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

    .article-body {
        font-size: 16px;
    }

    .article-body h2 {
        font-size: 24px;
        margin-top: 40px;
    }

    .article-body h3 {
        font-size: 20px;
        margin-top: 32px;
    }

    .article-body blockquote {
        margin: 24px 0;
        padding: 16px 20px;
    }

    .article-body pre {
        padding: 16px;
        margin: 20px -24px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .author-bio {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px;
    }

    .post-cta {
        padding: 36px 24px;
    }

    .post-cta-title {
        font-size: 24px;
    }

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

    .share-buttons {
        flex-wrap: wrap;
    }

    .breadcrumb {
        padding-top: 100px;
        margin-bottom: 24px;
    }

    .breadcrumb-current {
        max-width: 180px;
    }
}

/* === RESPONSIVE: SMALL MOBILE (max-width: 480px) === */
@media (max-width: 480px) {
    .blog-hero {
        padding: 120px 0 48px;
    }

    .post-card-excerpt {
        -webkit-line-clamp: 2;
    }

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