/* --- RESET & ALIGNEMENT GLOBAL (Fix Décalage Mobile) --- */
html, body {
    overflow-x: hidden;
    width: 100%;
}

*, *::before, *::after {
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 1150px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    position: relative;
    z-index: 10;
}

/* --- UTILITAIRES & EFFETS iOS --- */
.glass-ios {
    background-color: var(--glass-bg);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-ios);
}

.glass-panel {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
[data-theme="dark"] .glass-panel {
    background-color: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

.reveal { opacity: 0; transform: translateY(30px); transition: all 1s cubic-bezier(0.25, 1, 0.5, 1); }
.reveal.active { opacity: 1; transform: translate(0, 0); }
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }

/* --- HERO SECTION BLOG --- */
.blog-hero { position: relative; padding-top: 10rem; padding-bottom: 5rem; overflow: hidden; text-align: center; }
@media (min-width: 1024px) { .blog-hero { padding-top: 13rem; padding-bottom: 6rem; } }
.blog-hero-glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 150vw; height: 150vw; max-width: 600px; max-height: 600px; background: radial-gradient(circle, rgba(0, 123, 255, 0.08) 0%, rgba(0, 123, 255, 0) 70%); filter: blur(80px); z-index: 0; pointer-events: none; }

.blog-hero-tag { display: inline-block; padding: 0.5rem 1.25rem; border-radius: 9999px; color: var(--cpw-primary); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 2rem; }

.hero-title { font-size: 2.25rem; font-weight: 900; color: var(--cpw-text); margin-bottom: 1.5rem; letter-spacing: -0.02em; line-height: 1.2; }
.text-gradient { background: linear-gradient(135deg, var(--cpw-primary), #60a5fa); -webkit-background-clip: text; color: transparent; display: inline-block; }
@media (min-width: 768px) { .hero-title { font-size: 3rem; } }
@media (min-width: 1024px) { .hero-title { font-size: 4rem; } }

.hero-subtitle { font-size: 1.125rem; color: var(--cpw-text); opacity: 0.8; max-width: 44rem; margin: 0 auto; line-height: 1.7; font-weight: 500; }

/* --- GRILLE DES ARTICLES --- */
.blog-grid-section { padding-bottom: 8rem; position: relative; }
.blog-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 768px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .blog-grid { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }

/* État vide */
.empty-blog-box { text-align: center; padding: 5rem 2rem; border-radius: 2.5rem; }
.empty-blog-box h3 { font-size: 1.5rem; font-weight: 800; color: var(--cpw-text); margin-bottom: 0.5rem; }
.empty-blog-box p { color: var(--cpw-text); opacity: 0.7; }

/* Cartes Articles (Liquid Glass) */
.blog-card { border-radius: 2rem; overflow: hidden; display: flex; flex-direction: column; height: 100%; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.blog-card:hover { transform: translateY(-8px); border-color: var(--cpw-primary); box-shadow: 0 20px 40px -10px rgba(0, 123, 255, 0.15); background-color: var(--glass-highlight); }

.blog-card-img-wrapper { display: block; height: 14rem; position: relative; overflow: hidden; border-radius: 1.75rem 1.75rem 0 0; margin: 0.5rem 0.5rem 0 0.5rem; }
.blog-card-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 1.5rem; }
.blog-card:hover .blog-card-img { transform: scale(1.05); }

.blog-img-placeholder { width: 100%; height: 100%; background-color: rgba(0,0,0,0.05); display: flex; align-items: center; justify-content: center; color: var(--cpw-text); opacity: 0.3; font-size: 2.5rem; border-radius: 1.5rem; }

.blog-card-date { position: absolute; top: 1rem; left: 1rem; padding: 0.375rem 1rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 800; color: var(--cpw-text); letter-spacing: 0.05em; }

.blog-card-body { padding: 2rem; display: flex; flex-direction: column; flex: 1; }
.blog-card-title { font-size: 1.25rem; font-weight: 800; color: var(--cpw-text); margin-bottom: 1rem; line-height: 1.3; transition: color 0.3s ease; }
.blog-card:hover .blog-card-title { color: var(--cpw-primary); }

.blog-card-excerpt { color: var(--cpw-text); opacity: 0.7; font-size: 0.9375rem; margin-bottom: 2rem; flex: 1; line-height: 1.7; }

.blog-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 1.5rem; border-top: 1px solid var(--border-light); margin-top: auto; }

.blog-author-info { display: flex; align-items: center; gap: 0.75rem; }
.blog-author-avatar { width: 2.25rem; height: 2.25rem; border-radius: 50%; background-color: rgba(0, 123, 255, 0.1); color: var(--cpw-primary); display: flex; align-items: center; justify-content: center; font-size: 0.875rem; font-weight: 800; }
.blog-author-name { font-size: 0.8125rem; font-weight: 700; color: var(--cpw-text); opacity: 0.8; }

.blog-read-btn { width: 2.5rem; height: 2.5rem; border-radius: 50%; background-color: rgba(0,0,0,0.05); display: flex; align-items: center; justify-content: center; color: var(--cpw-primary); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
[data-theme="dark"] .blog-read-btn { background-color: rgba(255,255,255,0.05); }

/* --- PAGINATION --- */
.pagination-wrapper { margin-top: 5rem; display: flex; justify-content: center; gap: 0.75rem; }
.page-link { width: 3rem; height: 3rem; border-radius: 1rem; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; color: var(--cpw-text); transition: all 0.3s ease; }
.page-link:hover:not(.active) { transform: translateY(-3px); background-color: var(--hover-bg); }
.page-link.active { background: linear-gradient(135deg, var(--cpw-primary), #2563eb); color: white; border-color: transparent; box-shadow: 0 10px 20px -5px rgba(0, 123, 255, 0.4); }

/* --- STYLES PAGE ARTICLE UNIQUE (Conservés) --- */
.reading-progress-bar { position: fixed; top: 0; left: 0; height: 4px; background: linear-gradient(to right, var(--cpw-primary), #60a5fa); z-index: 9999; width: 0; transition: width 0.1s ease; box-shadow: 0 0 10px rgba(0, 123, 255, 0.5); }

.article-main-container { padding-top: 10rem; padding-bottom: 6rem; background-color: transparent; }

.article-header { max-width: 56rem; margin: 0 auto 3rem auto; padding: 0 1.5rem; text-align: center; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1.25rem; font-size: 0.875rem; color: var(--cpw-text); opacity: 0.7; font-weight: 700; margin-bottom: 1.5rem; }
.meta-date { background-color: var(--glass-bg); backdrop-filter: blur(12px); border: 1px solid var(--glass-border); padding: 0.5rem 1rem; border-radius: 9999px; }
.meta-date i { margin-right: 0.5rem; color: var(--cpw-primary); }
.meta-author { display: flex; align-items: center; gap: 0.5rem; }
.author-dot { width: 0.3rem; height: 0.3rem; border-radius: 50%; background-color: var(--cpw-primary); }

.article-main-title { font-size: 2.25rem; font-weight: 900; color: var(--cpw-text); line-height: 1.2; margin-bottom: 2rem; letter-spacing: -0.02em; }
@media (min-width: 768px) { .article-main-title { font-size: 3rem; } }

.article-cover-wrapper { max-width: 64rem; margin: 0 auto 4rem auto; padding: 0 1.5rem; }
.article-cover-inner { border-radius: 2.5rem; overflow: hidden; box-shadow: var(--shadow-ios); aspect-ratio: 16 / 9; position: relative; border: 1px solid var(--glass-border); background-color: var(--glass-bg); }
.article-cover-img { width: 100%; height: 100%; object-fit: cover; }

.article-content-wrapper { max-width: 50rem; margin: 0 auto; padding: 0 1.5rem; }

.article-share-section { margin-top: 5rem; padding-top: 3rem; border-top: 1px solid var(--border-light); text-align: center; }
.share-title { font-size: 0.875rem; font-weight: 800; color: var(--cpw-text); opacity: 0.6; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1.5rem; }
.share-buttons { display: flex; justify-content: center; gap: 1rem; }
.share-btn { width: 3.5rem; height: 3.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border: 1px solid var(--glass-border); background-color: var(--glass-bg); }
.share-btn:hover { transform: translateY(-4px); box-shadow: var(--shadow-ios); }
.btn-facebook { color: #1877F2; } .btn-facebook:hover { background-color: #1877F2; color: white; border-color: transparent; }
.btn-twitter { color: var(--cpw-text); } .btn-twitter:hover { background-color: var(--cpw-text); color: var(--cpw-bg); border-color: transparent; }
.btn-whatsapp { color: #25D366; } .btn-whatsapp:hover { background-color: #25D366; color: white; border-color: transparent; }

/* Commentaires */
.comments-section { margin-top: 6rem; padding-top: 4rem; border-top: 1px solid var(--border-light); }
.comments-title { font-size: 1.75rem; font-weight: 900; color: var(--cpw-text); margin-bottom: 2.5rem; letter-spacing: -0.02em; }

.comments-list { margin-bottom: 4rem; display: flex; flex-direction: column; gap: 2rem; }
.empty-comments { text-align: center; padding: 3rem; background-color: var(--hover-bg); border-radius: 1.5rem; border: 1px dashed var(--glass-border); }
.empty-comments p { font-weight: 500; color: var(--cpw-text); opacity: 0.6; margin: 0; }

.comment-item { display: flex; gap: 1.25rem; }
.comment-avatar { width: 3rem; height: 3rem; border-radius: 50%; background: linear-gradient(135deg, var(--cpw-primary), #60a5fa); color: white; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; flex-shrink: 0; box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3); }
.comment-content { flex: 1; }
.comment-box { background-color: var(--glass-bg); border-radius: 1.5rem; border-top-left-radius: 0; padding: 1.5rem; border: 1px solid var(--glass-border); backdrop-filter: blur(12px); }
.comment-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.comment-author-name { font-weight: 800; font-size: 0.9375rem; color: var(--cpw-text); }
.comment-date { font-size: 0.7rem; font-weight: 800; color: var(--cpw-text); opacity: 0.5; text-transform: uppercase; letter-spacing: 0.05em; }
.comment-text { font-size: 0.9375rem; color: var(--cpw-text); opacity: 0.8; line-height: 1.7; margin: 0; }

.comment-form-box { background-color: var(--glass-bg); backdrop-filter: blur(24px); border: 1px solid var(--glass-border); border-radius: 2rem; padding: 2.5rem; position: relative; overflow: hidden; box-shadow: var(--shadow-ios); }
.form-accent-line { position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(to right, var(--cpw-primary), #60a5fa); }
.form-title { font-size: 1.25rem; font-weight: 800; color: var(--cpw-text); margin-bottom: 2rem; letter-spacing: -0.01em; }

.comment-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 768px) { .form-row { grid-template-columns: repeat(2, 1fr); } }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-label { font-size: 0.8125rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--cpw-text); opacity: 0.6; padding-left: 0.5rem; }
.form-control { width: 100%; background-color: var(--hover-bg); border: 1px solid var(--glass-border); border-radius: 1rem; padding: 1rem 1.25rem; font-family: inherit; font-size: 0.9375rem; color: var(--cpw-text); transition: all 0.3s ease; }
.form-control:focus { outline: none; border-color: var(--cpw-primary); background-color: var(--glass-bg); box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15); }
.textarea-resize { resize: vertical; min-height: 120px; }

.btn-primary { background: linear-gradient(135deg, var(--cpw-primary), #2563eb); color: white; border: none; padding: 1rem 2.5rem; border-radius: 9999px; font-weight: 700; font-size: 1rem; cursor: pointer; transition: all 0.3s ease; display: inline-flex; justify-content: center; align-items: center; gap: 0.75rem; box-shadow: 0 10px 15px -3px rgba(0, 123, 255, 0.3); align-self: flex-start; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 15px 25px -5px rgba(0, 123, 255, 0.4); }

.article-toast-container { position: fixed; top: 6rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.75rem; pointer-events: none; }
.toast-msg { display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.5rem; border-radius: 1rem; color: white; font-size: 0.9375rem; font-weight: 700; box-shadow: var(--shadow-ios); backdrop-filter: blur(12px); opacity: 0; transform: translateX(30px); transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1); pointer-events: auto; }
.toast-msg.show { opacity: 1; transform: translateX(0); }
.toast-success { background: rgba(34, 197, 94, 0.9); border: 1px solid rgba(255,255,255,0.2); }
.toast-error { background: rgba(239, 68, 68, 0.9); border: 1px solid rgba(255,255,255,0.2); }