/* ==========================================================================
   Fiche d'un membre (web/pages/team_details.html)
   Volontairement sobre : mêmes codes que la fiche projet (Bootstrap, titres
   bleu primaire, cartes bordées). Cartes projets / thèses : cards.css.
   ========================================================================== */

.profile section { padding: 0; } /* annule le padding global des <section> (main.css) */
.profile section.other-projects-section { padding: 80px 0; }
.profile h2, .profile h3 { padding-bottom: 0; } /* annule le padding hérité des titres (style.css) */

/* ---------------------------------------------------------------- identité */
.profile-id { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2.5rem; align-items: center; }
.profile-photo {
  width: 170px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; flex: none;
  background: #e9ecef; border: 4px solid #fff; box-shadow: 0 0 0 1px #dee2e6, var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1));
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; } /* visage en haut du cadre */
.profile-photo .mdi { display: flex; height: 100%; align-items: center; justify-content: center; font-size: 5rem; color: #8a96a8; }

.profile-chip { /* même rendu que les pays d'un projet (.country-chip) */
  font-size: 0.8rem; font-weight: 600; color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.08); border-radius: 999px; padding: 0.15rem 0.6rem;
}

.profile-keyfacts { gap: 0.25rem 0; font-size: 0.92rem; color: var(--bs-secondary-color, #6c757d); }
.profile-keyfacts li + li::before { content: "·"; margin: 0 0.6rem; color: #adb5bd; }
.profile-keyfacts strong { color: var(--bs-primary); font-weight: 700; }

.orcid-badge {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%;
  background: #a6ce39; color: #fff; font-size: 0.58rem; font-weight: 800; letter-spacing: -0.02em; flex: none;
}

/* ---------------------------------------------------------------- colonne « En bref » */
.profile-aside { position: sticky; top: 100px; }
.profile-facts { margin: 0; }
.profile-facts div { display: grid; grid-template-columns: 2rem 1fr; gap: 0.1rem 0; padding: 0.75rem 0; border-top: 1px solid #edf0f4; }
.profile-facts div:first-child { border-top: 0; padding-top: 0; }
.profile-facts .mdi, .profile-facts .orcid-badge { grid-row: span 2; align-self: center; font-size: 1.25rem; }
.profile-facts .orcid-badge { width: 22px; height: 22px; font-size: 0.65rem; }
.profile-facts dt { font-size: 0.8rem; font-weight: 400; color: var(--bs-secondary-color, #6c757d); }
.profile-facts dd { margin: 0; font-weight: 600; color: var(--bs-primary); overflow-wrap: anywhere; }
.profile-facts a { color: var(--bs-primary); text-decoration: none; }
.profile-facts a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- contenu */
.profile-section { scroll-margin-top: 100px; }
.profile-bio { line-height: 1.75; color: #374151; }
.profile-bio p:last-child { margin-bottom: 0; }
@media (min-width: 768px) {
  .profile-bio p, .profile-bio li { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
}

/* publications : liste bibliographique groupée par année */
.work { padding: 0.9rem 0; border-bottom: 1px solid #edf0f4; }
.work-year {
  display: block; margin: 0.75rem 0 0.4rem; font-size: 0.85rem; font-weight: 700;
  letter-spacing: 1px; color: var(--bs-secondary);
}
.work:first-child .work-year { margin-top: 0; }
.work-title { font-size: 1rem; font-weight: 600; line-height: 1.45; color: #212529; margin: 0 0 0.25rem; }
.work-title a { color: inherit; text-decoration: none; }
.work-title a:hover, .work-title a:focus-visible { color: var(--bs-primary); text-decoration: underline; }
.work-title .mdi { font-size: 0.85em; color: #adb5bd; }
.work-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin: 0; font-size: 0.85rem; color: var(--bs-secondary-color, #6c757d); }
.work-source { display: inline-flex; align-items: center; gap: 0.3rem; }
.work-source .orcid-badge { width: 14px; height: 14px; font-size: 0.45rem; }
.works.is-collapsed .work:nth-child(n + 9) { display: none; }

/* thèses : gabarit des cartes projet, liseré selon le type */
.project-card-v.is-thesis { border-top-color: var(--bs-secondary); }
.project-card-v.is-memoir { border-top-color: var(--bs-primary); }
.project-card-v.is-thesis:hover, .project-card-v.is-memoir:hover { transform: none; box-shadow: none; } /* carte non cliquable */

/* fiche sans travaux : carte d'identité seule, faits sur plusieurs colonnes */
.profile-solo .profile-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 2rem; }
.profile-solo .profile-facts div:nth-child(-n + 3) { border-top: 0; padding-top: 0; }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 991.98px) {
  .profile-aside { position: static; }
}
@media (max-width: 767.98px) {
  .profile-id { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; justify-items: center; text-align: center; }
  .profile-id ul, .profile-actions { justify-content: center; }
  .profile-photo { width: 140px; }
  .profile-solo .profile-facts div { border-top: 1px solid #edf0f4 !important; }
  .profile-solo .profile-facts div:first-child { border-top: 0 !important; }
}

/* ---------------------------------------------------------------- impression / PDF */
.print-only { display: none; }
@media print {
  @page { size: A4 portrait; margin: 14mm; }
  body > *:not(.profile), .no-print, .profile-actions, .profile-others, .works-more, .pdf-float-btn { display: none !important; }
  body { font-size: 10.5pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; background: #fff !important; }
  .profile main { padding: 0 !important; max-width: none; }
  .print-only { display: flex !important; }
  .print-header { align-items: center; justify-content: space-between; padding-bottom: 3mm; margin-bottom: 5mm; border-bottom: 2px solid var(--bs-primary); font-size: 9pt; text-transform: uppercase; letter-spacing: 1px; color: #6c757d; }
  .print-footer { justify-content: space-between; gap: 6mm; padding-top: 3mm; margin-top: 6mm; border-top: 1px solid #dee2e6; font-size: 8pt; color: #6c757d; word-break: break-all; }
  .profile-id { grid-template-columns: 34mm 1fr; gap: 7mm; padding-bottom: 5mm !important; margin-bottom: 5mm !important; text-align: left; justify-items: start; }
  .profile-id ul { justify-content: flex-start; }
  .profile-photo { width: 34mm; box-shadow: none; border: 0; }
  .profile-id h1 { font-size: 20pt; }
  .profile .row > * { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; }
  .profile .row { --bs-gutter-y: 5mm; }
  .profile .order-1 { order: -1 !important; }
  .profile-aside { position: static; }
  .profile-aside > *, .profile-solo > * { box-shadow: none !important; break-inside: avoid; }
  .profile-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6mm; }
  .profile-facts div:nth-child(2) { border-top: 0; padding-top: 0; }
  .profile-facts a[href^="http"]::after { content: " (" attr(href) ")"; font-weight: 400; color: #6c757d; }
  .works.is-collapsed .work:nth-child(n + 9) { display: block; }
  .work { break-inside: avoid; padding: 1.5mm 0; }
  .work-title .mdi { display: none; }
  .project-card-v { break-inside: avoid; transform: none !important; box-shadow: none !important; padding: 3mm; }
  .profile .col-md-6 { width: 50% !important; flex: 0 0 50% !important; }
  .pc-cta { display: none !important; }
  .pc-title { display: block; -webkit-line-clamp: unset; overflow: visible; }
  .profile-section h2 { break-after: avoid; page-break-after: avoid; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
