/* article.css - Styles des articles de blog Start-Informatique
   Source unique : chargé par article.php (site public) et les previews admin (dashboard) */

.article-page { padding-bottom: 0; position: relative; }

/* Reading Progress Bar */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-dark));
    z-index: 2500; 
    opacity: 0;
    transition: width 0.1s ease-out, opacity 0.3s ease;
    box-shadow: 0 0 15px rgba(12, 113, 195, 0.45);
}

.reading-progress-bar::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 80px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6));
    filter: blur(4px);
}

.article-hero { padding: 160px 0 40px; background: radial-gradient(circle at top right, var(--primary-light) 0%, var(--bg-alt) 60%); }
.breadcrumb { font-size: 13px; margin-bottom: 20px; color: var(--text-muted); font-weight: var(--weight-medium); }
.breadcrumb a { color: var(--primary-blue); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 6px; }
.breadcrumb .current { color: var(--text-muted); }

.article-meta-bar { 
    display: flex; 
    justify-content: space-between;
    align-items: center; 
    margin-bottom: 24px; 
    flex-wrap: wrap; 
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);
}
.meta-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.meta-category { font-size: 12px; font-weight: var(--weight-bold); color: var(--primary-blue); background: var(--primary-light); padding: 4px 12px; border-radius: var(--radius-pill); text-decoration: none; transition: var(--transition); }
.meta-category:hover { background: var(--primary-blue); color: var(--surface); }
.meta-date, .meta-reading { font-size: 14px; color: var(--text-muted); font-weight: var(--weight-medium); }

/* Horizontal Share In Hero */
.share-inline { display: flex; align-items: center; gap: 8px; }
.share-label { font-size: 13px; font-weight: var(--weight-bold); color: var(--text-muted); margin-right: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.share-icon { 
    width: 32px; 
    height: 32px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 50%; 
    font-size: 12px; 
    font-weight: var(--weight-extra); 
    text-decoration: none; 
    transition: var(--transition-bounce); 
    border: none; 
    cursor: pointer;
    font-family: inherit;
}
.si-facebook { background: #1877f2; color: white; }
.si-twitter { background: #000; color: white; }
.si-linkedin { background: #0a66c2; color: white; }
.si-copy { background: var(--primary-light); color: var(--primary-blue); font-size: 14px; }
.share-icon:hover { transform: translateY(-3px); filter: brightness(1.1); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

/* Title & Intro */
.article-hero h1 { 
    font-size: clamp(34px, 6.5vw, 58px); 
    font-weight: var(--weight-extra); 
    line-height: 1.08; 
    color: var(--primary-dark); 
    margin: 24px 0; 
    width: 100%;
    max-width: 100%; 
    display: block;
    letter-spacing: -1.5px; 
    text-wrap: pretty;
}
.article-intro { 
    font-size: 20px; 
    color: var(--text-muted); 
    line-height: 1.6; 
    max-width: 1000px; 
}

.article-cover { margin-bottom: 40px; }
.article-cover img { width: 100%; max-height: 480px; object-fit: cover; border-radius: var(--radius-lg); }

.article-body { padding: 0 0 60px; }
.article-grid { display: grid; grid-template-columns: 1fr 280px; gap: 40px; }

.article-content { font-size: 17px; line-height: 1.85; color: var(--text-dark); }
.article-content h2 { 
    font-size: 26px; 
    font-weight: var(--weight-extra); 
    margin: 44px 0 18px; 
    color: var(--primary-dark); 
    padding-bottom: 10px; 
    border-bottom: 3px solid var(--primary-light); 
    letter-spacing: -0.3px;
    scroll-margin-top: 120px; 
}
.article-content h3 { 
    font-size: 21px; 
    font-weight: var(--weight-bold); 
    margin: 36px 0 14px; 
    color: var(--primary-dark); 
    padding-left: 14px; 
    border-left: 4px solid var(--primary-blue);
    scroll-margin-top: 120px; 
}
.article-content p { margin-bottom: 18px; }
.article-content a { color: var(--primary-blue); font-weight: var(--weight-normal); text-decoration: underline; text-decoration-color: rgba(12, 113, 195, 0.35); text-underline-offset: 3px; text-decoration-thickness: 2px; transition: var(--transition); }
.article-content a:hover { text-decoration-color: var(--primary-blue); color: var(--primary-dark); }
.article-content img { max-width: 100%; border-radius: var(--radius-lg); margin: 24px 0; }
.article-content ul, .article-content ol { margin: 20px 0; padding-left: 26px; }

/* Article Footer Tags */
.article-footer-tags { 
    margin-top: 60px; 
    padding-top: 30px; 
    border-top: 1px solid var(--border-soft); 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}
.tags-label { font-size: 14px; font-weight: var(--weight-bold); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill { font-size: 12px; padding: 6px 14px; border-radius: var(--radius-pill); text-decoration: none; color: var(--text-muted); background: var(--primary-light); border: 1px solid var(--border-soft); transition: var(--transition); }
.tag-pill:hover { color: var(--primary-blue); border-color: var(--primary-blue); transform: translateY(-1px); }

.article-content li { margin-bottom: 10px; line-height: 1.75; }
.article-content li::marker { color: var(--primary-blue); }
.article-content blockquote { border-left: 4px solid var(--primary-blue); margin: 24px 0; padding: 18px 22px; background: var(--primary-light); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; font-style: italic; color: var(--text-muted); }
.article-content strong { color: var(--primary-dark); font-weight: var(--weight-bold); background: linear-gradient(to top, var(--primary-light) 40%, transparent 40%); padding: 0 2px; }
.article-content .si-highlight { color: var(--primary-blue); font-weight: var(--weight-bold); background: linear-gradient(to top, rgba(12, 113, 195, 0.12) 40%, transparent 40%); padding: 0 3px; }
.article-content .si-stat { color: var(--primary-dark); font-weight: var(--weight-extra); font-size: 1.1em; letter-spacing: -0.3px; }
.article-content .si-quote { color: var(--primary-dark); font-style: italic; font-weight: var(--weight-medium); }
.article-content .si-quote::before { content: "\00AB\00A0"; color: var(--primary-blue); }
.article-content .si-quote::after { content: "\00A0\00BB"; color: var(--primary-blue); }

/* Sidebar */
.sidebar-sticky { position: sticky; top: 115px; z-index: 10; }
.sidebar-block { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.02); }
.sidebar-block h4 { font-size: 13px; font-weight: var(--weight-extra); color: var(--primary-dark); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--primary-light); padding-bottom: 8px; }

.toc-block { 
    box-shadow: 0 10px 40px rgba(12, 113, 195, 0.1); 
    border-color: rgba(12, 113, 195, 0.12);
}
.toc-nav { 
    display: flex; 
    flex-direction: column; 
    gap: 2px; 
    max-height: calc(100vh - 450px); 
    overflow-y: auto; 
    padding-right: 5px; 
}
.toc-nav::-webkit-scrollbar { width: 4px; }
.toc-nav::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 4px; }
.toc-nav:hover::-webkit-scrollbar-thumb { background: var(--primary-blue); opacity: 0.3; }

.toc-link { font-size: 13px; color: var(--text-muted); text-decoration: none; padding: 6px 10px; border-left: 2px solid var(--border-soft); transition: var(--transition); font-weight: var(--weight-medium); }
.toc-link.toc-sub { padding-left: 22px; font-size: 12px; }
.toc-link:hover, .toc-link.toc-active { color: var(--primary-blue); border-left-color: var(--primary-blue); background: rgba(12, 113, 195, 0.06); }

.sidebar-cta { background: var(--primary-light); border: 2px solid var(--primary-blue); border-radius: var(--radius-lg); padding: 20px; text-align: center; }
.sidebar-cta h4 { border-bottom: none; margin-bottom: 8px; padding-bottom: 0; }
.sidebar-cta p { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.4; font-weight: var(--weight-medium); }
.sidebar-cta .btn-primary { padding: 10px 18px; font-size: 14px; width: 100%; justify-content: center; }

/* Inline Promo Block */
.article-content .si-promo {
    position: relative;
    margin: 40px 0 30px;
    padding: 28px 32px 28px 60px;
    background: var(--primary-light);
    border: 1px solid rgba(12, 113, 195, 0.15);
    border-radius: var(--radius-lg);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-dark);
    font-weight: var(--weight-normal);
    box-shadow: var(--shadow-subtle);
}
.article-content .si-promo::before {
    content: "💡";
    position: absolute;
    top: 24px;
    left: 22px;
    font-size: 22px;
    line-height: 1;
}
.article-content .si-promo a {
    color: var(--primary-blue);
    font-weight: var(--weight-bold);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.article-content .si-promo a:hover {
    color: var(--primary-dark);
}
.si-promo-hook {
    color: var(--primary-blue);
    font-weight: var(--weight-medium);
}
.si-promo-brand {
    color: var(--primary-blue);
    font-weight: var(--weight-bold);
    text-decoration: none;
}
.si-promo-brand:hover {
    text-decoration: underline;
}
.si-promo-phone {
    color: var(--primary-blue);
    font-weight: var(--weight-medium);
    text-decoration: none;
}
.si-promo-phone:hover {
    text-decoration: underline;
}

/* Bottom CTA & Related */
.article-bottom-cta { padding: 80px 0; background: var(--bg-alt); }
.bottom-cta-card { display: flex; justify-content: space-between; align-items: center; gap: 30px; background: var(--surface); padding: 40px; border-radius: var(--radius-xl); box-shadow: var(--shadow-soft); }
.bottom-cta-text h3 { font-size: 22px; font-weight: var(--weight-extra); color: var(--primary-dark); margin-bottom: 8px; }
.bottom-cta-text p { font-size: 15px; color: var(--text-muted); max-width: 500px; font-weight: var(--weight-medium); }
.bottom-cta-actions { display: flex; gap: 12px; flex-shrink: 0; }
.article-page .btn-secondary { border-color: var(--primary-blue); color: var(--primary-blue); }
.article-page .btn-secondary:hover { background: var(--primary-blue); color: var(--surface); }

.related-section { padding: 80px 0; background: var(--primary-light); }
.related-section .section-header { margin-bottom: 40px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.related-card { text-decoration: none; color: var(--text-dark); background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border-soft); transition: var(--transition); box-shadow: var(--shadow-subtle); }
.related-card:hover { box-shadow: var(--shadow-card); transform: translateY(-4px); }
.related-img { height: 160px; overflow: hidden; }
.related-img img { width: 100%; height: 100%; object-fit: cover; }
.related-img-fallback { display: flex; align-items: center; justify-content: center; background: var(--primary-light); font-size: 40px; }
.related-body { padding: 16px; }
.related-cat { font-size: 11px; font-weight: var(--weight-bold); color: var(--primary-blue); text-transform: uppercase; }
.related-card h3 { font-size: 15px; font-weight: var(--weight-bold); margin: 6px 0 4px; line-height: 1.35; color: var(--primary-dark); }
.related-date { font-size: 12px; color: var(--text-muted); font-weight: var(--weight-medium); }

@media (max-width: 1024px) {
    .article-grid { grid-template-columns: 1fr; }
    .article-sidebar { order: -1; }
    .sidebar-sticky { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .bottom-cta-card { flex-direction: column; text-align: center; }
    .related-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .article-hero { padding: 120px 0 30px; }
    .article-meta-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
    .meta-right { border-top: 1px solid var(--border-soft); width: 100%; padding-top: 12px; }
    .sidebar-sticky { grid-template-columns: 1fr; }
    .bottom-cta-actions { flex-direction: column; width: 100%; }
    .related-grid { grid-template-columns: 1fr; }
    .article-content .si-promo { padding: 24px 20px 24px 52px; margin: 32px 0 24px; }
    .article-content .si-promo::before { top: 20px; left: 16px; font-size: 20px; }
}
