/* ============================================
   COMMON.CSS - Styles communs à tous les thèmes
   Structure de base, mise en page, responsive
   ============================================ */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    position: relative;
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

/* === CONTAINER PRINCIPAL === */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px;
    position: relative;
}

/* === SCROLLBAR COMMUNE === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--matrix-darker, #050805);
}

::-webkit-scrollbar-thumb {
    background: var(--matrix-primary, #0f0);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--matrix-primary-dark, #00cc33);
}

/* === HEADER COMMUN === */
header {
    padding: 30px 0 20px;
    margin-bottom: 40px;
    position: relative;
}

header h1 a {
    text-decoration: none;
    font-size: 2.8rem;
    letter-spacing: 8px;
    text-transform: uppercase;
    transition: 0.2s ease;
    font-weight: 300;
}

header h1 a:hover {
    letter-spacing: 10px;
}

/* === NAVIGATION COMMUNE === */
nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
    margin-top: 25px;
    flex-wrap: wrap;
}

nav ul li a {
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 30px;
    transition: 0.2s ease;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* === TRI === */
.sort-options {
    margin-bottom: 30px;
    padding: 15px 0;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.sort-options span {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* === BOUTONS === */
.btn, .btn-small {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 30px;
    text-decoration: none;
    transition: 0.2s ease;
    cursor: pointer;
    font-family: monospace;
    font-size: 0.85rem;
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* === GRILLE DES ARTICLES === */
.articles-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

/* === CARTES ARTICLES === */
.article-card {
    border-radius: 16px;
    padding: 25px;
    transition: 0.3s ease;
    position: relative;
    overflow: hidden;
}

.article-card h2 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.article-card h2 a {
    text-decoration: none;
    transition: 0.2s ease;
}

/* === MÉTADONNÉES === */
.article-meta {
    font-size: 0.8rem;
    margin: 12px 0;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.category {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    transition: 0.2s ease;
}

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    margin-bottom: 12px;
}

.article-excerpt {
    margin: 20px 0;
    line-height: 1.5;
}

.comments-count {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* === BADGE PINNED (À LA UNE) === */
.pinned-article {
    border-width: 2px;
    background: linear-gradient(135deg, rgba(0,255,65,0.05), rgba(0,0,0,0.2));
    position: relative;
}

.pinned-badge {
    display: inline-block;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
/* Animation de pulsation pour l'article épinglé */
.pinned-article {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
        border-color: rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(255, 215, 0, 0.6);
        border-color: rgba(255, 215, 0, 0.8);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
        border-color: rgba(255, 215, 0, 0.3);
    }
}

/* === PAGE ARTICLE COMPLET === */
.article-full {
    padding: 40px;
    border-radius: 24px;
    margin-bottom: 30px;
}

.article-full h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.article-full h2 {
    margin: 1.5em 0 0.5em;
}

.article-full h3, .article-full h4 {
    margin: 1.2em 0 0.5em;
}

.article-full p {
    margin: 1em 0;
}

.article-full pre,
.article-full code {
    padding: 10px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
}

.article-full blockquote {
    margin: 20px 0;
    padding: 10px 20px;
    font-style: italic;
}

.article-full img {
    max-width: 100%;
    border-radius: 8px;
}

.article-full ul, .article-full ol {
    margin: 1em 0;
    padding-left: 2em;
}

.article-full li {
    margin: 0.5em 0;
}

/* === FILENAME BADGE === */
.filename-badge {
    display: inline-block;
    border-radius: 30px;
    padding: 6px 15px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.filename-icon {
    margin-right: 8px;
}

.filename-text {
    font-weight: bold;
}

.filename-extension {
    margin-left: 2px;
    opacity: 0.7;
}

/* === SECTION COMMENTAIRES === */
.comment-section {
    margin-top: 60px;
    padding-top: 30px;
}

.comment-section h3 {
    font-size: 1.8rem;
    margin-bottom: 25px;
}

.comment-section h4 {
    margin: 30px 0 15px 0;
    padding-bottom: 10px;
}

.comment-form {
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 30px;
}

.comment-form input,
.comment-form textarea {
    padding: 12px;
    width: 100%;
    margin-bottom: 15px;
    border-radius: 8px;
    font-family: monospace;
    transition: 0.2s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
}

.comment-form button {
    padding: 12px 28px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    font-family: monospace;
    font-size: 1rem;
    transition: 0.2s ease;
}

.comment-list {
    margin-top: 30px;
}

.comment-item {
    padding: 18px;
    margin-bottom: 15px;
    border-radius: 12px;
    transition: 0.2s ease;
}

.comment-meta {
    font-size: 0.8rem;
    margin-bottom: 10px;
    padding-bottom: 8px;
}

.no-comments {
    text-align: center;
    padding: 30px;
    border-radius: 8px;
    font-style: italic;
}

/* === FORMULAIRES === */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* === MESSAGES === */
.success-message,
.error-message {
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
}

.success-message {
    border-left: 4px solid #00ff41;
    background: rgba(0, 255, 65, 0.1);
}

.error-message {
    border-left: 4px solid #ff4444;
    background: rgba(255, 0, 0, 0.1);
}

/* === FOOTER === */
footer {
    margin-top: 70px;
    padding: 30px 0 20px;
    text-align: center;
    font-size: 0.8rem;
}

/* === NO ARTICLES === */
.no-articles {
    text-align: center;
    padding: 60px 20px;
    border-radius: 16px;
    border: 1px dashed;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .container {
        padding: 20px 30px;
    }
    
    .articles-list {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px 20px;
    }
    
    .articles-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .article-full {
        padding: 20px;
    }
    
    .article-full h1 {
        font-size: 1.8rem;
    }
    
    header h1 a {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }
    
    nav ul {
        gap: 12px;
    }
    
    nav ul li a {
        padding: 5px 12px;
        font-size: 0.75rem;
    }
    
    .sort-options {
        gap: 10px;
    }
    
    .btn-small {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
    
    .comment-section h3 {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px 15px;
    }
    
    .article-card {
        padding: 15px;
    }
    
    .article-card h2 {
        font-size: 1.2rem;
    }
    
    .btn {
        padding: 6px 16px;
        font-size: 0.75rem;
    }
    
    .comment-form {
        padding: 15px;
    }
}

/* === PRINT STYLES === */
@media print {
    .matrix-bg, 
    nav, 
    .comment-section, 
    footer, 
    .sort-options, 
    .theme-selector,
    .pinned-badge,
    .category-badge {
        display: none;
    }
    
    .article-full {
        background: white;
        color: black;
        padding: 0;
        box-shadow: none;
    }
    
    .article-full h1, 
    .article-full h2, 
    .article-full h3 {
        color: black;
    }
    
    body {
        background: white;
    }
    
    .container {
        padding: 0;
        margin: 0;
    }
}

/* === UTILITAIRES === */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
    display: none;
}

.clearfix::after {
    content: '';
    clear: both;
    display: table;
}