/* ===== BASE & RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 11px;
    color: #333;
    line-height: 1.4;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 210mm;
    margin: 0 auto;
    background-color: white;
    padding: 15mm;
}

/* ===== PRINT OPTIMISATIONS (A4) ===== */
@media print {
    @page {
        size: A4;
        margin: 15mm 10mm 12mm 12mm;
    }

    body {
        margin: 0;
        padding: 0;
    }
}

@media print {
    body {
        background: white;
    }

    .container {
        max-width: 100%;
        width: 100%;
        padding: 0;
        box-shadow: none;
        background: white;
    }

    /* Sauts de page */
    .page-break-before {
        break-before: page;
    }

    .page-break-after {
        break-after: page;
    }


    /* Gestion des veuves/orphelines */
    p, li {
        orphans: 3;
        widows: 3;
    }

    /* Suppression des éléments inutiles */
    .cv-footer {
        margin-top: 20px;
        padding-top: 5px;
        border-top: 1px solid #ddd;
    }
}

/* ===== HEADER ===== */
.cv-header {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 3px solid #2c3e50;
}

.photo-container {
    flex: 0 0 120px;
}

.photo-container img {
    width: 100%;
    height: auto;
    border-radius: 50%;
    border: 3px solid #3498db;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.header-info {
    flex: 1;
}

.header-info h1 {
    margin-bottom: 5px;
    font-size: 24px;
    color: #2c3e50;
    font-weight: 700;
}

.header-info .title {
    color: #3498db;
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: 600;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 5px;
    margin-top: 10px;
    font-size: 10px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-item i {
    color: #3498db;
    width: 16px;
    text-align: center;
}

/* ===== SECTIONS ===== */
.cv-section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #3498db;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== PROFIL ===== */
.profile-summary {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    border-left: 4px solid #3498db;
    margin-bottom: 15px;
    font-style: italic;
    text-align: justify;
}

/* ===== EXPÉRIENCES ===== */
.experience-item {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ddd;
}

.experience-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 5px;
}

.experience-title {
    font-weight: 700;
    color: #2c3e50;
    font-size: 13px;
}

.experience-company {
    color: #3498db;
    font-weight: 600;
}

.experience-dates {
    color: #7f8c8d;
    font-size: 10px;
    white-space: nowrap;
}
.experience-dates i {
     padding-right: 10px;
 }

.experience-location {
    color: #95a5a6;
    font-size: 12px;
    font-style: italic;
    margin: 2px 0 5px;
}

.experience-description {
    margin: 5px 0;
    text-align: justify;
}

.activities-list {
    margin: 8px 0 5px;
    padding-left: 20px;
}

.activities-list li {
    margin-bottom: 2px;
    text-align: justify;
}

.technologies {
    margin-top: 8px;
    font-size: 10px;
}

.tech-tag {
    display: inline-block;
    background: #162dff;
    padding: 2px 6px;
    margin: 2px 3px 2px 0;
    border-radius: 3px;
    font-size: 9px;
    color: white;
}

/* ===== ÉDUCATION ===== */
.education-item {
    margin-bottom: 12px;
    padding-left: 15px;
    border-left: 2px solid #2ecc71;
}

.education-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 3px;
    font-size: 12px;
}

.education-details {
    color: #7f8c8d;
    font-size: 10px;
    margin-bottom: 3px;
}

.education-description {
    font-size: 11px;
}

/* ===== COMPÉTENCES ===== */
.skills-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.skill-category {
    margin-bottom: 10px;
}

.skill-category h4 {
    font-size: 12px;
    color: #2c3e50;
    margin-bottom: 8px;
    padding-bottom: 3px;
    border-bottom: 1px solid #ddd;
}

.skill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.skill-name {
    font-size: 11px;
    flex: 1;
}

.skill-level {
    width: 100px;
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    background: #3498db;
    border-radius: 4px;
}

/* ===== PUBLICATIONS & CONTRIBUTIONS ===== */
.publication-item,
.contribution-item {
    margin-bottom: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #9b59b6;
}

.publication-title,
.contribution-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 3px;
    font-size: 12px;
}

.publication-details,
.contribution-details {
    color: #7f8c8d;
    font-size: 10px;
    margin-bottom: 3px;
}

.publication-authors {
    color: #95a5a6;
    font-size: 10px;
    font-style: italic;
}

/* ===== FOOTER ===== */
.cv-footer {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
    text-align: center;
    color: #7f8c8d;
    font-size: 10px;
}

/* ===== UTILITAIRES ===== */
.text-muted {
    color: #95a5a6;
    font-style: italic;
}

.mb-0 { margin-bottom: 0 !important; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }

/* ===== RESPONSIVE MOBILE ===== */
@media screen and (max-width: 768px) {
    body {
        font-size: 10px;
        background-color: white;
    }

    .container {
        padding: 10mm;
    }

    .cv-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .photo-container {
        flex: 0 0 auto;
        width: 100px;
        align-self: center;
    }

    .photo-container img {
        width: 100px;
        height: 100px;
    }

    .header-info {
        width: 100%;
    }

    .header-info h1 {
        font-size: 18px;
    }

    .header-info .title {
        font-size: 14px;
    }

    .contact-info {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .contact-item {
        justify-content: flex-start;
    }

    .section-title {
        font-size: 14px;
    }

    .skills-section {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .experience-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .experience-dates {
        white-space: normal;
    }

    .experience-title {
        font-size: 12px;
    }

    .tech-tag {
        font-size: 8px;
        padding: 1px 4px;
    }

    .cv-footer {
        font-size: 8px;
        text-align: center;
    }

    /* Alignement à gauche global */
    .profile-summary,
    .experience-description,
    .activities-list,
    .activities-list li,
    .education-item,
    .skill-category,
    .contribution-item,
    .publication-item {
        text-align: left;
    }
}

/* ===== ANCIENS ATTRIBUTS style= INLINE =====
   Repris en classes : la CSP envoyée par setSecurityHeaders() déclare
   `style-src 'self' 'nonce-...'` sans 'unsafe-inline', ce qui bloque les attributs
   style= (un nonce ne vaut que pour les balises <style>, jamais pour les attributs).
   Les barres de compétences s'affichaient donc à 0 %. */
.subtitle {
    color: #7f8c8d;
    font-size: 12px;
    margin-bottom: 8px;
}

.subsection-title {
    color: #2c3e50;
    font-size: 13px;
    margin: 20px 0 10px 0;
}

.subsection-title.is-first {
    margin-top: 15px;
}

.livrables-list {
    margin-top: 5px;
}

.livrable-item {
    font-size: 10px;
    margin-right: 10px;
}
