/* ==========================================================================
   Fiche d'un membre (web/pages/team_details.html)
   S'appuie sur motion.css : [data-reveal], .stat-card, .member, --ease-out.
   ========================================================================== */

.profile { --sticky-top: calc(var(--pn-bar-height, 76px) + 1rem); background: #f5f7fa; }
.profile section:not(.profile-card) { padding: 0; } /* annule le padding global des <section> (main.css), sauf cartes */
.profile h2, .profile h3 { padding-bottom: 0; } /* annule le padding hérité des titres (style.css) */

/* ---------------------------------------------------------------- bandeau */
.profile-hero {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  padding: 2.5rem 0 6.5rem;
  background: linear-gradient(120deg, #001a3a 0%, #002045 45%, #0b3a75 100%);
}
.profile-hero::before, .profile-hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(60px);
  animation: profile-drift 18s ease-in-out infinite alternate;
}
.profile-hero::before { width: 460px; height: 460px; right: -120px; top: -180px; background: #1e63b5; opacity: 0.55; }
.profile-hero::after { width: 340px; height: 340px; left: 4%; bottom: -240px; background: #b51822; opacity: 0.35; animation-duration: 22s; }
@keyframes profile-drift { to { transform: translate3d(-70px, 40px, 0) scale(1.15); } }

.profile-hero .breadcrumb-item, .profile-hero .breadcrumb-item a { color: rgba(255, 255, 255, 0.7); text-decoration: none; }
.profile-hero .breadcrumb-item a:hover { color: #fff; }
.profile-hero .breadcrumb-item + .breadcrumb-item::before { color: rgba(255, 255, 255, 0.4); }
.profile-hero .breadcrumb-item.active { color: #fff; }

.profile-id { display: grid; grid-template-columns: auto 1fr; gap: 2.5rem; align-items: center; margin-top: 1.5rem; }

.profile-portrait {
  --ring: conic-gradient(from 0deg, var(--bs-secondary), var(--accent-blue, #1e63b5), var(--bs-success), #fff, var(--bs-secondary));
  position: relative; width: 220px; aspect-ratio: 1; border-radius: 50%; padding: 6px;
}
.profile-portrait::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ring);
  animation: profile-spin 14s linear infinite;
}
.profile-portrait::after { /* halo */
  content: ""; position: absolute; inset: -18px; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
}
@keyframes profile-spin { to { transform: rotate(360deg); } }
.profile-photo {
  position: relative; width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  border: 5px solid #002045; background: #e8edf3;
}
.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: 6rem; color: #8a96a8; }

.profile-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 0.9rem;
  padding: 0.3rem 0.85rem; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.85);
}
.profile-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--bs-success); box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.25); }
.profile-name { font-size: clamp(1.9rem, 3.8vw, 3.1rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: #fff; margin: 0 0 0.6rem; }
.profile-name small { display: block; font-size: 0.45em; font-weight: 600; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.65); margin-bottom: 0.35rem; }
.profile-role { font-size: clamp(1.05rem, 1.6vw, 1.3rem); font-weight: 600; color: #ffb3b8; margin: 0 0 1rem; }

.profile-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.profile-tags li {
  padding: 0.35rem 0.85rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18); backdrop-filter: blur(4px);
}

.profile-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.profile-action {
  display: inline-flex; align-items: center; gap: 0.5rem; height: 44px; padding: 0 1.1rem;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.08);
  color: #fff; font-weight: 600; font-size: 0.92rem; text-decoration: none; cursor: pointer;
  transition: background 0.25s, transform 0.25s var(--ease-out, ease), border-color 0.25s;
}
.profile-action:hover, .profile-action:focus-visible { background: #fff; color: #002045; border-color: #fff; transform: translateY(-2px); }
.profile-action .mdi { font-size: 1.25rem; }
.profile-action--primary { background: #b51822; border-color: #b51822; }
.profile-action--primary:hover, .profile-action--primary:focus-visible { background: #fff; color: #b51822; }
.orcid-badge {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%;
  background: #a6ce39; color: #fff; font-size: 0.62rem; font-weight: 800; letter-spacing: -0.02em; flex: none;
}

/* ---------------------------------------------------------------- chiffres */
.profile-stats { position: relative; z-index: 2; margin-top: -4rem; }
.profile-stats .stat-card { height: 100%; }
.profile-stats .stat-value { font-size: clamp(2rem, 3.5vw, 2.6rem); }

/* ---------------------------------------------------------------- corps */
.profile-body { padding: 3rem 0 4rem; }
.profile-aside { position: sticky; top: var(--sticky-top); }
.profile-card {
  background: #fff; border-radius: 1.25rem; padding: 1.75rem;
  box-shadow: 0 1px 2px rgba(0, 32, 69, 0.06), 0 18px 40px -28px rgba(0, 32, 69, 0.35);
}
.profile-card-title { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: #6b7280; margin: 0 0 1.25rem; }
.profile-facts { margin: 0; }
.profile-facts div { display: grid; grid-template-columns: 2.25rem 1fr; gap: 0.15rem 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.35rem; color: var(--bs-primary); }
.profile-facts .orcid-badge { width: 24px; height: 24px; font-size: 0.7rem; color: #fff; }
.profile-facts dt { font-size: 0.75rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.06em; }
.profile-facts dd { margin: 0; font-weight: 600; color: #1f2937; overflow-wrap: anywhere; }
.profile-facts a { color: var(--bs-primary); text-decoration: none; }
.profile-facts a:hover { color: var(--bs-secondary); text-decoration: underline; }

/* navigation interne */
.profile-nav {
  position: sticky; top: var(--sticky-top); z-index: 5; display: flex; gap: 0.35rem; overflow-x: auto;
  margin-bottom: 1.5rem; padding: 0.4rem; border-radius: 999px; background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px); box-shadow: 0 10px 30px -20px rgba(0, 32, 69, 0.5); scrollbar-width: none;
}
.profile-nav::-webkit-scrollbar { display: none; }
.profile-nav a {
  flex: none; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 1rem; border-radius: 999px;
  font-weight: 600; font-size: 0.9rem; color: #4b5563; text-decoration: none; transition: background 0.2s, color 0.2s;
}
.profile-nav a span { font-size: 0.75rem; padding: 0 0.45rem; border-radius: 999px; background: #eef1f5; color: #4b5563; }
.profile-nav a:hover { color: var(--bs-primary); background: #eef3fa; }
.profile-nav a.is-active { background: var(--bs-primary); color: #fff; }
.profile-nav a.is-active span { background: rgba(255, 255, 255, 0.2); color: #fff; }

.profile-section { scroll-margin-top: calc(var(--sticky-top) + 4.5rem); margin-bottom: 1.5rem; }
.profile-section-head { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 1.25rem; }
.profile-section-head .mdi {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 14px;
  font-size: 1.4rem; color: var(--accent, var(--bs-primary)); background: color-mix(in srgb, var(--accent, var(--bs-primary)) 12%, #fff);
}
.profile-section-head h2 { font-size: 1.35rem; font-weight: 800; color: var(--bs-primary); margin: 0; }
.profile-section-head p { margin: 0; font-size: 0.85rem; color: #6b7280; }

.profile-bio { font-size: 1.05rem; line-height: 1.75; color: #374151; }
.profile-bio p:last-child { margin-bottom: 0; }

/* publications : frise par année */
.works { list-style: none; margin: 0; padding: 0; position: relative; }
.works::before { content: ""; position: absolute; left: 3.15rem; top: 0.5rem; bottom: 0.5rem; width: 2px; background: linear-gradient(#dfe5ee, #eef1f5); }
.work { position: relative; display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 1rem; align-items: start; padding: 0.65rem 0; }
.work-year {
  position: relative; z-index: 1; justify-self: start; min-width: 3.5rem; padding: 0.2rem 0.5rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 800; text-align: center; color: #fff; background: var(--bs-primary);
}
.work-year[aria-hidden="true"] { visibility: hidden; }
.work-body {
  position: relative; padding: 0.9rem 1.1rem; border-radius: 0.9rem; background: #f7f9fc; border: 1px solid transparent;
  transition: background 0.25s, border-color 0.25s, transform 0.25s var(--ease-out, ease), box-shadow 0.25s;
}
.work:hover .work-body { background: #fff; border-color: #e3e8ef; transform: translateX(4px); box-shadow: 0 14px 30px -22px rgba(0, 32, 69, 0.5); }
.work-title { font-size: 1rem; font-weight: 700; line-height: 1.4; color: #1f2937; margin: 0 0 0.35rem; }
.work-title a { color: inherit; text-decoration: none; }
.work-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.work-title a:hover { color: var(--bs-primary); }
.work-title a:focus-visible { outline: none; }
.work-body:focus-within { outline: 3px solid var(--bs-secondary); outline-offset: 2px; }
.work-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.75rem; margin: 0; font-size: 0.85rem; color: #6b7280; }
.work-meta em { color: #374151; }
.work-type { font-weight: 600; color: var(--bs-success); }
.work-source { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 600; }
.work-source .orcid-badge { width: 16px; height: 16px; font-size: 0.5rem; }
.work-arrow { align-self: center; font-size: 1.25rem; color: #9ca3af; transition: transform 0.25s var(--ease-out, ease), color 0.25s; }
.work:hover .work-arrow { color: var(--bs-secondary); transform: translate(3px, -3px); }
.works.is-collapsed .work:nth-child(n + 9) { display: none; }
.works-more { margin-top: 1rem; }

/* thèses et projets */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 0.5rem; height: 100%; padding: 1.25rem;
  border-radius: 1rem; background: #f7f9fc; border: 1px solid #edf0f4; color: inherit; text-decoration: none;
  transition: transform 0.3s var(--ease-out, ease), box-shadow 0.3s, background 0.3s;
}
.tile::before { content: ""; position: absolute; left: 0; top: 1.25rem; bottom: 1.25rem; width: 3px; border-radius: 3px; background: var(--accent, var(--bs-secondary)); transform: scaleY(0.4); transition: transform 0.35s var(--ease-out, ease); }
.tile:hover { background: #fff; transform: translateY(-4px); box-shadow: 0 22px 40px -28px rgba(0, 32, 69, 0.55); }
.tile:hover::before { transform: scaleY(1); }
a.tile:focus-visible { outline: 3px solid var(--bs-secondary); outline-offset: 3px; }
.tile-badge { align-self: flex-start; padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent, var(--bs-secondary)); background: color-mix(in srgb, var(--accent, var(--bs-secondary)) 12%, #fff); }
.tile-title { font-size: 0.98rem; font-weight: 700; line-height: 1.4; color: #1f2937; margin: 0; }
.tile-meta { margin: auto 0 0; font-size: 0.83rem; color: #6b7280; }
.tile-logo { width: 56px; height: 56px; border-radius: 12px; background: #fff; border: 1px solid #edf0f4; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tile-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tile-logo .mdi { font-size: 1.6rem; color: var(--bs-primary); }

/* fiche sans travaux : carte d'identité seule, centrée */
.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; }

/* autres membres */
.profile section.profile-others { padding: 4rem 0; background: #fff; }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 991.98px) {
  .profile-aside, .profile-nav { position: static; }
  .profile-nav { margin-top: 0.5rem; }
}
@media (max-width: 767.98px) {
  .profile-hero { padding: 1.75rem 0 5.5rem; text-align: center; }
  .profile-id { grid-template-columns: 1fr; gap: 1.5rem; justify-items: center; }
  .profile-portrait { width: 170px; }
  .profile-tags, .profile-actions { justify-content: center; }
  .profile-card { padding: 1.25rem; }
  .works::before { left: 1.9rem; }
  .work { grid-template-columns: 3.8rem 1fr; gap: 0.6rem; }
  .work-year { min-width: 3.2rem; font-size: 0.72rem; }
  .work-arrow { display: none; }
  .profile-solo .profile-facts div { border-top: 1px solid #edf0f4 !important; }
  .profile-solo .profile-facts div:first-child { border-top: 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
  .profile-hero::before, .profile-hero::after, .profile-portrait::before { animation: none; }
  .work-body, .tile, .tile::before, .profile-action, .work-arrow { transition: none; }
}

/* ---------------------------------------------------------------- impression / PDF */
.print-only { display: none; }
@media print {
  @page { size: A4 portrait; margin: 14mm; }
  body > *:not(.profile), .no-print, .profile-nav, .profile-actions,
  .profile-others, .works-more, .profile-hero nav, .work-arrow, .pdf-float-btn { display: none !important; }
  body { font-size: 10.5pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; background: #fff !important; }
  .profile { background: #fff; }
  .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-hero { background: none !important; color: #000; padding: 0 !important; }
  .profile-hero::before, .profile-hero::after, .profile-portrait::before, .profile-portrait::after { display: none; }
  .profile-id { grid-template-columns: 34mm 1fr; gap: 7mm; margin: 0; text-align: left; justify-items: start; }
  .profile-portrait { width: 34mm; padding: 0; }
  .profile-photo { border: 0; }
  .profile-eyebrow { display: none; }
  .profile-name { color: var(--bs-primary); font-size: 20pt; }
  .profile-name small { color: #6c757d; }
  .profile-role { color: var(--bs-secondary); font-size: 12pt; }
  .profile-tags li { background: none; border: 1px solid #ccc; color: #333; backdrop-filter: none; }
  .profile-stats { margin: 5mm 0 0; }
  .profile-stats .stat-card { box-shadow: none; border: 1px solid #ddd; padding: 3mm; }
  .profile-stats .stat-icon { display: none; }
  .profile-body { padding: 5mm 0 0; }
  .profile-body .row > * { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; }
  .profile-aside { position: static; margin-bottom: 5mm; }
  .profile-card { box-shadow: none; border: 1px solid #ddd; padding: 4mm; break-inside: avoid; }
  .profile-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6mm; }
  .profile-facts a[href^="http"]::after { content: " (" attr(href) ")"; font-weight: 400; color: #6c757d; }
  .works.is-collapsed .work:nth-child(n + 9) { display: grid; }
  .works::before { display: none; }
  .work { break-inside: avoid; padding: 1mm 0; grid-template-columns: 16mm 1fr; }
  .work-body { background: none; padding: 0; transform: none !important; box-shadow: none !important; }
  .tile-grid { grid-template-columns: 1fr 1fr; }
  .tile { break-inside: avoid; background: none; transform: none !important; box-shadow: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
