/* ==============================================
   FOKAL BLOG TEMPLATE - SEO OPTIMIZED
   Checklist:
   1. Breadcrumb navigation
   2. Post date + updated date
   3. Author bio + profile link
   4. Structured headings (H1-H3)
   5. Formatting styles (bold, quotes, lists, tables)
   6. Rich media (images, video, charts)
   7. Mobile-first design
   8. Subscribe CTA / lead magnet
   9. Internal links block
   10. Schema markup (in HTML, not CSS)
   ============================================== */

/* ==============================================
   CSS VARIABLES (inherits from site)
   ============================================== */
:root {
    --blog-max-width: 720px;
    --blog-wide-width: 900px;
    --blog-reading-font-size: 18px;
    --blog-line-height: 1.75;
    --blog-paragraph-spacing: 1.5em;
}

/* ==============================================
   1. BREADCRUMB NAVIGATION
   ============================================== */
.blog-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    padding: 120px 24px 16px; /* top padding clears fixed navbar */
    max-width: var(--blog-wide-width);
    margin: 0 auto;
}

.blog-breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-breadcrumbs a:hover {
    color: var(--accent-blue);
}

.blog-breadcrumbs .separator {
    color: var(--text-subtle);
    font-size: 12px;
}

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

/* ==============================================
   BLOG HEADER (Title, Meta, Author)
   ============================================== */
.blog-header {
    max-width: var(--blog-max-width);
    margin: 0 auto;
    padding: 40px 24px 32px;
    text-align: center;
}

.blog-category {
    display: inline-block;
    background: rgba(74, 192, 255, 0.12);
    color: var(--accent-blue);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.blog-header h1 {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    background: linear-gradient(180deg, #FFFFFF 0%, #C6CDD8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-excerpt {
    font-size: 20px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 28px;
}

/* ==============================================
   2. POST DATE + UPDATED DATE
   ============================================== */
.blog-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.blog-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-meta-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.blog-meta .separator {
    width: 4px;
    height: 4px;
    background: var(--text-subtle);
    border-radius: 50%;
}

.blog-updated {
    background: rgba(0, 230, 118, 0.1);
    color: var(--accent-green);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* ==============================================
   3. AUTHOR BIO + PROFILE LINK
   ============================================== */
.blog-author-card {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: var(--blog-max-width);
    margin: 0 auto 40px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
}

.blog-author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.blog-author-info {
    flex: 1;
}

.blog-author-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.blog-author-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-author-name a:hover {
    color: var(--accent-blue);
}

.blog-author-title {
    font-size: 14px;
    color: var(--text-muted);
}

.blog-author-links {
    display: flex;
    gap: 12px;
}

.blog-author-links a {
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.blog-author-links a:hover {
    color: var(--accent-blue);
}

.blog-author-links svg {
    width: 20px;
    height: 20px;
}

/* ==============================================
   FEATURED IMAGE
   ============================================== */
.blog-featured-image {
    max-width: var(--blog-wide-width);
    margin: 0 auto 48px;
    padding: 0 24px;
}

.blog-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.blog-featured-image figcaption {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 12px;
}

/* ==============================================
   BLOG CONTENT AREA
   ============================================== */
.blog-content {
    max-width: var(--blog-max-width);
    margin: 0 auto;
    padding: 0 24px;
    font-size: var(--blog-reading-font-size);
    line-height: var(--blog-line-height);
    color: var(--text-secondary);
}

/* ==============================================
   4. STRUCTURED HEADINGS (H1-H3)
   ============================================== */
.blog-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 48px 0 20px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.blog-content h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 36px 0 16px;
    line-height: 1.4;
}

.blog-content h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 28px 0 12px;
}

/* Anchor links for headings */
.blog-content h2[id],
.blog-content h3[id] {
    scroll-margin-top: 100px;
}

.blog-content .heading-anchor {
    opacity: 0;
    margin-left: 8px;
    color: var(--accent-blue);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.blog-content h2:hover .heading-anchor,
.blog-content h3:hover .heading-anchor {
    opacity: 1;
}

/* ==============================================
   5. FORMATTING STYLES (bold, quotes, lists, tables)
   ============================================== */

/* Paragraphs */
.blog-content p {
    margin-bottom: var(--blog-paragraph-spacing);
}

/* Bold & Italic */
.blog-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.blog-content em {
    font-style: italic;
}

/* Links */
.blog-content a {
    color: var(--accent-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.blog-content a:hover {
    color: #7DD3FF;
}

/* Blockquotes */
.blog-content blockquote {
    margin: 32px 0;
    padding: 24px 28px;
    background: rgba(179, 136, 255, 0.06);
    border-left: 4px solid var(--accent-purple);
    border-radius: 0 12px 12px 0;
    font-size: 19px;
    font-style: italic;
    color: var(--text-primary);
}

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

.blog-content blockquote cite {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    font-style: normal;
    color: var(--text-muted);
}

/* Unordered Lists */
.blog-content ul {
    margin: 24px 0;
    padding-left: 0;
    list-style: none;
}

.blog-content ul li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
}

.blog-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    background: var(--accent-blue);
    border-radius: 50%;
}

/* Ordered Lists */
.blog-content ol {
    margin: 24px 0;
    padding-left: 0;
    list-style: none;
    counter-reset: blog-counter;
}

.blog-content ol li {
    position: relative;
    padding-left: 36px;
    margin-bottom: 16px;
    counter-increment: blog-counter;
}

.blog-content ol li::before {
    content: counter(blog-counter);
    position: absolute;
    left: 0;
    top: 2px;
    width: 24px;
    height: 24px;
    background: rgba(74, 192, 255, 0.15);
    color: var(--accent-blue);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tables */
.blog-content table {
    width: 100%;
    margin: 32px 0;
    border-collapse: collapse;
    font-size: 15px;
}

.blog-content th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
    padding: 14px 16px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.blog-content td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.blog-content tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Code - Inline */
.blog-content code {
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9em;
    color: var(--accent-purple);
}

/* Code - Block */
.blog-content pre {
    margin: 32px 0;
    padding: 24px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow-x: auto;
}

.blog-content pre code {
    background: none;
    padding: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* Horizontal Rule */
.blog-content hr {
    margin: 48px 0;
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* ==============================================
   6. RICH MEDIA (images, video, charts)
   ============================================== */
.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 32px 0;
}

.blog-content figure {
    margin: 32px 0;
}

.blog-content figcaption {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 12px;
}

/* Video embed container */
.blog-video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    margin: 32px 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-panel);
}

.blog-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Info/Tip boxes */
.blog-callout {
    margin: 32px 0;
    padding: 20px 24px;
    border-radius: 12px;
    display: flex;
    gap: 16px;
}

.blog-callout-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.blog-callout-content {
    flex: 1;
}

.blog-callout-content p:last-child {
    margin-bottom: 0;
}

.blog-callout.info {
    background: rgba(74, 192, 255, 0.08);
    border: 1px solid rgba(74, 192, 255, 0.2);
}

.blog-callout.info .blog-callout-icon {
    color: var(--accent-blue);
}

.blog-callout.warning {
    background: rgba(255, 167, 38, 0.08);
    border: 1px solid rgba(255, 167, 38, 0.2);
}

.blog-callout.warning .blog-callout-icon {
    color: var(--accent-amber);
}

.blog-callout.success {
    background: rgba(0, 230, 118, 0.08);
    border: 1px solid rgba(0, 230, 118, 0.2);
}

.blog-callout.success .blog-callout-icon {
    color: var(--accent-green);
}

/* ==============================================
   8. SUBSCRIBE CTA / LEAD MAGNET
   ============================================== */
.blog-subscribe-cta {
    max-width: var(--blog-max-width);
    margin: 64px auto;
    padding: 40px 32px;
    background: linear-gradient(135deg, rgba(179, 136, 255, 0.1) 0%, rgba(74, 192, 255, 0.08) 100%);
    border: 1px solid rgba(179, 136, 255, 0.2);
    border-radius: 20px;
    text-align: center;
}

.blog-subscribe-cta h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.blog-subscribe-cta p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.blog-subscribe-form {
    display: flex;
    gap: 12px;
    max-width: 420px;
    margin: 0 auto;
}

.blog-subscribe-form input {
    flex: 1;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
}

.blog-subscribe-form input::placeholder {
    color: var(--text-muted);
}

.blog-subscribe-form input:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.blog-subscribe-form button {
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--accent-purple) 0%, #9575CD 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.blog-subscribe-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(179, 136, 255, 0.3);
}

/* ==============================================
   9. INTERNAL LINKS BLOCK
   ============================================== */
.blog-related-posts {
    max-width: var(--blog-wide-width);
    margin: 64px auto;
    padding: 0 24px;
}

.blog-related-posts h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

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

.blog-related-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 24px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.blog-related-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(179, 136, 255, 0.25);
    transform: translateY(-4px);
}

.blog-related-card .category {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.blog-related-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.blog-related-card .date {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==============================================
   AUTHOR BIO (Bottom of post - expanded)
   ============================================== */
.blog-author-bio {
    max-width: var(--blog-max-width);
    margin: 64px auto;
    padding: 32px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
}

.blog-author-bio-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.blog-author-bio-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.blog-author-bio-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.blog-author-bio-title {
    font-size: 14px;
    color: var(--text-muted);
}

.blog-author-bio-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.blog-author-bio-links {
    display: flex;
    gap: 16px;
}

.blog-author-bio-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-blue);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-author-bio-links a:hover {
    color: #7DD3FF;
}

/* ==============================================
   TABLE OF CONTENTS (Sticky sidebar)
   ============================================== */
.blog-layout-with-toc {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 48px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.blog-toc {
    position: sticky;
    top: 100px;
    align-self: start;
    padding: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.blog-toc h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

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

.blog-toc li {
    margin-bottom: 8px;
}

.blog-toc a {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 12px;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
}

.blog-toc a:hover {
    color: var(--text-primary);
    border-left-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.02);
}

.blog-toc a.active {
    color: var(--accent-blue);
    border-left-color: var(--accent-blue);
    background: rgba(74, 192, 255, 0.08);
}

.blog-toc .toc-h3 {
    padding-left: 24px;
    font-size: 13px;
}

/* ==============================================
   7. MOBILE-FIRST RESPONSIVE
   ============================================== */
@media (max-width: 968px) {
    .blog-layout-with-toc {
        grid-template-columns: 1fr;
    }

    .blog-toc {
        display: none; /* Hide TOC on mobile, or make it collapsible */
    }

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

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

    .blog-excerpt {
        font-size: 17px;
    }

    .blog-content {
        font-size: 16px;
    }

    .blog-content h2 {
        font-size: 24px;
    }

    .blog-content h3 {
        font-size: 20px;
    }

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

    .blog-author-bio-header {
        flex-direction: column;
        text-align: center;
    }

    .blog-subscribe-form {
        flex-direction: column;
    }

    .blog-meta {
        flex-direction: column;
        gap: 8px;
    }

    .blog-meta .separator {
        display: none;
    }
}

@media (max-width: 480px) {
    .blog-header {
        padding: 24px 16px;
    }

    .blog-content {
        padding: 0 16px;
    }

    .blog-header h1 {
        font-size: 28px;
    }

    .blog-subscribe-cta {
        padding: 28px 20px;
        margin: 48px 16px;
    }
}

/* ==============================================
   SHARE BUTTONS
   ============================================== */
.blog-share {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: var(--blog-max-width);
    margin: 48px auto;
    padding: 0 24px;
}

.blog-share-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.blog-share-buttons {
    display: flex;
    gap: 8px;
}

.blog-share-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.blog-share-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transform: translateY(-2px);
}

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

/* ==============================================
   READING PROGRESS BAR
   ============================================== */
.blog-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue));
    z-index: 1000;
    transition: width 0.1s ease;
}

/* ==============================================
   PRINT STYLES
   ============================================== */
@media print {
    .blog-toc,
    .blog-share,
    .blog-subscribe-cta,
    .blog-progress-bar {
        display: none;
    }

    .blog-content {
        max-width: 100%;
        color: black;
    }

    .blog-header h1 {
        background: none;
        -webkit-text-fill-color: black;
        color: black;
    }
}
