/* ===== STYLES POUR LES PAGES STATIQUES ===== */

/* Bandeau allégé - utilise les classes des articles avec styles inline */

/* Container principal */
.page-content {
    min-height: calc(100vh - 350px);
    padding: 0 !important; /* Suppression complète du padding */
}

/* Corrections spécifiques pour les pages */
.page-content .article-page {
    padding: 0 0 2rem 0 !important; /* Suppression complète du padding du haut */
}

.page-content .article-header {
    margin-top: 0 !important; /* Suppression complète de la marge du haut */
    margin-bottom: 0.75rem; /* Encore plus réduit : 0.75rem au lieu de 1rem */
}

/* Forcer la suppression du padding Bootstrap pour les pages */
.page-content .container-fluid.article-page {
    padding-top: 0 !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* Forcer la première row des pages à coller au haut */
.page-content .article-page .row:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Forcer spécifiquement le header des pages */
.page-content .article-page .article-header {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Forcer spécifiquement le titre des pages */
.page-content .article-page .article-title {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Forcer le header-content des pages */
.page-content .article-page .header-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Forcer le header-text des pages */
.page-content .article-page .header-text {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* === STYLES POUR LES PAGES SANS .page-content === */
/* Les pages utilisent directement .article-page sans .page-content */

/* Ajuster le padding des pages directement */
body .container-fluid.article-page {
    padding-top: 0.75rem !important; /* Même marge que les articles */
}

/* Forcer le header des pages directement */
body .article-page .article-header {
    margin-top: 0.25rem !important; /* Même marge réduite que les articles */
    padding-top: 0 !important;
}

/* Forcer le titre des pages directement */
body .article-page .article-title {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Forcer le header-content des pages directement */
body .article-page .header-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Forcer le header-text des pages directement */
body .article-page .header-text {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* === RÉDUIRE LE PADDING DU CORPS DU TEXTE DES PAGES === */
/* Réduire le padding du contenu des pages */
body .article-page .article-content {
    padding: 1rem !important; /* Réduit de 2rem à 1rem */
    margin-top: 0.5rem !important; /* Petite marge du haut */
}

/* Réduire les marges internes du contenu des pages */
body .article-page .article-content h1,
body .article-page .article-content h2,
body .article-page .article-content h3,
body .article-page .article-content h4 {
    margin-top: 1rem !important; /* Réduit de 2rem à 1rem */
    margin-bottom: 0.5rem !important;
}

body .article-page .article-content p {
    margin-bottom: 0.75rem !important; /* Réduit de 1.2rem à 0.75rem */
}

/* En-tête de page - utilise maintenant les classes des articles */

/* Contenu article */
.page-article {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.article-content {
    font-size: 0.9rem; /* Réduit de 1.1rem à 0.9rem */
    line-height: 1.6;
    color: #333;
}

.article-content h1, 
.article-content h2, 
.article-content h3, 
.article-content h4 {
    color: #2c3e50;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content h1 { font-size: 1.5rem; } /* Réduit de 2rem à 1.5rem */
.article-content h2 { font-size: 1.3rem; } /* Réduit de 1.7rem à 1.3rem */
.article-content h3 { font-size: 1.1rem; } /* Réduit de 1.4rem à 1.1rem */
.article-content h4 { font-size: 1rem; }   /* Réduit de 1.2rem à 1rem */

.article-content p {
    margin-bottom: 1.2rem;
    text-align: justify;
}

.article-content ul, 
.article-content ol {
    margin-bottom: 1.2rem;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    border-left: 4px solid #007bff;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #6c757d;
}

/* Images de page */
.page-images h3 {
    color: #2c3e50;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.page-images .card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.page-images .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.page-images .card-img-top {
    border-radius: 8px 8px 0 0;
}

/* Pièces jointes */
.page-attachments h3 {
    color: #2c3e50;
    border-bottom: 2px solid #28a745;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.page-attachments .list-group-item {
    border: 1px solid #dee2e6;
    border-radius: 6px !important;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.page-attachments .list-group-item:hover {
    background-color: #f8f9fa;
    border-color: #28a745;
    transform: translateX(5px);
}

.page-attachments .fas {
    margin-right: 0.5rem;
    width: 20px;
}

.page-attachments .fa-file-pdf {
    color: #dc3545;
}

.page-attachments .fa-file-alt {
    color: #6c757d;
}

/* Container PDF */
.pdf-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pdf-actions {
    text-align: center;
}

.pdf-actions .btn {
    margin: 0 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
}

.pdf-embed {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Alertes */
.alert {
    border-radius: 8px;
    padding: 1.5rem;
    font-size: 1.1rem;
}

.alert .fas {
    margin-right: 0.5rem;
}

/* === SIDEBAR PIÈCES JOINTES (repris des articles) === */
.attachments-sidebar {
    padding-left: 1rem;
}

.sidebar-attachments {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    position: sticky;
    top: 2rem;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #007bff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* === ITEMS PIÈCES JOINTES === */
.attachment-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.attachment-item:hover {
    background: #e9ecef;
    border-color: #007bff;
    transform: translateY(-1px);
    text-decoration: none;
    color: inherit;
}

.attachment-icon {
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
    flex-shrink: 0;
}

.attachment-icon .fa-file-pdf {
    color: #dc3545;
}

.attachment-icon .fa-file-word {
    color: #0d6efd;
}

.attachment-icon .fa-file-excel {
    color: #198754;
}

.attachment-icon .fa-file-alt {
    color: #6c757d;
}

.attachment-info {
    flex-grow: 1;
    min-width: 0;
}

.attachment-info strong {
    font-size: 0.85rem;
    font-weight: 500;
    color: #2c3e50;
    word-break: break-word;
    display: block;
    margin-bottom: 0.2rem;
}

.attachment-info small {
    color: #6c757d;
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .page-content {
        padding: 1rem 0;
    }
    
    .page-header {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-article {
        padding: 1.5rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .pdf-actions .btn {
        display: block;
        width: 100%;
        margin: 0.5rem 0;
    }
    
    .pdf-embed {
        height: 500px;
    }
    
    /* Sidebar responsive - passe en dessous sur mobile */
    .page-sidebar {
        margin-top: 2rem;
        position: static;
        order: 2; /* Force la sidebar après le contenu */
    }
    
    /* Réorganise les colonnes sur mobile */
    .row {
        flex-direction: column;
    }
    
    .col-2:first-child, 
    .col-2:last-child {
        display: none; /* Cache les marges sur mobile */
    }
    
    .col-6, .col-8 {
        order: 1;
        width: 100%;
        max-width: 100%;
    }
    
    .sidebar-attachments {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .attachment-item {
        flex: 1;
        min-width: calc(50% - 0.25rem);
    }
}

@media (max-width: 576px) {
    .page-header {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.7rem;
    }
    
    .page-article {
        padding: 1rem;
    }
    
    .pdf-embed {
        height: 400px;
    }
}
