@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Lora:ital,wght@0,400;0,500;1,400;1,500&display=swap');

:root {
    /* Palette de marque — miroir de app/theme.py (COLORS) */
    --brand-navy: #083C76;
    --brand-blue: #0775C0;
    --brand-light-blue: #6BBFE4;
    --brand-orange: #EA9765;
    --brand-light-green: #8AC99A;
    --brand-green: #01AC4C;

    /* Jetons de carte, réutilisés sur toutes les pages */
    --card-bg: #ffffff;
    --card-radius: 10px;
    --card-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    --card-padding: 16px 20px;
}

/* Le fond gris couvre toujours toute la hauteur, même sur les pages courtes */
html, body { margin: 0; background-color: #F5F5F5; }

/* Police de base : Inter, avec repli système propre */
body, .dash-table-container {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
#react-entry-point, #_dash-app-content { min-height: 100vh; }

.tl-step { position: relative; display: flex; flex-direction: column; align-items: center; flex: 1; }

.tl-tip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    background: #2c2c2a;
    color: #f1efe8;
    font-size: 12px;
    line-height: 1.45;
    padding: 8px 10px;
    border-radius: 6px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s;
    z-index: 10;
    pointer-events: none;
}

.tl-step:hover .tl-tip { opacity: 1; visibility: visible; }

.team-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 210px;
    padding: 4px 8px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color .15s;
}
.team-member:hover { background-color: rgba(0, 0, 0, 0.04); }

/* Signature « /bin-{phun} » dans le pied de page */
.bin-phun-mark {
    font-family: 'Trebuchet MS', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 1;
    letter-spacing: .01em;
    color: #0D2A6F;
    white-space: nowrap;
}
.bin-phun-mark .brace { color: #98B049; }

a.bin-phun-link {
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    background-color: transparent;
    transition: background-color .15s;
}
a.bin-phun-link:hover { background-color: rgba(0, 0, 0, 0.06); }

/* --- FAQ : questions repliables ------------------------------------------- */
.faq-list { display: flex; flex-direction: column; gap: 10px; }

.faq-item {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.faq-question {
    position: relative;
    list-style: none;
    cursor: pointer;
    padding: 16px 44px;
    font-size: 15px;
    font-weight: 500;
    color: #1A202C;
    text-align: center;
    transition: background-color .15s;
}
.faq-question::-webkit-details-marker { display: none; }

/* chevron */
.faq-question::after {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #718096;
    border-bottom: 2px solid #718096;
    transform: translateY(-70%) rotate(45deg);
    transition: transform .18s ease;
}
.faq-item[open] .faq-question::after { transform: translateY(-30%) rotate(225deg); }

.faq-question:hover { background-color: rgba(0, 0, 0, 0.03); }

.faq-answer {
    padding: 0 24px 18px;
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    text-align: center;
}

/* --- Conteneurs génériques --------------------------------------------- */
.page { padding: 0.5rem 0; }

.card {
    background-color: var(--card-bg);
    border-radius: var(--card-radius);
    padding: var(--card-padding);
    box-shadow: var(--card-shadow);
}

.section-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #1A202C;
    margin: 36px 0 16px;
    text-align: center;
}

.mb-20 { margin-bottom: 20px; }

/* --- Page d'accueil -------------------------------------------------------- */
.intro-quote {
    border-left: 4px solid #2e7d5b;
    border-radius: 0;
    padding: 22px 28px;
    margin: 10px 0 20px;
}
.intro-quote__text {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: 19px;
    line-height: 1.6;
    color: #333;
}

.home-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.home-col { flex: 3 1 320px; }

.block-title { font-size: 18px; font-weight: 500; }

.video-frame { aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; }
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-caption { font-size: 13px; font-weight: 500; margin-top: 10px; }
.video-subcaption { font-size: 11px; color: #888; margin-top: 2px; }

.prose-p {
    font-size: 14px;
    color: #444;
    line-height: 1.5;
    text-align: justify;
    text-indent: 2em;
    margin: 0 0 10px 0;
}

/* Frise chronologique des étapes du projet */
.timeline { position: relative; display: flex; }
.timeline__line {
    position: absolute;
    top: 10px;
    left: 0;
    right: 10px;
    height: 2px;
    background-color: #d5d5d5;
}
.timeline__arrow {
    position: absolute;
    top: 4px;
    right: 0;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 10px solid #d5d5d5;
}
.tl-tip__text { margin-bottom: 4px; }
.tl-tip__list { margin: 0; padding-left: 16px; text-align: left; }
.tl-dot {
    position: relative;
    z-index: 1;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    box-shadow: 0 0 0 4px #fff;
    /* la couleur de fond reste définie en Python (step['color']) */
}
.tl-label {
    font-size: 11px;
    color: #555;
    text-align: center;
    margin-top: 10px;
    max-width: 110px;
}

/* Équipe & auxiliaires de recherche */
.team-grid { display: flex; flex-wrap: wrap; gap: 20px; }
.assistants-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 32px;
    justify-content: center;
}

.person-name {
    font-size: 15px;
    font-weight: 700;
    color: #1A202C;
    line-height: 1.3;
    text-align: center;
}
.person-inst {
    font-size: 12px;
    color: #718096;
    line-height: 1.4;
    margin-top: 3px;
    text-align: center;
}

.assistant { width: 210px; padding: 4px 8px; text-align: center; }

.team-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px #fff, 0 0 0 4px #E2E8F0;
    object-fit: cover;
    display: block;
}
.team-avatar--initials {
    background-color: #3266AD;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.team-member__name { margin-top: 12px; }
.team-member__role {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-green);
    letter-spacing: 0.06em;
    line-height: 1.4;
    margin-top: 4px;
    text-align: center;
}

/* --- Composants partagés entre les pages de contenu ------------------- */
/* Titre de page : intitulé + sous-titre alignés sur la ligne de base */
.page-title,
.section-head { display: flex; align-items: baseline; gap: 12px; }
.page-title { margin-bottom: 20px; }
.section-head { margin-bottom: 12px; }
.page-title__main { font-size: 20px; font-weight: 500; }
.section-head__main { font-size: 16px; font-weight: 500; }
.page-title__sub,
.section-head__sub { font-size: 13px; color: #888; }

/* Titres internes de carte */
.card-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.card-subtitle { font-size: 12px; color: #888; margin-bottom: 10px; }
.card-note { font-size: 11px; color: #888; margin-bottom: 10px; }

/* Bandeau de cartes KPI */
.kpi-row { display: grid; gap: 10px; margin-bottom: 20px; }
.kpi-row--3 { grid-template-columns: repeat(3, 1fr); }
.kpi-row--4 { grid-template-columns: repeat(4, 1fr); }

.kpi-card {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.kpi-card__label { font-size: 12px; color: #666; margin-bottom: 4px; }
.kpi-card__value { font-size: 15px; font-weight: 500; }
/* la couleur de .kpi-card__value est fournie en Python (paramètre value_color) */

/* Grilles & utilitaires */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2-3 { display: grid; grid-template-columns: 2fr 3fr; gap: 16px; align-items: start; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.field-half { width: 50%; margin-bottom: 20px; }
.field-half__label { font-size: 13px; }
.rule { border-color: rgba(0, 0, 0, 0.08); margin-bottom: 20px; }
/* NB : pour qu'un dcc.Dropdown remplisse une barre flex, mettre flex:1 dans son
   style= (inline) : className= est transmis au react-select interne, pas au div externe. */

/* Légende de couleurs sous un graphique */
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.legend__item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: #555; }
.legend__swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
    /* la couleur de fond est fournie en Python (THEME_COLORS) */
}

/* --- Page « Représentations du personnel » --------------------------- */
.source-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    width: 50%;
}
.source-row__label { font-size: 13px; color: #555; white-space: nowrap; }
.source-row__note { font-size: 11px; color: #888; font-style: italic; }

/* --- Page « Portrait des thèmes » ----------------------------------- */
.portrait-viz-toolbar { display: flex; gap: 10px; margin-bottom: 12px; }

/* --- Page « Évolution temporelle des thèmes » --------------------- */
.page-title--tight { margin-bottom: 16px; }