/* ====================================
   CSS MODERNE pour les pages de billets
   ==================================== */

/* Variables CSS modernes (cohérence avec vos autres pages) */
:root {
    --primary-color: #3d99f7;
    --secondary-color: #fecc03;
    --text-dark: #2c3e50;
    --text-light: #ecf0f1;
    --bg-light: #f8f9fa;
    --shadow: 0 4px 20px rgba(0,0,0,0.1);
    --radius: 20px; /* Conserve votre border-radius de 20px */
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --border-color: #d3caca;
}

/* Reset moderne */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Body modernisé avec sticky footer */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', "Verdana", sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
}

/* Header modernisé avec glassmorphism */
header {
    background: rgba(61, 153, 247, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding: 0;
    margin: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

header p {
    margin: 0;
    padding: 0;
}

header img {
    display: block;
    padding-left: 20px;
    padding-bottom: 0;
    margin: 0;
    border: 0;
    transition: var(--transition);
    border-radius: 8px;
}

header img:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Section principale - flex pour sticky footer */
section {
    flex: 1;
    position: relative;
    margin-left: auto;
    margin-right: auto;
    width: 950px;
    padding: 2rem 0;
    /* Hauteur calculée dynamiquement selon le contenu */
    min-height: calc(100vh - 200px);
}

/* Conteneur pour gérer la hauteur du contenu */
section::after {
    content: "";
    display: block;
    clear: both;
    height: 0;
}

/* Cadre principal modernisé */
section div#cadre {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border: 3px solid rgba(211, 202, 202, 0.6);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    animation: fadeInUp 0.8s ease-out 0.2s both;
    
    /* Structure modifiée pour respect du flux */
    padding-top: 50px;
    padding-bottom: 50px; /* Ajout de padding bottom */
    font-family: "Times New Roman", serif;
    display: block; /* Changé de inline-block à block */
    position: relative; /* Changé d'absolute à relative */
    width: 900px;
    margin: 50px auto; /* Centré automatiquement */
    margin-bottom: 50px; /* Espacement avec le footer */
    min-height: auto; /* Hauteur automatique selon le contenu */
    word-wrap: break-word;
    overflow: visible; /* Changé d'auto à visible */
    z-index: 1;
}

section div#cadre:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

/* Paragraphes dans le cadre */
section div#cadre p {
    margin: 40px;
    margin-bottom: 0px;
    margin-top: 0px;
    margin-left: 80px;
    padding: 0px;
    color: var(--text-dark);
    font-size: 18px;
    text-align: justify;
    clear: both;
    font-family: "Verdana", sans-serif;
    line-height: 1.8;
}

/* Commentaires */
section div#cadre p#com {
    text-align: right;
    color: var(--primary-color);
    padding: 0px;
    margin-top: 0px;
    margin-right: 20px;
    font-size: 16px;
    font-weight: 500;
}

section div#cadre p#com a {
    text-decoration: none;
    color: #8b4513; /* Conserve votre couleur brown */
    transition: var(--transition);
}

section div#cadre p#com a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Images dans le cadre */
div#IMG {
    margin-left: 80px;
}

img#image {
    border: 0;
    display: inline-block;
    float: left;
    padding-right: 20px;
    padding-top: 10px;
    padding-bottom: 10px;
    border-radius: 12px;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

img#image:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

section div#cadre p img#trait {
    padding: 0px;
    margin: 0px;
    border: 0;
}

/* Menu latéral modernisé */
section div#menu1 {
    background: rgba(241, 241, 241, 0.95);
    backdrop-filter: blur(10px);
    border: 3px solid rgba(211, 202, 202, 0.6);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    animation: slideInLeft 0.8s ease-out;
    
    /* Positionnement absolu par rapport à la section */
    display: block;
    position: absolute;
    z-index: 2;
    width: 100px;
    height: 200px;
    left: -120px; /* Position relative à la section */
    top: 100px; /* Position depuis le top de la section */
}

section div#menu1:hover {
    transform: translateY(-2px);
    background: rgba(241, 241, 241, 1);
}

section div#menu1 ul {
    text-align: center;
    font-size: 1.2em;
    color: #9a9b9a;
    list-style-type: none;
    padding: 0;
    margin: 0;
    padding-top: 5px;
}

section div#menu1 li a {
    text-decoration: none;
    color: #9a9b9a;
    transition: var(--transition);
    display: inline-block;
    padding: 0.5rem;
    border-radius: 8px;
}

section div#menu1 li a:hover {
    color: #540a22;
    background: rgba(84, 10, 34, 0.1);
    transform: translateY(-1px);
}

/* Footer modernisé sticky */
footer {
    background: linear-gradient(135deg, var(--primary-color), #2980b9);
    border-top: 3px solid var(--secondary-color);
    margin: 0; /* Supprime tous les margins */
    padding: 0; /* Supprime tous les paddings par défaut */
    left: 0;
    margin-top: auto;
    flex-shrink: 0;
    position: relative;
    width: 100%;
    min-height: 60px; /* Hauteur minimale garantie */
    box-sizing: border-box; /* Important pour les calculs de largeur */
}

footer p {
    padding: 15px 20px; /* Padding ajusté pour plus d'espace */
    font-family: arial, sans-serif;
    font-size: 1em;
    margin: 0; /* Supprime complètement les margins */
    text-align: center;
    color: white;
    line-height: 1.6;
    background: transparent; /* Assure que le p n'a pas d'arrière-plan */
}

footer a {
    text-decoration: none;
    color: var(--secondary-color);
    transition: var(--transition);
    font-weight: 500;
}

footer a:hover {
    color: white;
    text-decoration: underline;
    transform: translateY(-1px);
}

/* Lien d'administration dans le footer - VERSION AMÉLIORÉE */
footer .admin-link,
footer a[href*="admin"] {
    display: inline-block; /* Changé de block à inline-block */
    text-align: center;
    padding: 8px 15px;
    background: rgba(0,0,0,0.2); /* Assombri légèrement */
    margin: 5px auto 0 auto;
    border-top: 1px solid rgba(255,255,255,0.2);
    border-radius: 5px; /* Ajout de bordures arrondies */
    transition: var(--transition);
}

footer .admin-link:hover,
footer a[href*="admin"]:hover {
    background: rgba(0,0,0,0.3);
    transform: translateY(-1px);
}


/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    section {
        width: 100%;
        padding: 1rem;
    }
    
    section div#cadre {
        width: calc(100% - 40px);
        margin: 20px auto;
    }
    
    section div#menu1 {
        position: relative;
        width: 100%;
        height: auto;
        margin: 20px 0;
        left: auto;
        top: auto;
    }
    
    section div#cadre p {
        margin-left: 20px;
        margin-right: 20px;
    }
    
    div#IMG {
        margin-left: 20px;
    }
    
    img#image {
        float: none;
        display: block;
        margin: 0 auto 20px auto;
    }
}

@media (max-width: 1200px) {
    section {
        position: relative;
        overflow: visible; /* Permet au menu de déborder */
    }
    
    section div#menu1 {
        left: -120px; /* S'adapte aux écrans plus petits */
    }
}

@media (max-width: 1070px) {
    section div#menu1 {
        display: none; /* Cache le menu sur les très petits écrans */
    }
}

/* Mode sombre (bonus) */
/*@media (prefers-color-scheme: dark) {*/
    :root {
        --text-dark: #ecf0f1;
        --bg-light: #2c3e50;
    }
    
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    section div#cadre {
        background: rgba(52, 73, 94, 0.95);
        color: var(--text-dark);
    }
    
    section div#menu1 {
        background: rgba(52, 73, 94, 0.95);
    }
    
    section div#cadre p {
        color: var(--text-dark);
    }
/*}*/

/* Améliorations de performance */
img {
    max-width: 100%;
    height: auto;
}

/* Scroll-bar personnalisée */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}