/*
 * Fiche publique d'un candidat : /candidat-rh/{id}/
 *
 * Reprise de la feuille en ligne du gabarit d'origine, themes/dms/candidat-profil.php,
 * déclaration par déclaration. La référence portait déjà la plupart de ses
 * sélecteurs sous « .dms-candidat-page » : cette page reprend cette portée, et
 * l'étend aux quelques règles qui étaient nues.
 *
 * Les écarts sont commentés : ils remplacent un style que la référence écrivait
 * en attribut, ou un style que lui apportaient hello-elementor et le kit
 * Elementor, absents ici.
 */

:root {
    --dms-color-primary: #005998;
    --dms-color-secondary: #FAB327;
    --dms-color-text: #374151;
    --dms-color-text-light: #6B7280;
    --dms-color-bg-light: #F9FAFB;
    --dms-radius: 0.5rem;
    --dms-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --dms-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Fil d'Ariane */
.dms-candidat-page .dms-bc-wrap { margin-bottom: 1.5rem; font-size: 0.875rem; color: var(--dms-color-text-light); }
.dms-candidat-page .dms-bc__link { color: var(--dms-color-text-light); text-decoration: none; transition: color 0.2s; }
.dms-candidat-page .dms-bc__link:hover { color: var(--dms-color-primary); }
.dms-candidat-page .dms-bc__current { color: var(--dms-color-primary); font-weight: 500; }
.dms-candidat-page .dms-bc__sep { margin: 0 0.5rem; color: #9ca3af; }
.dms-candidat-page .dms-bc__icon { margin-right: 0.5rem; color: var(--dms-color-text-light); }

/*
 * Disposition du fil : le widget d'origine l'écrivait en attribut « style » sur
 * la liste et sur chaque élément. Valeurs relevées dans le HTML de la référence.
 */
.dms-candidat-page .dms-bc {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}
.dms-candidat-page .dms-bc__icon,
.dms-candidat-page .dms-bc__item { display: inline-flex; align-items: center; }
.dms-candidat-page .dms-bc__sep { display: inline-flex; }
.dms-candidat-page .dms-bc__icon .dms-icon { width: 0.875rem; height: 0.875rem; }

/*
 * Police et hauteur de ligne du bloc, deux valeurs mesurées et non déduites.
 *
 * POLICE. La référence déclare « 'Inter', sans-serif » sur ce bloc. Aucune
 * feuille ne sert Inter sur cette page, et la machine de rendu ne l'a pas
 * installée : le navigateur retombe donc sur la police sans empattement par
 * défaut. Le thème, lui, sert Inter depuis Google Fonts sur toutes ses pages.
 * Reprendre la déclaration telle quelle chargerait vraiment Inter et changerait
 * la police de la fiche entière. On ne garde donc que le repli effectif.
 *
 * HAUTEUR DE LIGNE. La référence hérite du corps de page de hello-elementor,
 * en 1,5 sans unité : 24px sous 16px, 21px sous 14px. Le socle du thème pose à
 * la place une valeur fixe de 26px, qui ne se remet pas à l'échelle. Sans ce
 * rappel, chaque ligne gagnait 2 pixels : mesuré 20,2 pixels sur le seul
 * bandeau de tête, et l'écart s'accumulait sur toute la page.
 */
.dms-candidat-page {
    font-family: sans-serif;
    line-height: 1.5;
    color: var(--dms-color-text);
    background-color: #fff;
}

.dms-candidat-page .dms-hero {
    background: linear-gradient(135deg, #F5F7FA 0%, #ffffff 100%);
    padding: 3rem 0;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    overflow: hidden;
}
.dms-candidat-page .dms-hero-bg-accent {
    position: absolute;
    top: 0; right: 0; width: 33%; height: 100%;
    background: linear-gradient(to left, rgba(250, 179, 39, 0.05), transparent);
    pointer-events: none;
}
.dms-candidat-page .dms-container,
.dms-container { max-width: 1216px; margin: 0 auto; padding: 0 32px; }
.dms-candidat-page .dms-header-layout { display: flex; gap: 2rem; align-items: flex-start; }
.dms-candidat-page .dms-photo-wrapper {
    flex-shrink: 0; width: 12rem; height: 12rem; border-radius: 1rem;
    overflow: hidden; box-shadow: var(--dms-shadow-lg); border: 4px solid #fff; position: relative;
}
.dms-candidat-page .dms-photo-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.dms-candidat-page .dms-header-info { flex: 1; }
.dms-candidat-page h1.dms-header-name {
    color: #005998; font-family: "Plus Jakarta Sans"; font-size: 16px;
    font-weight: 700; line-height: 24px; margin: 0 0 0.5rem 0;
}
.dms-candidat-page .dms-header-role { font-size: 1.125rem; color: var(--dms-color-text); margin-bottom: 0.5rem; font-weight: 500; }
.dms-candidat-page .dms-header-meta {
    display: flex; color: var(--dms-color-text-light); font-size: 0.95rem;
    margin-bottom: 1rem; align-items: center; gap: 0.25rem;
}
.dms-candidat-page .dms-cv-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background-color: var(--dms-color-secondary); color: var(--dms-color-primary);
    font-weight: 600; border: none; padding: 0.625rem 1.25rem; border-radius: 0.375rem;
    cursor: pointer; text-decoration: none; transition: background-color 0.2s; font-size: 0.95rem; margin-top: 0.75rem;
}
.dms-candidat-page .dms-cv-btn:hover { background-color: #E5A420; color: var(--dms-color-primary); }

.dms-candidat-page .dms-main-section { padding: 4rem 0; }
.dms-candidat-page .dms-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media(min-width: 1024px) {
    .dms-candidat-page .dms-grid { grid-template-columns: 2fr 1fr; }
    .dms-candidat-page .dms-grid.dms-grid--single { grid-template-columns: 1fr; max-width: 800px; }
}
.dms-candidat-page .dms-card {
    background: #fff; border-radius: var(--dms-radius); box-shadow: var(--dms-shadow);
    padding: 2rem; margin-bottom: 2rem; border: 1px solid #e5e7eb;
}
.dms-candidat-page .dms-card-title, .dms-candidat-page h2.dms-card-title {
    color: #005998; font-family: "Plus Jakarta Sans", sans-serif; font-size: 20px;
    font-weight: 500; line-height: 30px; margin-bottom: 1.5rem;
    display: flex; align-items: center; gap: 0.5rem;
}
/*
 * Les titres de la colonne latérale portaient ces valeurs en attribut, et leur
 * graisse vient d'ailleurs : la règle du gabarit d'origine ne les vise que par
 * la classe, quand le kit Elementor vise « h3 » avec un sélecteur plus fort.
 * Le kit l'emporte donc, et ces titres sortent en 700 alors que les titres de
 * carte, visés eux par « h2.dms-card-title », restent en 500. Mesuré, pas
 * déduit : c'est la moitié de l'écart résiduel de la fiche sans contenu.
 */
.dms-candidat-page h3.dms-card-title--aside { font-size: 1.1rem; margin-bottom: 1rem; font-weight: 700; }
.dms-candidat-page h3.dms-card-title--centre { justify-content: center; }
/* Le pictogramme des titres portait « font-size: 1.25em » en attribut. */
.dms-candidat-page .dms-pp-titre { font-size: 1.25em; }

.dms-candidat-page .dms-prose { font-size: 1rem; line-height: 1.75; color: var(--dms-color-text); }
.dms-candidat-page .dms-sidebar-card { border-left: 4px solid var(--dms-color-primary); padding: 1.5rem; }

/* Chronologie */
.dms-candidat-page .dms-timeline { position: relative; padding-left: 1.5rem; }
.dms-candidat-page .dms-timeline::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 2px; background: var(--dms-color-secondary); border-radius: 10px;
}
.dms-candidat-page .dms-timeline-item { position: relative; margin-bottom: 2rem; padding-bottom: 0.5rem; }
.dms-candidat-page .dms-timeline-item:last-child { margin-bottom: 0; }
.dms-candidat-page .dms-timeline-item::before {
    content: ''; position: absolute; left: -1.8rem; top: 0.35rem;
    width: 12px; height: 12px; background: var(--dms-color-secondary);
    border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}
.dms-candidat-page .dms-timeline-title { font-weight: 600; font-size: 1rem; color: var(--dms-color-text); margin-bottom: 0.25rem; }
.dms-candidat-page .dms-timeline-subtitle { font-size: 0.9rem; color: var(--dms-color-primary); font-weight: 500; margin-bottom: 0.25rem; }
.dms-candidat-page .dms-timeline-date { font-size: 0.85rem; color: var(--dms-color-text-light); margin-bottom: 0.5rem; }
.dms-candidat-page .dms-timeline-comment { font-size: 0.9rem; color: var(--dms-color-text); line-height: 1.6; }
/* Le pictogramme de date portait « margin-right: 0.25rem » en attribut. */
.dms-candidat-page .dms-pp-date { margin-right: 0.25rem; }

/* CV et localisation */
.dms-candidat-page .dms-cv-card { text-align: center; }
.dms-candidat-page .dms-cv-card .dms-cv-icon { font-size: 3rem; color: var(--dms-color-primary); margin-bottom: 1rem; }
.dms-candidat-page .dms-cv-download-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    background-color: var(--dms-color-primary); color: #fff; font-weight: 600;
    border: none; padding: 0.75rem 1.5rem; border-radius: 0.375rem; cursor: pointer;
    text-decoration: none; transition: background-color 0.2s; font-size: 0.95rem; width: 100%;
}
.dms-candidat-page .dms-cv-download-btn:hover { background-color: #004070; color: #fff; }
.dms-candidat-page .dms-location-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; margin-bottom: 0.5rem; }
.dms-candidat-page .dms-location-item .dms-pp { color: var(--dms-color-primary); }
/*
 * Le nom du fichier de CV portait ces valeurs en attribut, donc prioritaires.
 * Le sélecteur porte la carte en plus pour rester au-dessus de la marge de
 * paragraphe rappelée plus bas, quel que soit l'ordre des règles : sans cela il
 * passait de 16 à 14,4px et décalait de 1,6px tout ce qui suit.
 */
.dms-candidat-page .dms-cv-card .dms-cv-nom { font-size: 0.85rem; color: var(--dms-color-text-light); margin-bottom: 1rem; }

/* Contact */
.dms-candidat-page .dms-contact-section { background: linear-gradient(135deg, #005998 0%, #004070 100%); padding: 4rem 0; color: #fff; }
.dms-candidat-page .dms-contact-grid { display: grid; grid-template-columns: 1fr; gap: 3rem; align-items: center; }
@media(min-width: 768px) { .dms-candidat-page .dms-contact-grid { grid-template-columns: 1fr 1fr; } }
.dms-candidat-page .dms-contact-form-card { background: #fff; border-radius: var(--dms-radius); padding: 2rem; color: var(--dms-color-text); }
.dms-candidat-page .wpforms-field-row.wpforms-field-medium { max-width: 100% !important; width: 100% !important; }
.dms-candidat-page .dms-empty-state { text-align: center; padding: 2rem; color: var(--dms-color-text-light); font-style: italic; }

/* Ces quatre blocs portaient leurs valeurs en attribut « style ». */
.dms-candidat-page .dms-contact-titre { font-size: 2rem; font-weight: 700; margin-bottom: 1.5rem; }
.dms-candidat-page .dms-contact-accroche { font-size: 1.1rem; opacity: 0.9; margin-bottom: 2rem; }
.dms-candidat-page .dms-contact-points { font-size: 1rem; opacity: 0.9; }
.dms-candidat-page .dms-pp-point { color: var(--dms-color-secondary); margin-right: 0.5rem; }
.dms-candidat-page .dms-contact-form-titre {
    color: var(--dms-color-primary); font-size: 1.5rem; font-weight: 600; margin-bottom: 1.5rem;
}

/*
 * Deux valeurs que hello-elementor apporte dans la référence et que le reset du
 * socle met à zéro. Relevées sur le rendu, pas déduites :
 *
 *   titres      8px de marge haute sur tout titre qui n'en déclare pas. Trois
 *               titres de carte, trois de colonne latérale et deux du bloc de
 *               contact : 8px chacun, soit 40 pixels de hauteur de page.
 *   paragraphes 14,4px de marge basse, le 0,9rem du reset de hello-elementor.
 *               Ne concerne que les paragraphes sans règle propre : ceux de
 *               .dms-prose gardent leur 1rem, comme dans la référence.
 *   listes      aucune marge verticale. Relevé sur l'expert 17, dont le parcours
 *               contient des listes : sans cette remise à zéro, chaque liste
 *               gagnait les 16px de marge haute du navigateur, soit 144 pixels
 *               de hauteur de page.
 *   titres bis  16px de marge basse, pour les titres écrits dans un champ riche.
 *               Ceux du gabarit déclarent la leur et ne sont pas touchés.
 *   police des  le kit Elementor donne Plus Jakarta Sans à tout titre dans la
 *   titres      référence, alors que le bloc, lui, rend en police sans
 *               empattement par défaut. Les titres de carte le déclarent déjà ;
 *               ceux du bloc de contact en héritaient, et sortaient donc dans la
 *               mauvaise police : à eux deux, les trois quarts de l'écart
 *               résiduel de la fiche d'expert.
 *
 * Les titres passent par :where() pour rester à zéro de spécificité : sans lui,
 * la règle battrait celle du titre principal, qui déclare sa marge à zéro.
 */
.dms-candidat-page :where(h1, h2, h3, h4, h5, h6) {
    margin-top: 8px;
    margin-bottom: 1rem;
    font-family: "Plus Jakarta Sans", sans-serif;
}
.dms-candidat-page :where(dd, dl, dt, li, ol, ul) { margin-block: 0; }
.dms-candidat-page .dms-card > p,
.dms-candidat-page .dms-contact-points p { margin-bottom: 14.4px; }

@media(max-width: 768px) {
    .dms-candidat-page .dms-header-layout { flex-direction: column; align-items: center; text-align: center; }
    .dms-candidat-page .dms-header-meta { justify-content: center; }
}

/* --- Mode édition --- */
.dms-admin-edit-btn {
    position: fixed; bottom: 2rem; right: 2rem; z-index: 9999;
    background: var(--dms-color-primary); color: #fff !important; border: none;
    padding: 0.75rem 1.5rem; border-radius: 0.5rem; font-size: 0.95rem; font-weight: 600;
    cursor: pointer; box-shadow: var(--dms-shadow-lg); text-decoration: none;
    display: inline-flex; align-items: center; gap: 0.5rem; transition: background 0.2s;
}
.dms-admin-edit-btn:hover { background: #004070; color: #fff !important; }

.dms-edit-banner {
    background: #FEF3C7; border-bottom: 2px solid var(--dms-color-secondary);
    padding: 0.75rem 0; text-align: center; font-weight: 600; color: #92400E; font-size: 0.95rem;
}
.dms-edit-banner a { color: var(--dms-color-primary); margin-left: 1rem; text-decoration: underline; }

.dms-edit-field { margin-bottom: 1rem; }
.dms-edit-field label {
    display: block; font-weight: 600; font-size: 0.85rem; color: var(--dms-color-text-light);
    margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.025em;
}
.dms-edit-field input[type="text"],
.dms-edit-field textarea,
.dms-edit-field select {
    width: 100%; padding: 0.6rem 0.75rem; border: 1px solid #d1d5db; border-radius: 0.375rem;
    font-size: 0.95rem; font-family: inherit; background: #fff; transition: border-color 0.2s;
}
.dms-edit-field input:focus, .dms-edit-field textarea:focus, .dms-edit-field select:focus {
    outline: none; border-color: var(--dms-color-primary); box-shadow: 0 0 0 3px rgba(0, 89, 152, 0.1);
}
.dms-edit-field textarea { min-height: 80px; resize: vertical; }

/* La paire prénom / nom portait sa disposition en attribut « style ». */
.dms-edit-nom { display: flex; gap: 1rem; margin-bottom: 0.75rem; }
.dms-edit-nom .dms-edit-field { flex: 1; margin-bottom: 0; }
/* Le rappel du CV en place portait ces valeurs en attribut. */
.dms-edit-cv-actuel { margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--dms-color-text-light); }

/* Le bandeau de changement de photo portait sa mise en place en attribut. */
.dms-edit-photo-upload {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(0, 0, 0, 0.6); padding: 0.5rem; text-align: center;
}
.dms-edit-photo-upload label { cursor: pointer; color: #fff; font-size: 0.8rem; display: block; }

.dms-edit-submit-bar { background: #fff; border-top: 2px solid var(--dms-color-primary); padding: 1.5rem 0; text-align: center; }
.dms-edit-submit-btn {
    background: var(--dms-color-primary); color: #fff; border: none; padding: 0.85rem 3rem;
    border-radius: 0.5rem; font-size: 1.1rem; font-weight: 700; cursor: pointer; transition: background 0.2s;
}
.dms-edit-submit-btn:hover { background: #004070; }

.dms-success-notice {
    background: #D1FAE5; border: 1px solid #6EE7B7; color: #065F46;
    padding: 0.75rem 1.5rem; border-radius: 0.5rem; margin-bottom: 1.5rem; font-weight: 500; text-align: center;
}

/* Répéteurs */
.dms-repeater-row {
    border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 1rem; margin-bottom: 1rem;
    background: var(--dms-color-bg-light); position: relative;
}
.dms-repeater-row .dms-remove-row-btn {
    position: absolute; top: 0.5rem; right: 0.5rem;
    background: #EF4444; color: #fff; border: none; border-radius: 50%;
    width: 24px; height: 24px; font-size: 14px; cursor: pointer; line-height: 24px; text-align: center;
}
.dms-repeater-row .dms-remove-row-btn:hover { background: #DC2626; }
.dms-add-row-btn {
    background: var(--dms-color-primary); color: #fff; border: none;
    padding: 0.5rem 1rem; border-radius: 0.375rem; font-size: 0.9rem;
    cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem;
}
.dms-add-row-btn:hover { background: #004070; }

/*
 * Le gabarit d'origine neutralisait ici les styles de bouton du kit Elementor
 * sur la barre d'outils de Trumbowyg. L'éditeur n'était jamais appliqué à un
 * champ et n'est pas repris : la règle n'a plus d'objet.
 *
 * Le rappel sur le bouton de retrait, lui, reste utile : les extensions
 * redéfinissent les boutons dans leurs conteneurs.
 */
.dms-remove-row-btn,
.dms-remove-row-btn:hover,
.dms-remove-row-btn:focus {
    background: #EF4444 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 50% !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    font-size: 14px !important;
    line-height: 24px !important;
    padding: 0 !important;
    text-decoration: none !important;
    font-family: inherit !important;
}
.dms-remove-row-btn:hover { background: #DC2626 !important; }
