/* ========== BLOG STYLES ========== */
/* Uses CSS custom properties from style.css */

/* ===== Blog Navigation ===== */
.blog-nav-links {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ===== Blog Main ===== */
.blog-main {
    padding: 40px 24px 80px;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-intro {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 48px;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ===== Blog Grid ===== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

/* ===== Blog Card ===== */
.blog-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.blog-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1px;
    background: linear-gradient(135deg, transparent 40%, rgba(124, 111, 247, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.blog-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 60px rgba(124, 111, 247, 0.06);
}

.blog-card:hover::before {
    opacity: 1;
}

.blog-card:hover .blog-card-link {
    color: var(--accent-light);
}

.blog-card-body {
    padding: 24px 24px 16px;
    flex: 1;
}

.blog-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    margin-top: 12px;
    color: var(--text);
}

.blog-card-link {
    display: block;
    padding: 14px 24px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    transition: color var(--transition);
    letter-spacing: 0.02em;
}

/* ===== Blog Tags ===== */
.blog-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.blog-tag-debutant {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.blog-tag-intermediaire {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.blog-tag-avance {
    background: rgba(124, 111, 247, 0.12);
    color: var(--accent-light);
    border: 1px solid rgba(124, 111, 247, 0.2);
}

/* ===== Blog Excerpt ===== */
.blog-excerpt {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-top: 10px;
}

/* ===== Article Content ===== */
.article-content {
    max-width: 780px;
    margin: 0 auto;
    padding: 40px 0 80px;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
}

.article-content h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.3;
}

.article-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 48px 0 16px;
    color: var(--text);
    position: relative;
    padding-bottom: 12px;
}

.article-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 48px;
    height: 3px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 2px;
}

.article-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 36px 0 12px;
    color: var(--text);
}

.article-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 28px 0 10px;
    color: var(--text);
}

.article-content p {
    margin-bottom: 20px;
    color: var(--text);
    opacity: 0.92;
}

.article-content a {
    color: var(--accent-light);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(124, 111, 247, 0.3);
    transition: text-decoration-color var(--transition);
}

.article-content a:hover {
    text-decoration-color: var(--accent-light);
}

.article-content ul,
.article-content ol {
    margin: 16px 0 24px 24px;
}

.article-content li {
    margin-bottom: 8px;
    color: var(--text);
    opacity: 0.92;
}

.article-content li::marker {
    color: var(--accent);
}

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

.article-content em {
    font-style: italic;
    color: var(--accent-light);
}

/* Tables */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.92rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.article-content thead {
    background: var(--surface);
}

.article-content th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--accent-light);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}

.article-content td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.article-content tbody tr:last-child td {
    border-bottom: none;
}

.article-content tbody tr:hover {
    background: rgba(124, 111, 247, 0.04);
}

.article-content .table-responsive {
    overflow-x: auto;
    margin: 24px 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.article-content .table-responsive table {
    margin: 0;
    border: none;
    border-radius: 0;
}

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

.article-content pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    margin: 24px 0;
    overflow-x: auto;
    line-height: 1.6;
}

.article-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.88rem;
    color: var(--text);
}

/* Blockquotes */
.article-content blockquote {
    border-left: 4px solid var(--accent);
    background: rgba(124, 111, 247, 0.06);
    padding: 16px 24px;
    margin: 24px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text);
    opacity: 0.9;
}

.article-content blockquote p {
    margin-bottom: 0;
}

/* Info & Tip Boxes */
.article-content .info-box {
    background: rgba(124, 111, 247, 0.08);
    border: 1px solid rgba(124, 111, 247, 0.2);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    margin: 24px 0;
}

.article-content .info-box h4 {
    color: var(--accent-light);
    margin-bottom: 8px;
    font-size: 1rem;
}

.article-content .tip-box {
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    margin: 24px 0;
}

.article-content .tip-box h4 {
    color: #34d399;
    margin-bottom: 8px;
    font-size: 1rem;
}

/* Images */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 24px 0;
    border: 1px solid var(--border);
}

/* ===== Article Meta ===== */
.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 0 32px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.article-meta time {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-meta time::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a7a96' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    flex-shrink: 0;
}

.article-meta .blog-tag {
    font-size: 0.7rem;
}

/* ===== Article Navigation (prev/next) ===== */
.article-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.article-nav a {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-nav a:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.article-nav-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
}

.article-nav-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
}

.article-nav a:last-child {
    text-align: right;
}

.article-nav a:only-child {
    grid-column: 1;
}

.article-nav a:last-child:not(:only-child) {
    grid-column: 2;
}

/* ===== Article Sidebar ===== */
.article-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 40px;
}

.article-sidebar h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.article-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-sidebar li {
    margin-bottom: 0;
}

.article-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition);
}

.article-sidebar a:hover {
    background: rgba(124, 111, 247, 0.08);
    color: var(--accent-light);
}

.article-sidebar a::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity var(--transition);
}

.article-sidebar a:hover::before {
    opacity: 1;
}

/* ===== Article Layout with Sidebar ===== */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 0 80px;
    align-items: start;
}

.article-layout .article-sidebar {
    position: sticky;
    top: 80px;
    margin-top: 0;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-layout .article-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .blog-main {
        padding: 24px 16px 60px;
    }

    .blog-intro {
        margin-bottom: 32px;
        font-size: 0.95rem;
    }

    .blog-card-body {
        padding: 20px 20px 12px;
    }

    .blog-card-title {
        font-size: 1.08rem;
    }

    .blog-card-link {
        padding: 12px 20px;
    }

    .article-content {
        padding: 24px 0 60px;
        font-size: 1rem;
    }

    .article-content h1 {
        font-size: 1.7rem;
    }

    .article-content h2 {
        font-size: 1.5rem;
        margin-top: 36px;
    }

    .article-content h3 {
        font-size: 1.15rem;
    }

    .article-content pre {
        padding: 14px 16px;
    }

    .article-content table {
        font-size: 0.85rem;
    }

    .article-content th,
    .article-content td {
        padding: 8px 12px;
    }

    .article-nav {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 40px;
    }

    .article-nav a:last-child {
        text-align: left;
    }

    .article-nav a:last-child:not(:only-child) {
        grid-column: 1;
    }

    .article-meta {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .blog-grid {
        gap: 12px;
    }

    .blog-card-body {
        padding: 16px 16px 10px;
    }

    .blog-card-title {
        font-size: 1rem;
    }

    .blog-excerpt {
        font-size: 0.84rem;
    }

    .article-content blockquote {
        padding: 12px 16px;
    }

    .article-sidebar {
        padding: 18px;
    }
}
