/*
 * Feuille du CV : rendu écran, puis rendu papier.
 *
 * Elle est poussée via @stack('styles'), après @vite, pour primer sur le thème
 * Glitche sans avoir à le modifier — glitche-layout.css est partagé par toutes
 * les pages du site.
 */

.cv-page .content {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.cv-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.cv {
    font-family: 'Nunito', system-ui, sans-serif;
    color: #141414;
    line-height: 1.55;
}

.cv-header {
    border-bottom: 2px solid #303f9f;
    padding-bottom: 16px;
    margin-bottom: 28px;
}

.cv-name {
    font-family: 'Roboto Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 0 0 4px;
}

.cv-role {
    margin: 0 0 12px;
    color: #303f9f;
    font-weight: 600;
}

.cv-contact {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 0.9rem;
    color: #4b5563;
}

.cv-contact a { text-decoration: underline; }

.cv-section { margin-bottom: 28px; }

.cv-section__title {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #303f9f;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 6px;
    margin: 0 0 14px;
}

.cv-bio { margin: 0; }

.cv-skills { margin: 0; color: #374151; }

.cv-item { margin-bottom: 16px; }

.cv-item__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.cv-item__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.cv-item__period {
    font-size: 0.85rem;
    color: #6b7280;
    white-space: nowrap;
}

.cv-item__desc { margin: 4px 0 0; }

.cv-item__meta {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: #6b7280;
}

.cv-provenance {
    margin-top: 40px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    font-size: 0.8rem;
    color: #6b7280;
}

/* ------------------------------------------------------------------------ */

@page { size: A4 portrait; margin: 14mm 14mm 16mm; }

@media print {
    /*
     * (A) Le thème masque tout jusqu'à la fin du préchargeur :
     *     glitche-basic.css met body header/footer/.section en
     *     opacity:0 + visibility:hidden, et seule la classe body.loaded,
     *     ajoutée par glitche-scripts.js après window.load PLUS 800 ms de
     *     fondu, les rétablit. Un Ctrl+P anticipé — ou JS désactivé —
     *     imprimait une page blanche.
     */
    body header,
    body footer,
    body .section,
    body.loaded header,
    body.loaded footer,
    body.loaded .section {
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* (B) glitche-scripts.js écrit une hauteur EN STYLE INLINE sur
           .section.started, égale à la hauteur de fenêtre : une page blanche
           réservée sur le papier. */
    .section.started { height: auto !important; }

    /* (C) overflow:auto sur body/.container tronque l'impression à une page
           dans plusieurs moteurs. */
    html, body, .container {
        overflow: visible !important;
        height: auto !important;
        background: #fff !important;
    }

    /* (D) Ce qui n'a rien à faire sur le papier. */
    .preloader,
    .cookie-consent,
    .locale-switch,
    .hero-languages,
    .cv-actions,
    .page-top-nav,
    .container .line,
    /* Le pied de site vit dans .container, pas en enfant direct de body : un
       sélecteur `body > footer` le manquait. On ne peut pas non plus masquer
       tous les <footer>, .cv-provenance en est un — et c'est la ligne qui date
       et source la feuille imprimée. */
    .container > footer {
        display: none !important;
    }

    /* (E) Artefacts du thème : le glitch imprime le texte en double. */
    .glitch-effect:before,
    .glitch-effect:after,
    .typed-cursor { display: none !important; }

    /* (F) Couleurs : forcer ce qui doit survivre au retrait des fonds. */
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    body, .container { color: #000 !important; padding: 0 !important; margin: 0 !important; }
    .cv-page .content { max-width: none; padding: 0; }

    /* (G) Sauts de page. */
    .cv-item,
    .cv-header { break-inside: avoid; page-break-inside: avoid; }
    .cv-section__title { break-after: avoid; page-break-after: avoid; }

    /* (H) Les URL n'apparaissent que là où le texte du lien n'est pas l'adresse. */
    .cv a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 8pt;
        color: #555;
        word-break: break-all;
    }
    .cv-contact a::after,
    .cv a[href^="mailto"]::after { content: "" !important; }

    /* (I) Typographie papier. */
    .cv { font-size: 10pt; line-height: 1.35; }
    .cv-name { font-size: 18pt; }
    .cv-section__title { font-size: 9pt; }
    .cv-item__title { font-size: 10.5pt; }
}
