/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9ff;
    color: #222;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Breadcrumbs (hub + posts) */
.blog-breadcrumbs {
    margin-bottom: 1.5rem;
}

.blog-breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.8125rem;
    color: #6B7280;
    line-height: 1.4;
}

.blog-breadcrumbs li {
    display: inline-flex;
    align-items: center;
    margin: 0;
    color: #6B7280;
}

.blog-breadcrumbs li:not(:last-child)::after {
    content: '/';
    margin: 0 0.5rem;
    color: rgba(95, 16, 160, 0.35);
    font-weight: 400;
}

.blog-breadcrumbs a {
    color: #5f10a0;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.blog-breadcrumbs a:hover {
    border-bottom-color: rgba(95, 16, 160, 0.35);
}

.blog-breadcrumbs [aria-current="page"] {
    color: #4B5563;
    font-weight: 500;
}

.blog-hub-hero .blog-breadcrumbs {
    margin-bottom: 1.25rem;
}

/* Blog Hero Section */
.blog-hero {
    background: linear-gradient(135deg, #E0F2FE 0%, #d2bbf0 100%);
    padding: 2rem 1.5rem 3rem;
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        135deg,
        transparent,
        transparent 20px,
        rgba(255, 255, 255, 0.03) 20px,
        rgba(255, 255, 255, 0.03) 40px
    );
    pointer-events: none;
}

.blog-hero-content {
    max-width: 750px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Main Container */
.main-container {
    max-width: 750px;
    margin: 0 auto;
    padding: 3rem 1.5rem 0;
}

/* Article Header */
.article-header {
    margin-bottom: 2rem;
    text-align: center;
}

.article-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.article-subtitle {
    font-size: 1.125rem;
    color: #1E293B;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6B7280;
    margin-bottom: 2rem;
}

.article-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
}

/* Featured Image — desktop only (hidden on tablet and smaller) */
.featured-image {
    margin-bottom: 0;
}

.featured-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.featured-image figcaption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #6B7280;
    text-align: center;
    font-style: italic;
}

@media (max-width: 1023px) {
    .featured-image {
        display: none;
    }
}

/* Article Content */
article {
    background: #ffffff;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

article h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

article h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

article p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
    color: #374151;
}

article ul, article ol {
    margin-left: 1.5rem;
    margin-bottom: 1.25rem;
    line-height: 1.8;
}

article li {
    margin-bottom: 0.5rem;
    color: #374151;
}

article strong {
    color: #111827;
    font-weight: 600;
}

article a {
    color: #5f10a0;
    text-decoration: none;
    border-bottom: 1px solid rgba(95, 16, 160, 0.2);
    transition: border-color 0.2s ease;
}

article a:hover {
    border-bottom-color: #5f10a0;
}

/* Blockquote */
article blockquote {
    border-left: 4px solid #5f10a0;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #4B5563;
    background: #f9f7ff;
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
}

/* Code Blocks */
article pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

article code {
    font-family: 'Courier New', monospace;
}

article pre code {
    color: #f9fafb;
}

article p code {
    background: #f3f4f6;
    color: #1f2937;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Callout Box */
.callout-box {
    background: #f9f7ff;
    border-left: 4px solid #5f10a0;
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
}

.callout-box strong {
    display: block;
    color: #5f10a0;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

/* Muted info box (definitions / context) */
.info-box {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 1.75rem 0;
}

.info-box h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: #4b5563;
}

.info-box p {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
    color: #6b7280;
    line-height: 1.6;
}

.info-box p:last-child {
    margin-bottom: 0;
}

/* Article figures */
.article-figure {
    margin: 1.75rem 0;
}

.article-figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
}

.article-figure figcaption {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: #6b7280;
    text-align: center;
    line-height: 1.45;
}

.article-figure-grid {
    display: grid;
    gap: 1rem;
    margin: 1.75rem 0;
    align-items: stretch;
}

.article-figure-grid .article-figure {
    display: flex;
    flex-direction: column;
    margin: 0;
    height: 100%;
}

.article-figure-grid .article-figure figcaption {
    margin-top: auto;
    padding-top: 0.75rem;
    margin-bottom: 0;
}

@media (min-width: 640px) {
    .article-figure-grid.cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .article-figure-grid.cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Comparison / troubleshooting tables */
.table-wrap {
    overflow-x: auto;
    margin: 1.5rem 0 2rem;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(95, 16, 160, 0.12);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.content-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #4B5563;
    background: transparent;
}

.content-table caption {
    caption-side: top;
    text-align: left;
    padding: 0.875rem 1.125rem 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6B7280;
    letter-spacing: 0.01em;
}

.content-table thead th {
    background: #f9f7ff;
    color: #5f10a0;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    vertical-align: bottom;
    padding: 0.875rem 1.125rem;
    border-bottom: 1px solid rgba(95, 16, 160, 0.14);
    white-space: nowrap;
}

.content-table tbody th,
.content-table tbody td {
    text-align: left;
    vertical-align: top;
    padding: 0.9rem 1.125rem;
    border-bottom: 1px solid #eef0f4;
}

.content-table tbody tr:last-child th,
.content-table tbody tr:last-child td {
    border-bottom: none;
}

.content-table tbody th[scope="row"] {
    font-weight: 600;
    color: #111827;
    width: 28%;
}

.content-table tbody td {
    color: #4B5563;
}

.content-table tbody tr:nth-child(even) th,
.content-table tbody tr:nth-child(even) td {
    background: #fafafc;
}

.content-table tbody tr:hover th,
.content-table tbody tr:hover td {
    background: #f5f0fb;
}

@media (max-width: 640px) {
    .content-table {
        font-size: 0.875rem;
    }

    .content-table thead th,
    .content-table tbody th,
    .content-table tbody td {
        padding: 0.75rem 0.875rem;
    }

    .content-table thead th {
        white-space: normal;
    }

    .content-table tbody th[scope="row"] {
        width: auto;
        min-width: 7.5rem;
    }
}

/* ASCII sample in article body */
.ascii-sample {
    margin: 1rem 0;
    padding: 0.875rem 1rem;
    background: #111827;
    color: #f9fafb;
    border-radius: 8px;
    overflow-x: auto;
    font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Menlo, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.15;
    letter-spacing: 0;
    font-variant-ligatures: none;
    white-space: pre;
}

.media-todo {
    margin: 1.25rem 0;
    padding: 0.875rem 1rem;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    background: #fafafa;
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.5;
}

.media-todo strong {
    color: #4b5563;
}

/* FAQ Section */
.faq-section {
    margin: 3rem 0;
}

.faq-section h2 {
    margin-bottom: 1.5rem;
}

.faq-item {
    margin-bottom: 1rem;
    border: 1px solid rgba(95, 16, 160, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    list-style: none;
    background: #ffffff;
    transition: background 0.2s ease;
}

.faq-item summary:hover {
    background: #f9f7ff;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::before {
    content: '+';
    display: inline-block;
    margin-right: 0.75rem;
    color: #5f10a0;
    font-weight: 700;
    font-size: 1.25rem;
}

.faq-item[open] summary::before {
    content: '−';
}

.faq-item p {
    padding: 0 1.25rem 1.25rem 1.25rem;
    margin: 0;
    color: #4B5563;
}

/* Author Footer */
.author-footer {
    background: #f9f7ff;
    border: 1px solid rgba(95, 16, 160, 0.15);
    border-radius: 12px;
    padding: 2rem;
    margin: 3rem 0;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.author-footer-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #e5e7eb;
    flex-shrink: 0;
}

.alexis-avatar {
    background-image: url('/imgs/authors/alexis_small.png');
    background-size: cover;
    background-position: center;
}


.author-footer-content h3 {
    font-size: 1.125rem;
    color: #111827;
    margin-bottom: 0.5rem;
}

.author-footer-content p {
    font-size: 0.9375rem;
    color: #4B5563;
    margin: 0;
}

/* Post Navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 3rem 0;
}

.post-nav-item {
    padding: 1.5rem;
    background: #ffffff;
    border: 1px solid rgba(95, 16, 160, 0.15);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.25s ease;
}

.post-nav-item:hover {
    border-color: rgba(95, 16, 160, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.post-nav-label {
    font-size: 0.75rem;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.post-nav-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.post-nav-item.prev {
    text-align: left;
}

.post-nav-item.next {
    text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
    .main-container {
        padding: 2rem 1rem;
    }
    
    .article-header h1 {
        font-size: 2rem;
    }
    
    article {
        padding: 2rem 1.5rem;
    }
    
    article h2 {
        font-size: 1.625rem;
    }
    
    article h3 {
        font-size: 1.375rem;
    }
    
    .blog-hero {
        padding: 1.5rem 1rem 2rem;
    }
    
    .article-header h1 {
        font-size: 2rem;
    }
    
    .article-subtitle {
        font-size: 1rem;
    }
    
    .post-navigation {
        grid-template-columns: 1fr;
    }
    
    .author-footer {
        flex-direction: column;
        text-align: center;
    }
}

/* YouTube Embed Container */
.youtube-embed-container {
    margin: 3rem 0;
    max-width: 100%;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    background: #000;
}

.youtube-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

/* Video card (tutorial embeds inside article flow) */
.video-card {
    margin: 1.75rem 0 2rem;
    padding: 0.75rem;
    background: #ffffff;
    border: 1px solid rgba(95, 16, 160, 0.12);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.video-card .youtube-embed-container {
    margin: 0;
    border-radius: 10px;
    box-shadow: none;
}

.video-card .youtube-embed-container iframe {
    border-radius: 10px;
}

.video-card figcaption {
    margin: 0.75rem 0.25rem 0.15rem;
    font-size: 0.8125rem;
    color: #6B7280;
    text-align: center;
    line-height: 1.45;
}

@media (max-width: 768px) {
    .youtube-embed-container {
        margin: 2rem 0;
        border-radius: 8px;
    }
    
    .youtube-embed-container iframe {
        border-radius: 8px;
    }

    .video-card {
        padding: 0.5rem;
        border-radius: 12px;
    }

    .video-card .youtube-embed-container,
    .video-card .youtube-embed-container iframe {
        border-radius: 8px;
    }
}

/* ========== Blog Hub ========== */

.blog-hub-hero {
    background: linear-gradient(135deg, #E0F2FE 0%, #d2bbf0 100%);
    padding: 3rem 1.5rem 2.5rem;
    text-align: center;
}

.blog-hub-hero-content {
    max-width: 640px;
    margin: 0 auto;
}

.blog-hub-hero h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.blog-hub-hero p {
    font-size: 1.0625rem;
    color: #1E293B;
    line-height: 1.6;
    margin: 0;
}

.blog-hub-topics {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem 0.15rem;
    margin-top: 1.15rem;
}

.blog-hub-topics a {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #5f10a0;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(95, 16, 160, 0.12);
    border-radius: 999px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.blog-hub-topics a:hover {
    color: #4c0d80;
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(95, 16, 160, 0.22);
}

.blog-hub-topics a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(95, 16, 160, 0.25);
}

.blog-hub-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.blog-post-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(95, 16, 160, 0.1);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-post-card:hover {
    border-color: rgba(95, 16, 160, 0.28);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(95, 16, 160, 0.1);
}

.blog-post-card-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f3f4f6;
}

.blog-post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-post-card-body {
    padding: 1.25rem 1.35rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.blog-post-card-date {
    font-size: 0.8125rem;
    color: #6B7280;
    letter-spacing: 0.01em;
}

.blog-post-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin: 0;
}

.blog-post-card:hover .blog-post-card-title {
    color: #5f10a0;
}

.blog-post-card-excerpt {
    font-size: 0.9375rem;
    color: #4B5563;
    line-height: 1.55;
    margin: 0;
}

@media (max-width: 768px) {
    .blog-hub-hero {
        padding: 2rem 1.25rem 1.75rem;
    }

    .blog-hub-hero h1 {
        font-size: 1.875rem;
    }

    .blog-hub-hero p {
        font-size: 1rem;
    }

    .blog-hub-topics {
        margin-top: 1rem;
        gap: 0.3rem 0.1rem;
    }

    .blog-hub-topics a {
        padding: 0.28rem 0.65rem;
        font-size: 0.75rem;
    }

    .blog-hub-container {
        padding: 1.75rem 1rem 3rem;
    }

    .blog-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .blog-post-card-body {
        padding: 1.125rem 1.15rem 1.35rem;
    }
}

