/* =========================================================
   🎨 detailPerson.css — Styles globaux pour l'annuaire
   ========================================================= */

/* =========================================================
   🎨 VARIABLES GLOBALES (Design Tokens)
   ========================================================= */
:root {
    /* Couleurs principales */
    --color-primary: #278FE2;          /* Bleu principal utilisé pour titres/links */
    --color-primary-dark: #1e3d7b;     /* Bleu foncé au survol */
    --color-dark-blue: #092851;        /* Bleu foncé pour boutons non-actifs */
    --color-orange: #f28c00;           /* Orange accent / département */
    --color-accent: #f57c00;           /* autre orange (breadcrumbs) */

    /* Textes et fonds */
    --color-text-dark: #333;
    --color-text-medium: #444;
    --color-text-light: #999;
    --color-background-light: #e0e0e0;
    --color-background-off-white: #f1f1f1;
    --color-row-even: #ffffff;
    --color-row-odd: #eeeeee;
    --color-row-hover: #d7dff2;

    /* Espacement */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;

    /* Rayons */
    --radius-sm: 10px;
    --radius-lg: 25px;

    /* Typographie */
    --font-family: 'Raleway', sans-serif;
    --font-size-sm: 12px;
    --font-size-md: 14px;
    --font-size-lg: 1.8rem;
}

/* =========================================================
   🧱 STRUCTURE GLOBALE
   ========================================================= */
* { box-sizing: border-box; }

body {
    margin: 0;
    padding-top: 0 !important;
    font-family: var(--font-family);
    color: var(--color-text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page-title {
    display: flex !important; /* Force l'alignement horizontal */
    flex-direction: row !important; /* Assure que c'est bien une ligne */
    align-items: center !important;
    gap: 20px !important;
    margin-bottom: 25px;
    padding: 10px 0;
    position: relative; /* Important pour ta ligne décorative ::before */
}

/* On s'assure que le groupe de texte ne prend pas toute la largeur seul */
.title-text-group {
    display: inline-flex !important;
    align-items: baseline;
    flex-wrap: nowrap; /* Empêche le retour à la ligne sur PC */
}

/* On nettoie les spans qui pourraient forcer un bloc */
.page-title span {
    display: inline !important; /* On repasse en inline pour qu'ils se suivent */
}

.detailperson-layout {
    display: flex;
    gap: 30px;
    flex-direction: row;
    max-width: 1200px;
    margin: var(--spacing-lg) auto 60px auto;
    padding: 0 var(--spacing-lg);
    background-color: #fff;
}

/* --- LE LOOK DES AVATARS (Commun) --- */
/* --- LE LOOK SPÉCIFIQUE DE L'AVATAR PC --- */
.pc-only .avatar-design {
    width: 150px !important;  /* Carré parfait */
    height: 150px !important;

    /* LE SECRET : Arrondi uniquement en bas à droite */
    border-radius: 0 0 20px 0 !important; /* Top-L, Top-R, Bot-R, Bot-L */

    background-color: #268FE2;
    background-size: cover; /* Pour l'image réelle */
    background-position: center;

    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Pour que l'image suive l'arrondi */
}

/* Ajustement de l'icône FontAwesome pour la taille 200x200 */
.pc-only .avatar-design i {
    font-size: 100px !important; /* Taille de l'icône homme/femme */
    color: white;
}

/* Ligne décorative */
.page-title::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 0;
    width: 150px;
    height: 2px;
    background-color: rgba(40, 143, 226, 1);
}

.page-title .title-name {
    font-size: 1.5rem;
    font-weight: 700; /* Nom + Prénom */
    text-transform: none;
}

/* Partie légère */
.page-title .title-separator {
    font-size: 1rem;
    font-weight: 500; /* ou 300 */
    opacity: 0.85;
    letter-spacing: 0.02em;
}

/* Optionnel : petit espace plus propre */
.page-title span {
    display: inline-block;
}

.content-align-logo { margin-top: var(--spacing-xl); }

.person-header h3 {
    color: #1E73BE;
    font-size: 1.8rem;
    margin: 0;
}
.person-header h4
{
    color: #1E73BE;
    font-size: 1.5rem;
    font-weight: 500;
}

/* --- Mise en page principale (2 colonnes) --- */
.person-detail-vignettes {
    display: flex;
    gap: 30px; /* Espace entre la photo et la grille d'infos */
    align-items: flex-start; /* Aligner le contenu en haut */
    margin-top: 20px;
}

/* --- Colonne Photo (Gauche) --- */
.person-photo-col {
    flex: 0 0 200px; /* Largeur fixe pour la photo/avatar */
    text-align: center;
}

.person-avatar {
    width: 150px;
    height: 150px;
    background-color: #ddd; /* Placeholder gris */
    border-bottom-right-radius: 20px;
    margin-bottom: 10px;
    /* Ajoutez l'image ici si disponible */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: #555;
}

/* --- Icône générique --- */
.default-avatar i {
    color: var(--color-text-light); /* Gris clair */
    font-size: 100px; /* Taille de l'icône générique */
}

/* --- Icône Homme --- */
.man-avatar {
    background-color: #268FE2; /* #092851 */
}
.man-avatar i {
    color: white;
    font-size: 100px; /* Taille de l'icône homme */
}

/* --- Icône Femme --- */
.woman-avatar {
    background-color: #268FE2; /* Bleu principal/moyen */
}
.woman-avatar i {
    color: white;
    font-size: 100px; /* Taille de l'icône femme */
}
/* --- Grille d'Infos (Droite) --- */
.person-info-grid {
    flex-grow: 1; /* Prend l'espace restant */
    display: grid;
    grid-template-columns: 1fr 1fr; /* Deux sous-colonnes de taille égale */
    gap: 20px; /* Espace entre les deux sous-colonnes */
}

.grid-col-left,
.grid-col-right {
    display: flex;
    flex-direction: column;
    gap: 2px; /* Espace entre les vignettes dans chaque colonne */
}

/* --- Style du Texte dans le Bloc Bleu (Département/Abréviation) --- */
.dep-abbreviation {
    font-size: 1.4em;
    font-weight: 800;
    color: white;
    text-align: center;
    /* Ajuster la line-height si le texte est très grand pour éviter le débordement vertical */
    line-height: 1.1;
    display: block;
}

/* --- Style des Vignettes (Cards) --- */
/* 🟦 Style du Bloc Icône (Fond Bleu Carré) */
.vignette-icon-wrapper {
    /* 1. Définir le bloc carré et le fond bleu */
    flex-shrink: 0;
    background-color: #268FE2;
    width: 80px;
    height: 80px;

    /* 2. Centrer l'icône à l'intérieur */
    display: flex;
    align-items: center;    /* Centre verticalement */
    justify-content: center; /* Centre horizontalement */
}

/* 3. Style de l'icône (le i) */
.vignette-icon-wrapper i {
    font-size: 2em;
    color: white;
}

.info-vignette {
    display: flex;
    align-items: stretch; /* Très important pour que les blocs enfants prennent toute la hauteur */
    padding: 0; /* Enlever le padding du parent */
    color: #333; /* Couleur de base pour le texte */
    border-radius: 0; /* Applique un arrondi global */
    overflow: hidden; /* Important pour que l'arrondi fonctionne bien avec les fonds des enfants */
    min-height: 80px;
}

.vignette-icon {
    display: flex;
    flex-shrink: 0;
    background-color: #268FE2;
    width: 80px; /* Fixer une largeur pour le carré */
    display: flex;
    align-items: center;
    justify-content: center;

    /* Style de l'icône elle-même */
    font-size: 2em;
    color: white; /* Icône blanche */
}

.vignette-content {
    /* Style du fond carré #F8F6F3 */
    flex-grow: 1; /* Prend l'espace restant */
    background-color: #F8F6F3;
    color: #333; /* Texte sombre sur fond clair */

    /* Padding interne */
    padding: 15px;

    display: flex;
    flex-direction: column;
    text-align: left;
    justify-content: center;
    max-height: 80px;
}

/* On cible spécifiquement la vignette des liens pour qu'elle puisse s'agrandir */
.vignette-links .vignette-content {
    max-height: none; /* On retire la limite de hauteur */
    min-height: 80px;
    padding: 10px 15px; /* Un peu moins de padding vertical pour compacter */
    justify-content: flex-start; /* Aligne les liens vers le haut */
}

/* Aligner l'icône de gauche (le carré bleu) sur la hauteur totale */
.vignette-links {
    align-items: stretch;
}

.vignette-links .vignette-icon-wrapper {
    height: auto; /* Le carré bleu s'étire selon la hauteur des liens */
    min-height: 80px;
}

.vignette-content strong {
    color: #268FE2;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 5px;
}

.vignette-content span,
.vignette-content a {
    font-size: 13px;
    color: #454545;
    text-decoration: none;
    line-height: 1.3;
}

.vignette-content a:hover {
    text-decoration: underline;
}

/* Cible la dernière vignette de la colonne de gauche */
.grid-col-left .info-vignette:last-child {
    border-bottom-right-radius: 25px;
}

/* Cible la dernière vignette de la colonne de droite */
.grid-col-right .info-vignette:last-child {
    border-bottom-right-radius: 25px;
}

/* Optionnel : Si vous voulez aussi que le fond (vignette-content)
   épouse l'arrondi si vous avez une couleur de fond différente */
.grid-col-left .info-vignette:last-child .vignette-content,
.grid-col-right .info-vignette:last-child .vignette-content {
    border-bottom-right-radius: 25px;
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {

    .pc-only { display: none !important; }
    .mobile-only {
        display: flex !important;
        width: 60px;
        height: 60px; /* Taille réduite pour le titre */
    }

    .mobile-only .avatar-design {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 100% !important;
        font-size: 30px !important;
        color: white !important;
        background-color: #268FE2 !important;
        border-radius: 0 0 20px 0 !important; /* Ton arrondi bas-droite */
        overflow: hidden;
    }

    .detailperson-layout {
        flex-direction: column;
    }

    /* 1. On force le conteneur principal à s'empiler */
    .person-detail-vignettes {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px;
        padding: 10px;
    }

    /* 2. La photo prend toute la largeur et se centre */
    .person-photo-col {
        width: 100% !important;
        display: flex;
        justify-content: center;
        margin-bottom: 10px;
    }

    .person-avatar {
        width: 150px; /* Taille adaptée au mobile */
        height: 150px;
        font-size: 60px; /* Taille de l'icône si pas de photo */
    }

    /* 3. On libère les deux sous-colonnes d'infos */
    .person-info-grid {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px;
    }

    .grid-col-left, .grid-col-right {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px;
    }

    /* 4. On ajuste les vignettes pour qu'elles soient bien lisibles */
    .info-vignette {
        width: 100% !important;
        display: flex !important;
        align-items: center;
        background: #fff;
        margin: 0 !important;
    }

    .page-title {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 15px !important;
    }

    .title-text-group {
        display: flex;
        flex-direction: column;  /* SUR MOBILE : Nom en haut, Statut en dessous */
        align-items: flex-start; /* Alignés à gauche du bloc texte */
    }

    .title-name {
        font-size: 20px;
        text-transform: uppercase;
    }

    .title-separator {
        margin-top: 5px; /* Ajuste la valeur selon l'écart voulu */
        font-size: 18px;
    }

    /* On aligne l'icône et le texte horizontalement dans la vignette */
    .vignette-icon-wrapper {
        min-width: 50px;
        /*height: 50px;*/
        margin-right: 15px;
    }

    .vignette-content {
        display: flex;
        flex-direction: column;
        text-align: left;
    }

    .vignette-content strong {
        font-size: 13px;
        color: #278FE2; /* Couleur du titre pour mieux séparer */
        margin-bottom: 2px;
    }

    .vignette-content span, .vignette-content a {
        font-size: 14px;
        word-break: break-word; /* Évite que les longs emails ne dépassent */
    }

    /* On retire l'arrondi de la colonne de gauche qui se retrouve au milieu */
    .grid-col-left .info-vignette:last-child {
        border-bottom-right-radius: 0;
    }

    .grid-col-left .info-vignette:last-child .vignette-content, .grid-col-right .info-vignette:last-child .vignette-content {
        border-bottom-right-radius: 0;
    }

    /* On garde l'arrondi uniquement sur la toute dernière vignette du bas */
    .grid-col-right .info-vignette:last-child {
        border-bottom-right-radius: 25px;
    }
}